if ($entry_state_error == true) {
                if ($entry_state_has_zones == true) {
                    $zones_array = array();
                    $zones_query = xtc_db_query("SELECT zone_name FROM " . TABLE_ZONES . " WHERE zone_country_id = '" . xtc_db_input($cInfo->entry_country_id) . "' order by zone_name");
                    while ($zones_values = xtc_db_fetch_array($zones_query)) {
                        $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
                    }
                    echo xtc_draw_pull_down_menu('entry_state', $zones_array) . ' ' . ENTRY_STATE_ERROR;
                } else {
                    echo xtc_draw_input_field('entry_state', xtc_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)) . ' ' . ENTRY_STATE_ERROR;
                }
            } else {
                echo $entry_state . xtc_draw_hidden_field('entry_zone_id') . xtc_draw_hidden_field('entry_state');
            }
        } else {
            echo xtc_draw_input_field('entry_state', xtc_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state));
        }
        ?>
              </div>
           </div>
            <?php 
    }
    ?>
            <div class='col-xs-12'>
              <div class="main col-xs-12 col-sm-2"><?php 
    echo ENTRY_COUNTRY;
    ?>
</div>
              <div class="main col-xs-12 col-sm-10">
                <?php 
    if ($error == true) {
        if ($entry_state_error == true) {
            if ($entry_state_has_zones == true) {
                $zones_array = array();
                $zones_query = xtc_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . xtc_db_input($a_country) . "' order by zone_name");
                while ($zones_values = xtc_db_fetch_array($zones_query)) {
                    $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
                }
                $state_content = xtc_draw_pull_down_menuNote(array('name' => 'a_state', 'text' => '&nbsp;' . ENTRY_STATE_ERROR), $zones_array);
            } else {
                $state_content = xtc_draw_input_fieldNote(array('name' => 'a_state', 'text' => '&nbsp;' . ENTRY_STATE_ERROR));
            }
        } else {
            $state_content = $state . xtc_draw_hidden_field('a_zone_id') . xtc_draw_hidden_field('a_state');
        }
    } else {
        $state_content = xtc_draw_input_fieldNote(array('name' => 'a_state', 'text' => '&nbsp;' . ENTRY_STATE_TEXT), xtc_get_zone_name($affiliate['affiliate_country_id'], $affiliate['affiliate_zone_id'], $affiliate['affiliate_state']));
    }
    $module_smarty->assign('state_content', $state_content);
}
if ($is_read_only == true) {
    $telephone_content = $affiliate['affiliate_telephone'];
} elseif ($error == true) {
    if ($entry_telephone_error == true) {
        $telephone_content = xtc_draw_input_fieldNote(array('name' => 'a_telephone', 'text' => '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR));
    } else {
        $telephone_content = $a_telephone . xtc_draw_hidden_field('a_telephone');
    }
} else {
    $telephone_content = xtc_draw_input_fieldNote(array('name' => 'a_telephone', 'text' => '&nbsp;' . ENTRY_TELEPHONE_NUMBER_TEXT), $affiliate['affiliate_telephone']);
}
$module_smarty->assign('telephone_content', $telephone_content);
$module_smarty->assign('INPUT_CITY', xtc_draw_input_fieldNote(array('name' => 'city', 'text' => '&nbsp;' . (xtc_not_null(ENTRY_CITY_TEXT) ? '<span class="inputRequirement">' . ENTRY_CITY_TEXT . '</span>' : '')), $entry['entry_city']));
if (ACCOUNT_STATE == 'true') {
    $module_smarty->assign('state', '1');
    if ($process == true) {
        if ($entry_state_has_zones == true) {
            $zones_array = array();
            $zones_query = xtc_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . xtc_db_input($country) . "' order by zone_name");
            while ($zones_values = xtc_db_fetch_array($zones_query)) {
                $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
            }
            $state_input = xtc_draw_pull_down_menuNote(array('name' => 'state', 'text' => '&nbsp;' . (xtc_not_null(ENTRY_STATE_TEXT) ? '<span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>' : '')), $zones_array);
        } else {
            $state_input = xtc_draw_input_fieldNote(array('name' => 'state', 'text' => '&nbsp;' . (xtc_not_null(ENTRY_STATE_TEXT) ? '<span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>' : '')));
        }
    } else {
        $state_input = xtc_draw_input_fieldNote(array('name' => 'state', 'text' => '&nbsp;' . (xtc_not_null(ENTRY_STATE_TEXT) ? '<span class="inputRequirement">' . ENTRY_STATE_TEXT . '</span>' : '')), xtc_get_zone_name($entry['entry_country_id'], $entry['entry_zone_id'], $entry['entry_state']));
    }
    $module_smarty->assign('INPUT_STATE', $state_input);
}
if (isset($_POST['country'])) {
    $selected = $_POST['country'];
} elseif (isset($entry['entry_country_id'])) {
    $selected = $entry['entry_country_id'];
} else {
    $selected = STORE_COUNTRY;
}
$module_smarty->assign('SELECT_COUNTRY', xtc_get_country_list(array('name' => 'country', 'text' => '&nbsp;' . (xtc_not_null(ENTRY_COUNTRY_TEXT) ? '<span class="inputRequirement">' . ENTRY_COUNTRY_TEXT . '</span>' : '')), $selected));
if (isset($_GET['edit']) && $_SESSION['customer_default_address_id'] != $_GET['edit'] || isset($_GET['edit']) == false) {
    $module_smarty->assign('new', '1');
    $module_smarty->assign('CHECKBOX_PRIMARY', xtc_draw_checkbox_field('primary', 'on', false, 'id="primary"'));
}
        if (isset($entry_state_error) && $entry_state_error == true) {
            if ($entry_state_has_zones == true) {
                $zones_array = array();
                $zones_query = xtc_db_query("select zone_name from " . TABLE_ZONES . " where zone_country_id = '" . xtc_db_input($entry_country_id) . "' order by zone_name");
                while ($zones_values = xtc_db_fetch_array($zones_query)) {
                    $zones_array[] = array('id' => $zones_values['zone_name'], 'text' => $zones_values['zone_name']);
                }
                echo xtc_draw_pull_down_menu('entry_state', $zones_array) . '&nbsp;' . ENTRY_STATE_ERROR;
            } else {
                echo xtc_draw_input_field('entry_state', xtc_get_zone_name(isset($entry_country_id) ? $entry_country_id : '', isset($entry_zone_id) ? $entry_zone_id : '', isset($entry_state) ? $entry_state : '')) . '&nbsp;' . ENTRY_STATE_ERROR;
            }
        } else {
            echo xtc_draw_input_field('entry_state', xtc_get_zone_name(isset($entry_country_id) ? $entry_country_id : '', isset($entry_zone_id) ? $entry_zone_id : '', isset($entry_state) ? $entry_state : ''));
        }
    } else {
        echo xtc_draw_input_field('entry_state', xtc_get_zone_name(isset($entry_country_id) ? $entry_country_id : '', isset($entry_zone_id) ? $entry_zone_id : '', isset($entry_state) ? $entry_state : ''));
    }
    ?>
                        </div>
                      </div>
                      <?php 
}
?>
                    <div class="col-xs-12">
                      <div class="col-sm-2 col-xs-12 main"><?php 
echo ENTRY_COUNTRY;
?>
</div>
                      <div class="col-sm-10 col-xs-12 main">
                        <?php 
if (isset($error) && $error == true) {