<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
<?
if($action == 'search'){empty($baht_baid) && exit("请输入查询条件");$sqlba="select * from $baht_table where (1=1) and (baht_baid<>'')";if($baht_baid) {$sqlba=$sqlba." and baht_baid like '%$baht_baid%' ";}
$query=mysql_query($sqlba);
?>
<table width="208" height="23" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333">
  <tr class="style1">
    <td width=113 bgcolor="#FFFFFF"><div align="center" class="text">备案号</div></td>
    <td width=30 bgcolor="#FFFFFF" class="title"><div align="center"><span class="text">查看</span></div></td>
  </tr>
  <?
$n=0;
$row=mysql_fetch_array($query);
$count=mysql_num_rows($query);
if(empty($offset))
{$offset=0;}
$query=mysql_query($sqlba." order by baht_id desc limit $offset,$list_num") or die ("fail");
while($row=mysql_fetch_array($query)){
if(($n%2)!='0'){
echo "<tr bgcolor=#FFFFff>";}
else{
echo "<tr bgcolor=#E4E4E4>";
}
echo"
<td height='15' class='text'> <div align='center'>".$row['baht_baid']."</div></td>
<td height='15' class='text'> <div align='center'>
<a href=admin_ba_see.php?baht_id=".$row['baht_id'].">查看</a></div></td>
</tr> ";
$n++;
}
?>
</table>
<?
$pages=ceil($count/$list_num);
echo "<table width=770 border=0 cellspacing=0 cellpadding=0 align=center class='text'>
<tbody>
<tr>
<td width='159'><font color='#ff0000'>目前共有".$count." 条记录</font> </td>
<td width='205'>".$pages."页</td>";if($offset){
$preoffset=$offset-$list_num;
print "<td width='132'><a href=\"$PHP_SELF?offset=$preoffset\">上一页</a></td>";}
else {
echo "<td width='132'>上一页</td>";
}
$newoffset=$offset+$list_num;
if(($pages!=0)&&(($newoffset/$list_num)!=$pages))
{
print("<td width='158'><a href=\"$PHP_SELF?offset=$newoffset\">下一页</a></td>");
}
else{ echo "<td width='158'>下一页</td>";}
$pageno=($offset/$list_num)+1;
echo "<td width='112' class=text>第<input class=text type='text' size='4'value=".$pageno." readonly>
页</td>
<td width='4'>&nbsp;</td></tr>
</table>";
}
else{
?>
<table width="770" border="0" cellspacing="1" cellpadding="0" class="text" bgcolor="#000000" align="center">
<!--DWLayoutTable-->
<form method="post" action="search.php">
<tr bgcolor="#E4E4E4">
  <td class="text"><div align="center">按备案号:</div>    <div align="center">
    </div></td>
  <td colspan="2"><div align="center">
    <input name="baht_baid" type="text" id="baht_id">
  </div></td>
  </tr>
<tr bgcolor="#FFFFFF">
  <td height="30" colspan="3" class="text"><div align="center">
        <input type="hidden" name="action" value="search" >
        <input type="submit" value="查 询" class="text">
  </div></td>
  </tr>
<tr bgcolor="#E4E4E4">
<td height="17" colspan="3" valign="top" bgcolor="#FFFFFF"> <font color="#FF0000">
 *请选择上边的任一种查询条件或选择多个条件进行查询有关内容。</font></td>
</tr>
</form>
</table>
<?}?>搜索没有问题,不过当存在分页时,无法显示下一页,求救,各位大虾