<?
include_once("../admin/comm/db_sql.php");
include_once("../admin/comm/config.php");
include_once("../admin/comm/connect.php");
include_once("../admin/comm/Function.php");
include_once("../admin/product/Function.php");
include_once("../Smarty/Smarty.class.php");

$page_show = new Smarty(); 
if ($WebLinkType=="0"){
		$page_show->template_dir = "./templates";
		$page_show->compile_dir = "./templates_c"; 
}else
{
		$page_show->template_dir = "./templateshtml";
		$page_show->compile_dir = "./templateshtml_c"; 
}
$page_show->left_delimiter = "<{";      
$page_show->right_delimiter = "}>";

$channel=trim($_GET[channel]);
if (empty($channel))
	{
		$channel="1";
	}
$id=trim($_GET[id]);
if (empty($id))
	{
		$id="1";
	}
$page=trim($_GET[page]);
if (empty($page))
	{
		$page=1;
	}
/*《------------------------------------------导航中心------------------------------------------》*/
$channel_all_record=channel_query_all($db);
$page_show->assign("channel_all_record_Array", $channel_all_record);

/*《------------------------------------------同一类型的频道------------------------------------------》*/
$channel_record_select=channel_query_category($db);
$page_show->assign("channel_record_array", $channel_record_select);

/*《------------------------------------------返回当前频道名称------------------------------------------》*/
$channel_record_one=channel_query($channel,$db);
$page_show->assign("channel_name", $channel_record_one['name']);

/*《------------------------------------------返回当前大类名称------------------------------------------》*/
$category_query_one_record= category_query_one($id,$db);
$page_show->assign("category_name", $category_query_one_record['name']);

/*《------------------------------------------返回当前频道大类------------------------------------------》*/
$category_record_channel=category_query_channel($db,$channel);
$page_show->assign("category_record_channel_Array", $category_record_channel);

/*《------------------------------------------返回当前频道小类------------------------------------------》*/
$sub_category_record_channel=sub_category_query_channel($db,$channel);
$page_show->assign("sub_category_record_channel_Array", $sub_category_record_channel);

/*《------------------------------------------返回当前大类的所有记录------------------------------------------》*/
$info_query_page_big_category_record=info_query_page_big_category($db,$page,$channel,$id);
$page_show->assign("info_query_page_big_category_Array", $info_query_page_big_category_record);

$page_show->assign("prepage", $prepage);
$page_show->assign("nextpage", $nextpage);
$page_show->assign("pages", $pages);
$page_show->assign("rows_count", $rows_count);
$page_show->assign("id", $id);
$page_show->assign("channel",$channel);
/*《------------------------------------------返回当前频道的10个图片新闻------------------------------------------》*/
$info_query_pic_record_channel=info_query_pic_channel($db,$channel);
$page_show->assign("info_query_pic_record_channel_Array", $info_query_pic_record_channel);

/*《------------------------------------------返回当前大类的小类------------------------------------------》*/
//$sub_category_query_category=sub_category_query_category($db,$category);
$page_show->assign("sub_category_query_category_Array", $info_query_new_record_channel);

/*《------------------------------------------搜索用到的------------------------------------------》*/
$page_show->assign("search_url", $product_search);

//数组:子类
$category_record=sub_category_query_all($db);
$page_show->assign("category_record_array", $category_record);

//专题:
$category_record_zt=channel_query_category_zt($db);
$page_show->assign("category_record_zt_array", $category_record_zt);

//大类,独立大类
$category_record_all_no=category_query_all_no($db);
$page_show->assign("category_record_all_no_array", $category_record_all_no);
$page_show->assign("yywdyb_companyName", $companyName);
$page_show->assign("yywdyb_SaleTel", $SaleTel);
$page_show->assign("yywdyb_TechTel", $TechTel);
$page_show->assign("yywdyb_Fax", $Fax);
$page_show->assign("yywdyb_Address", $Address);
$page_show->assign("yywdyb_mobile", $mobile);
$page_show->assign("yywdyb_QQ", $QQ);
$page_show->assign("yywdyb_Mail", $Mail);
$page_show->assign("CopyRight", $CopyRight);
$page_show->display("category.html"); 
?>