[ Index ]

PHP Cross Reference of osCMax 2.0.4

title

Body

[close]

/templates/fallback/content/ -> index_products.tpl.php (source)

   1  <?php
   2  /* bof catdesc for bts1a */
   3  // Get the category name and description from the database
   4      $category_query = tep_db_query("select cd.categories_name, cd.categories_heading_title, cd.categories_description, c.categories_image from " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where c.categories_id = '" . (int)$current_category_id . "' and cd.categories_id = '" . (int)$current_category_id . "' and cd.language_id = '" . (int)$languages_id . "'");
   5      $category = tep_db_fetch_array($category_query);
   6  /* bof catdesc for bts1a */
   7  ?>
   8  
   9      <table border="0" width="100%" cellspacing="0" cellpadding="0">
  10        <tr>
  11          <td><table border="0" width="100%" cellspacing="0" cellpadding="0">
  12            <tr>
  13                          <td class="pageHeading">
  14  <?php
  15  /* bof catdesc for bts1a, replacing "echo HEADING_TITLE;" by "categories_heading_title" */
  16               if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) {
  17                   echo $category['categories_heading_title'];
  18                 } else {
  19                   echo HEADING_TITLE;
  20                 }
  21  /* eof catdesc for bts1a */ ?>
  22              </td>
  23  <?php
  24  // optional Product List Filter
  25      if (PRODUCT_LIST_FILTER > 0) {
  26        if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  27          $filterlist_sql = "select distinct c.categories_id as id, cd.categories_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd where p.products_status = '1' and p.products_id = p2c.products_id and p2c.categories_id = c.categories_id and p2c.categories_id = cd.categories_id and cd.language_id = '" . (int)$languages_id . "' and p.manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "' order by cd.categories_name";
  28        } else {
  29          $filterlist_sql= "select distinct m.manufacturers_id as id, m.manufacturers_name as name from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_TO_CATEGORIES . " p2c, " . TABLE_MANUFACTURERS . " m where p.products_status = '1' and p.manufacturers_id = m.manufacturers_id and p.products_id = p2c.products_id and p2c.categories_id = '" . (int)$current_category_id . "' order by m.manufacturers_name";
  30        }
  31        $filterlist_query = tep_db_query($filterlist_sql);
  32        if (tep_db_num_rows($filterlist_query) > 1) {
  33          echo '            <td align="center" class="main">' . tep_draw_form('filter', FILENAME_DEFAULT, 'get') . TEXT_SHOW . '&nbsp;';
  34          if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  35            echo tep_draw_hidden_field('manufacturers_id', $HTTP_GET_VARS['manufacturers_id']);
  36            $options = array(array('id' => '', 'text' => TEXT_ALL_CATEGORIES));
  37          } else {
  38            echo tep_draw_hidden_field('cPath', $cPath);
  39            $options = array(array('id' => '', 'text' => TEXT_ALL_MANUFACTURERS));
  40          }
  41          echo tep_draw_hidden_field('sort', $HTTP_GET_VARS['sort']);
  42          while ($filterlist = tep_db_fetch_array($filterlist_query)) {
  43            $options[] = array('id' => $filterlist['id'], 'text' => $filterlist['name']);
  44          }
  45          echo tep_draw_pull_down_menu('filter_id', $options, (isset($HTTP_GET_VARS['filter_id']) ? $HTTP_GET_VARS['filter_id'] : ''), 'onchange="this.form.submit()"');
  46          echo tep_hide_session_id() . '</form></td>' . "\n";
  47        }
  48      }
  49  
  50  // Get the right image for the top-right
  51      $image = DIR_WS_IMAGES . 'table_background_list.gif';
  52      if (isset($HTTP_GET_VARS['manufacturers_id'])) {
  53        $image = tep_db_query("select manufacturers_image from " . TABLE_MANUFACTURERS . " where manufacturers_id = '" . (int)$HTTP_GET_VARS['manufacturers_id'] . "'");
  54        $image = tep_db_fetch_array($image);
  55        $image = $image['manufacturers_image'];
  56      } elseif ($current_category_id) {
  57        $image = tep_db_query("select categories_image from " . TABLE_CATEGORIES . " where categories_id = '" . (int)$current_category_id . "'");
  58        $image = tep_db_fetch_array($image);
  59        $image = $image['categories_image'];
  60      }
  61  ?>
  62     <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_heading_title'])) ) { ?>
  63              <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, $category['categories_heading_title'], HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  64            </tr>
  65          <?php } else { ?>
  66            <td align="right"><?php echo tep_image(DIR_WS_IMAGES . $image, HEADING_TITLE, HEADING_IMAGE_WIDTH, HEADING_IMAGE_HEIGHT); ?></td>
  67            </tr>
  68          <?php } ?>
  69        <?php if ( (ALLOW_CATEGORY_DESCRIPTIONS == 'true') && (tep_not_null($category['categories_description'])) ) { ?>
  70        <tr>
  71              <td align="left" colspan="2" class="category_desc"><?php echo $category['categories_description']; ?></td>
  72        </tr>
  73        <?php } ?>
  74          </table></td>
  75        </tr>
  76        <tr>
  77          <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td>
  78        </tr>
  79        <tr>
  80          <td><?php if (PRODUCT_LIST_TYPE == 0) {
  81  
  82          include(DIR_WS_MODULES . FILENAME_PRODUCT_LISTING);
  83         } else {
  84  
  85          include (DIR_WS_MODULES . FILENAME_PRODUCT_LISTING_COL);
  86        }
  87          ?>
  88          </td>
  89        </tr>
  90    </table>


Generated: Fri Jan 1 13:43:16 2010 Cross-referenced by PHPXref 0.7