<?php
/*
  $Id: new_products.php,v 1.1.1.1 2003/09/18 19:04:53 wilt Exp $

  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();


?>
<!-- new_products //-->
<?php
  $info_box_heading_contents = array();
  $info_box_heading_contents[] = array('text' => sprintf(TABLE_HEADING_NEW_SUBSCRIPTIONS, strftime('%B')));

  

  if ( (!isset($new_subscription_category_id)) || ($new_subscription_category_id == '0') ) {
    $new_subscription_query = tep_db_query("select subscription_id, subscription_image, subscription_tax_class_id, subscription_costs from " . TABLE_SUBSCRIPTIONS . " where subscription_status = '1' order by subscription_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_subscription_query = tep_db_query("select distinct su.subscription_id, su.subscription_image, su.subscription_tax_class_id, su.subscription_costs from " . TABLE_SUBSCRIPTIONS . " su, " . TABLE_SUBSCRIPTION_TO_SUBSCRIPTION_CATEGORIES . " su2c, " . TABLE_SUBSCRIPTION_CATEGORIES . " suc where su.subscription_id = su2c.subscription_id and su2c.subscription_categories_id = suc.subscription_categories_id and suc.parent_id = '" . $new_subscription_category_id . "' and su.subscription_status = '1' order by su.subscription_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }


  $row = 0;
  $col = 0;
  $info_box_contents = array();
  while ($new_subscription = tep_db_fetch_array($new_subscription_query)) {
  	
    	
      $subscription_cost = $currencies->display_price($new_subscription['subscription_costs'], tep_get_tax_rate($new_subscription['subscription_tax_class_id']));
    

    $new_subscription['subscription_name'] = tep_get_subscription_name($new_subscription['subscription_id']);
    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_SUBSCRIPTION_INFO, 'subscription_id=' . $new_subscription['subscription_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_subscription['subscription_image'], $new_subscription['subscription_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_SUBSCRIPTION_INFO, 'subscription_id=' . $new_subscription['subscription_id']) . '">' . $new_subscription['subscription_name'] . '</a><br>' . $subscription_price);


    $col ++;
    if ($col > 2) {
      $col = 0;
      $row ++;
    }
  }

if (tep_db_num_rows($new_subscription_query)>0){
  new contentBoxHeading($info_box_heading_contents, false, false, tep_href_link(FILENAME_SUBSCRIPTIONS_NEW));
  
  new contentBox($info_box_contents);
	if (MAIN_TABLE_BORDER == 'yes'){
	$info_box_contents = array();
	  $info_box_contents[] = array('align' => 'left',
									'text'  => tep_draw_separator('pixel_trans.gif', '100%', '1')
								  );
	  new infoboxFooter($info_box_contents, true, true);
	}
}
?>
<!-- new_products_eof //-->
