?? scorequery2.asp
字號:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="StudentConn.asp" -->
<%
if Request.QueryString<>"" then Session("strQureyString")=Request.QueryString
if Request.Form<>"" then Session("strQureyString")=Request.Form
Dim rsTestName__MMColParam,rsScore__MMColParam
Dim strSheetName, strStudentNum, strName, strGrade, strClass,strSubjects
strSheetName = Request("SheetName")
rsTestName__MMColParam = Request("SheetName")
Session("txtSheetName")=Request("SheetName")
set rsSubjects = Server.CreateObject("ADODB.Recordset")
rsSubjects.ActiveConnection = MM_StudentConn_STRING
rsSubjects.Source = "SELECT Top 1 * FROM " & strSheetName
rsSubjects.CursorType = 0
rsSubjects.CursorLocation = 2
rsSubjects.LockType = 3
rsSubjects.Open()
rsSubjects_numRows = 0
strSubjects=strSheetName & "." & rsSubjects.Fields.Item(4).Name
for i=5 to rsSubjects.Fields.Count-1
strSubjects = strSubjects & "," & strSheetName & "." & rsSubjects.Fields.Item(i).Name
next
%>
<%
set rsTestName = Server.CreateObject("ADODB.Recordset")
rsTestName.ActiveConnection = MM_StudentConn_STRING
rsTestName.Source = "SELECT SheetName, TestName FROM TestName WHERE SheetName = '" + Replace(rsTestName__MMColParam, "'", "''") + "'"
rsTestName.CursorType = 0
rsTestName.CursorLocation = 2
rsTestName.LockType = 3
rsTestName.Open()
rsTestName_numRows = 0
%>
<%
strStudentNum= Request("StudentNum")
strName=Request("Name")
strClass=Request("ClassID")
set rsScore = Server.CreateObject("ADODB.Recordset")
rsScore.ActiveConnection = MM_StudentConn_STRING
strSQL = "Select " & strSheetName & ".StudentNum, StudentInfo.Name, " & strSubjects & " From " & strSheetName
strSQL = strSQL & " LEFT JOIN StudentInfo ON " & strSheetName & ".StudentNum = StudentInfo.StudentNum"
if (strStudentNum <> "") then
strSQL = strSQL & " Where " & strSheetName & ".StudentNum Like '%" & strStudentNum & "%'"
elseif (strName<>"") then
strSQL = strSQL & " Where StudentInfo.Name Like '%" & strName & "%'"
else
if strClass="All" then strClass=""
strSQL = strSQL & " Where StudentInfo.ClassName Like '%" & strClass & "%'"
end if
strSQL = strSQL & " ORDER BY " & strSheetName & ".StudentNum"
rsScore.Source = strSQL
rsScore.CursorType = 0
rsScore.CursorLocation = 2
rsScore.LockType = 3
rsScore.Open()
rsScore_numRows = 0
%>
<%
Dim Repeat1__numRows
Repeat1__numRows = -1
Dim Repeat1__index
Repeat1__index = 0
rsScore_numRows = rsScore_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
%>
<!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 href="home.css" rel="stylesheet" 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("確定要刪除選中的記錄嗎?一旦刪除將不能恢復!"))
return true;
else
return false;
}
</SCRIPT>
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=0 topMargin=0>
<!--#include file="ScoreManage_Top.asp"-->
<TABLE cellSpacing=0 cellPadding=0 width=760 align=center border=0>
<TR>
<TD align="center" bgcolor="#F7f7ff"><% If Not rsScore.EOF Or Not rsScore.BOF Then %>
<form Name="del" onSubmit="return ConfirmDel()" method="post" action="ScoreDel2.asp"><br><br>
<b><font color="#FF0000">月庫名稱:</font></b> <%=(rsTestName.Fields.Item("TestName").Value)%>
<font color="#FF0000"><b>查詢條件:</b></font>
<%
if Request("StudentNum")<>"" then
response.write "編號中含有“" & strStudentNum & "”"
elseif strName<>"" then
response.write "姓名中含有“" & strName & "”"
else
if strClass<>"" then response.write strClass
end if
%><br><br>
<table cellspacing=0 width="100%" border=1 cellpadding="0" bordercolor="#CCCCFF" style="border-collapse:collapse">
<tr align="center" valign="middle" class="littletitle">
<td height="28"><font color="#000000">是否刪除</font></td>
<td height="28"><font color="#000000">操作</font></td>
<td><font color="#000000">編 號</font></td>
<td><font color="#000000">姓 名</font></td>
<%
for i=2 to rsScore.Fields.Count-1
Response.Write "<td height='28'><font color='#000000'>" & rsScore.Fields.Item(i).Name & "</font></td>"
next
%>
</tr>
<%
While ((Repeat1__numRows <> 0) AND (NOT rsScore.EOF))
%>
<tr align="center" valign="middle">
<td height="20"><input type="checkbox" value="<%= (rsScore.Fields.Item("StudentNum").Value) %>" onClick=unselectall() Name="chkNum"></td>
<td class="input_txt" width="20">
<A HREF="ScoreModify.asp?SheetName=<%=strSheetName%>&StudentNum=<%=(rsScore.Fields.Item("StudentNum").Value)%>">修改</A>
|<A HREF="ScoreDel.asp?sheetName=<%=strSheetName%>&StudentNum=<%=(rsScore.Fields.Item("StudentNum").Value)%>">刪除</A></td>
<%
for i=0 to rsScore.Fields.Count-1
tmpScore=rsScore.Fields.Item(i).Value
if tmpScore<>"" and i>1 then tmpScore=Round(tmpScore,2)
if IsNull(tmpScore) then tmpScore=" "
Response.Write "<td><textarea name='test_content' style='width:45;overflow-x:visible;overflow-y:visible;' class='input_txt'>" & tmpScore & "</textarea></td>"
next
%>
</tr>
<%
Repeat1__index=Repeat1__index+1
Repeat1__numRows=Repeat1__numRows-1
rsScore.MoveNext()
Wend
%>
</table><br>
<table border="0" style="border-collapse:collapse" cellspacing="0" cellpadding="0" align="center" bordercolor="#CCCCFF">
<tr>
<td width="100"><input type="checkbox" Name="chkAll" value="1" onClick=CheckAll(this.form)>全部選定</td>
<td><input name="SheetName" type="hidden" value="<%=Request("SheetName")%>"></td>
<td width="46"><input type="submit" Name="Submit" value="刪除選定的記錄"></td>
</tr>
</table><br><br></form>
<% else %><br><br><br>找不到符合條件的記錄!<br><br><br><% end if %>
</TD>
</TR>
</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>
<%
rsTestName.Close()
rsScore.Close()
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -