function getZones()
 {
     global $toC_Json;
     foreach (osC_Address::getZones($_REQUEST['countries_id']) as $zone) {
         $zones_array[] = array('id' => $zone['id'], 'text' => $zone['name']);
     }
     $response = array(EXT_JSON_READER_ROOT => $zones_array);
     echo $toC_Json->encode($response);
 }
function osc_cfg_set_zones_pulldown_menu($default, $key = null)
{
    $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value';
    $zones_array = array();
    foreach (osC_Address::getZones() as $zone) {
        $zones_array[] = array('id' => $zone['id'], 'text' => $zone['name'], 'group' => $zone['country_name']);
    }
    return osc_draw_pull_down_menu($name, $zones_array, $default);
}
예제 #3
0
 function getZones()
 {
     global $toC_Json;
     foreach (osC_Address::getZones() as $zone) {
         if ($zone['country_id'] == STORE_COUNTRY) {
             $zones_array[] = array('id' => $zone['id'], 'text' => $zone['name'], 'group' => $zone['country_name']);
         }
     }
     $response = array(EXT_JSON_READER_ROOT => $zones_array);
     echo $toC_Json->encode($response);
 }
function osc_cfg_set_zones_pulldown_menu($default, $key = null)
{
    $name = !empty($key) ? 'configuration[' . $key . ']' : 'configuration_value';
    $zones_array = array();
    foreach (osC_Address::getZones() as $zone) {
        $zones_array[] = array('id' => $zone['id'], 'text' => $zone['name'], 'group' => $zone['country_name']);
    }
    $control = array();
    $control['name'] = $name;
    $control['type'] = 'combobox';
    $control['mode'] = 'remote';
    $control['module'] = 'cfg';
    $control['action'] = 'get_zones';
    return $control;
}
예제 #5
0
 function getZones()
 {
     global $toC_Json;
     $country_id = isset($_REQUEST['country_id']) ? $_REQUEST['country_id'] : null;
     $records = array();
     foreach (osC_Address::getZones($country_id) as $zone) {
         $records[] = array('zone_code' => $zone['code'], 'zone_name' => $zone['name']);
     }
     echo $toC_Json->encode(array(EXT_JSON_READER_ROOT => $records));
 }
예제 #6
0
  http://www.oscommerce.com

  Copyright (c) 2009 osCommerce

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/
$osC_ObjectInfo = new osC_ObjectInfo(osC_ZoneGroups_Admin::getEntry($_GET['zeID']));
$countries_array = array(array('id' => '', 'text' => $osC_Language->get('all_countries')));
foreach (osC_Address::getCountries() as $country) {
    $countries_array[] = array('id' => $country['id'], 'text' => $country['name']);
}
$zones_array = array(array('id' => '', 'text' => $osC_Language->get('all_zones')));
if ($osC_ObjectInfo->get('zone_country_id') > 0) {
    foreach (osC_Address::getZones($osC_ObjectInfo->get('zone_country_id')) as $zone) {
        $zones_array[] = array('id' => $zone['id'], 'text' => $zone['name']);
    }
}
?>

<script type="text/javascript"><!--
function update_zone(theForm) {
  var NumState = theForm.zone_id.options.length;
  var SelectedCountry = "";

  while(NumState > 0) {
    NumState--;
    theForm.zone_id.options[NumState] = null;
  }