<?php
session_start();
include "../conn/conn.php";
include "../inc/chec.php";
include "../inc/func.php";
$a_sql = "select * from tb_iss where p_id = ".$_SESSION[id];
$a_rst = mysql_query($a_sql,$conn);
?>
<link href="../css/style.css" rel="stylesheet" />
<script src="../js/client_js.js"></script>
<script type="text/javascript" src="../lhgcore.js"></script>
	<script type="text/javascript" src="../lhgdialog.js"></script>
	<SCRIPT language=javascript src="../dedeajax2.js"></SCRIPT>

<SCRIPT language=javascript src="../js/cksj.js"></SCRIPT>
	<script type="text/javascript">
function dlgopen1()
{
	J.dialog.get({ id: 'test1', title: '发布申请', page: 'shps/add_issuance.php', width: '590' , height: '430' });
}
</script>
<table width="765" border="1" cellpadding="0" cellspacing="0" class="big_td">
	<tr>
		<td height="33" background="../images/list.jpg" id="list">发布审核</td>
	</tr>
</table>
<table width="765" border="0" cellpadding="0" cellspacing="0" bgcolor="#DEEBEF" class="big_td">
	<tr>
		<td height="30" colspan="5" align="center" valign="middle"><input type="button" id="a" value="发布申请" onclick="dlgopen1()"/></td>
	</tr>
	<tr>
		<td width="100" height="25" align="center" valign="middle">日期</td>
		<td width="100" height="25" align="center" valign="middle">标题</td>
		<td width="100" height="25" align="center" valign="middle">内容</td>
		<td width="100" height="25" align="center" valign="middle">是否批示</td>
		<td width="100" height="25" align="center" valign="middle">操作</td>
	</tr>
<?php
	while($a_rows = mysql_fetch_array($a_rst)){
?>
<?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_iss  where p_id = ".$_SESSION[id]." order by i_state desc"));
                    $url = 'au_read.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,i_time,i_title,i_content,i_state from tb_iss  where p_id = ".$_SESSION[id]." order by id desc limit $offset,$num";
$result3=mysql_query($info,$conn);
$j=0;
while($list=mysql_fetch_array($result3)){
$j++;
if($list[i_state] == 3)
			$list['i_state']=未审核;
		else
			$list['i_state']=($a_rows[i_state] == 0)?"通过":"未通过"; 
echo '<tr><td height="25" align="center" valign="middle">'.$list['i_time'].'</td><td height="25" align="center" valign="middle">'.$list['i_title'].'</td><td height="25" align="center" valign="middle">'.$list['i_content'].'</td><td  height="25" align="center" valign="middle">'.$list['i_state'].'</td><td  height="25" align="center" valign="middle"><A  onclick="AlertMsg( '.$list['id'].','.$list['id'].')" href="javascript:">修改</a>||<a href="del_issuance_chk.php?id='.$list['id'].'" onclick="return del_mess();">删除</a></td></tr>';}
echo '</table>';
echo $pagenav;//输出分页导航
ob_end_flush();
?>
</table>