<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=account_edit.<br />
 * View or change Customer Account Information
 *
 * @package templateSystem
 * @copyright Copyright 2003-2005 Zen Cart Development Team
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version $Id: tpl_account_edit_default.php 3848 2006-06-25 20:33:42Z drbyte $
 * @copyright Portions Copyright 2003 osCommerce
 */
?>
<div class="centerColumn" id="accountEditDefault">
	<div class="stacked-layout">

		<?php echo zen_draw_form('account_edit', zen_href_link(FILENAME_ACCOUNT_EDIT, '', 'SSL'), 'post', 'onsubmit="return check_form(account_edit);"') . zen_draw_hidden_field('action', 'process'); ?>

		<?php if ($messageStack->size('account_edit') > 0) echo $messageStack->output('account_edit'); ?>

		<h3 class="section-title"><?php echo HEADING_TITLE; ?></h3>
		<p class="text-danger"><?php echo FORM_REQUIRED_INFORMATION; ?></p>
		<br>

		<?php
		  if (ACCOUNT_GENDER == 'true') {
		?>
		<div class="account-radio form-group">
			<label class="radioButtonLabel radio-inline" for="gender-male">
				<?php echo zen_draw_radio_field('gender', 'm', $male, 'id="gender-male"') . MALE; ?>
			</label>
			<label class="radioButtonLabel radio-inline" for="gender-female">
				<?php echo zen_draw_radio_field('gender', 'f', $female, 'id="gender-female"') . FEMALE; ?>
			</label>
			<?php echo (zen_not_null(ENTRY_GENDER_TEXT) ? '<span class="alert form-alert text-danger">' . ENTRY_GENDER_TEXT . '</span>': ''); ?>
		</div>
		<br>
		<?php
		  }
		?>

		<div class="form-group">
			<label class="inputLabel" for="firstname"><?php echo str_replace(':', '', ENTRY_FIRST_NAME) . (zen_not_null(ENTRY_FIRST_NAME_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_FIRST_NAME_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('firstname', $account->fields['customers_firstname'], 'id="firstname"'); ?>
		</div>

		<div class="form-group">
			<label class="inputLabel" for="lastname"><?php echo str_replace(':', '', ENTRY_LAST_NAME) . (zen_not_null(ENTRY_LAST_NAME_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_LAST_NAME_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('lastname', $account->fields['customers_lastname'], 'id="lastname"'); ?>
		</div>

		<?php
		  if (ACCOUNT_DOB == 'true') {
		?>
		<div class="form-group">
			<label class="inputLabel" for="dob"><?php echo str_replace(':', '', ENTRY_DATE_OF_BIRTH) . (zen_not_null(ENTRY_DATE_OF_BIRTH_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_DATE_OF_BIRTH_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('dob', zen_date_short($account->fields['customers_dob']), 'id="dob"'); ?>
		</div>
		<?php
		  }
		?>

		<div class="form-group">
			<label class="inputLabel" for="email-address"><?php echo str_replace(':', '', ENTRY_EMAIL_ADDRESS) . (zen_not_null(ENTRY_EMAIL_ADDRESS_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_EMAIL_ADDRESS_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('email_address', $account->fields['customers_email_address'], 'id="email-address"'); ?>
		</div>

		<div class="form-group">
			<label class="inputLabel" for="telephone"><?php echo str_replace(':', '', ENTRY_TELEPHONE_NUMBER) . (zen_not_null(ENTRY_TELEPHONE_NUMBER_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_TELEPHONE_NUMBER_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('telephone', $account->fields['customers_telephone'], 'id="telephone"'); ?>
		</div>

		<div class="form-group">
			<label class="inputLabel" for="fax"><?php echo str_replace(':', '', ENTRY_FAX_NUMBER) . (zen_not_null(ENTRY_FAX_NUMBER_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_FAX_NUMBER_TEXT . '</span>': ''); ?></label>
			<?php echo zen_draw_input_field('fax', $account->fields['customers_fax'], 'id="fax"'); ?>
		</div>

		<?php
		  if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral == '') {
		?>
		<div class="form-group">
			<label class="inputLabel" for="customers-referral"><?php echo str_replace(':', '', ENTRY_CUSTOMERS_REFERRAL); ?></label>
			<?php echo zen_draw_input_field('customers_referral', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_referral', 15), 'id="customers-referral"'); ?>
		</div>
		<?php } ?>

		<?php
		  if (CUSTOMERS_REFERRAL_STATUS == 2 and $customers_referral != '') {
		?>
		<div class="form-group">
			<label for="customers-referral-readonly"><?php echo str_replace(':', '', ENTRY_CUSTOMERS_REFERRAL); ?></label>
			<?php echo $customers_referral; zen_draw_hidden_field('customers_referral', $customers_referral,'id="customers-referral-readonly"'); ?>
		</div>
		<?php } ?>

		<h3 class="section-title"><?php echo ENTRY_EMAIL_PREFERENCE; ?></h3>
			<div class="account-radio">
				<label class="radioButtonLabel radio-inline" for="email-format-html">
					<?php echo zen_draw_radio_field('email_format', 'HTML', $email_pref_html,'id="email-format-html"') . ENTRY_EMAIL_HTML_DISPLAY; ?>
				</label>
				<label  class="radioButtonLabel radio-inline" for="email-format-text">
					<?php echo zen_draw_radio_field('email_format', 'TEXT', $email_pref_text, 'id="email-format-text"') . ENTRY_EMAIL_TEXT_DISPLAY; ?>
				</label>
			</div>
			<div class="clearfix"></div>
		<br><br>

		<div class="buttonRow pull-left"><?php echo '<a href="' . zen_href_link(FILENAME_ACCOUNT, '', 'SSL') . '" class="button button-inverse">' . BUTTON_BACK_ALT . '</a>'; ?></div>
		<div class="buttonRow pull-right"><input type="submit" value="<?php echo BUTTON_UPDATE_ALT; ?>" class="button"></div>
		<div class="clearfix"></div>

		</form>
	</div>
</div>