<?php
/*
  $Id: news_list.php $
  TomatoCart Open Source Shopping Cart Solutions
  http://www.tomatocart.com

  Copyright (c) 2011 Wuxi Elootec Technology Co., Ltd

  This program is free software; you can redistribute it and/or modify
  it under the terms of the GNU General Public License v2 (1991)
  as published by the Free Software Foundation.
*/

  class osC_Info_News_list extends osC_Template {

/* Private variables */

    var $_module = 'news_list',
        $_group = 'info',
        $_page_title,
        $_page_contents = 'news_list.php',
        $_page_image = 'table_background_reviews_new.gif';

/* Class constructor */

    function osC_Info_News_list() {
      global $osC_Language, $osC_Services, $breadcrumb, $Qnews, $osC_Database;
      
      $Qnews = $osC_Database->query('select * from :table_news n, :table_news_description nd where n.news_id = nd.news_id and n.news_status = 1 and nd.language_id = :language_id');
      $Qnews->bindTable(':table_news', TABLE_NEWS);
      $Qnews->bindTable(':table_news_description', TABLE_NEWS_DESCRIPTION);
      $Qnews->bindInt(':language_id', $osC_Language->getID());
      $Qnews->setBatchLimit((isset($_GET['page']) && is_numeric($_GET['page']) ? $_GET['page'] : 1), MAX_DISPLAY_SEARCH_RESULTS);
      $Qnews->execute();
      
      if ( $Qnews->numberOfRows() > 0 ) {
        $this->_page_title = '新闻列表';
      } else {
        $this->_page_title = $osC_Language->get('info_not_found_heading');
        $this->_page_contents = 'info_not_found.php';
      }
    }
  }
?>
