?? 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">冊數(shù)</div>
</td>
<td width=40 bgcolor="#FFFFFF" class="title">
<div align="center">狀態(tài)</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";?>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -