📄 listcourse.asp
字号:
<!-- #include file="utility/checkAdmin.asp" -->
<%
'****************************************
'目的: 列表显示所有课程信息
'开始时间: 2005-6-2 21:22
'最后修改时间: 2005-6-3 8:17
'编写人: 某某某
'****************************************
dim sql
dim rs
dim cName
dim cNameIS '课程名匹配
dim cAddress
dim cAddressIS '地址匹配
dim tName
dim tNameIS '教师名匹配
dim cTime
dim cTimeIS '上课时间匹配
cName = Trim(Request.Form("cName"))
cNameIS = Trim(Request.Form("cNameIS"))
cAddress = Trim(Request.Form("cAddress"))
cAddressIS = Trim(Request.Form("cAddressIS"))
tName = Trim(Request.Form("tName"))
tNameIS = Trim(Request.Form("tNameIS"))
cTime = Trim(Request.Form("cTime"))
cTimeIS = Trim(Request.Form("cTimeIS"))
sql = "select course.*,teacher.tName from course,teacher"
sql = sql & " where course.tID = teacher.ID "
'按照课程名查询
if(cName <> "") then
if(cNameIS <> "") then
sql = sql & "and course.cName = '" & cName & "' "
else
sql = sql & "and course.cName like '%" & cName & "%' "
end if
end if
'按照上课地点查询
if(cAddress <> "") then
if(cAddressIS <> "") then
sql = sql & "and course.cAddress = '" & cAddress & "' "
else
sql = sql & "and course.cAddress like '%" & cAddress & "%' "
end if
end if
'按照上课时间查询
if(cTime <> "") then
if(cTimeIS <> "") then
sql = sql & "and course.cTime = '" & cTime & "' "
else
sql = sql & "and course.cTime like '%" & cTime & "%' "
end if
end if
'按照教师名称查询
if(tName <> "") then
if(tNameIS <> "") then
sql = sql & "and teacher.tName = '" & tName & "' "
else
sql = sql & "and teacher.tName like '%" & tName & "%' "
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>已发信息列表</title>
<link rel="stylesheet" type="text/css" href="images/link.css">
</head>
<body>
<div align="center">
<table border="1" width="700" id="table2" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="22">
<tr>
<td valign="bottom"> 当前操作: 课程列表</td>
</tr>
</table>
<br>
<%
'循环显示表格开始
set rs = ExecuteQuery(sql)
if(rs.EOF) then
Alert("暂时没有任何数据,请返回执行其他操作!")
GoBack()
Response.end
end if
do while(not rs.EOF)
%>
<table border="1" width="700" id="table1" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="65" bordercolor="#CCCCCC">
<tr>
<td width="70" height="21" align="right" bgcolor="#F2F2F2">课程名称:</td>
<td height="21" width="261"> <%=rs("cName")%></td>
<td height="21" width="99" align="right" bgcolor="#F2F2F2">任课教师:</td>
<td height="21" width="265"> <%=rs("tName")%></td>
</tr>
<tr>
<td width="70" align="right" height="21" bgcolor="#F2F2F2">上课时间:</td>
<td height="21" width="261"> <%=rs("cTime")%></td>
<td height="21" width="99" align="right" bgcolor="#F2F2F2">上课地点:</td>
<td height="21" width="265"> <%=rs("cAddress")%></td>
</tr>
<tr>
<td width="70" align="right" height="21" bgcolor="#F2F2F2">课程时间:</td>
<td height="21" width="261"> <%=rs("cStartTime")%> 到 <%=rs("cEndTime")%></td>
<td height="21" width="99" align="right" bgcolor="#F2F2F2">学分:</td>
<td height="21" width="265"> <%=rs("cCredit")%></td>
</tr>
</table>
<br>
<%
'循环显示表格结束
rs.MoveNext()
loop
rs.close()
set rs = nothing
%>
<table border="1" width="700" id="table4" cellspacing="0" cellpadding="0" style="border-collapse: collapse" height="103">
<tr>
<td valign="bottom" height="19" bgcolor="#F2F2F2" colspan="4"> 搜索面板:</td>
</tr>
<tr>
<td valign="middle" height="8" colspan="4"></td>
</tr>
<form action=listCourse.asp method=post>
<tr>
<td valign="bottom" height="22" width="70" align="right" bgcolor="#F2F2F2">
课程名:</td>
<td valign="bottom" height="22" width="264"> <input type="text" name="cName" class="inputTextShort" size="20" > <input type="checkbox" name="cNameIS" value="精确匹配" id="fp1"><label for="fp1">精确匹配</label></td>
<td valign="bottom" height="22" width="95" align="right" bgcolor="#F2F2F2">上课地点:</td>
<td valign="bottom" height="22" width="264"> <input type="text" name="cAddress" size="20" class="inputTextShort" > <input type="checkbox" name="cAddressIS" value="精确匹配" id="fp4"><label for="fp4">精确匹配</label> </td>
</tr>
<tr>
<td valign="bottom" width="70" align="right" height="23" bgcolor="#F2F2F2">
教师名:</td>
<td valign="bottom" width="264" height="23"> <input type="text" name="tName" size="20" class="inputTextShort" > <input type="checkbox" name="tNameIS" value="精确匹配" id="fp2"><label for="fp2">精确匹配</label></td>
<td valign="bottom" width="95" height="23" align="right" bgcolor="#F2F2F2">上课时间:</td>
<td valign="bottom" width="264" height="23"> <input type="text" name="cTime" size="20" class="inputTextShort" > <input type="checkbox" name="cTimeIS" value="精确匹配" id="fp5"><label for="fp5">精确匹配</label></td>
</tr>
<tr>
<td valign="bottom" width="70" align="right" height="24" bgcolor="#F2F2F2"> </td>
<td valign="middle" width="627" height="24" colspan="3"> <input type=submit value="确定查询" name="OK" class="anniu">
<input type=reset value="重新填写" name="cancel" class="anniu"></td>
</tr>
</form>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -