?>

<label class="inputLabel" for="country"><?php 
            echo ENTRY_COUNTRY;
            ?>
</label>
<?php 
            echo zen_get_country_list('zone_country_id', $selected_country, 'id="country" onchange="update_zone(this.form);"');
            ?>
<br class="clearBoth" /> <label class="inputLabel" for="stateZone"
		id="zoneLabel"><?php 
            echo ENTRY_STATE;
            ?>
</label>
<?php 
            echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $state_zone_id, 'id="stateZone"');
            ?>
<br class="clearBoth" id="stBreak" /> <label class="inputLabel"
		for="state" id="stateLabel"><?php 
            echo $state_field_label;
            ?>
</label>
<?php 
            echo zen_draw_input_field('state', $selectedState, zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' id="state"') . '&nbsp;<span class="alert" id="stText">&nbsp;</span>';
            ?>
<br class="clearBoth" />

<?php 
            if (CART_SHIPPING_METHOD_ZIP_REQUIRED == "true") {
                ?>
<label class="inputLabel"><?php 
    /** Echoes out a complete address form, returns nothing.
     *
     * You are required to manually put the `form-horizontal` class in the
     * surrounding `<form>` element.
     */
    public static function echo_shipping_address_form()
    {
        global $entry, $zone_name, $zone_id, $flag_show_pulldown_states, $selected_country;
        ?>
    <p class="text-danger"><strong><?php 
        echo FORM_REQUIRED_INFORMATION;
        ?>
</strong></p>
    <?php 
        if (ACCOUNT_GENDER == 'true') {
            $male = (isset($gender) ? $gender : $entry->fields['entry_gender']) == 'male';
            echo '<label class="radio-inline">' . zen_draw_radio_field('gender', 'm', $male, 'id="gender-male"') . MALE . '</label>' . '<label class="radio-inline">' . zen_draw_radio_field('gender', 'f', !$male, 'id="gender-female"') . FEMALE . '</label>' . self::required_text(ENTRY_GENDER_TEXT);
        }
        ?>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="firstname"><?php 
        echo self::required_text(ENTRY_FIRST_NAME_TEXT) . ENTRY_FIRST_NAME;
        ?>
</label>
    <div class='col-sm-8'>
      <?php 
        echo zen_draw_input_field('firstname', $entry->fields['entry_firstname'], zen_set_field_length(TABLE_CUSTOMERS, 'customers_firstname', '40') . ' class="form-control" id="firstname"');
        ?>
    </div>
    </div>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="lastname"><?php 
        echo self::required_text(ENTRY_LAST_NAME_TEXT) . ENTRY_LAST_NAME;
        ?>
</label>
    <div class='col-sm-8'>
    <?php 
        echo zen_draw_input_field('lastname', $entry->fields['entry_lastname'], zen_set_field_length(TABLE_CUSTOMERS, 'customers_lastname', '40') . ' class="form-control" id="lastname"');
        ?>
    </div>
    </div>

    <?php 
        if (ACCOUNT_COMPANY == 'true') {
            ?>
      <div class='form-group'>
      <label class="control-label col-sm-4" for="lastname"><?php 
            echo self::required_text(ENTRY_COMPANY_TEXT) . ENTRY_COMPANY;
            ?>
</label>
      <div class='col-sm-8'>
      <?php 
            echo zen_draw_input_field('company', $entry->fields['entry_company'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_company', '40') . ' class="form-control" id="company"');
            ?>
      </div>
      </div>
    <?php 
        }
        ?>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="street-address"><?php 
        echo self::required_text(ENTRY_STREET_ADDRESS_TEXT) . ENTRY_STREET_ADDRESS;
        ?>
</label>
    <div class='col-sm-8'>
    <?php 
        echo zen_draw_input_field('street_address', $entry->fields['entry_street_address'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_street_address', '40') . ' class="form-control" id="street-address"');
        ?>
    </div>
    </div>

    <?php 
        if (ACCOUNT_SUBURB == 'true') {
            ?>
    <div class='form-group'>
    <label class="control-label col-sm-4" for="suburb"><?php 
            echo self::required_text(ENTRY_SUBURB_TEXT) . ENTRY_SUBURB;
            ?>
</label>
    <div class='col-sm-8'>
    <?php 
            echo zen_draw_input_field('suburb', $entry->fields['entry_suburb'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_suburb', '40') . ' class="form-control" id="suburb"');
            ?>
    </div>
    </div>
    <?php 
        }
        ?>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="city"><?php 
        echo self::required_text(ENTRY_CITY_TEXT) . ENTRY_CITY;
        ?>
</label>
    <div class='col-sm-8'>
    <?php 
        echo zen_draw_input_field('city', $entry->fields['entry_city'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' class="form-control" id="city"');
        ?>
    </div></div>

    <?php 
        if (ACCOUNT_STATE == 'true') {
            if ($flag_show_pulldown_states == true) {
                ?>
          <div class='form-group'>
          <label class="control-label col-sm-4" for="stateZone" class="form-control" id="zoneLabel">
            <?php 
                echo self::required_text(ENTRY_STATE_TEXT) . ENTRY_STATE;
                ?>
          </label>
          <div class='col-sm-8'>
    <?php 
                echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'class="form-control" id="stateZone"');
                echo '</div></div>';
            }
            ?>

    <div class='form-group' id='stateLabel'>
    <label class="control-label col-sm-4" for="state"><?php 
            echo self::required_text(ENTRY_STATE_TEXT) . ENTRY_STATE;
            ?>
</label>
    <!-- Elements with ids of `stText` & `stBreak` are required by Zencart,
         leaving them out breaks the auto-populating of the State dropdown when editing
         an address. -->
    <span id='stText'></span><span id='stBreak'></span>
    <div class='col-sm-8'>
    <?php 
            echo zen_draw_input_field('state', zen_get_zone_name($entry->fields['entry_country_id'], $entry->fields['entry_zone_id'], $entry->fields['entry_state']), zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_state', '40') . ' class="form-control" id="state"');
            if ($flag_show_pulldown_states == false) {
                echo zen_draw_hidden_field('zone_id', $zone_name, ' ');
            }
            ?>
    </div></div>
    <?php 
        }
        ?>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="postcode"><?php 
        echo self::required_text(ENTRY_POST_CODE_TEXT) . ENTRY_POST_CODE;
        ?>
</label>
    <div class='col-sm-8'>
    <?php 
        echo zen_draw_input_field('postcode', $entry->fields['entry_postcode'], zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_postcode', '40') . ' class="form-control" id="postcode"');
        ?>
    </div></div>

    <div class='form-group'>
    <label class="control-label col-sm-4" for="country"><?php 
        echo self::required_text(ENTRY_COUNTRY_TEXT) . ENTRY_COUNTRY;
        ?>
</label>
    <div class='col-sm-8'>
    <?php 
        echo zen_get_country_list('zone_country_id', isset($entry->fields['entry_country_id']) ? $entry->fields['entry_country_id'] : $selected_country, 'class="form-control" id="country" ' . ($flag_show_pulldown_states == true ? 'onchange="update_zone(this.form);"' : ''));
        ?>
    </div></div><?php 
    }
</label>
<?php 
echo zen_draw_input_field('city', '', zen_set_field_length(TABLE_ADDRESS_BOOK, 'entry_city', '40') . ' class="fc_input_text_border"') . (zen_not_null(ENTRY_CITY_TEXT) ? '<span class="alert">' . ENTRY_CITY_TEXT . '</span>' : '');
?>
<br class="clearBoth" />

<?php 
if (ACCOUNT_STATE == 'true') {
    if ($flag_show_pulldown_states == true) {
        ?>
<label class="inputLabel" title="stateZone"> <?php 
        echo ENTRY_STATE;
        ?>
</label>
<?php 
        echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'class="fc_input_text_border"');
        if (zen_not_null(ENTRY_STATE_TEXT)) {
            echo '&nbsp;<span class="alert">' . ENTRY_STATE_TEXT . '</span>';
        }
    }
    ?>

<?php 
    if ($flag_show_pulldown_states == true) {
        ?>
<br class="clearBoth"/>
<?php 
    }
    ?>
<label class="inputLabel stateLabel" title="state"><?php 
    echo ENTRY_STATE;
    <?php 
            echo zen_get_country_list('zone_country_id_shipping', $selected_country_shipping, 'id="country_shipping" ' . ($flag_show_pulldown_states_shipping == true ? 'onchange="update_zone_shipping(this.form);"' : '')) . (zen_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="alert">' . ENTRY_COUNTRY_TEXT . '</span>' : '');
            ?>
    <br class="clearBoth" />
	</div>
  
  <?php 
            if (ACCOUNT_STATE == 'true') {
                if ($flag_show_pulldown_states_shipping == true) {
                    ?>
  <label class="inputLabel" for="stateZone_shipping" id="zoneLabel"><?php 
                    echo ENTRY_STATE;
                    ?>
</label>
  <?php 
                    echo zen_draw_pull_down_menu('zone_id_shipping', zen_prepare_country_zones_pull_down($selected_country_shipping), $zone_id_shipping, 'id="stateZone_shipping"');
                    if (zen_not_null(ENTRY_STATE_TEXT)) {
                        echo '&nbsp;<span class="alert">' . ENTRY_STATE_TEXT . '</span>';
                    }
                }
                ?>
  
  <?php 
                if ($flag_show_pulldown_states_shipping == true) {
                    ?>
  <br class="clearBoth" id="stBreakShipping" />
  <?php 
                }
                ?>
  <label class="inputLabel" for="state_shipping" id="stateLabelShipping"><?php 
                echo $state_field_label_shipping;
Пример #5
0
if ($action == 'list') {
    switch ($saction) {
        case 'new':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] . '&' : '') . 'saction=insert_sub'));
            $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), '', 'onChange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down()));
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_insert.gif', IMAGE_INSERT) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        case 'edit':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=save_sub'));
            $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY . '<br>' . zen_draw_pull_down_menu('zone_country_id', zen_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'onChange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id));
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_update.gif', IMAGE_UPDATE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        case 'delete':
            $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>');
            $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=deleteconfirm_sub'));
            $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
            $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>');
            $contents[] = array('align' => 'center', 'text' => '<br>' . zen_image_submit('button_delete.gif', IMAGE_DELETE) . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
            break;
        default:
            if (isset($sInfo) && is_object($sInfo)) {
                $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>');
                $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>');
                $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->date_added));
                if (zen_not_null($sInfo->last_modified)) {
		<label for="stateZone" id="zoneLabel" class="col-xs-12 col-sm-4 col-md-3 control-label"><?php 
        echo ENTRY_STATE;
        ?>
			<?php 
        if (zen_not_null(ENTRY_STATE_TEXT)) {
            ?>
<span class="required"><?php 
            echo ENTRY_STATE_TEXT;
            ?>
</span><?php 
        }
        ?>
		</label>
		<div class="col-xs-12 col-sm-8 col-md-9">
			<?php 
        echo zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down($selected_country), $zone_id, 'id="stateZone" class="form-control"');
        ?>
			
			<div id="stBreak"></div>
		</div>
	</div>
	<?php 
    }
    ?>
	
	<div class="form-group<?php 
    if (!zen_not_null($state_field_label)) {
        ?>
 hidden<?php 
    }
    ?>