<?php
$bt="携手改善";
include("../head.php");
include("../conn.php");
include_once("../function.php");
/*
2014年1月3日，大隐
一线印象增加携手改善功能
*/
$sid=sqlstr($_COOKIE["dl"]);
$user=mysql_fetch_array(mysql_query("select * from user where sid='$sid'"));
$mid=$user["id"];
if(!$user){
header("Location:../login.php");
exit;//反之，则跳转到登录界面
}

$page=sqlstr($_GET['page']);
echo <<<htm
<div class="hui"><div class="zuo">提建议 携手改善</div><div class="you"><a href="submit.php">写建议</a> | <a href="/m">返回</a></div></div><div id="main"><div class="listyou">感谢在物质和精神上支持一线印象的所有人<br/>提意见前请看: <a href="/m/about.php">关于我们</a>，感谢支持。</div></div>
htm;
//列表开始
$max=mysql_num_rows(mysql_query("SELECT * FROM tg"));
$p=ceil($max/10);
if(!$page or $page>$p){
$page=1;
}
$low=10*($page-1);//开始查询的条数
$pagesize=10;//每页查询的条数
$rs=mysql_query("SELECT * FROM tg ORDER BY time DESC LIMIT {$low},{$pagesize}");//列出最新公开的日记


while($uinfo=mysql_fetch_array($rs)){
$id=$uinfo["id"];
$rows=mysql_fetch_array(mysql_query("select * from user where id='$id'"));
$name=$rows["name"];
$time=ctime($uinfo['time']); 
$txt=$uinfo["txt"];
$hf=$uinfo["hf"];
$tid=$uinfo["mid"];
if($mid==1){
$zzz=" <a href='return.php?id=".$tid."'>回复</a>";
}else{
$zzz=" ";
}
$aaa="dayin";
if($hf==$aaa){
$admin="";
}else{
$admin="<br/><font color='blue'>由 Dayin 回复：谢谢您的支持，".$hf."</font>";
}
echo '<div id="main"><div class="youlist">'.$tb.'<div class="time">'.$time.'</div></div><b>'.$name.'</b>: '.$uinfo["txt"].$zzz.$admin.'</div>';
}


echo '<br/><div class="hui"><center>';
if($max){
if($page>1){
$pag=$page-1;
echo '<center><a href="index.php?page='.$pag.'">«更近的</a>　';
} if($page<$p){
$page=$page+1;
echo  '　<a href="index.php?page='.$page.'">更早的»</a>';
}
$pa=$page-1;
echo '</center>';
echo '共'.$p.'页/第'.$pa.'页/'.$max.'条建议</div>';
}else{
echo '还没有发布建议哦<br/>';
}

include("../footer.php"); 

?>