📄 book_list.php
字号:
<?
//######################图书列表并可借书##########################
include "config.php";
include "header.php";
include "auth.php";
?>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="style.css" rel="stylesheet" type="text/css">
<table width="770" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center">
<tr>
<td width="144" bgcolor="#FFFFFF">
<div align="center" class="title">书名</div>
</td>
<td width=132 bgcolor="#FFFFFF">
<div align="center" class="title">作者</div>
</td>
<td width="98" bgcolor="#FFFFFF">
<div align="center" class="text">
<p>出版社</p>
</div>
</td>
<td width=80 bgcolor="#FFFFFF">
<div align="center" class="title">出版日期</div>
</td>
<td width="74" nowrap bgcolor="#FFFFFF">
<div align="center" class="title">价格(元)</div>
</td>
<td width="68" bgcolor="#FFFFFF">
<div align="center" class="title">分类号</div>
</td>
<td width=56 bgcolor="#FFFFFF" class="title">
<div align="center">册数</div>
</td>
<td width=40 bgcolor="#FFFFFF" class="title">
<div align="center">状态</div>
</td>
<td width="68" bgcolor="#FFFFFF" class="title">
<div align="center">借书</div>
</td>
</tr>
<?
$n=0;
$query=mysql_query("select count(*) as sm from $book_table ");
$row=mysql_fetch_array($query);
$count=$row[sm];
if(empty($offset))
{$offset=0;}
$query=mysql_query("select * from $book_table order by book_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'>
<div align='center' class='text'>".$row['book_name']."</div></td>
<td width=100 height='15' class='text'> <div align='center'>".$row['author']."</div></td>
<td height='15' class='text'> <div align='center'>".$row['pub_addr']."</div></td>
<td width=65 height='15' class='text'> <div align='center'>".$row['pub_date']."</div></td>
<td width='5%' height='15' class='text'><div align='center'>".$row['price']."</div></td>
<td width='9%' height='15' class='text'> <div align='center'>".$row['sort_id']."</div></td>
<td height='15' class='text'> <div align='center'>".$row['volumes']."</div></td>
<td width=30 height='15' class='text'>
<div align='center'>".$row['status']."</div></td>
<td height='15' class='text'><div align='center'>
<a href=borrow.php?book_name=".$row['book_name'].">借书</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'> </td></tr>
</table>";
?>
<?include "foot.php";?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -