?? admin.php
字號:
<?
//######################管理員功能頁##########################
include "config.php";?>
<?include "header.php";?>
<?include "admin_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="#000000" align="center">
<tr>
<td bgcolor="#FFFFFF">
<div align="right" class="text"><font color="#FF0000"><a href="admin_query.php">管理員查詢</a>‖<a href="add_book.php">添加圖書</a></font></div>
</td>
</tr>
</table>
<table width="770" border="0" cellspacing="1" cellpadding="0" bgcolor="#333333" align="center">
<tr>
<td bgcolor="#FFFFFF">
<div align="center" class="title">書名</div>
</td>
<td width=100 bgcolor="#FFFFFF">
<div align="center" class="title">作者</div>
</td>
<td bgcolor="#FFFFFF">
<div align="center" class="text">
<p>出版社</p>
</div>
</td>
<td width=65 bgcolor="#FFFFFF">
<div align="center" class="title">出版日期</div>
</td>
<td width="5%" bgcolor="#FFFFFF">
<div align="center" class="title">價格(元)</div>
</td>
<td width="9%" bgcolor="#FFFFFF">
<div align="center" class="title">分類號</div>
</td>
<td width=30 bgcolor="#FFFFFF" class="title">
<div align="center">冊數</div>
</td>
<td width=30 bgcolor="#FFFFFF" class="title">
<div align="center">狀態</div>
</td>
<td width="9%" bgcolor="#FFFFFF" class="title">
<div align="center">刪除</div>
</td>
</tr>
<?
$n=0;
$query=mysql_query("select count(*) as sm from book_list ");
$row=mysql_fetch_array($query);
$count=$row[sm];
if(empty($offset))
{$offset=0;}
$query=mysql_query("select * from book_list 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=book_del.php?book_id=".$row['book_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'> </td></tr>
</table>";
?>
<?include "foot.php";?>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -