[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
[phpBB Debug] PHP Warning: in file [ROOT]/includes/crs/crs_misc_functions.php on line 37: mime_content_type(): Empty filename or path
Zen Cart 源代码 geo_zones.php

Zen Cart 源代码 geo_zones.php




下载文件

文件名: geo_zones.php
文件类型: PHP文件
文件大小: 29.56 KiB
MD5: 96983eca75eb380373ad050eac2461fa

geo_zones.php - 关闭高亮
  1. <?php
  2. /**
  3.  * @package admin
  4.  * @copyright Copyright 2003-2014 Zen Cart Development Team
  5.  * @copyright Portions Copyright 2003 osCommerce
  6.  * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
  7.  * @version $Id: geo_zones.php  drbyte  Modified in v1.5.4 $
  8.  */
  9.  
  10.   require('includes/application_top.php');
  11.  
  12.   $saction = (isset($_GET['saction']) ? $_GET['saction'] : '');
  13.   if (isset($_GET['zID'])) $_GET['zID'] = (int)$_GET['zID'];
  14.   if (isset($_GET['zpage'])) $_GET['zpage'] = (int)$_GET['zpage'];
  15.   if (isset($_GET['spage'])) $_GET['spage'] = (int)$_GET['spage'];
  16.  
  17.   if (zen_not_null($saction)) {
  18.     switch ($saction) {
  19.       case 'insert_sub':
  20.         $zID = zen_db_prepare_input($_GET['zID']);
  21.         $zone_country_id = zen_db_prepare_input($_POST['zone_country_id']);
  22.         $zone_id = zen_db_prepare_input($_POST['zone_id']);
  23.  
  24.         $db->Execute("insert into " . TABLE_ZONES_TO_GEO_ZONES . "
  25.                    (zone_country_id, zone_id, geo_zone_id, date_added)
  26.                    values ('" . (int)$zone_country_id . "',
  27.                            '" . (int)$zone_id . "',
  28.                            '" . (int)$zID . "',
  29.                            now())");
  30.  
  31.         $new_subzone_id = $db->Insert_ID();
  32.  
  33. //        zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $new_subzone_id));
  34.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list' . '&sID=' . $new_subzone_id));
  35.         break;
  36.       case 'save_sub':
  37.         $sID = zen_db_prepare_input($_GET['sID']);
  38.         $zID = zen_db_prepare_input($_GET['zID']);
  39.         $zone_country_id = zen_db_prepare_input($_POST['zone_country_id']);
  40.         $zone_id = zen_db_prepare_input($_POST['zone_id']);
  41.  
  42.         $db->Execute("update " . TABLE_ZONES_TO_GEO_ZONES . "
  43.                      set geo_zone_id = '" . (int)$zID . "',
  44.                          zone_country_id = '" . (int)$zone_country_id . "',
  45.                          zone_id = " . (zen_not_null($zone_id) ? "'" . (int)$zone_id . "'" : 'null') . ",
  46.                          last_modified = now()
  47.                      where association_id = '" . (int)$sID . "'");
  48.  
  49.  
  50.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $_GET['sID']));
  51.         break;
  52.       case 'deleteconfirm_sub':
  53.         // demo active test
  54.         if (zen_admin_demo()) {
  55.           $_GET['action']= '';
  56.           $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  57.           zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage']));
  58.         }
  59.         $sID = zen_db_prepare_input($_POST['sID']);
  60.  
  61.         $db->Execute("delete from " . TABLE_ZONES_TO_GEO_ZONES . "
  62.                      where association_id = '" . (int)$sID . "'");
  63.  
  64.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage']));
  65.         break;
  66.     }
  67.   }
  68.  
  69.   $action = (isset($_GET['action']) ? $_GET['action'] : '');
  70.  
  71.   if (zen_not_null($action)) {
  72.     switch ($action) {
  73.       case 'insert_zone':
  74.         $geo_zone_name = zen_db_prepare_input($_POST['geo_zone_name']);
  75.         $geo_zone_description = zen_db_prepare_input($_POST['geo_zone_description']);
  76.  
  77.         $db->Execute("insert into " . TABLE_GEO_ZONES . "
  78.                    (geo_zone_name, geo_zone_description, date_added)
  79.                    values ('" . zen_db_input($geo_zone_name) . "',
  80.                            '" . zen_db_input($geo_zone_description) . "',
  81.                            now())");
  82.  
  83.         $new_zone_id = $db->Insert_ID();
  84.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zID=' . $new_zone_id));
  85.         break;
  86.       case 'save_zone':
  87.         $zID = zen_db_prepare_input($_GET['zID']);
  88.         $geo_zone_name = zen_db_prepare_input($_POST['geo_zone_name']);
  89.         $geo_zone_description = zen_db_prepare_input($_POST['geo_zone_description']);
  90.  
  91.         $db->Execute("update " . TABLE_GEO_ZONES . "
  92.                      set geo_zone_name = '" . zen_db_input($geo_zone_name) . "',
  93.                          geo_zone_description = '" . zen_db_input($geo_zone_description) . "',
  94.                          last_modified = now() where geo_zone_id = '" . (int)$zID . "'");
  95.  
  96.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zID=' . $_GET['zID']));
  97.         break;
  98.       case 'deleteconfirm_zone':
  99.         // demo active test
  100.         if (zen_admin_demo()) {
  101.           $_GET['action']= '';
  102.           $messageStack->add_session(ERROR_ADMIN_DEMO, 'caution');
  103.           zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage']));
  104.         }
  105.         $zID = zen_db_prepare_input($_POST['zID']);
  106.  
  107.         $check_tax_rates = $db->Execute("select tax_zone_id from " . TABLE_TAX_RATES . " where tax_zone_id='" . (int)$zID . "'");
  108.         if ($check_tax_rates->RecordCount() > 0) {
  109.           $_GET['action']= '';
  110.           $messageStack->add_session(ERROR_TAX_RATE_EXISTS, 'caution');
  111.         } else {
  112.           $db->Execute("delete from " . TABLE_GEO_ZONES . "
  113.                        where geo_zone_id = '" . (int)$zID . "'");
  114.  
  115.           $db->Execute("delete from " . TABLE_ZONES_TO_GEO_ZONES . "
  116.                        where geo_zone_id = '" . (int)$zID . "'");
  117.         }
  118.  
  119.         zen_redirect(zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage']));
  120.         break;
  121.     }
  122.   }
  123. ?>
  124. <!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
  125. <html <?php echo HTML_PARAMS; ?>>
  126. <head>
  127. <meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>">
  128. <title><?php echo TITLE; ?></title>
  129. <link rel="stylesheet" type="text/css" href="includes/stylesheet.css">
  130. <link rel="stylesheet" type="text/css" href="includes/cssjsmenuhover.css" media="all" id="hoverJS">
  131. <script language="javascript" src="includes/menu.js"></script>
  132. <script language="javascript" src="includes/general.js"></script>
  133. <?php
  134.   if (isset($_GET['zID']) && (($saction == 'edit') || ($saction == 'new'))) {
  135. ?>
  136. <script language="javascript"><!--
  137. function resetZoneSelected(theForm) {
  138.   if (theForm.state.value != '') {
  139.     theForm.zone_id.selectedIndex = '0';
  140.     if (theForm.zone_id.options.length > 0) {
  141.       theForm.state.value = '<?php echo JS_STATE_SELECT; ?>';
  142.     }
  143.   }
  144. }
  145.  
  146. function update_zone(theForm) {
  147.   var NumState = theForm.zone_id.options.length;
  148.   var SelectedCountry = "";
  149.  
  150.   while(NumState > 0) {
  151.     NumState--;
  152.     theForm.zone_id.options[NumState] = null;
  153.   }
  154.  
  155.   SelectedCountry = theForm.zone_country_id.options[theForm.zone_country_id.selectedIndex].value;
  156.  
  157. <?php echo zen_js_zone_list('SelectedCountry', 'theForm', 'zone_id'); ?>
  158.  
  159. }
  160. //--></script>
  161. <?php
  162.   }
  163. ?>
  164. <script type="text/javascript">
  165.   <!--
  166.   function init()
  167.   {
  168.     cssjsmenu('navbar');
  169.     if (document.getElementById)
  170.     {
  171.       var kill = document.getElementById('hoverJS');
  172.       kill.disabled = true;
  173.     }
  174.   }
  175.   // -->
  176. </script>
  177. </head>
  178. <body onLoad="init()">
  179. <!-- header //-->
  180. <?php require(DIR_WS_INCLUDES . 'header.php'); ?>
  181. <!-- header_eof //-->
  182.  
  183. <!-- body //-->
  184. <table border="0" width="100%" cellspacing="2" cellpadding="2">
  185.   <tr>
  186. <!-- body_text //-->
  187.     <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  188.       <tr>
  189.         <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0">
  190.           <tr>
  191.             <td class="pageHeading"><?php echo HEADING_TITLE; if (isset($_GET['zone'])) echo '<br><span class="smallText">' . zen_get_geo_zone_name($_GET['zone']) . '</span>'; ?></td>
  192.             <td class="pageHeading" align="right"><?php echo zen_draw_separator('pixel_trans.gif', HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  193.           </tr>
  194.         </table></td>
  195.       </tr>
  196.       <tr>
  197.         <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  198.           <tr>
  199.             <td valign="top">
  200. <?php
  201.   if ($action == 'list') {
  202. ?>
  203.             <table border="0" width="100%" cellspacing="0" cellpadding="2">
  204.               <tr class="dataTableHeadingRow">
  205.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY; ?></td>
  206.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_COUNTRY_ZONE; ?></td>
  207.                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  208.               </tr>
  209. <?php
  210. // Split Page
  211. // reset page when page is unknown
  212. if ((!isset($_GET['spage']) or $_GET['spage'] == '' or $_GET['spage'] == '1') and $_GET['sID'] != '') {
  213.   $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . (int)$_GET['zID'] . " order by c.countries_name, association_id";
  214.   $check_page = $db->Execute($zones_query_raw);
  215.   $check_count=1;
  216.   if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
  217.     while (!$check_page->EOF) {
  218.       if ($check_page->fields['association_id'] == $_GET['sID']) {
  219.         break;
  220.       }
  221.       $check_count++;
  222.       $check_page->MoveNext();
  223.     }
  224.     $_GET['spage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
  225.   } else {
  226.     $_GET['spage'] = 1;
  227.   }
  228. }
  229.     $rows = 0;
  230.     $zones_query_raw = "select a.association_id, a.zone_country_id, c.countries_name, a.zone_id, a.geo_zone_id, a.last_modified, a.date_added, z.zone_name from (" . TABLE_ZONES_TO_GEO_ZONES . " a left join " . TABLE_COUNTRIES . " c on a.zone_country_id = c.countries_id left join " . TABLE_ZONES . " z on a.zone_id = z.zone_id) where a.geo_zone_id = " . (int)$_GET['zID'] . " order by c.countries_name, association_id";
  231.     $zones_split = new splitPageResults($_GET['spage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
  232.     $zones = $db->Execute($zones_query_raw);
  233.     while (!$zones->EOF) {
  234.       $rows++;
  235.       if ((!isset($_GET['sID']) || (isset($_GET['sID']) && ($_GET['sID'] == $zones->fields['association_id']))) && !isset($sInfo) && (substr($action, 0, 3) != 'new')) {
  236.         $sInfo = new objectInfo($zones->fields);
  237.       }
  238.       if (isset($sInfo) && is_object($sInfo) && ($zones->fields['association_id'] == $sInfo->association_id)) {
  239.         echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $sInfo->association_id . '&saction=edit') . '\'">' . "\n";
  240.       } else {
  241.         echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $zones->fields['association_id']) . '\'">' . "\n";
  242.       }
  243. ?>
  244.                 <td class="dataTableContent"><?php echo (($zones->fields['countries_name']) ? $zones->fields['countries_name'] : TEXT_ALL_COUNTRIES); ?></td>
  245.                 <td class="dataTableContent"><?php echo (($zones->fields['zone_id']) ? $zones->fields['zone_name'] : PLEASE_SELECT); ?></td>
  246.                 <td class="dataTableContent" align="right"><?php if (isset($sInfo) && is_object($sInfo) && ($zones->fields['association_id'] == $sInfo->association_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif', ''); } else { echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&sID=' . $zones->fields['association_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
  247.               </tr>
  248. <?php
  249.       $zones->MoveNext();
  250.     }
  251. ?>
  252.               <tr>
  253.                 <td colspan="3"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  254.                   <tr>
  255.                     <td class="smallText" valign="top"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['spage'], TEXT_DISPLAY_NUMBER_OF_COUNTRIES); ?></td>
  256.                     <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['spage'], 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list', 'spage'); ?></td>
  257.                   </tr>
  258.                 </table></td>
  259.               </tr>
  260.               <tr>
  261.                 <td align="right" colspan="3"><?php if (empty($saction)) echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID']) . '">' . zen_image_button('button_back.gif', IMAGE_BACK) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&' . (isset($sInfo) ? 'sID=' . $sInfo->association_id . '&' : '') . 'saction=new') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
  262.               </tr>
  263.             </table>
  264. <?php
  265.   } else {
  266. ?>
  267. <?php echo TEXT_LEGEND; ?>&nbsp;
  268. <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif') . TEXT_LEGEND_TAX_AND_ZONES; ?>&nbsp;&nbsp;&nbsp;
  269. <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif') . TEXT_LEGEND_ONLY_ZONES; ?>&nbsp;&nbsp;&nbsp;
  270. <?php echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif') . TEXT_LEGEND_NOT_CONF; ?>&nbsp;&nbsp;&nbsp;<br />
  271.             <table border="0" width="100%" cellspacing="0" cellpadding="2">
  272.               <tr class="dataTableHeadingRow">
  273.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES; ?></td>
  274.                 <td class="dataTableHeadingContent"><?php echo TABLE_HEADING_TAX_ZONES_DESCRIPTION; ?></td>
  275.                 <td class="dataTableHeadingContent" align="center"><?php echo TABLE_HEADING_STATUS; ?></td>
  276.                 <td class="dataTableHeadingContent" align="right"><?php echo TABLE_HEADING_ACTION; ?>&nbsp;</td>
  277.               </tr>
  278. <?php
  279. // Split Page
  280. // reset page when page is unknown
  281. if ((!isset($_GET['zpage']) or $_GET['zpage'] == '' or $_GET['zpage'] == '1') and $_GET['zID'] != '') {
  282.   $zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
  283.   $check_page = $db->Execute($zones_query_raw);
  284.   $check_count=1;
  285.   if ($check_page->RecordCount() > MAX_DISPLAY_SEARCH_RESULTS) {
  286.     while (!$check_page->EOF) {
  287.       if ($check_page->fields['geo_zone_id'] == $_GET['zID']) {
  288.         break;
  289.       }
  290.       $check_count++;
  291.       $check_page->MoveNext();
  292.     }
  293.     $_GET['zpage'] = round((($check_count/MAX_DISPLAY_SEARCH_RESULTS)+(fmod_round($check_count,MAX_DISPLAY_SEARCH_RESULTS) !=0 ? .5 : 0)),0);
  294.   } else {
  295.     $_GET['zpage'] = 1;
  296.   }
  297. }
  298.     $zones_query_raw = "select geo_zone_id, geo_zone_name, geo_zone_description, last_modified, date_added from " . TABLE_GEO_ZONES . " order by geo_zone_name";
  299.     $zones_split = new splitPageResults($_GET['zpage'], MAX_DISPLAY_SEARCH_RESULTS, $zones_query_raw, $zones_query_numrows);
  300.     $zones = $db->Execute($zones_query_raw);
  301.     while (!$zones->EOF) {
  302.         $num_zones = $db->Execute("select count(*) as num_zones
  303.                                   from " . TABLE_ZONES_TO_GEO_ZONES . "
  304.                                   where geo_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
  305.                                   group by geo_zone_id");
  306.  
  307.         if ($num_zones->fields['num_zones'] > 0) {
  308.           $zones->fields['num_zones'] = $num_zones->fields['num_zones'];
  309.         } else {
  310.           $zones->fields['num_zones'] = 0;
  311.         }
  312.  
  313.         $num_tax_rates = $db->Execute("select count(*) as num_tax_rates
  314.                                   from " . TABLE_TAX_RATES . "
  315.                                   where tax_zone_id = '" . (int)$zones->fields['geo_zone_id'] . "'
  316.                                   group by tax_zone_id");
  317.  
  318.         if ($num_tax_rates->fields['num_tax_rates'] > 0) {
  319.           $zones->fields['num_tax_rates'] = $num_tax_rates->fields['num_tax_rates'];
  320.         } else {
  321.           $zones->fields['num_tax_rates'] = 0;
  322.         }
  323.  
  324.       if ((!isset($_GET['zID']) || (isset($_GET['zID']) && ($_GET['zID'] == $zones->fields['geo_zone_id']))) && !isset($zInfo) && (substr($action, 0, 3) != 'new')) {
  325.         $zInfo = new objectInfo($zones->fields);
  326.       }
  327.       if (isset($zInfo) && is_object($zInfo) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id)) {
  328.         echo '                  <tr id="defaultSelected" class="dataTableRowSelected" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '\'">' . "\n";
  329.       } else {
  330.         echo '                  <tr class="dataTableRow" onmouseover="rowOverEffect(this)" onmouseout="rowOutEffect(this)" onclick="document.location.href=\'' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id']) . '\'">' . "\n";
  331.       }
  332. ?>
  333.                 <td class="dataTableContent"><?php echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id'] . '&action=list') . '">' . zen_image(DIR_WS_ICONS . 'folder.gif', ICON_FOLDER) . '</a>&nbsp;' . $zones->fields['geo_zone_name']; ?></td>
  334.                 <td class="dataTableContent"><?php echo $zones->fields['geo_zone_description']; ?></td>
  335.                 <td class="dataTableContent" align="center"><?php
  336.                     // show current status
  337.                     if ($zones->fields['num_tax_rates'] && $zones->fields['num_zones']) {
  338.                       echo zen_image(DIR_WS_IMAGES . 'icon_status_green.gif');
  339.                     } elseif ($zones->fields['num_zones']) {
  340.                       echo zen_image(DIR_WS_IMAGES . 'icon_status_yellow.gif');
  341.                     } else {
  342.                       echo zen_image(DIR_WS_IMAGES . 'icon_status_red.gif');
  343.                     }
  344.                   ?></td>
  345.                 <td class="dataTableContent" align="right"><?php if (isset($zInfo) && is_object($zInfo) && ($zones->fields['geo_zone_id'] == $zInfo->geo_zone_id)) { echo zen_image(DIR_WS_IMAGES . 'icon_arrow_right.gif'); } else { echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zones->fields['geo_zone_id']) . '">' . zen_image(DIR_WS_IMAGES . 'icon_info.gif', IMAGE_ICON_INFO) . '</a>'; } ?>&nbsp;</td>
  346.               </tr>
  347. <?php
  348.       $zones->MoveNext();
  349.     }
  350. ?>
  351.               <tr>
  352.                 <td colspan="4"><table border="0" width="100%" cellspacing="0" cellpadding="2">
  353.                   <tr>
  354.                     <td class="smallText"><?php echo $zones_split->display_count($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, $_GET['zpage'], TEXT_DISPLAY_NUMBER_OF_TAX_ZONES); ?></td>
  355.                     <td class="smallText" align="right"><?php echo $zones_split->display_links($zones_query_numrows, MAX_DISPLAY_SEARCH_RESULTS, MAX_DISPLAY_PAGE_LINKS, $_GET['zpage'], '', 'zpage'); ?></td>
  356.                   </tr>
  357.                 </table></td>
  358.               </tr>
  359.               <tr>
  360.                 <td align="right" colspan="4"><?php if (!$action) echo '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=new_zone') . '">' . zen_image_button('button_insert.gif', IMAGE_INSERT) . '</a>'; ?></td>
  361.               </tr>
  362.             </table>
  363. <?php
  364.   }
  365. ?>
  366.             </td>
  367. <?php
  368.   $heading = array();
  369.   $contents = array();
  370.  
  371.   if ($action == 'list') {
  372.     switch ($saction) {
  373.       case 'new':
  374.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_SUB_ZONE . '</b>');
  375.  
  376.         $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'));
  377.         $contents[] = array('text' => TEXT_INFO_NEW_SUB_ZONE_INTRO);
  378.         $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);"'));
  379.         $contents[] = array('text' => '<br>' . TEXT_INFO_COUNTRY_ZONE . '<br>' . zen_draw_pull_down_menu('zone_id', zen_prepare_country_zones_pull_down()));
  380.         $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>');
  381.         break;
  382.       case 'edit':
  383.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_SUB_ZONE . '</b>');
  384.  
  385.         $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'));
  386.         $contents[] = array('text' => TEXT_INFO_EDIT_SUB_ZONE_INTRO);
  387.         $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);"'));
  388.         $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));
  389.         $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>');
  390.         break;
  391.       case 'delete':
  392.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_SUB_ZONE . '</b>');
  393.  
  394.         $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=list&spage=' . $_GET['spage'] . '&saction=deleteconfirm_sub') . zen_draw_hidden_field('sID', $sInfo->association_id));
  395.         $contents[] = array('text' => TEXT_INFO_DELETE_SUB_ZONE_INTRO);
  396.         $contents[] = array('text' => '<br><b>' . $sInfo->countries_name . '</b>');
  397.         $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>');
  398.         break;
  399.       default:
  400.         if (isset($sInfo) && is_object($sInfo)) {
  401.           $heading[] = array('text' => '<b>' . $sInfo->countries_name . '</b>');
  402.  
  403.           $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>');
  404.           $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($sInfo->date_added));
  405.           if (zen_not_null($sInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($sInfo->last_modified));
  406.         }
  407.         break;
  408.     }
  409.   } else {
  410.     switch ($action) {
  411.       case 'new_zone':
  412.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_NEW_ZONE . '</b>');
  413.  
  414.         $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $_GET['zID'] . '&action=insert_zone'));
  415.         $contents[] = array('text' => TEXT_INFO_NEW_ZONE_INTRO);
  416.         $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . zen_draw_input_field('geo_zone_name', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
  417.         $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . zen_draw_input_field('geo_zone_description', '', zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
  418.         $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']) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  419.         break;
  420.       case 'edit_zone':
  421.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_EDIT_ZONE . '</b>');
  422.  
  423.         $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=save_zone'));
  424.         $contents[] = array('text' => TEXT_INFO_EDIT_ZONE_INTRO);
  425.         $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_NAME . '<br>' . zen_draw_input_field('geo_zone_name', htmlspecialchars($zInfo->geo_zone_name, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_name')));
  426.         $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . zen_draw_input_field('geo_zone_description', htmlspecialchars($zInfo->geo_zone_description, ENT_COMPAT, CHARSET, TRUE), zen_set_field_length(TABLE_GEO_ZONES, 'geo_zone_description')));
  427.         $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=' . $zInfo->geo_zone_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  428.         break;
  429.       case 'delete_zone':
  430.         $heading[] = array('text' => '<b>' . TEXT_INFO_HEADING_DELETE_ZONE . '</b>');
  431.  
  432.         $contents = array('form' => zen_draw_form('zones', FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&action=deleteconfirm_zone') . zen_draw_hidden_field('zID', $zInfo->geo_zone_id));
  433.         $contents[] = array('text' => TEXT_INFO_DELETE_ZONE_INTRO);
  434.         $contents[] = array('text' => '<br><b>' . $zInfo->geo_zone_name . '</b>');
  435.         $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=' . $zInfo->geo_zone_id) . '">' . zen_image_button('button_cancel.gif', IMAGE_CANCEL) . '</a>');
  436.         break;
  437.       default:
  438.         if (isset($zInfo) && is_object($zInfo)) {
  439.           $heading[] = array('text' => '<b>' . $zInfo->geo_zone_name . '</b>');
  440.  
  441.           $contents[] = array('align' => 'center', 'text' => '<a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=edit_zone') . '">' . zen_image_button('button_edit.gif', IMAGE_EDIT) . '</a> <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=delete_zone') . '">' . zen_image_button('button_delete.gif', IMAGE_DELETE) . '</a>' . ' <a href="' . zen_href_link(FILENAME_GEO_ZONES, 'zpage=' . $_GET['zpage'] . '&zID=' . $zInfo->geo_zone_id . '&action=list') . '">' . zen_image_button('button_details.gif', IMAGE_DETAILS) . '</a>');
  442.           $contents[] = array('align' => 'center', 'text' =>  ($zInfo->num_tax_rates > 0 ? '<a href="' . zen_href_link(FILENAME_TAX_RATES, '', 'NONSSL') . '">' . zen_image_button('button_tax_rates.gif', IMAGE_TAX_RATES) . '</a>' : ''));
  443.           $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_ZONES . ' ' . $zInfo->num_zones);
  444.           $contents[] = array('text' => '<br>' . TEXT_INFO_NUMBER_TAX_RATES . ' ' . $zInfo->num_tax_rates);
  445.           $contents[] = array('text' => '<br>' . TEXT_INFO_DATE_ADDED . ' ' . zen_date_short($zInfo->date_added));
  446.           if (zen_not_null($zInfo->last_modified)) $contents[] = array('text' => TEXT_INFO_LAST_MODIFIED . ' ' . zen_date_short($zInfo->last_modified));
  447.           $contents[] = array('text' => '<br>' . TEXT_INFO_ZONE_DESCRIPTION . '<br>' . $zInfo->geo_zone_description);
  448.         }
  449.         break;
  450.     }
  451.   }
  452.  
  453.   if ( (zen_not_null($heading)) && (zen_not_null($contents)) ) {
  454.     echo '            <td width="25%" valign="top">' . "\n";
  455.  
  456.     $box = new box;
  457.     echo $box->infoBox($heading, $contents);
  458.  
  459.     echo '            </td>' . "\n";
  460.   }
  461. ?>
  462.           </tr>
  463.         </table></td>
  464.       </tr>
  465.     </table></td>
  466. <!-- body_text_eof //-->
  467.   </tr>
  468. </table>
  469. <!-- body_eof //-->
  470.  
  471. <!-- footer //-->
  472. <?php require(DIR_WS_INCLUDES . 'footer.php'); ?>
  473. <!-- footer_eof //-->
  474. <br>
  475. </body>
  476. </html>
  477. <?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>


cron