[TEP-COMMIT] CVS: catalog/catalog advanced_search.php,1.50,1.51 advanced_search_result.php,1.72,1.73

Harald Ponce de Leon <[email protected]>
Newsgroups gmane.comp.web.oscommerce.cvs
Message-ID <[email protected]>
Update of /cvsroot/tep/catalog/catalog
In directory sc8-pr-cvs1:/tmp/cvs-serv2358

Modified Files:
	advanced_search.php advanced_search_result.php 
Log Message:
use the new classes and super global variables


Index: advanced_search.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/advanced_search.php,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -d -r1.50 -r1.51
--- advanced_search.php	5 Jun 2003 23:25:46 -0000	1.50
+++ advanced_search.php	17 Nov 2003 20:49:39 -0000	1.51
@@ -12,7 +12,7 @@
 
   require('includes/application_top.php');
 
-  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
+  require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ADVANCED_SEARCH);
 
   $breadcrumb->add(NAVBAR_TITLE_1, tep_href_link(FILENAME_ADVANCED_SEARCH));
 ?>

Index: advanced_search_result.php
===================================================================
RCS file: /cvsroot/tep/catalog/catalog/advanced_search_result.php,v
retrieving revision 1.72
retrieving revision 1.73
diff -u -d -r1.72 -r1.73
--- advanced_search_result.php	23 Jun 2003 06:50:11 -0000	1.72
+++ advanced_search_result.php	17 Nov 2003 20:49:40 -0000	1.73
@@ -12,15 +12,15 @@
 
   require('includes/application_top.php');
 
-  require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_ADVANCED_SEARCH);
+  require(DIR_WS_LANGUAGES . $osC_Session->value('language') . '/' . FILENAME_ADVANCED_SEARCH);
 
   $error = false;
 
-  if ( (isset($HTTP_GET_VARS['keywords']) && empty($HTTP_GET_VARS['keywords'])) &&
-       (isset($HTTP_GET_VARS['dfrom']) && (empty($HTTP_GET_VARS['dfrom']) || ($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING))) &&
-       (isset($HTTP_GET_VARS['dto']) && (empty($HTTP_GET_VARS['dto']) || ($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING))) &&
-       (isset($HTTP_GET_VARS['pfrom']) && !is_numeric($HTTP_GET_VARS['pfrom'])) &&
-       (isset($HTTP_GET_VARS['pto']) && !is_numeric($HTTP_GET_VARS['pto'])) ) {
+  if ( (isset($_GET['keywords']) && empty($_GET['keywords'])) &&
+       (isset($_GET['dfrom']) && (empty($_GET['dfrom']) || ($_GET['dfrom'] == DOB_FORMAT_STRING))) &&
+       (isset($_GET['dto']) && (empty($_GET['dto']) || ($_GET['dto'] == DOB_FORMAT_STRING))) &&
+       (isset($_GET['pfrom']) && !is_numeric($_GET['pfrom'])) &&
+       (isset($_GET['pto']) && !is_numeric($_GET['pto'])) ) {
     $error = true;
 
     $messageStack->add_session('search', ERROR_AT_LEAST_ONE_INPUT);
@@ -31,24 +31,24 @@
     $pto = '';
     $keywords = '';
 
-    if (isset($HTTP_GET_VARS['dfrom'])) {
-      $dfrom = (($HTTP_GET_VARS['dfrom'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dfrom']);
+    if (isset($_GET['dfrom'])) {
+      $dfrom = (($_GET['dfrom'] == DOB_FORMAT_STRING) ? '' : $_GET['dfrom']);
     }
 
-    if (isset($HTTP_GET_VARS['dto'])) {
-      $dto = (($HTTP_GET_VARS['dto'] == DOB_FORMAT_STRING) ? '' : $HTTP_GET_VARS['dto']);
+    if (isset($_GET['dto'])) {
+      $dto = (($_GET['dto'] == DOB_FORMAT_STRING) ? '' : $_GET['dto']);
     }
 
-    if (isset($HTTP_GET_VARS['pfrom'])) {
-      $pfrom = $HTTP_GET_VARS['pfrom'];
+    if (isset($_GET['pfrom'])) {
+      $pfrom = $_GET['pfrom'];
     }
 
-    if (isset($HTTP_GET_VARS['pto'])) {
-      $pto = $HTTP_GET_VARS['pto'];
+    if (isset($_GET['pto'])) {
+      $pto = $_GET['pto'];
     }
 
-    if (isset($HTTP_GET_VARS['keywords'])) {
-      $keywords = $HTTP_GET_VARS['keywords'];
+    if (isset($_GET['keywords'])) {
+      $keywords = $_GET['keywords'];
     }
 
     $date_check_error = false;
@@ -213,21 +213,24 @@
   $from_str = "from " . TABLE_PRODUCTS . " p left join " . TABLE_MANUFACTURERS . " m using(manufacturers_id), " . TABLE_PRODUCTS_DESCRIPTION . " pd left join " . TABLE_SPECIALS . " s on p.products_id = s.products_id, " . TABLE_CATEGORIES . " c, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c";
 
   if ( (DISPLAY_PRICE_WITH_TAX == 'true') && (tep_not_null($pfrom) || tep_not_null($pto)) ) {
-    if (!tep_session_is_registered('customer_country_id')) {
+    if ($osC_Customer->isLoggedOn()) {
+      $customer_country_id = $osC_Customer->country_id;
+      $customer_zone_id = $osC_Customer->zone_id;
+    } else {
       $customer_country_id = STORE_COUNTRY;
       $customer_zone_id = STORE_ZONE;
     }
     $from_str .= " left join " . TABLE_TAX_RATES . " tr on p.products_tax_class_id = tr.tax_class_id left join " . TABLE_ZONES_TO_GEO_ZONES . " gz on tr.tax_zone_id = gz.geo_zone_id and (gz.zone_country_id is null or gz.zone_country_id = '0' or gz.zone_country_id = '" . (int)$customer_country_id . "') and (gz.zone_id is null or gz.zone_id = '0' or gz.zone_id = '" . (int)$customer_zone_id . "')";
   }
 
-  $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
+  $where_str = " where p.products_status = '1' and p.products_id = pd.products_id and pd.language_id = '" . (int)$osC_Session->value('languages_id') . "' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id ";
 
-  if (isset($HTTP_GET_VARS['categories_id']) && tep_not_null($HTTP_GET_VARS['categories_id'])) {
-    if (isset($HTTP_GET_VARS['inc_subcat']) && ($HTTP_GET_VARS['inc_subcat'] == '1')) {
+  if (isset($_GET['categories_id']) && tep_not_null($_GET['categories_id'])) {
+    if (isset($_GET['inc_subcat']) && ($_GET['inc_subcat'] == '1')) {
       $subcategories_array = array();
-      tep_get_subcategories($subcategories_array, $HTTP_GET_VARS['categories_id']);
+      tep_get_subcategories($subcategories_array, $_GET['categories_id']);
 
-      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
+      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and (p2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
 
       for ($i=0, $n=sizeof($subcategories_array); $i<$n; $i++ ) {
         $where_str .= " or p2c.categories_id = '" . (int)$subcategories_array[$i] . "'";
@@ -235,12 +238,12 @@
 
       $where_str .= ")";
     } else {
-      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' and p2c.categories_id = '" . (int)$HTTP_GET_VARS['categories_id'] . "'";
+      $where_str .= " and p2c.products_id = p.products_id and p2c.products_id = pd.products_id and pd.language_id = '" . (int)$osC_Session->value('languages_id') . "' and p2c.categories_id = '" . (int)$_GET['categories_id'] . "'";
     }
   }
 
-  if (isset($HTTP_GET_VARS['manufacturers_id']) && tep_not_null($HTTP_GET_VARS['manufacturers_id'])) {
-    $where_str .= " and m.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'";
+  if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {
+    $where_str .= " and m.manufacturers_id = '" . (int)$_GET['manufacturers_id'] . "'";
   }
 
   if (isset($search_keywords) && (sizeof($search_keywords) > 0)) {
@@ -256,7 +259,7 @@
         default:
           $keyword = tep_db_prepare_input($search_keywords[$i]);
           $where_str .= "(pd.products_name like '%" . tep_db_input($keyword) . "%' or p.products_model like '%" . tep_db_input($keyword) . "%' or m.manufacturers_name like '%" . tep_db_input($keyword) . "%'";
-          if (isset($HTTP_GET_VARS['search_in_description']) && ($HTTP_GET_VARS['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
+          if (isset($_GET['search_in_description']) && ($_GET['search_in_description'] == '1')) $where_str .= " or pd.products_description like '%" . tep_db_input($keyword) . "%'";
           $where_str .= ')';
           break;
       }
@@ -273,8 +276,8 @@
   }
 
   if (tep_not_null($pfrom)) {
-    if ($currencies->is_set($currency)) {
-      $rate = $currencies->get_value($currency);
+    if ($currencies->is_set($osC_Session->value('currency'))) {
+      $rate = $currencies->get_value($osC_Session->value('currency'));
 
       $pfrom = $pfrom / $rate;
     }
@@ -298,17 +301,17 @@
     $where_str .= " group by p.products_id, tr.tax_priority";
   }
 
-  if ( (!isset($HTTP_GET_VARS['sort'])) || (!ereg('[1-8][ad]', $HTTP_GET_VARS['sort'])) || (substr($HTTP_GET_VARS['sort'], 0, 1) > sizeof($column_list)) ) {
+  if ( (!isset($_GET['sort'])) || (!ereg('[1-8][ad]', $_GET['sort'])) || (substr($_GET['sort'], 0, 1) > sizeof($column_list)) ) {
     for ($i=0, $n=sizeof($column_list); $i<$n; $i++) {
       if ($column_list[$i] == 'PRODUCT_LIST_NAME') {
-        $HTTP_GET_VARS['sort'] = $i+1 . 'a';
+        $_GET['sort'] = $i+1 . 'a';
         $order_str = ' order by pd.products_name';
         break;
       }
     }
   } else {
-    $sort_col = substr($HTTP_GET_VARS['sort'], 0 , 1);
-    $sort_order = substr($HTTP_GET_VARS['sort'], 1);
+    $sort_col = substr($_GET['sort'], 0 , 1);
+    $sort_order = substr($_GET['sort'], 1);
     $order_str = ' order by ';
     switch ($column_list[$sort_col-1]) {
       case 'PRODUCT_LIST_MODEL':



-------------------------------------------------------
This SF. Net email is sponsored by: GoToMyPC
GoToMyPC is the fast, easy and secure way to access your computer from
any Web browser or wireless device. Click here to Try it Free!
https://www.gotomypc.com/tr/OSDN/AW/Q4_2003/t/g22lp?Target=mm/g22lp.tmpl
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.