⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bookinfo.asp

📁 === === === === === === === === === 项目:图书管理系统V2.0 作者:覃武权 主页:http://cpucool.512j.com 邮箱:cooltoend
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<!--#include file="global.asp" -->
<% checkUser("user") %>
<% 
If Session("userright")="admin" And Request("cardno")="" Then
	showMsg "管理员没有借书记录"
End If 

Dim Recordset1__MMColParam
If Session("userright")="admin" Then
	Recordset1__MMColParam = Request("cardno")
Else
	Recordset1__MMColParam = Session("cardno")
End If

Dim Recordset1
Dim Recordset1_numRows

Set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_conn_STRING
Recordset1.Source = "SELECT name,loannum FROM Borrowers WHERE cardno = " + Replace(Recordset1__MMColParam, "'", "''") + ""
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 1
Recordset1.Open()

Recordset1_numRows = 0
%>
<%
Dim Recordset2
Dim Recordset2_numRows

Set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_conn_STRING
Recordset2.Source = "SELECT * FROM Loans WHERE cardno = " + Replace(Recordset1__MMColParam, "'", "''") + " ORDER BY date DESC"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 1
Recordset2.Open()

Recordset2_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index

Repeat1__numRows = -1
Repeat1__index = 0
Recordset2_numRows = Recordset2_numRows + Repeat1__numRows
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>个人信息</title>
<link href="images/style.css" rel="stylesheet" type="text/css">
</head>

<body>
<p align="center">&nbsp;</p>
<table width="97%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#FFFFFF">
  <tr>
    <td><br>
<table cellspacing=0 cellpadding=0 border=0 width=95% align=center>
  <tr class=multi>
    <td></td>
  </tr>
  <tr>
    <td bgcolor=#666666> <table border=0 cellspacing=1 cellpadding=4 width=100%>
        <tr class=header> 
          <td colspan=6><img src=images/flag.gif align=absmiddle width=16 height=16><strong> 
            <%=(Recordset1.Fields.Item("name").Value)%>的个人借书情况如下</strong></td>
        </tr>
        <tr> 
          <td bgcolor=#F8F8F8 colspan=6> <table width=95% border=0 align="center" cellspacing=1>
              <tr> 
                <td width=90% valign=top nowrap>已经借阅图书<%=(Recordset1.Fields.Item("loannum").Value)%>册,还可以借<%=maxLoanNumber-(Recordset1.Fields.Item("loannum").Value)%>册,详细信息如下:</td>
              </tr>
            </table>
            <p><b><font color=#FF0000></font></b></td>
        </tr>
        <tr class=header align=center> 
          <td></td>
          <td><b><font color="#FFFFFF">图书编号</font></b></td>
          <td><b><font color="#FFFFFF">图书类别</font></b></td>
          <td><b><font color="#FFFFFF">书名</font></b></td>
          <td><font color="#FFFFFF">借阅时间</font></td>
          <td><font color="#FFFFFF">期限</font></td>
        </tr>
		  <% While ((Repeat1__numRows <> 0) AND (NOT Recordset2.EOF))
  Dim keepDays
  keepDays = maxLoanKeepDays - DateDiff("d",Recordset2.Fields.Item("date").Value,now())
  if keepDays<0 then keepDays="<font color=red>超期"&ABS(keepDays)&"天</font>"
  %>
        <tr align=center> 
          <td bgcolor=#FFFFFF width=20 nowrap><img border=0 src=images/flag.gif width=16 height=16></td>
          <td bgcolor=#F8F8F8><font color="#000000"><%=(Recordset2.Fields.Item("bookno").Value)%></font></td>
          <td bgcolor=#FFFFFF><font color="#000000"><%=(Recordset2.Fields.Item("cardno").Value)%></font></td>
          <td bgcolor=#F8F8F8><font color="#000000"><%=(Recordset2.Fields.Item("title").Value)%></font></td>
          <td bgcolor=#FFFFFF><font color="#000000"><%=(Recordset2.Fields.Item("date").Value)%></font></td>
          <td bgcolor=#F8F8F8><%= keepDays %></td>
        </tr>
		  <% 
  Repeat1__index=Repeat1__index+1
  Repeat1__numRows=Repeat1__numRows-1
  Recordset2.MoveNext()
Wend
%>
      </table></td>
  </tr>
  <tr> 
    <td></td>
  </tr>
</table>
<p>&nbsp;</p>
</td>
</tr>
</table>
</body>
</html>
<%
Recordset1.Close()
Set Recordset1 = Nothing
%>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -