<?php
/*
  $Id: default_specials.php,v 2.0 2004/04/07

  osCommerce, Open Source E-Commerce Solutions
  http://www.oscommerce.com

  Copyright (c) 2003 osCommerce

  Released under the GNU General Public License
*/
// Check to ensure this file is included in Freeway!
defined('_FEXEC') or die();
?>
<!-- default_specials mainpage //-->
<?php
  // BOF: Lango Added for template MOD
  if (MAIN_TABLE_BORDER == 'yes'){
  table_image_border_top(false, false, sprintf(TABLE_HEADING_DEFAULT_SPECIALS, strftime('%B')));
  }
// EOF: Lango Added for template MOD
?>
<?php
echo '<td align="center">';
$customer_group=tep_get_customers_groups_id();
 $new = tep_db_query("select p.products_id, pd.products_name, p.products_price, p.products_tax_class_id, p.products_image,s.specials_new_products_price from " . TABLE_PRODUCTS . " p, " . TABLE_PRODUCTS_DESCRIPTION . " pd, " . TABLE_SPECIALS . " s where p.products_status = '1' and p.products_id = s.products_id and pd.products_id = s.products_id and pd.language_id = '" . (int)$languages_id . "' and s.status = '1' and ((s.customers_id = '" . $customer_id . "' and " . (int)$customer_id .">0) or (s.customers_groups_id = '" . $customer_group . "' and " . (int)$customer_group . ">0) or (s.customers_id = '0' and s.customers_groups_id = '0')) order by s.specials_date_added desc limit " . MAX_DISPLAY_SPECIAL_PRODUCTS);


  $row = 0;
  $col = 0;
  while ($default_specials = tep_db_fetch_array($new)) {
    $default_specials['products_name'] = tep_get_products_name($default_specials['products_id']);

    echo '<td class="smallText" align= "center" valign="top"><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials["products_id"]) . '">' . tep_image(DIR_WS_IMAGES . $default_specials['products_image'], $default_specials['products_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_PRODUCT_INFO, 'products_id=' . $default_specials['products_id']) . '">' . $default_specials['products_name'] . '</a><br><s>' . $currencies->display_price($default_specials['products_price'], tep_get_tax_rate($default_specials['products_tax_class_id']),1,true) . '</s><br><span class="productSpecialPrice">' . $currencies->display_price($default_specials['specials_new_products_price'], tep_get_tax_rate($default_specials['products_tax_class_id'])) . '</span></td>';

    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
  }
echo '</td>';
if (MAIN_TABLE_BORDER == 'yes'){
table_image_border_bottom();
}
?>

<!-- default_specials_eof //-->
