<?php 
require "../Run.php";
require "../include/page.inc.php";
echo head(class_name($_GET['cid'],'cn',WAPID));
echo topNav('留言板','<a href="../index.php?cid='.class_name($_GET['cid'],'gro',WAPID).'">上级</a>',' ');
$mysql = new D('liuyan');
$list = $mysql -> where(array('gro'=>$_GET['cid']))->order('lid DESC')->limit(slist($_GET['p'],15),15)->select();    
	if($list){
	$mus = 0;
	foreach($list as $value)
	{
		$div = $num++%2 == 0?'line1':'line2';
		$html.= '<div class="'.$div.'">▪<a href="content.php?cid='.$value['gro'].'&id='.$value['lid'].'&" target="_blank">'.$value['title'].'</a><br>['.$value['time'].']</div>';
	 }
	 }else{
	 $html = '此栏目暂无记录';
	 }
	 echo '<div class="title"><a href="add.php?cid='.$_GET['cid'].'&">发表留言</a>|留言板</div>';
	echo $html; 
	$sql = "SELECT count(*) FROM liuyan WHERE gro ='{$_GET['cid']}'";   
	$result = mysql_query($sql); 
	list($num) = mysql_fetch_row($result);
	$url = 'list.php?cid='.$_GET[cid].'&';
echo page($num,15,$url,NULL,'view');
echo footer(1);