⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin.php

📁 一个小型图书管理系统
💻 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'>&nbsp;</td></tr>
</table>";
   ?>
<?include "foot.php";?>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -