<?php
include("include/config.php");
include("pages.php");	
	$id_nav=intval($_GET[id]);
	$sql="SELECT * FROM `bigclass_nav` where id='$id_nav'";
	$result=query($sql);
	while ($info=mysql_fetch_array($result)) {
		$nav_name=$info[cname];
	};
	$smarty->assign('nav_name',$nav_name);
	$sql_list_total="SELECT * FROM `news` where yiid=$id_nav";
	$result_list_total=query($sql_list_total);
	$total=mysql_num_rows($result_list_total);
	pageft($total,5);
	$sql_list="SELECT * FROM `news` where yiid=$id_nav limit $firstcount,$displaypg";
	$result_list=query($sql_list);
	
	while ($info_list=@mysql_fetch_array($result_list)) {
		$list.="<li><a title='".$info_list[title]."' href='show.php?ID=".$info_list[ID]."'>".substr($info_list[title],0,40)."</a><span style='margin-left:350px'>[".$info_list[adddate]."]</span></li>";
	};
	
	$smarty->assign('pagenav',$pagenav);
	$smarty->assign('list',$list);	
	$smarty->display("list.html");

?>
