📄 index.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">
</head>
<body class="bodycolor" topmargin="5">
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/notify_new.gif" align="absmiddle"><span class="big3"> 借书登记 </span><br>
</td>
</tr>
</table>
<div align="center">
<input type="button" value="借书登记" class="BigButton" onClick="location='new.php';" title="借书登记">
</div>
<br>
<?
$BORROW_COUNT=0;
$query = "SELECT count(*) from BOOK_MANAGE where BOOK_STATUS='0' and STATUS='1' and REG_FLAG='1' and RUSER_ID='$LOGIN_USER_ID'";
$cursor= exequery($connection,$query);
if($ROW=mysql_fetch_array($cursor))
$BORROW_COUNT=$ROW[0];
if($BORROW_COUNT==0)
{
?>
<table border="0" width="95%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/book.gif" align="absmiddle"><span class="big3"> 借书管理</span>
</td>
</tr>
</table>
<br>
<?
Message("","没有借书信息");
$FLAG=1;
}
if($FLAG!=1)
{
$PER_PAGE=15;
$PAGES=10;
$PAGE_COUNT=ceil($BORROW_COUNT/$PER_PAGE);
if($CUR_PAGE<=0 || $CUR_PAGE=="")
$CUR_PAGE=1;
if($CUR_PAGE>$PAGE_COUNT)
$CUR_PAGE=$PAGE_COUNT;
?>
<table border="0" width="100%" cellspacing="0" cellpadding="3" class="small" align="center">
<tr>
<td class="Big"><img src="/images/menu/book.gif" align="absmiddle"><span class="big3"> 借书管理</span>
</td>
<td align="right" valign="bottom" class="small1">共<span class="big4"> <?=$BORROW_COUNT?></span> 条 每页显示<?=$PER_PAGE?>条
</td>
<td align="right" valign="bottom" class="small1">
<a class="A1" href="index.php?CUR_PAGE=1">首页</a>
<a class="A1" href="index.php?CUR_PAGE=<?=$PAGE_COUNT?>">末页</a>
<?
if($CUR_PAGE%$PAGES==0)
$J=$PAGES;
else
$J=$CUR_PAGE%$PAGES;
if($CUR_PAGE> $PAGES)
{
?>
<a class="A1" href="index.php?CUR_PAGE=<?=$CUR_PAGE-$J-$PAGES+1?>">上<?=$PAGES?>页</a>
<?
}
for($I=$CUR_PAGE-$J+1;$I<=$CUR_PAGE-$J+$PAGES;$I++)
{
if($I>$PAGE_COUNT)
break;
if($I==$CUR_PAGE)
{
?>
[<?=$I?>]
<?
}
else
{
?>
[<a class="A1" href="index.php?CUR_PAGE=<?=$I?>"><?=$I?></a>]
<?
}
}
?>
<?
if($I-1< $PAGE_COUNT)
{
?>
<a class="A1" href="index.php?CUR_PAGE=<?=$I?>">下<?=$PAGES?>页</a>
<?
}
if($CUR_PAGE-1>=1)
{
?>
<a class="A1" href="index.php?CUR_PAGE=<?=$CUR_PAGE-1?>">上一页</a>
<?
}
else
{
?>
上一页
<?
}
if($CUR_PAGE+1<= $PAGE_COUNT)
{
?>
<a class="A1" href="index.php?CUR_PAGE=<?=$CUR_PAGE+1?>">下一页</a>
<?
}
else
{
?>
下一页
<?
}
?>
</td>
</tr>
</table>
<table class="TableList" width="100%" align="center">
<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" width="6%">操 作</td>
</tr>
<?
//============================ 显示图书管理员直接登记的图书 =======================================
$query = "SELECT * from BOOK_MANAGE where BOOK_STATUS='0' and STATUS='1' and REG_FLAG='1' and RUSER_ID='$LOGIN_USER_ID'order by RETURN_DATE desc";
$cursor= exequery($connection,$query);
$BORROW_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$BORROW_COUNT++;
if($BORROW_COUNT<$CUR_PAGE*$PER_PAGE-$PER_PAGE+1)
continue;
if($BORROW_COUNT>$CUR_PAGE*$PER_PAGE)
break;
$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"];
$query1="select * from USER where USER_ID='$BUSER_ID'";
$cursor1= exequery($connection,$query1);
while($ROW=mysql_fetch_array($cursor1))
$USER_NAME1=$ROW["USER_NAME"];
$query1="select * from USER where USER_ID='$RUSER_ID'";
$cursor1= exequery($connection,$query1);
while($ROW=mysql_fetch_array($cursor1))
$USER_NAME2=$ROW["USER_NAME"];
$query1="select * from BOOK_INFO where BOOK_NO='$BOOK_NO'";
$cursor1= exequery($connection,$query1);
while($ROW=mysql_fetch_array($cursor1))
$BOOK_NAME=$ROW["BOOK_NAME"];
if($BORROW_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td nowrap align="center"><?=$USER_NAME1?></td>
<td nowrap align="center"><?=$BOOK_NAME?></td>
<td nowrap align="center"><?=$BORROW_DATE?></td>
<td nowrap align="center"><?=$RETURN_DATE?></td>
<td nowrap align="center"><?=$USER_NAME2?></td>
<td nowrap align="center"><?=$BORROW_REMARK?></td>
<td nowrap align="center"><a href="manage.php?BORROW_ID=<?=$BORROW_ID?>&BOOK_NO=<?=$BOOK_NO?>&OP_FLAG=11">还书</a></td>
</tr>
<?
}//while
?>
</table>
<?
}
?>
<table border="0" width="95%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/book.gif" align="absmiddle"><span class="big3"> 借书确认</span>
</td>
</tr>
</table>
<?
$query1 = "SELECT * from BOOK_MANAGER where find_in_set('$LOGIN_USER_ID',MANAGER_ID)";
$cursor1= exequery($connection,$query1);
while($ROW=mysql_fetch_array($cursor1))
$MANAGE_DEPT_ID.=$ROW["MANAGE_DEPT_ID"];
$query = "SELECT * from BOOK_MANAGE where BOOK_STATUS='0' and STATUS='0' and REG_FLAG='0' order by BORROW_DATE desc";
$cursor= exequery($connection,$query);
$BORROW_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$BOOK_NO=$ROW["BOOK_NO"];
$query1 = "SELECT * from BOOK_INFO where BOOK_NO='$BOOK_NO'";
$cursor1= exequery($connection,$query1);
if($ROW1=mysql_fetch_array($cursor1))
$DEPT=$ROW1["DEPT"];
if(!find_id($MANAGE_DEPT_ID,$DEPT) && $MANAGE_DEPT_ID!="ALL_DEPT")
continue;
$BORROW_COUNT++;
if($BORROW_COUNT==1)
{
?>
<table class="TableList" width="100%" align="center">
<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" width="6%">操 作</td>
</tr>
<?
}
$BORROW_ID=$ROW["BORROW_ID"];
$BUSER_ID=$ROW["BUSER_ID"];
$BORROW_DATE=$ROW["BORROW_DATE"];
$BORROW_REMARK=$ROW["BORROW_REMARK"];
$RUSER_ID=$ROW["RUSER_ID"];
$RETURN_DATE=$ROW["RETURN_DATE"];
$query1="select * from USER where USER_ID='$BUSER_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$USER_NAME1=$ROW["USER_NAME"];
$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($BORROW_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td nowrap align="center"><?=$USER_NAME1?></td>
<td nowrap align="center"><?=$BOOK_NAME?></td>
<td nowrap align="center"><?=$BORROW_DATE?></td>
<td nowrap align="center"><?=$RETURN_DATE?></td>
<td nowrap align="center"><?=$USER_NAME2?></td>
<td nowrap align="center"><?=$BORROW_REMARK?></td>
<td nowrap align="center">
<a href="manage.php?BORROW_ID=<?=$BORROW_ID?>&BOOK_NO=<?=$BOOK_NO?>&OP_FLAG=21">同意</a>
<a href="manage.php?BORROW_ID=<?=$BORROW_ID?>&BOOK_NO=<?=$BOOK_NO?>&OP_FLAG=22">退回</a>
</td>
</tr>
<?
}//while
echo "</table>";
if($BORROW_COUNT==0)
Message("","没有借书确认记录");
?>
<table border="0" width="95%" cellspacing="0" cellpadding="3" class="small">
<tr>
<td class="Big"><img src="/images/menu/book.gif" align="absmiddle"><span class="big3"> 还书确认</span>
</td>
</tr>
</table>
<?
$query = "SELECT * from BOOK_MANAGE where BOOK_STATUS='1' and STATUS='0' and REG_FLAG='0' order by RETURN_DATE desc";
$cursor= exequery($connection,$query);
$BORROW_COUNT=0;
while($ROW=mysql_fetch_array($cursor))
{
$BOOK_NO=$ROW["BOOK_NO"];
$query1 = "SELECT * from BOOK_INFO where BOOK_NO='$BOOK_NO'";
$cursor1= exequery($connection,$query1);
if($ROW1=mysql_fetch_array($cursor1))
$DEPT=$ROW1["DEPT"];
if(!find_id($MANAGE_DEPT_ID,$DEPT) && $MANAGE_DEPT_ID!="ALL_DEPT")
continue;
$BORROW_COUNT++;
if($BORROW_COUNT==1)
{
?>
<table class="TableList" width="100%" align="center">
<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" width="6%">操 作</td>
</tr>
<?
}
$BORROW_ID=$ROW["BORROW_ID"];
$BUSER_ID=$ROW["BUSER_ID"];
$BORROW_DATE=$ROW["BORROW_DATE"];
$BORROW_REMARK=$ROW["BORROW_REMARK"];
$RUSER_ID=$ROW["RUSER_ID"];
$RETURN_DATE=$ROW["RETURN_DATE"];
$query1="select * from USER where USER_ID='$BUSER_ID'";
$cursor1= exequery($connection,$query1);
if($ROW=mysql_fetch_array($cursor1))
$USER_NAME1=$ROW["USER_NAME"];
$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($BORROW_COUNT%2==1)
$TableLine="TableLine1";
else
$TableLine="TableLine2";
?>
<tr class="<?=$TableLine?>">
<td nowrap align="center"><?=$USER_NAME1?></td>
<td nowrap align="center"><?=$BOOK_NAME?></td>
<td nowrap align="center"><?=$BORROW_DATE?></td>
<td nowrap align="center"><?=$RETURN_DATE?></td>
<td nowrap align="center"><?=$USER_NAME2?></td>
<td nowrap align="center"><?=$BORROW_REMARK?></td>
<td nowrap align="center">
<a href="manage.php?BORROW_ID=<?=$BORROW_ID?>&BOOK_NO=<?=$BOOK_NO?>&OP_FLAG=31">同意</a>
<a href="manage.php?BORROW_ID=<?=$BORROW_ID?>&BOOK_NO=<?=$BOOK_NO?>&OP_FLAG=32">退回</a>
</td>
</tr>
<?
}//while
echo "</table>";
if($BORROW_COUNT==0)
Message("","没有还书确认记录");
?>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -