[ Index ]
osCommerce Docs :: PHP Cross Reference For osCommerce 2.2 MS2
Provided By OSCdox.com

/includes/functions/ -> specials.php (source)

[Summary view]

   1  <?php
   2  /*
   3    $Id: specials.php,v 1.6 2003/06/09 21:25:32 hpdl Exp $
   4  
   5    osCommerce, Open Source E-Commerce Solutions
   6    http://www.oscommerce.com
   7  
   8    Copyright (c) 2003 osCommerce
   9  
  10    Released under the GNU General Public License
  11  */
  12  
  13  ////
  14  // Sets the status of a special product
  15    function tep_set_specials_status($specials_id, $status) {
  16      return tep_db_query("update " . TABLE_SPECIALS . " set status = '" . $status . "', date_status_change = now() where specials_id = '" . (int)$specials_id . "'");
  17    }
  18  
  19  ////
  20  // Auto expire products on special
  21    function tep_expire_specials() {
  22      $specials_query = tep_db_query("select specials_id from " . TABLE_SPECIALS . " where status = '1' and now() >= expires_date and expires_date > 0");
  23      if (tep_db_num_rows($specials_query)) {
  24        while ($specials = tep_db_fetch_array($specials_query)) {
  25          tep_set_specials_status($specials['specials_id'], '0');
  26        }
  27      }
  28    }
  29  ?>


Generated: Tue Nov 4 23:53:39 2003
Hosted By :: AABox.com
Cross-referenced by PHPXref 0.4