📄 query.php
字号:
<?
include_once("inc/auth.php");
include_once("inc/utility_all.php");
?>
<html>
<head>
<title>图书借阅</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language="JavaScript">
function delete_manage(BORROW_ID)
{
msg='确认要删借图记录吗?';
if(window.confirm(msg))
{
URL="delete.php?BORROW_ID=" + BORROW_ID + "&STATUS=<?=$STATUS?>";
window.location=URL;
}
}
function return_book(BORROW_ID)
{
msg='确认要还该书吗?';
if(window.confirm(msg))
{
URL="return.php?BORROW_ID=" + BORROW_ID + "&STATUS=<?=$STATUS?>";
window.location=URL;
}
}
function delete_flag(BORROW_ID)
{
msg='确认要删除吗?';
if(window.confirm(msg))
{
URL="delete.php?BORROW_ID=" + BORROW_ID + "&DELETE_FLAG=1";
window.location=URL;
}
}
</script>
</head>
<body class="bodycolor" topmargin="5">
<?
if($STATUS==0)
$STATUS_DESC="待批借阅";
elseif($STATUS==1)
$STATUS_DESC="已准借阅";
elseif($STATUS==2)
$STATUS_DESC="未准借阅";
$query = "SELECT count(*) from BOOK_MANAGE where STATUS='$STATUS' and BUSER_ID='$LOGIN_USER_ID' and DELETE_FLAG!=1 ";
$cursor= exequery($connection,$query);
$BORROW_COUNT=0;
if($ROW=mysql_fetch_array($cursor))
$BORROW_COUNT=$ROW[0];
if($BORROW_COUNT==0)
{
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/book.gif" width="22" height="18"><span class="big3"> <?=$STATUS_DESC?></span>
</td>
</tr>
</table>
<?
Message("","无".$STATUS_DESC);
exit;
}
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/book.gif" width="22" height="18"><span class="big3"> <?=$STATUS_DESC?></span>
</td>
<td valign="bottom" class="small1">共<span class="big4"> <?=$BORROW_COUNT?></span> 记录
</td>
</tr>
</table>
<table class="TableList" width="95%">
<tr class="TableHeader">
<td nowrap align="center">书名</td>
<td nowrap align="center">图书编号</td>
<td nowrap align="center">借书日期</td>
<td nowrap align="center">还书日期</td>
<td nowrap align="center">登记人</td>
<td nowrap align="center">状态</td>
<td nowrap align="center">操作</td>
</tr>
<?
$query = "SELECT * from BOOK_MANAGE where STATUS='$STATUS' and BUSER_ID='$LOGIN_USER_ID' and DELETE_FLAG!=1 order by RETURN_DATE desc";
$cursor= exequery($connection,$query);
$BORROW_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$BORROW_COUNT++;
$BORROW_ID=$ROW["BORROW_ID"];
$BUSER_ID=$ROW["BUSER_ID"];
$BOOK_NO=$ROW["BOOK_NO"];
$BORROW_DATE=$ROW["BORROW_DATE"];
$BORROW_REMARK=$ROW["BORROW_REMARK"];
$RUSER_ID=$ROW["RUSER_ID"];
$RETURN_DATE=$ROW["RETURN_DATE"];
$BOOK_STATUS=$ROW["BOOK_STATUS"];
$STATUS=$ROW["STATUS"];
$query1="select * from USER where USER_ID='$RUSER_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$USER_NAME2=$ROW["USER_NAME"];
$query1="select * from BOOK_INFO where BOOK_NO='$BOOK_NO'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$BOOK_NAME=$ROW["BOOK_NAME"];
if($BOOK_STATUS==0 && $STATUS==0)
$DESC = "借书待批";
if($BOOK_STATUS==0 && $STATUS==1)
$DESC = "借书已准";
if($BOOK_STATUS==0 && $STATUS==2)
$DESC = "借书未准";
if($BOOK_STATUS==1 && $STATUS==0)
$DESC = "还书待批";
if($BOOK_STATUS==1 && $STATUS==1)
$DESC = "还书已准";
if($BOOK_STATUS==1 && $STATUS==2)
$DESC = "还书未准";
if($BORROW_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td align="center"><?=$BOOK_NAME?></td>
<td align="center"><?=$BOOK_NO?></td>
<td align="center"><?=$BORROW_DATE?></td>
<td align="center"><?=$RETURN_DATE?></td>
<td align="center"><?=$USER_NAME2?></td>
<td align="center"><?=$DESC?></td>
<td nowrap align="center">
<?
if($STATUS==0 && $BOOK_STATUS==0) //借阅待批
{
?>
<a href="javascript:delete_manage(<?=$BORROW_ID?>);"> 删除 </a>
<?
}
if($STATUS==1 && $BOOK_STATUS==0) //借阅已准
{
?>
<a href="javascript:return_book('<?=$BORROW_ID?>');"> 还书</a>
<?
}
if($STATUS==2 && $BOOK_STATUS==0) //借阅未准
{
?>
<a href="javascript:delete_manage(<?=$BORROW_ID?>);"> 删除 </a>
<?
}
if($STATUS==1 && $BOOK_STATUS==1) //还书已准
{
?>
<a href="javascript:delete_flag(<?=$BORROW_ID?>);"> 删除 </a>
<?
}
if($STATUS==2 && $BOOK_STATUS==1) //还书未准
{
?>
<a href="javascript:return_book('<?=$BORROW_ID?>');"> 还书</a>
<?
}
?>
</td>
</tr>
<?
}//while
?>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -