<?php $this->displayTemplate('header') ?>

<script type="text/javascript">
<!--
var default_iso = '<?php echo $this->session->shop_country ?>';
-->
</script>

<!-- Configuration form -->
<div id="infosShopBlock">
	<h2><?php echo $this->l('Information about your Store') ?></h2>

	<!-- Shop name -->
	<div class="field clearfix">
		<label for="infosShop" class="aligned"><?php echo $this->l('Shop name') ?> </label>
		<div class="contentinput">
			<input class="text required" type="text" id="infosShop" name="shop_name" value="<?php echo htmlspecialchars($this->session->shop_name) ?>" /> <sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('shop_name') ?>
	</div>

	<!-- Activity -->
	<div class="field clearfix">
		<label for="infosActivity" class="aligned"><?php echo $this->l('Main activity') ?></label>
		<div class="contentinput">
			<select id="infosActivity" name="shop_activity" class="chosen">
				<option value="0" style="font-weight: bold" <?php if (!$this->session->shop_activity): ?>selected="selected"<?php endif; ?>><?php echo $this->l('Please choose your main activity') ?></option>
				<?php foreach ($this->list_activities as $i => $activity): ?>
					<option value="<?php echo $i ?>" <?php if (isset($this->session->shop_activity) && $this->session->shop_activity == $i): ?>selected="selected"<?php endif; ?>><?php echo $activity ?></option>
				<?php endforeach; ?>
				<option value="0"><?php echo $this->l('Other activity...') ?></option>
			</select>
		</div>
		<p class="userInfos aligned"><?php echo $this->l('Help us learn more about your store so we can offer you optimal guidance and the best features for your business!') ?></p>
	</div>

	<?php if (_PS_MODE_DEV_): ?>
	<!-- Install type (with fixtures or not) -->
	<div class="field clearfix">
		<label class="aligned"><?php echo $this->l('Install demo products') ?></label>
		<div class="contentinput">
			<label>
				<input value="full" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'full'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
				<?php echo $this->l('Yes') ?>
			</label>
			<label>
				<input value="lite" type="radio" name="db_mode" style="vertical-align: middle;" <?php if ($this->install_type == 'lite'): ?>checked="checked"<?php endif; ?> autocomplete="off" />
				<?php echo $this->l('No'); ?>
			</label>
		</div>
		<p class="userInfos aligned"><?php echo $this->l('Demo products are a good way to learn how to use PrestaShop. You should install them if you are not familiar with it.') ?></p>
	</div>
	<?php else: ?>
		<input value="full" name="db_mode" type="hidden" />
	<?php endif; ?>

	<!-- Country list -->
	<div class="field clearfix">
		<label for="infosCountry" class="aligned"><?php echo $this->l('Country') ?></label>
		<div class="contentinput">
			<select name="shop_country" id="infosCountry" class="chosen">
				<option value="0" style="font-weight: bold"><?php echo $this->l('Select your country') ?></option>
				<?php foreach ($this->list_countries as $country): ?>
					<option value="<?php echo (isset($country['iso'])) ? $country['iso'] : '' ?>" <?php if ($this->session->shop_country && isset($country['iso']) && $this->session->shop_country === $country['iso']): ?>selected="selected"<?php endif; ?>><?php echo $country['name'] ?></option>
				<?php endforeach; ?>
			</select>
			<sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('shop_country') ?>
	</div>

	<!-- Timezone list -->
	<div id="timezone_div" class="field clearfix" <?php if (!in_array($this->session->shop_timezone, array('us','ca','au','ru','me','id'))) echo 'style="display:none"'; ?>>
		<label for="infosTimezone" class="aligned"><?php echo $this->l('Shop timezone') ?></label>
		<div class="contentinput">
			<select name="shop_timezone" id="infosTimezone" class="chosen no-chosen">
				<option value="0" style="font-weight: bold"><?php echo $this->l('Select your timezone') ?></option>
				<?php foreach ($this->getTimezones() as $timezone): ?>
					<option value="<?php echo $timezone ?>" <?php if ($this->session->shop_timezone == $timezone): ?>selected="selected"<?php endif; ?>><?php echo $timezone ?></option>
				<?php endforeach; ?>
			</select>
			<sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('shop_timezone') ?>
	</div>

	<!-- Shop logo
	<div class="field clearfix">
		<label for="uploadedImage" class="aligned logo"><?php echo $this->l('Shop logo') ?></label>
		<div class="contentinput">
			<p id="alignedLogo"><img id="uploadedImage" src="../img/logo.jpg?t=<?php echo time() ?>" alt="Logo" /></p>
		</div>
		<p class="userInfos aligned"><?php echo $this->l('Optional - You can add you logo at a later time.') ?></p>

		<div id="inputFileLogo" class="contentinput" style="top:-20px;position:relative">
			<input type="file" name="fileToUpload" id="fileToUpload"/>
		</div>
		<span id="resultInfosLogo" class="result"></span>
	</div>
	 -->

	<h2 style="margin-top:20px"><?php echo $this->l('Your Account') ?></h2>

	<!-- Admin firstname -->
	<div class="field clearfix">
		<label for="infosFirstname" class="aligned"><?php echo $this->l('First name') ?> </label>
		<div class="contentinput">
			<input class="text required" type="text" id="infosFirstname" name="admin_firstname" value="<?php echo htmlspecialchars($this->session->admin_firstname) ?>" />
			<sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('admin_firstname') ?>
	</div>

	<!-- Admin lastname -->
	<div class="field clearfix">
		<label for="infosName" class="aligned"><?php echo $this->l('Last name') ?> </label>
		<div class="contentinput">
			<input class="text required" type="text" id="infosName" name="admin_lastname" value="<?php echo htmlspecialchars($this->session->admin_lastname) ?>" />
			<sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('admin_lastname') ?>
	</div>

	<!-- Admin email -->
	<div class="field clearfix">
		<label for="infosEmail" class="aligned"><?php echo $this->l('E-mail address') ?> </label>
		<div class="contentinput">
			<input type="text" class="text required" id="infosEmail" name="admin_email" value="<?php echo htmlspecialchars($this->session->admin_email) ?>" />
			<sup class="required">*</sup>
		</div>
		<p class="userInfos aligned"><?php echo $this->l('This email address will be your username to access your store\'s back office.') ?></p>
		<?php echo $this->displayError('admin_email') ?>
	</div>

	<!-- Admin password -->
	<div class="field clearfix">
		<label for="infosPassword" class="aligned"><?php echo $this->l('Shop password') ?> </label>
		<div class="contentinput">
			<input autocomplete="off" type="password" class="text required" id="infosPassword" name="admin_password" value="<?php echo htmlspecialchars($this->session->admin_password) ?>" />
			<sup class="required">*</sup>
		</div>
		<?php if ($this->displayError('admin_password')): ?>
			<?php echo $this->displayError('admin_password') ?>
		<?php else: ?>
			<p class="userInfos aligned"><?php echo $this->l('Must be at least 8 characters') ?></p>
		<?php endif; ?>
	</div>

	<!-- Admin password confirm -->
	<div class="field clearfix">
		<label class="aligned" for="infosPasswordRepeat"><?php echo $this->l('Re-type to confirm') ?> </label>
		<div class="contentinput">
			<input type="password" autocomplete="off" class="text required" id="infosPasswordRepeat" name="admin_password_confirm" value="<?php echo htmlspecialchars($this->session->admin_password_confirm) ?>" />
			<sup class="required">*</sup>
		</div>
		<?php echo $this->displayError('admin_password_confirm') ?>
	</div>
	<br />
	<span><small><?php echo sprintf($this->l('All information you give us is collected by us and is subject to data processing and statistics, it is necessary for the members of the PrestaShop company in order to respond to your requests. Your personal data may be communicated to service providers and partners as part of partner relationships. Under the current "Act on Data Processing, Data Files and Individual Liberties" you have the right to access, rectify and oppose to the processing of your personal data through this <a href="%s" onclick="return !window.open(this.href)">link</a>.'), 'mailto:legal@prestashop.com'); ?></small></span>
</div>

<!-- Partners form -->
<div id="benefitsBlock" style="display:none"></div>

<?php $this->displayTemplate('footer') ?>
