<?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_SERVICES, strftime('%B')));

  

  if ( (!isset($new_services_category_id)) || ($new_services_category_id == '0') ) {
    $new_services_query = tep_db_query("select service_id, service_image, service_tax_class_id, service_costs from " . TABLE_SERVICES . " where service_status = '1' order by service_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  } else {
    $new_services_query = tep_db_query("select distinct su.service_id, su.service_image, su.service_tax_class_id, su.service_costs from " . TABLE_SERVICES . " su, " . TABLE_SERVICES_TO_SERVICES_CATEGORIES . " su2c, " . TABLE_SERVICES_CATEGORIES . " suc where su.service_id = su2c.service_id and su2c.services_categories_id = suc.services_categories_id and suc.parent_id = '" . $new_services_category_id . "' and su.service_status = '1' order by su.service_date_added desc limit " . MAX_DISPLAY_NEW_PRODUCTS);
  }


  $row = 0;
  $col = 0;
  $info_box_contents = array();
  while ($new_services = tep_db_fetch_array($new_services_query)) {
  	
    	
      $service_cost = $currencies->display_price($new_services['service_costs'], tep_get_tax_rate($new_services['service_tax_class_id']));
    

    $new_services['service_name'] = tep_get_service_name($new_services['service_id']);
    $info_box_contents[$row][$col] = array('align' => 'center',
                                           'params' => 'class="smallText" width="33%" valign="top"',
                                           'text' => '<a href="' . tep_href_link(FILENAME_SERVICES_INFO, 'service_id=' . $new_services['service_id']) . '">' . tep_image(DIR_WS_IMAGES . $new_services['service_image'], $new_services['service_name'], SMALL_IMAGE_WIDTH, SMALL_IMAGE_HEIGHT) . '</a><br><a href="' . tep_href_link(FILENAME_SERVICES_INFO, 'service_id=' . $new_services['service_id']) . '">' . $new_services['service_name'] . '</a><br>' . $service_cost);


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

if (tep_db_num_rows($new_services_query)>0){
  new contentBoxHeading($info_box_heading_contents, false, false, tep_href_link(FILENAME_SERVICES_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 //-->
