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

📄 index.asp

📁 本程序是一款比较完善的图书租赁系统
💻 ASP
字号:
<!--#include file="CONN.ASP"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name=vs_targetSchema content="http://schemas.microsoft.com/intellisense/ie5">
<link href="style.css" rel="stylesheet" type="text/css">
<title>影片租赁系统</title>
<script language="javascript" src="JS\inc.js"></script>
</head>
<body>
<!--插入通用的Html头模板-->
<!--#include file="head.asp"-->
<%
<!--测试-->
FindMovie=Request("FindMovie")
FindMovie=Replace(FindMovie,"'","")

'判断用户是否查找电影
If FindMovie<>"" Then
	'如果返回的查找电影名称的字符串非空,则根据用户的输入查找电影名称
	'如果返回的是数字,则根据电影ID查找
	If IsNumeric(FindMovie) Then
		strSQL="SELECT * FROM [VideoInfo] WHERE VI_ID_N="&FindMovie
	Else
		Select Case Request("FindType")
			Case "Title" 
				strSQL="SELECT * FROM [VideoInfo] WHERE VI_Title_S LIKE '%"&FindMovie&"%'"
			Case "Director"
				strSQL="SELECT * FROM [VideoInfo] WHERE VI_Director_S LIKE '%"&FindMovie&"%'"
			Case "Playactor"
				strSQL="SELECT * FROM [VideoInfo] WHERE VI_Playactor_S LIKE '%"&FindMovie&"%'"
			Case "Issuer"
				strSQL="SELECT * FROM [VideoInfo] WHERE VI_Issuer_S LIKE '%"&FindMovie&"%'"
			Case Else
				strSQL="SELECT * FROM [VideoInfo] WHERE VI_Title_S LIKE '%"&FindMovie&"%'"
		End Select
	End If
	'判断用户是否在特定的区域浏览电影
	If IsNumeric(Request("ViewArea")) AND Request("ViewArea")<>0 Then
		strSQL=strSQL&" AND VI_VS_ID_FN="&Request("ViewArea")
	End If
Else
	strSQL="SELECT * FROM [VideoInfo] ORDER BY VI_AddTime_D DESC"
	If IsNumeric(Request("ViewArea")) AND Request("ViewArea")<>0 Then
		strSQL="SELECT * FROM [VideoInfo] WHERE VI_VS_ID_FN="&Request("ViewArea")&" ORDER BY VI_AddTime_D DESC"
	End If
End If

Set objRS=Server.CreateObject("ADODB.RecordSet")
objRS.PageSize=3
objRS.Open strSQL,objConn,1,3

'如果从数据库中没有读取到任何电影的信息,则返回信息
If objRS.BOF Or objRS.EOF Then
	Response.Write "<table width=97% ><tr><td align=center>没有找到要查找的影片![<a href=javascript:history.go(-1)>返回</a>]</td></tr></table>"
	Response.Write strSQL&"<br>"
	Response.Write Request("FindType")
	Response.End
End If

Response.Write "<form method=Get name=MyForm>"
Response.Write "<table class=tableborder1 align=center  cellspacing=1 cellpadding=3 width=97% height=25% >"
Response.Write "<tr><th colspan=2 id=tabletitlelink height=25 style=font-weight:normal align=left>浏览电影:</th></tr>"
Response.Write "<tr><td class=TableBody2 colspan=2 align=right>"
%>
<!--#include file="ChangePage.asp"-->
<%
Call ChangePage("index.asp")
Response.Write "&nbsp;&nbsp;&nbsp;查找影片:<input type=text maxlength=20 name=FindMovie class=inputarea>&nbsp;"
Response.Write "<select case name=FindType>"
Response.Write "<option value=Title>名称</option><option value=Director>导演</option><option value=Playactor>演员</option><option value=Issuer>发行商</option>"
Response.Write "</select>"
Response.Write "&nbsp;<input class=inputarea type=submit value=查找>"
Response.Write "&nbsp;共<b>"&ObjRS.RecordCount&"</b>部电影<br>"
Response.Write "</td></tr>"
'读取指定页面容量的内容
For i=1 to objRS.PageSize
	Response.Write "<tr><td class=TableBody1 width=120 rowspan=3 align=cenetr><a href=dispmovie.asp?id="&objRS("VI_ID_N")&"><img src="&objRS("VI_Img_S")&" height=160 width=120 border=0></a></td>"
	Response.Write "<td class=tablebody2 width=650 height=17 align=center><a href=dispmovie.asp?id="&objRS("VI_ID_N")&">"&objRS("VI_Title_S")&"(ID:"&objRS("VI_ID_N")&")</td></tr>"
	Response.Write "<tr><td class=TableBody1 height=71><b>内容:</b>"&Left(objRS("VI_Content_S"),100)&"……"&_
						"<br><br><b>导演:</b>"&objRS("VI_Director_S")&"&nbsp;&nbsp;&nbsp;<b>演员:</b>"&objRS("VI_PlayActor_S")&_
						"<br><b>发行商:</b>"&objRS("VI_Issuer_S")&"&nbsp;&nbsp;&nbsp;<b>评价:</b>"&objRS("VI_Rank_N")&"</td></tr>"
	Response.Write "<tr><td class=TableBody1 height=17 align=right>状态:"&_
						"浏览"&objRS("VI_Count_N")&"次/出租"&objRS("VI_RentCount_N")&"次&nbsp;"
	'利用Select Case判断影片的状态
	Select Case objRS("VI_Status_N")
		Case 1
			Response.Write "待租"
		Case 2
			Response.Write "<i>未发行</i>"
		Case 3
			Response.Write "<b>已出租</b>"
		Case 4
			Response.Write "<font color=red>被预定</font>"
	End Select		
	Response.Write "</td></tr>"
	objRS.MoveNext
	'如果记录已到末尾则退出循环
	If objRS.EOF Then Exit For
Next
Response.Write "</table>"
Response.Write "</form>"
objRS.Close
</--测试-->
%>
<!--插入通用的Html末尾-->
<!--#include file="bottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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