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

📄 querybook.asp

📁 asp图书馆管理系统的一个源代码
💻 ASP
字号:
<% 
UserName=trim(cstr(request.form("UserName")))
%>


<html>
<head>
<title>QueryBook</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<LINK REL="stylesheet" TYPE="text/css" HREF="globe/style.css">


<script language="VBScript">
function submit_onclick()
dim  name
name=trim(form.UserName.value)
if name="" then
            alert("同学,你填空的,算什么呀?")
			form.UserName.focus()
			submit_onclick=false
						else
			submit_onclick=true
			end if
end function
</script>

</head>
<body bgcolor="#ccddff">

<form name="form" method="post"  action="QueryBook.asp">
<div id="Layer1" style="position:absolute; left:12px; top:9px; width:583px; height:30px; z-index:1"> 
  <table width="101%" border="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellspacing="0" height="22">
    <tr> 
      <td colspan="2"> <font color="#339933" size="4"><p>按推荐人的姓名查询:</p></font></td>
      <td width="46%"> 
        <input type="text" name="Username" size="30" >
      </td>
      <td width="20%">   
        <input type="submit" name="Submit" value="查 询">
      </td>
    </tr>
  </table>
</div></form>

<!--#include file="globe/DataConnect.asp"-->
<%
if  UserName <> "" then
 set rs=server.createobject("adodb.recordset")
 sql="select * from Book where UserName='"&UserName&"'"
 rs.open sql,cnn,1,1
 
if rs.recordcount>0   then
response.write "<div id='layer2' style='position:absolute;top:40pt;left:10pt;'>"
response.write "<table  style='font-family:宋体;font-size:11pt' bgColor=#ffffff border=1 borderColor=#000000 borderColorDark=#ffffff borderColorLight=#000000 cellSpacing=0>"
response.write "<TBODY><TR>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=20  width=280><center><font color=#3366CC'>书籍名称</font></center></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=20  width=80><center><font color=#3366CC'>推荐人</font></center></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=20  width=60><center><font color=#3366CC'>点击数</font></center></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=20  width=160><center><font color=#3366CC'>推荐时间</font></center></td></tr>"


do while Not rs.EOF
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=25  width=280>"
BookName=rs("BookName")
DTime=rs("DTime")
UserName=rs("UserName")
ClickNum=rs("ClickNum")
ID=rs("ID")
response.write "<a href='ViewBook.asp?ID="&ID&"'>"&BookName&"</a></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=25  width=80>"
response.write "<center><font color=#0099CC>"&UserName&"</font></center></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=25 width=60>"
response.write "<center><font color=red>"&ClickNum&"</font></center></td>"
response.write "<TD bgColor=#ccddff borderColor=#000000 borderColorDark=#ffffff   borderColorLight=#000000 height=25  width=160>"
response.write "<center>"&DTime&"</center></td></tr>"
rs.movenext
loop

response.write "</tbody></table></div>"

else
response.write "<div id='Layer1' style='position:absolute; left:12px; top:100px; width:583px; height:36px; z-index:1'>对不起,数据库中没有你需要的资料。</div>" 
end if

rs.close
set rs = Nothing: set sql = Nothing
end if
%>

<!--#include file="globe/DataClose.asp"-->
</body>
</html>

⌨️ 快捷键说明

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