?? lock.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<link href="style.css" type="text/css" rel="stylesheet">
<!--#include file="conn.asp"-->
<%'想法:從loans表導出時間超期的數據 更改系統時間來實現超期~ 管理員驗證 分頁顯示 管理員發消息提醒還書
if session("usertype")<>"admin" then
response.write "<script>alert('不是管理員,請先登陸! ');window.location.href='go.asp'</script>"
end if
dim loan_time '現在時間和借書時間相差三十天則超期
loan_time = dateserial(year(date),month(date),day(date)-30)'轉換日期格式2007-3-31,函數參考topic.csdn.net
sql1="select * from loans"
set rs1=db.execute(sql1)
sql2="select book.bookname as b_name,book.booktype as booktype,* from loans,u ,book where loans.time < '"&loan_time&"' and u.id=loans.uid and book.id=loans.bid "
set rs2=db.execute(sql2)
%>
<%if rs2.eof then
response.write "現在沒有超期的"
else%>
<table width="666" border="1" align="center">
<tr>
<td>用戶id</td>
<td>用戶名</td>
<td>所借圖書</td>
<td>圖書所屬分類</td>
<td>超期時間</td>
<td>罰金</td>
<td>操作</td>
</tr>
<%do while not rs2.eof %>
<tr>
<td><%=rs2("uid")%></td>
<td><a href="my_borrow.asp?id=<%=rs2("uid")%>" title="查看<%=rs2("name")%>借書詳情" target="right"><%=rs2("name")%></a></td>
<td><%=rs2("b_name")%></td>
<td><%=rs2("booktype")%></td>
<td><%=datediff("d",rs2("time"),date())-30%>天</td>
<td><%=(datediff("d",rs2("time"),date())-30)*3%>元</td>
<td>
<%
qq="select * from u where id="&rs2("uid")&""
set q1=db.execute(qq)
if q1("lock") then
response.Write("該用戶已被鎖定")
else%>
<a href="user.asp?query=type_mod&mod=yes&id=<%=rs2("uid")%>&islock=True&name=<%=rs2("name")%>&pwd=<%=rs2("pwd")%>" target="right">鎖定</a>
<%end if%>
<a href="msg.asp?uid=<%=rs2("uid")%>&content=<%=rs2("name")%>,你借的{<%=rs2("b_name")%>}一書已經超期<%=datediff("d",rs2("time"),date())-30%>天了,每天的罰金是RMB3元咯" title="發消息提醒下咯">催書</a></td>
</tr>
<%rs2.movenext
loop%>
</table> <br> <div><a href="msg.asp?act=all_send_msg" target="right">群發消息</a>
<%end if%> <a href="index.asp" target="right">首頁</a>
<a href="javascript:history.go(-1)" target="right">返回</a>
</div>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -