📄 search.php
字号:
<?php
include_once( "inc/auth.php" );
include_once( "inc/check_type.php" );
echo "\r\n<html>\r\n<head>\r\n<title>历史纪录查询</title>\r\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=gb2312\">\r\n<script>\r\nfunction delete_borrow(BORROW_ID,TO_ID,BOOK_NO,BOOK_STATUS)\r\n{\r\n msg='确认要删除该记录么?';\r\n if(window.confirm(msg))\r\n {\r\n URL=\"delete.php?BORROW_ID=\" + BORROW_ID + \"&TO_ID=\" + TO_ID + \"&BOOK_NO=\" + BOOK_NO + \"&BOOK_STATUS=\" + BOOK_STATUS;\r\n window.location=URL;\r\n }\r\n}\r\n\r\n</script>\r\n</head>\r\n\r\n<body class=\"bodycolor\" topmargin=\"5\">\r\n";
$CUR_DATE = date( "Y-m-d", time( ) );
if ( $START_B != "" )
{
$TIME_OK = is_date( $START_B );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
if ( $END_B != "" )
{
$TIME_OK = is_date( $END_B );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
if ( $START_R != "" )
{
$TIME_OK = is_date( $START_R );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
if ( $END_R != "" )
{
$TIME_OK = is_date( $END_R );
if ( !$TIME_OK )
{
message( "错误", "\"开始时间\"的格式不对,应形如 ".$CUR_DATE );
button_back( );
exit( );
}
}
$query1 = "SELECT * from BOOK_MANAGER where find_in_set('".$LOGIN_USER_ID."',MANAGER_ID)";
$cursor1 = exequery( $connection, $query1 );
while ( $ROW1 = mysql_fetch_array( $cursor1 ) )
{
$MANAGE_DEPT_ID .= $ROW1['MANAGE_DEPT_ID'];
}
if ( $TO_ID != "" )
{
$WHERE_STR .= " and BUSER_ID='".$TO_ID."'";
}
if ( $BOOK_NO != "" )
{
$WHERE_STR .= " and BOOK_NO='".$BOOK_NO."'";
}
if ( $START_B != "" )
{
$WHERE_STR .= " and BORROW_DATE>='".$START_B."'";
}
if ( $END_B != "" )
{
$WHERE_STR .= " and BORROW_DATE<='".$END_B."'";
}
if ( $BOOK_STATUS1 == "1" )
{
$WHERE_STR .= " and BOOK_STATUS='1' and STATUS='1'";
}
if ( $BOOK_STATUS1 == "0" )
{
$WHERE_STR .= " and ((BOOK_STATUS='0' and STATUS='1') or (BOOK_STATUS='1' and STATUS='0'))";
}
if ( $BOOK_STATUS1 == "" )
{
$WHERE_STR .= " and ((BOOK_STATUS='0' and STATUS='1') or (BOOK_STATUS='1' and STATUS='0') or (BOOK_STATUS='1' and STATUS='1'))";
}
$query = "SELECT * from BOOK_MANAGE where STATUS!='2'".$WHERE_STR." order by RETURN_DATE desc";
$cursor = exequery( $connection, $query );
$BOOK_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor ) )
{
$BOOK_NO1 = $ROW['BOOK_NO'];
$query2 = "SELECT DEPT from BOOK_INFO where BOOK_NO='".$BOOK_NO1."'";
$cursor2 = exequery( $connection, $query2 );
if ( $ROW2 = mysql_fetch_array( $cursor2 ) )
{
$DEPT = $ROW2['DEPT'];
}
if ( !find_id( $MANAGE_DEPT_ID, $DEPT ) || $MANAGE_DEPT_ID != "ALL_DEPT" )
{
++$BOOK_COUNT;
}
}
if ( $BOOK_COUNT == 0 )
{
message( "<br>提示", "没有符合条件的借书记录" );
echo "<br>\r\n<div align=\"center\">\r\n<input type=\"button\" value=\"返回\" class=\"BigButton\" onClick=\"location='index.php';\">\r\n</div>\r\n";
exit( );
}
echo "\r\n<table border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\" class=\"small\">\r\n <tr>\r\n <td class=\"Big\"><img src=\"/images/menu/infofind.gif\" align=\"absmiddle\"><span class=\"big3\"> 历史纪录查询 </span><br>\r\n </td>\r\n </tr>\r\n</table>\r\n\r\n<table class=\"TableList\" width=\"100%\">\r\n <tr class=\"TableHeader\">\r\n <td nowrap align=\"center\">借书人</td>\r\n <td nowrap align=\"center\">书 名</td>\r\n <td nowrap align=\"center\">借书日期</td>\r\n <td nowrap align=\"center\">还书日期</td>\r\n <td nowrap align=\"center\">实还日期</td>\r\n <td nowrap align=\"center\">登记人</td>\r\n <td nowrap align=\"center\">状 态</td>\r\n <td nowrap align=\"center\">操 作</td>\r\n </tr>\r\n\r\n";
$cursor1 = exequery( $connection, $query );
$BOOK_COUNT = 0;
while ( $ROW = mysql_fetch_array( $cursor1 ) )
{
++$BOOK_COUNT;
$BORROW_ID = $ROW['BORROW_ID'];
$BUSER_ID = $ROW['BUSER_ID'];
$BOOK_NO1 = $ROW['BOOK_NO'];
$BORROW_DATE = $ROW['BORROW_DATE'];
$RUSER_ID = $ROW['RUSER_ID'];
$RETURN_DATE = $ROW['RETURN_DATE'];
$BOOK_STATUS2 = $ROW['BOOK_STATUS'];
$REAL_RETURN_TIME = $ROW['REAL_RETURN_TIME'];
$STATUS = $ROW['STATUS'];
$query2 = "SELECT DEPT from BOOK_INFO where BOOK_NO='".$BOOK_NO1."'";
$cursor2 = exequery( $connection, $query2 );
if ( $ROW2 = mysql_fetch_array( $cursor2 ) )
{
$DEPT = $ROW2['DEPT'];
}
if ( !find_id( $MANAGE_DEPT_ID, $DEPT ) || $MANAGE_DEPT_ID != "ALL_DEPT" )
{
if ( $REAL_RETURN_TIME == "0000-00-00" )
{
$REAL_RETURN_TIME = "";
}
$query2 = "select * from USER where USER_ID='".$BUSER_ID."'";
$cursor2 = exequery( $connection, $query2 );
while ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$USER_NAME1 = $ROW['USER_NAME'];
}
$query2 = "select * from USER where USER_ID='".$RUSER_ID."'";
$cursor2 = exequery( $connection, $query2 );
while ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$USER_NAME2 = $ROW['USER_NAME'];
}
$query2 = "select * from BOOK_INFO where BOOK_NO='".$BOOK_NO1."'";
$cursor2 = exequery( $connection, $query2 );
while ( $ROW = mysql_fetch_array( $cursor2 ) )
{
$BOOK_NAME = $ROW['BOOK_NAME'];
}
if ( $BOOK_STATUS2 == "1" && $STATUS == "1" )
{
$BOOK_STATUS_DESC = "已还";
}
if ( !( $BOOK_STATUS2 == "0" ) && $STATUS == "1" || $BOOK_STATUS2 == "1" && $STATUS == "0" )
{
$BOOK_STATUS_DESC = "未还";
}
if ( $BOOK_COUNT % 2 == 1 )
{
$TableLine = "TableLine1";
}
else
{
$TableLine = "TableLine2";
}
echo "\r\n <tr class=\"";
echo $TableLine;
echo "\">\r\n <td nowrap align=\"center\">";
echo $USER_NAME1;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $BOOK_NAME;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $BORROW_DATE;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $RETURN_DATE;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $REAL_RETURN_TIME;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $USER_NAME2;
echo "</td>\r\n <td nowrap align=\"center\">";
echo $BOOK_STATUS_DESC;
echo "</td>\r\n";
if ( !( $BOOK_STATUS2 == "0" ) && $STATUS == "1" || $BOOK_STATUS2 == "1" && $STATUS == "0" )
{
echo " <td nowrap align=\"center\"> </td>\r\n";
}
if ( $BOOK_STATUS2 == "1" && $STATUS == "1" )
{
echo " <td nowrap align=\"center\">\r\n <a href=\"javascript:delete_borrow('";
echo $BORROW_ID;
echo "','";
echo $TO_ID;
echo "','";
echo $BOOK_NO;
echo "','";
echo $BOOK_STATUS1;
echo "');\"> 彻底删除</a>\r\n \t</td>\r\n";
}
echo " </tr>\r\n";
}
}
echo "</table>\r\n\r\n<br>\r\n<div align=\"center\">\r\n<input type=\"button\" value=\"返回\" class=\"BigButton\" onClick=\"location='index.php';\">\r\n</div>\r\n\r\n</body>\r\n</html>";
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -