<?php
	session_start();
	include "../inc/chec.php";
	include "../conn/conn.php";
?>
<link href="../css/style.css" rel="stylesheet" />

<script src="../js/client_js.js"></script>
<script src="../js/riq.js"></script>
<SCRIPT language=javascript src="../dedeajax2.js"></SCRIPT>
<SCRIPT language=javascript src="../js/ckgg.js"></SCRIPT>
<table width="765" border="1" cellpadding="0" cellspacing="0" class="big_td">
	<tr>
		<td height="33" background="../images/list.jpg" id="list">
		<?php
		if($_GET[u_id] == 9)
			echo "企业公告";
		elseif($_GET[u_id] == 10)
			echo "活动安排";
		?>
		</td>
	</tr>
</table>
<table width="765" border="1" cellpadding="0" cellspacing="0" bgcolor="#DEEBEF" class="big_td">
	<tr>
		<td width="100" height="25" align="center" valign="middle">发布时间</td>
		<td align="center" valign="middle">标题</td>
	</tr>
<?php
	if(isset($_GET[u_id])){
		$sqlstr = "select * from tb_person where u_id = ".$_GET[u_id];
		$result = mysql_query($sqlstr,$conn);
		while($rows = mysql_fetch_row($result)){
?>

<?php
		}}
?>
<?php
$met=$_GET['u_id'];
$spendor=($met=='srlist')?2:1;
$page=isset($_GET['page'])?(int)($_GET['page']):1;
$num=10;
$total=mysql_num_rows(mysql_query("SELECT * FROM tb_person where u_id = ".$_GET[u_id].""));
                    $url = 'p_message.php';
                    if ($total <= 0)
                        exit('还没有你的记录，快去记录吧');
//页码计算
$pagenum=ceil($total/$num);
$page=min($pagenum,$page);//获得首页
$prepg=$page-1;//上一页
$nextpg=($page==$pagenum?0:$page+1);//下一页
$offset=($page-1)*$num;
//开始分页导航条代码：
$pagenav="<div class=num>显示第 <B>".($total?($offset+1):0)."</B>-<B>".min($offset+10,$total)."</B> 条记录，共 $total 条记录 ";
$pagenav.=" <a href='$url?u_id=$met&page=1'>首页</a> ";
if($prepg) $pagenav.=" <a href='$url?u_id=$met&page=$prepg'>前页</a> "; else $pagenav.=" 前页 ";
if($nextpg) $pagenav.=" <a href='$url?u_id=$met&page=$nextpg'>后页</a> "; else $pagenav.=" 后页 ";
$pagenav.=" <a href='$url?u_id=$met&page=$pagenum'>尾页</a> ";
//下拉跳转列表，循环列出所有页码：
$pagenav.="　到第 <select name='topage' size='1' onchange='window.location=\"$url?u_id=$met&page=\"+this.value'>\n";
for($i=1;$i<=$pagenum;$i++){
if($i==$page) $pagenav.="<option value='$i' selected>$i</option>\n";
else $pagenav.="<option value='$i'>$i</option>\n";
}
$pagenav.="</select> 页，共 $pagenum 页</div>";
//假如传入的页数参数大于总页数，则显示错误信息
If($page>$pagenum){
       echo "Error : 不能找到页 ".$page;
       Exit;
}
$info="SELECT id,p_title,p_time from tb_person where u_id = ".$_GET[u_id]." order by id desc limit $offset,$num";
$result3=mysql_query($info,$conn);
$j=0;
while($list=mysql_fetch_array($result3)){
$j++;
echo '<tr><td width="100" height="25" align="center" valign="middle">'.$list['p_time'].'</td><td><A  onclick="AlertMsg( '.$list['id'].','.$list['id'].')" href="javascript:">'.$list['p_title'].'</a></td></tr>';}
echo '</table>';
echo $pagenav;//输出分页导航
ob_end_flush();
?>
</table>