if(@$_GET["id"])
{
$id=$_GET["id"];
$sql="SELECT * FROM `inform` WHERE id='$id'";
$inform = $db->fetch_assoc_one($sql);
?>
echo $inform["title"]; ?>
echo $inform["content"]; ?>
发布时间: echo $inform["time"]; ?>
}
else
{
?>
曾经发布的公告
标题
时间
$result = $db->fetch_assoc_one("SELECT count(*) as total FROM `inform`");
$totalnum = $result["total"];
$page = new Page($totalnum,20);
$startnum = $page->getPageStatus($totalnum,20);
$sql="SELECT * FROM `inform` order by id desc limit $startnum,20";
$arrItems = $db->fetch_assoc($sql);
$i=0;
foreach($arrItems as $inform)
{
++$i; if($i%2==0) $color="#D9E6F2"; else $color="#9ABCDE";
?>