📄 personal_pager.php
字号:
<?php
include("header.php");
if(($usernames=="") || ($passwords==""))
{
$sql="select * from user where name='".$username."' and password='".$password."'";
$rs=mysql_query($sql,$conn);
if(mysql_num_rows($rs)==0)
{
echo "<P align=center>用户名或密码错误";
echo "<br><a href=\"javascript:history.back()\">返回</a>";
exit();
}
$lists=mysql_fetch_array($rs);
$sorter=$lists[editor];
set_user("usernames","passwords",$lists[name],$lists[password]);
}
?>
<p align="center" class="1">个人资料</p>
<div align="center">
<center>
<table border="1" width="80%" bordercolor="#000000" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table border="1" width="100%" bordercolor="#008000" cellspacing="0" cellpadding="0">
<tr>
<?php
$sql="select * from user where editor='".$sorter."'";
$rs=@mysql_query($sql,$conn) or die ("<P align=center>查询发生错误");
if(mysql_num_rows($rs)==0)
{
echo "<p align=center>找不到此用户,编号可能输入错误<br><a href=\"javascript:history.back()\">返回</a>";
set_user("usernames","passwords","","");
exit();
}
$lists=mysql_fetch_array($rs);
echo "<td width=\"33%\">姓名:<font color=\"#800000\">".$lists[name]."</font></td>";
echo "<td width=\"33%\">编号:<font color=\"#800000\">".$lists[editor]."</font></td>";
echo "<td width=\"34%\">电话:<font color=\"#800000\">".$lists[phone]."</font></td></tr></table>";
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" bordercolor=\"#008000\" border=\"1\"><tr>";
echo "<td width=\"40%\">证件号码:<font color=\"#800000\">".$lists[document]."</font></td>";
echo "<td width=\"60%\">地址:<font color=\"#800000\">".$lists[dress]."</font></td></tr></table>";
$userid=$lists[id];
$sql="select * from lend where user_id=".$lists[id]." and type=0 order by id";
$rs=mysql_query($sql,$conn);
if(mysql_num_rows($rs)==0)
;
else
{
echo "<table border=\"1\" width=\"100%\" bordercolor=\"#008000\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"25%\" colspan=\"4\" align=\"center\">已借书籍</td></tr>";
while($lists=mysql_fetch_array($rs))
{
echo "<tr><td width=\"35%\">".$lists[book_name]."</td>";
echo "<td width=\"36%\">".$lists[book_sorter]."</td>";
echo "<td width=\"19%\" align=\"center\">";
if($lists[continu_date]!="")
{
echo $lists[lent_time];
if( (date("d")-date("d",$lists[lent_time]) )>$max_date )
{
echo "<br>过期:".(date("d")-date("d",$lists[lent_time]) )."天";
$continu_flag=1;
}
else
if( (date("d")-date("d",$lists[continu_date]) )>$lend_date )
echo "<br>过期:".(date("d")-date("d",$lists[continu_date]) )."天";
}
else
{
echo $lists[continu_date];
}
echo "</td>";
//echo "<td width=\"10%\" align=\"center\"><a href=\"restore_book.php?user_id=".$lists[user_id]."&book_id=".$lists[book_id]."&lendid=".$lists[id]."&sorter=".$sorter."\">归还</a></td>";
if($continu_flag)
echo "<td width=\"10%\" align=\"center\"> </td>";
else
echo "<td width=\"10%\" align=\"center\"><a href=\"admin/continu_lendbook.php?lendid=".$lists[id]."&mode=papared&sorter=".$sorter."\">续借</a></td>";
echo "</tr>";
}
echo "</talbe>";
}
$sql="select * from lend where user_id=".$userid." and type=1 order by id";
$rs=mysql_query($sql,$conn);
if(mysql_num_rows($rs)!=0)
{
$remain=($papared_num) - mysql_num_rows($rs);
echo " <table border=\"1\" width=\"100%\" bordercolor=\"#008000\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"25%\" colspan=\"4\" align=\"center\">预借书籍</td></tr>";
while($lists=mysql_fetch_array($rs))
{
echo "<tr><td width=\"35%\">".$lists[book_name]."</td>";
echo "<td width=\"36%\">".$lists[book_sorter]."</td>";
echo "<td width=\"19%\" align=\"center\">".$lists[lent_time]."</td>";
echo "<td width=\"10%\" align=\"center\"><a href=\"admin/restore_book.php?user_id=".$lists[user_id]."&book_id=".$lists[book_id]."&lendid=".$lists[id]."&sorter=".$sorter."&mode=papared\">删除</td></tr>";
}
echo "</table>";
}
else
$remain=$papared_num;
if($remain>0)
{
echo " <div align=\"center\"><center>";
echo "<table border=\"1\" width=\"100%\" bordercolor=\"#008000\" cellspacing=\"0\" cellpadding=\"0\">";
echo "<tr><td width=\"26%\" colspan=\"2\" align=\"center\">预借</td></tr>";
echo "<form action=\"admin/lendbook_register.php?user_id=".$userid."&sorter=".$sorter."&mode=papared\" method=\"post\">";
//echo $lend_num." or ".$remain;
for($i=0;$i<($remain);$i++)
{
echo "<tr><td width=\"20%\">书籍编号:</td>";
echo "<td width=\"80%\"><input type=\"text\" name=\"book_sorter".$i."\"></td></tr>";
}
echo "<tr><td width=\"50%\" colspan=\"2\" align=\"center\"><input type=\"submit\" value=\"登记\"</td>";
echo "</tr></table></center></div>";
}
mysql_close($conn);
?>
</td>
</tr>
</table>
</center>
</div>
<p align="center"><a href="exit.php?name1=usernames&name2=passwords">退出</a></p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -