?? infoquery2.asp
字號(hào):
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="StudentConn.asp" -->
<%
Dim Recordset1__MMColParam, strStudentNum, strName, strClass
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING
strStudentNum= Request("StudentNum")
strName=Request("Name")
strGrade=Request("GradeID")
strClass=Request("ClassID")
if Request.QueryString<>"" then Session("strQureyString")=Request.QueryString
if Request.Form<>"" then Session("strQureyString")=Request.Form
if strStudentNum <> "" then
Recordset1__MMColParam =strStudentNum
Recordset1.Source = "SELECT * FROM StudentInfo WHERE StudentNum like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
else
if strName<>"" then
Recordset1__MMColParam =strName
Recordset1.Source = "SELECT * FROM StudentInfo WHERE Name like '%" & Recordset1__MMColParam & "%' ORDER BY StudentNum"
else
if strClass<>"" and strGrade<>"" then
if strClass="All" then strClass=""
Recordset1__MMColParam =strClass
Recordset1__Grade=strGrade
Recordset1.Source = "SELECT * FROM StudentInfo WHERE ClassID like '%" & Recordset1__MMColParam & "%' and GradeID like '%" & Recordset1__Grade &"%' ORDER BY StudentNum"
end if
end if
end if
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
Recordset1_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
Recordset1_numRows = Recordset1_numRows + Repeat1__numRows
%>
<%
MM_removeList = "&index="
If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "="
MM_keepURL="":MM_keepForm="":MM_keepBoth="":MM_keepNone=""
For Each Item In Request.QueryString
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepURL = MM_keepURL & NextItem & Server.URLencode(Request.QueryString(Item))
End If
Next
For Each Item In Request.Form
NextItem = "&" & Item & "="
If (InStr(1,MM_removeList,NextItem,1) = 0) Then
MM_keepForm = MM_keepForm & NextItem & Server.URLencode(Request.Form(Item))
End If
Next
MM_keepBoth = MM_keepURL & MM_keepForm
if (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
if (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
if (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1)
Function MM_joinChar(firstItem)
If (firstItem <> "") Then
MM_joinChar = "&"
Else
MM_joinChar = ""
End If
End Function
%>
<%
Dim Recordset1_total
Dim Recordset1_first
Dim Recordset1_last
Recordset1_total = Recordset1.RecordCount
If (Recordset1_numRows < 0) Then
Recordset1_numRows = Recordset1_total
Elseif (Recordset1_numRows = 0) Then
Recordset1_numRows = 1
End If
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_total <> -1) Then
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
If (Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
End If
%>
<%
If (Recordset1_total = -1) Then
Recordset1_total=0
While (Not Recordset1.EOF)
Recordset1_total = Recordset1_total + 1
Recordset1.MoveNext
Wend
If (Recordset1.CursorType > 0) Then
Recordset1.MoveFirst
Else
Recordset1.Requery
End If
If (Recordset1_numRows < 0 Or Recordset1_numRows > Recordset1_total) Then
Recordset1_numRows = Recordset1_total
End If
Recordset1_first = 1
Recordset1_last = Recordset1_first + Recordset1_numRows - 1
If (Recordset1_first > Recordset1_total) Then
Recordset1_first = Recordset1_total
End If
If (Recordset1_last > Recordset1_total) Then
Recordset1_last = Recordset1_total
End If
End If
%>
<%
Dim Recordset2
Set Recordset2=Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection=MM_StudentConn_STRING
if not Recordset1.eof Then
Recordset2.Source="Select * from Class Where ClassID='" & Recordset1("ClassID") & "' and GradeID='" & Recordset1("GradeID") & "'"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 3
Recordset2.LockType = 3
Recordset2.Open()
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE>修改/刪除人員信息</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<META content="MSHTML 6.00.2600.0" Name=GENERATOR>
<link rel="stylesheet" href="home.css" type="text/css">
<SCRIPT language=javascript>
function unselectall()
{
if(document.del.chkAll.checked){
document.del.chkAll.checked = document.del.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != 'chkAll')
e.checked = form.chkAll.checked;
}
}
function ConfirmDel()
{
if(confirm("確定要?jiǎng)h除選中的記錄嗎?一旦刪除將不能恢復(fù)!"))
return true;
else
return false;
}
</SCRIPT>
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=0 topMargin=0>
<!--#include file="InfoManage_Top.asp"-->
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TR>
<TD align="center" valign="top" bgcolor="#F7f7ff">
<% If Recordset1.EOF And Recordset1.BOF Then %>
<div align="center"> <br>
<BR>
<BR>
<BR>
<font color="#FF3399">
<% flgDel=Session("txtDel")
if flgDel<>"" then %>
記錄已成功刪除!
<% else %>
抱歉!找不到您所尋找的人員記錄!
<% end if %>
</font><BR>
<BR>
<BR>
<BR>
</div>
<% End If %>
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<form Name="del" onSubmit="return ConfirmDel()" method="post" action="InfoDel2.asp">
<span class="title">修改或刪除條件:</span><font color="#FF0000"><b><br>
</b></font>
<%
if Request("StudentNum")<>"" then
response.write "編號(hào)中含有“" & strStudentNum & "”"
elseif strName<>"" then
response.write "姓名中含有“" & strName & "”"
else
if strClass<>"" then response.write strClass
end if
%>
共找到 <font color="#FF0000"><%=(Recordset1_total)%></font> 條記錄!
<table cellspacing=1 width="100%" border=1 cellpadding="1" bordercolor="#CCCCFF" align="center" style="border-collapse:collapse">
<tr align="center" valign="middle" bordercolor="#FFCC00">
<td nowrap><font color="#000000">是否刪除</font></td>
<td nowrap><font color="#000000">編號(hào)</font></td>
<td nowrap><font color="#000000">姓名</font></td>
<td nowrap><font color="#000000">政治面貌</font></td>
<td nowrap><font color="#000000">科室</font></td>
<td nowrap><font color="#000000">身份證號(hào)</font></td>
<td width="60" nowrap><font color="#000000">操作</font></td>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT Recordset1.EOF))
%>
<%
txtStudentNum=Recordset1.Fields.Item("StudentNum").Value & ""
txtName=replace(Recordset1.Fields.Item("Name").Value & ""," "," ")
if txtName="" then txtName=" "
txtPolitics=replace(Recordset1.Fields.Item("politics").Value & ""," "," ")
if txtPolitics="" then txtPolitics=" "
txtClassName=replace(Recordset2("ClassName") & ""," "," ")
if txtClassName="" then txtClassName=" "
txtTelnum=replace(Recordset1.Fields.Item("TelNum").Value & ""," "," ")
if txtTelnum="" then txtTelnum=" "
%>
<tr>
<td height="20" align="center"><input type="checkbox" value="<%= (Recordset1.Fields.Item("StudentNum").Value) %>" onclick=unselectall() Name="chkNum"></td>
<td height="20" align="center" nowrap><%=txtStudentNum%></td>
<td height="20" align="center" nowrap><%=txtName%></td>
<td height="20" align="center" nowrap><%=txtPolitics%></td>
<td height="20" align="center" nowrap><%=txtClassName%></td>
<td height="20" align="center" nowrap><%=txtTelnum%></td>
<td height="20" align="center"><a href="InfoModify.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "StudentNum=" & Recordset1.Fields.Item("StudentNum").Value %>">修改</a> <a href="InfoDel.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "StudentNum=" & Recordset1.Fields.Item("StudentNum").Value %>">刪除</a></td>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
Recordset1.MoveNext()
Wend
%>
</table>
<br>
<table border="1" style="border-collapse:collapse"cellspacing="0" cellpadding="0" align="center">
<tr>
<td align="center"> <input type="checkbox" Name="chkAll" value="1" onclick=CheckAll(this.form)>
全部選定 <input type="submit" Name="Submit" value="刪除選定的記錄"> </td>
</tr>
</table>
</form>
<% End If %>
</TD>
</TR>
</TBODY>
</TABLE>
<table width="760" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<Iframe src="CopyRight.asp" width="760" height="100" marginheight="0" marginwidth="0" scrolling="NO" frameborder="0" name="CopyRight"></iframe>
</td>
</tr>
</table></BODY>
</HTML>
<%
Recordset1.Close()
%>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -