Пример #1
0
 case 'edit':
     $check_query = xos_db_query("select ab.entry_zone_id, zgz.zone_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_zone_id = '" . (int) $cInfo->zone_id . "' or zgz.zone_id = '" . (int) $cInfo->zone_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>';
     $form_tag = xos_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=save');
     $contents[] = array('text' => TEXT_INFO_EDIT_INTRO);
     if (isset($_GET['error_name'])) {
         if (empty($_GET['error_name'])) {
             $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME_ERROR_EMPTY . '<br />');
         } else {
             $contents[] = array('text' => '<br />' . sprintf(TEXT_INFO_ZONES_NAME_ERROR, $_GET['error_name']) . '<br />');
         }
     }
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_NAME . '<br />' . xos_draw_input_field('zone_name', isset($_GET['zone_name']) ? $_GET['zone_name'] : $cInfo->zone_name) . xos_draw_hidden_field('actual_zone_name', $cInfo->zone_name));
     $contents[] = array('text' => '<br />' . TEXT_INFO_ZONES_CODE . '<br />' . xos_draw_input_field('zone_code', isset($_GET['zone_code']) ? $_GET['zone_code'] : $cInfo->zone_code));
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br />' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(), isset($_GET['zone_country_id']) ? $_GET['zone_country_id'] : $cInfo->countries_id, 'style="font-size:9px"') . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     } else {
         $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_NAME . '<br /><b>' . $cInfo->countries_name . '</b>' . xos_draw_hidden_field('zone_country_id', $cInfo->countries_id) . xos_draw_hidden_field('actual_zone_country_id', $cInfo->countries_id));
     }
     $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     break;
 case 'delete':
     $check_query = xos_db_query("select ab.entry_zone_id, zgz.zone_id from " . TABLE_ADDRESS_BOOK . " ab, " . TABLE_ZONES_TO_GEO_ZONES . " zgz where ab.entry_zone_id = '" . (int) $cInfo->zone_id . "' or zgz.zone_id = '" . (int) $cInfo->zone_id . "' LIMIT 1");
     $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>';
     if (!xos_db_num_rows($check_query) && STORE_ZONE != $cInfo->zone_id) {
         $form_tag = xos_draw_form('zones', FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id . '&action=deleteconfirm');
         $contents[] = array('text' => TEXT_INFO_DELETE_INTRO);
         $contents[] = array('text' => '<br /><b>' . $cInfo->zone_name . '</b>');
         $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_ZONES, 'page=' . $_GET['page'] . '&cID=' . $cInfo->zone_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
     } else {
         $contents[] = array('text' => TEXT_INFO_DELETE_NOT_ALLOWED . '<br /><br />');
Пример #2
0
function xos_cfg_pull_down_country_list($country_id)
{
    return '<div class="form-group">' . xos_draw_pull_down_menu('configuration_value', xos_get_countries(), $country_id, 'class="form-control"') . '</div>';
}
Пример #3
0
             }
         } else {
             $smarty->assign('state_in_out_values', $entry_state . xos_draw_hidden_field('entry_zone_id') . xos_draw_hidden_field('entry_state'));
         }
     } else {
         $smarty->assign('state_in_out_values', xos_draw_input_field('entry_state', xos_get_zone_name($cInfo->entry_country_id, $cInfo->entry_zone_id, $cInfo->entry_state)));
     }
 }
 if ($error == true) {
     if ($entry_country_error == true) {
         $smarty->assign('country_in_out_values', xos_draw_pull_down_menu('entry_country_id', xos_get_countries(), $cInfo->entry_country_id) . '&nbsp;' . ENTRY_COUNTRY_ERROR);
     } else {
         $smarty->assign('country_in_out_values', xos_get_country_name($cInfo->entry_country_id) . xos_draw_hidden_field('entry_country_id'));
     }
 } else {
     $smarty->assign('country_in_out_values', xos_draw_pull_down_menu('entry_country_id', xos_get_countries(), $cInfo->entry_country_id));
 }
 if ($error == true) {
     if ($entry_telephone_error == true) {
         $smarty->assign('telephone_in_out_values', xos_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"') . '&nbsp;' . ENTRY_TELEPHONE_NUMBER_ERROR);
     } else {
         $smarty->assign('telephone_in_out_values', $cInfo->customers_telephone . xos_draw_hidden_field('customers_telephone'));
     }
 } else {
     $smarty->assign('telephone_in_out_values', xos_draw_input_field('customers_telephone', $cInfo->customers_telephone, 'maxlength="32"', true));
 }
 if ($processed == true) {
     $smarty->assign('fax_in_out_values', $cInfo->customers_fax . xos_draw_hidden_field('customers_fax'));
 } else {
     $smarty->assign('fax_in_out_values', xos_draw_input_field('customers_fax', $cInfo->customers_fax, 'maxlength="32"'));
 }
Пример #4
0
function xos_get_country_name($country_id)
{
    $country_array = xos_get_countries($country_id);
    return $country_array['countries_name'];
}
Пример #5
0
 $contents = array();
 if ($action == 'list') {
     switch ($saction) {
         case 'new':
             $heading_title = '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>';
             $form_tag = xos_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 /><div class="form-group">' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), '', 'class="form-control" onchange="update_zone(this.form);"') . '</div>');
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down(), '', 'class="form-control"') . '</div>');
             $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_INSERT . ' ">' . BUTTON_TEXT_INSERT . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         case 'edit':
             $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>';
             $form_tag = xos_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 /><div class="form-group">' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'class="form-control" onchange="update_zone(this.form);"') . '</div>');
             $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br /><div class="form-group">' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id, 'class="form-control"') . '</div>');
             $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_UPDATE . ' ">' . BUTTON_TEXT_UPDATE . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         case 'delete':
             $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>';
             $form_tag = xos_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('text' => '<br /><a href="" onclick="zones.submit(); return false" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_CANCEL . ' ">' . BUTTON_TEXT_CANCEL . '</a><br />&nbsp;');
             break;
         default:
             if (isset($sInfo) && is_object($sInfo)) {
                 $heading_title = '<b>' . $sInfo->countries_name . '</b>';
                 $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '" class="btn btn-default btn-margin-infobox" title=" ' . BUTTON_TITLE_EDIT . ' ">' . BUTTON_TEXT_EDIT . '</a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '" class="btn btn-danger btn-margin-infobox" title=" ' . BUTTON_TITLE_DELETE . ' ">' . BUTTON_TEXT_DELETE . '</a>');
                 $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_date_short($sInfo->date_added));
Пример #6
0
$contents = array();
if ($action == 'list') {
    switch ($saction) {
        case 'new':
            $heading_title = '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>';
            $form_tag = xos_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 />' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), '', 'style="font-size:9px" onchange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br />' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down(), '', 'style="font-size:9px"'));
            $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_INSERT . ' "><span>' . BUTTON_TEXT_INSERT . '</span></a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($_GET['sID']) ? 'sID=' . $_GET['sID'] : '')) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
            break;
        case 'edit':
            $heading_title = '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>';
            $form_tag = xos_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 />' . xos_draw_pull_down_menu('zone_country_id', xos_get_countries(TEXT_ALL_COUNTRIES), $sInfo->zone_country_id, 'style="font-size:9px" onchange="update_zone(this.form);"'));
            $contents[] = array('text' => '<br />' . TEXT_INFO_COUNTRY_ZONE . '<br />' . xos_draw_pull_down_menu('zone_id', xos_prepare_country_zones_pull_down($sInfo->zone_country_id), $sInfo->zone_id, 'style="font-size:9px"'));
            $contents[] = array('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_UPDATE . ' "><span>' . BUTTON_TEXT_UPDATE . '</span></a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
            break;
        case 'delete':
            $heading_title = '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>';
            $form_tag = xos_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('text' => '<br /><a href="" onclick="zones.submit(); return false" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id) . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_CANCEL . ' "><span>' . BUTTON_TEXT_CANCEL . '</span></a><br />&nbsp;');
            break;
        default:
            if (isset($sInfo) && is_object($sInfo)) {
                $heading_title = '<b>' . $sInfo->countries_name . '</b>';
                $contents[] = array('text' => '<a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_EDIT . ' "><span>' . BUTTON_TEXT_EDIT . '</span></a><a href="' . xos_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=delete') . '" class="button-default" style="margin-right: 5px; float: left" title=" ' . BUTTON_TITLE_DELETE . ' "><span>' . BUTTON_TEXT_DELETE . '</span></a>');
                $contents[] = array('text' => '<br />' . TEXT_INFO_DATE_ADDED . ' ' . xos_date_short($sInfo->date_added));
Пример #7
0
function xos_cfg_pull_down_country_list($country_id)
{
    return xos_draw_pull_down_menu('configuration_value', xos_get_countries(), $country_id, 'style="font-size:9px"');
}
Пример #8
0
function xos_get_country_list($name, $selected = '', $parameters = '')
{
    $countries_array = array(array('id' => '', 'text' => PULL_DOWN_DEFAULT));
    $countries = xos_get_countries();
    for ($i = 0, $n = sizeof($countries); $i < $n; $i++) {
        $countries_array[] = array('id' => $countries[$i]['countries_id'], 'text' => $countries[$i]['countries_name']);
    }
    return xos_draw_pull_down_menu($name, $countries_array, $selected, $parameters);
}