<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style.css" rel="stylesheet">
<?php
include("../conn/conn.php");
%包含数据库连接文件
$state=$_POST[state];
%获取“是否审核”的状态
$type=$_POST[type];
%获取“信息类别”
if($_POST[type]==""){
$state=$_GET[state];
$type=$_GET[type];
%若没有设置审核状态和信息类别,则采用默认值
}
if($state=="all"){
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' order by edate");
%若选择“全部”,则显示所有的信息
}else{
$sql1=mysql_query("select count(*) as total from tb_info where type='$type' and checkstate=$state order by edate");
%否则,显示相应状态的信息
}
$minfo=mysql_fetch_array($sql1);
%获得结果
$total=$minfo[total];
%获取结果总数
$pagesize=10;
%一页显示的条数
if($total<=$pagesize){
$pagecount=1;
%如果总数不大于每页的显示数,那么总页数为1
}
if(($total%$pagesize)!=0){
$pagecount=intval($total/$pagesize)+1;
%如果不能整除,则向上取整
}else{
$pagecount=$total/$pagesize;
%能整除,就直接取整数
}
if(($_GET[page])==""){
$page=1;
%默认为第一页
}else{
$page=intval($_GET[page]);
%若设置了页数,则page设为该页
}
if($state=="all"){
$sql=mysql_query("select * from tb_info where type='$type' order by edate limit ".($page-1)*$pagesize.",$pagesize");
%若选择“全部”,则跳到相应的页面处
}else{
$sql=mysql_query("select * from tb_info where type='$type' and checkstate=$state order by edate limit ".($page-1)*$pagesize.",$pagesize");
%否则也跳到相应的页面处
}
$info=mysql_fetch_array($sql);
%获得结果
?>
<table width="776" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="32" background="images/right_line.gif"> 您现在的位置:九九度供求信息网 > 后台管理系统</td>
</tr>
<tr>
<td height="32" background="images/right_top.gif"> </td>
</tr>
<tr>
<td height="488" align="center" valign="top" background="images/right_middle.gif">
当前信息类别: 『<span class="style11"> <?php echo $type;?> </span>』<br>
<table width="708" border="0" cellpadding="0" cellspacing="1" bgcolor="#FFCC33">
<tr align="center" bgcolor="#FFCC33">
<td width="111">信息标题</td>
<td width="203">信息内容</td>
<td width="63">联系人</td>
<td width="79">联系电话</td>
<td width="125">发布时间</td>
<td width="61">审核状态</td>
<td width="58">操作</td>
</tr>
<?php
if($info){
do{
if($info[checkstate]==1){
$state1="已审核";
}else{
$state1="未审核";
}
?>
<tr bgcolor="#FFFFFF">
<td> <?php echo $info[title];?></td>
<td> <?php echo $info[content];?></td>
<td> <?php echo $info[linkman];?></td>
<td> <?php echo $info[tel];?></td>
<td> <?php echo $info[edate];?></td>
<td align="center" class="style11"><?php echo $state1;?></td>
<td align="center" bgcolor="#FFFFFF"><a href="state_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">审核</a>/<a href="miandel_ok.php?id=<?php echo $info[id];?>&type=<?php echo $type;?>&state=<?php echo $state;?>">删除</a></td>
</tr>
<?php
}while($info=mysql_fetch_array($sql));
?>
<tr bgcolor="#FFFFDD">
<td height="22" colspan="7" align="right"> 共有
<?php
echo $total;
?>
条 每页显示 <?php echo $pagesize;?> 条 第 <?php echo $page;?> 页/共 <?php echo $pagecount; ?> 页
<?php
if($page>=2){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=1" title="首页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="上一页"></a>
<?php
}
if($pagecount<=4){
for($i=1;$i<=$pagecount;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php
}
}else{
for($i=1;$i<=4;$i++){
?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $i;?>"><?php echo $i;?></a>
<?php }?>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $page-1;?>" title="下一页"></a>
<a href="find_mianfei.php?type=<?php echo $type;?>&state=<?php echo $state;?>&page=<?php echo $pagecount;?>" title="尾页"></a>
<?php }?>
</td>
</tr>
<?php
}else{
?>
<tr align="center" bgcolor="#FFFFFF"><td colspan="7">对不起,您检索的信息不存在!</td>
</tr>
<?php
}
?>
</table></td>
</tr>
<tr>
<td height="32" background="images/right_bottom.gif"> </td>
</tr>
</table>