<?php
/**
 * Page Template
 *
 * Loaded automatically by index.php?main_page=create_account.<br />
 * Displays Create Account form.
 *
 * @package templateSystem
 * @copyright Copyright 2003-2012 Zen Cart Development Team
 * @copyright Portions Copyright 2003 osCommerce
 * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
 * @version GIT: $Id: Author: DrByte  Sun Aug 19 09:47:29 2012 -0400 Modified in v1.5.1 $
 */
?>

<?php if ($messageStack->size('create_account') > 0) echo $messageStack->output('create_account'); ?>
<p class="text-danger"><?php echo FORM_REQUIRED_INFORMATION; ?></p>
<br class="clearBoth" />

<?php if (DISPLAY_PRIVACY_CONDITIONS == 'true') { ?>
  <h3 class="section-title"><?php echo TABLE_HEADING_PRIVACY_CONDITIONS; ?></h3>
  <p class="information"><?php echo TEXT_PRIVACY_CONDITIONS_DESCRIPTION;?></p>
  <div class="checkbox">
    <label class="checkboxLabel" for="privacy">
      <?php echo zen_draw_checkbox_field('privacy_conditions', '1', false, 'id="privacy"');?>
      <?php echo TEXT_PRIVACY_CONDITIONS_CONFIRM;?>
    </label>
  </div>
  <br><br>
<?php } ?>

<?php if (ACCOUNT_COMPANY == 'true') { ?>
  <h3 class="section-title"><?php echo CATEGORY_COMPANY; ?></h3>
  <div class="form-group">
    <label class="inputLabel" for="company"><?php echo ENTRY_COMPANY; ?></label>
    <?php echo zen_draw_input_field('company', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' id="company"') . (zen_not_null(ENTRY_COMPANY_TEXT) ? '<span class="alert form-alert text-danger">' . ENTRY_COMPANY_TEXT . '</span>': ''); ?>
  </div>
  <br>
<?php
  }
?>

<h3 class="section-title"><?php echo TABLE_HEADING_ADDRESS_DETAILS; ?></h3>
<?php if (ACCOUNT_GENDER == 'true') { ?>
<div class="account-radio">
  <label class="radioButtonLabel radio-inline" for="gender-male">
    <?php echo zen_draw_radio_field('gender', 'm', '', 'id="gender-male"') . MALE; ?>
  </label>
  <label class="radioButtonLabel radio-inline" for="gender-female">
    <?php echo zen_draw_radio_field('gender', 'f', '', '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 class="clearBoth" />
<?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', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' 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', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', '40') . ' id="lastname"'); ?>
</div>

<div class="form-group">
  <label class="inputLabel" for="street-address"><?php echo str_replace(':', '', ENTRY_STREET_ADDRESS) . (zen_not_null(ENTRY_STREET_ADDRESS_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_STREET_ADDRESS_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_input_field('street_address', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' id="street-address"'); ?>
</div>

<?php echo zen_draw_input_field('should_be_empty', '', ' size="40" id="CAAS" style="visibility:hidden; display:none;" autocomplete="off"'); ?>

<?php if (ACCOUNT_SUBURB == 'true') { ?>
<div class="form-group">
  <label class="inputLabel" for="suburb"><?php echo str_replace(':', '', ENTRY_SUBURB) . (zen_not_null(ENTRY_SUBURB_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_SUBURB_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_input_field('suburb', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', '40') . ' id="suburb"'); ?>
</div>
<?php } ?>

<div class="form-group">
  <label class="inputLabel" for="city"><?php echo str_replace(':', '', ENTRY_CITY) . (zen_not_null(ENTRY_CITY_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_CITY_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' id="city"'); ?>
</div>

<?php
  if (ACCOUNT_STATE == 'true') {
    if ($flag_show_pulldown_states == true) {
?>
<div class="form-group">
<label class="inputLabel" for="stateZone" id="zoneLabel"><?php echo str_replace(':', '', ENTRY_STATE) . (zen_not_null(ENTRY_STATE_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_STATE_TEXT . '</span>' : ''); ?></label>
<?php
  echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone"');
?>
</div>
<?php } ?>

<?php if ($flag_show_pulldown_states == true) { ?>
<?php } ?>
<div class="form-group">
<label class="inputLabel" for="state" id="stateLabel"><?php echo str_replace(':', '', $state_field_label) . (zen_not_null(ENTRY_STATE_TEXT) ? ' <span class="alert form-alert text-danger" id="stText">' . ENTRY_STATE_TEXT . '</span>' : ''); ?></label>
<?php
  echo zen_draw_input_field('state', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"');
  if ($flag_show_pulldown_states == false) {
    echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
  }
?>
</div>
<?php } ?>

<div class="form-group">
  <label class="inputLabel" for="postcode"><?php echo str_replace(':', '', ENTRY_POST_CODE) . (zen_not_null(ENTRY_POST_CODE_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_POST_CODE_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_input_field('postcode', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' id="postcode"'); ?>
</div>

<div class="form-group">
  <label class="inputLabel" for="country"><?php echo str_replace(':', '', ENTRY_COUNTRY) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? ' <span class="alert form-alert text-danger">' . ENTRY_COUNTRY_TEXT . '</span>': ''); ?></label>
  <?php echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : '')); ?>
</div><br>

<h3 class="section-title"><?php echo TABLE_HEADING_PHONE_FAX_DETAILS; ?></h3>
<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', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_telephone', '40') . ' id="telephone"'); ?>
</div>

<?php if (ACCOUNT_FAX_NUMBER == 'true') { ?>
<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', '', 'id="fax"'); ?>
</div>
<?php } ?>

<br>

<?php if (ACCOUNT_DOB == 'true') { ?>
<h3 class="section-title"><?php echo TABLE_HEADING_DATE_OF_BIRTH; ?></h3>
<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','', 'id="dob"'); ?>
</div>
<?php } ?>

<br>

<h3 class="section-title"><?php echo TABLE_HEADING_LOGIN_DETAILS; ?></h3>
<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', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_email_address', '40') . ' id="email-address"'); ?>
</div>

<?php
  if ($phpBB->phpBB['installed'] == true) {
?>
<div class="form-group">
  <label class="inputLabel" for="nickname"><?php echo str_replace(':', '', ENTRY_NICK) . (zen_not_null(ENTRY_NICK_TEXT) ? '<span class="alert form-alert text-danger">' . ENTRY_NICK_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_input_field('nick','','id="nickname"'); ?>
</div>
<?php
  }
?>

<div class="form-group">
  <label class="inputLabel" for="password-new"><?php echo str_replace(':', '', ENTRY_PASSWORD) . (zen_not_null(ENTRY_PASSWORD_TEXT) ? '<span class="alert form-alert text-danger">' . ENTRY_PASSWORD_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_password_field('password', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-new"'); ?>
</div>

<div class="form-group">
  <label class="inputLabel" for="password-confirm"><?php echo str_replace(':', '', ENTRY_PASSWORD_CONFIRMATION) . (zen_not_null(ENTRY_PASSWORD_CONFIRMATION_TEXT) ? '<span class="alert form-alert text-danger">' . ENTRY_PASSWORD_CONFIRMATION_TEXT . '</span>': ''); ?></label>
  <?php echo zen_draw_password_field('confirmation', '', zen_set_field_length(TABLE_CUSTOMERS, 'customers_password', '20') . ' id="password-confirm"'); ?>
</div>

<br>

<?php echo recaptcha_get_html(true); ?>
<br><br>

<?php if (CUSTOMERS_REFERRAL_STATUS == 2) { ?>
<h3 class="section-title"><?php echo TABLE_HEADING_REFERRAL_DETAILS; ?></h3>
<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 } ?>
