[ Index ]
 

Code source de osCommerce 2.2ms2-060817

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/catalog/includes/boxes/ -> best_sellers.php (source)

   1  <?php
   2  /*
   3    $Id: best_sellers.php,v 1.21 2003/06/09 22:07:52 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    if (isset($current_category_id) && ($current_category_id > 0)) {
  14      $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c where p.products_status = '1' and p.products_ordered > 0 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 and '" . (int)$current_category_id . "' in (c.categories_id, c.parent_id) order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
  15    } else {
  16      $best_sellers_query = tep_db_query("select distinct p.products_id, pd.products_name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd where p.products_status = '1' and p.products_ordered > 0 and p.products_id = pd.products_id and pd.language_id = '" . (int)$languages_id . "' order by p.products_ordered desc, pd.products_name limit " . MAX_DISPLAY_BESTSELLERS);
  17    }
  18  
  19    if (tep_db_num_rows($best_sellers_query) >= MIN_DISPLAY_BESTSELLERS) {
  20  ?>
  21  <!-- best_sellers //-->
  22            <tr>
  23              <td>
  24  <?php
  25      $info_box_contents = array();
  26      $info_box_contents[] = array('text' => BOX_HEADING_BESTSELLERS);
  27  
  28      new infoBoxHeading($info_box_contents, false, false);
  29  
  30      $rows = 0;
  31      $bestsellers_list = '<table border="0" width="100%" cellspacing="0" cellpadding="1">';
  32      while ($best_sellers = tep_db_fetch_array($best_sellers_query)) {
  33        $rows++;
  34        $bestsellers_list .= '<tr><td class="infoBoxContents" valign="top">' . tep_row_number_format($rows) . '.</td><td class="infoBoxContents"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $best_sellers['products_id']) . '">' . $best_sellers['products_name'] . '</a></td></tr>';
  35      }
  36      $bestsellers_list .= '</table>';
  37  
  38      $info_box_contents = array();
  39      $info_box_contents[] = array('text' => $bestsellers_list);
  40  
  41      new infoBox($info_box_contents);
  42  ?>
  43              </td>
  44            </tr>
  45  <!-- best_sellers_eof //-->
  46  <?php
  47    }
  48  ?>


Généré le : Mon Nov 26 19:48:25 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics