📄 scoremodify.asp
字号:
<%@LANGUAGE="VBSCRIPT"%>
<!--#include file="StudentConn.asp" -->
<!--#include file="CheckLogin.asp"-->
<%
strSheetName = Request("SheetName")
if strSheetName<>"" then
strSheetName = Request("SheetName")
else
strSheetName = Request.QueryString("SheetName")
end if
strStudentNum = Request("StudentNum")
if strStudentNum<>"" then
strStudentNum = Request("StudentNum")
else
strStudentNum = Request.QueryString("StudentNum")
end if
%>
<%
MM_editAction = CStr(Request("URL"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Request.QueryString
End If
MM_abortEdit = false
MM_editQuery = ""
%>
<%
If (CStr(Request("MM_update")) <> "" And CStr(Request("StudentNum")) <> "") Then
MM_editConnection = MM_StudentConn_STRING
MM_editTable = strSheetName
MM_editColumn = "StudentNum"
MM_recordId = "'" + Request.Form("StudentNum") + "'"
MM_fieldsStr = request.form("Subject")
MM_columnsStr = replace(MM_fieldsStr,"value","',none,''")
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
total = 0
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(i+1) = CStr(Request.Form(MM_fields(i)))
if MM_fields(i+1)="" then MM_fields(i+1)="0"
total =total + MM_fields(i+1)
Next
End If
%>
<%
If (CStr(Request("MM_update")) <> "" And CStr(Request("StudentNum")) <> "") Then
MM_editQuery = "update " & MM_editTable & " set "
For i = LBound(MM_fields) To UBound(MM_fields) Step 2
FormVal = MM_fields(i+1)
MM_typeArray = Split(MM_columns(i+1),",")
Delim = MM_typeArray(0)
If (Delim = "none") Then Delim = ""
AltVal = MM_typeArray(1)
If (AltVal = "none") Then AltVal = ""
EmptyVal = MM_typeArray(2)
If (EmptyVal = "none") Then EmptyVal = ""
If (FormVal = "") Then
FormVal = EmptyVal
Else
If (AltVal <> "") Then
FormVal = AltVal
ElseIf (Delim = "'") Then
FormVal = "'" & Replace(FormVal,"'","''") & "'"
Else
FormVal = Delim + FormVal + Delim
End If
End If
If (i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(i) & " = " & FormVal
Next
' MM_editQuery = MM_editQuery & ",应发总数 = " & total
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
Response.Redirect("ScoreQuery2.asp?SheetName=" & strSheetName & "&StudentNum=" & strStudentNum)
End If
End If
%>
<%
set Recordset1 = Server.CreateObject("ADODB.Recordset")
Recordset1.ActiveConnection = MM_StudentConn_STRING
Recordset1.Source = "SELECT StudentNum, Name, ClassName FROM StudentInfo WHERE StudentNum = '" + Replace(strStudentNum, "'", "''") + "'"
Recordset1.CursorType = 0
Recordset1.CursorLocation = 2
Recordset1.LockType = 3
Recordset1.Open()
%>
<%
set Recordset2 = Server.CreateObject("ADODB.Recordset")
Recordset2.ActiveConnection = MM_StudentConn_STRING
Recordset2.Source = "SELECT SheetName, TestName FROM TestName WHERE SheetName = '" + Replace(strSheetName, "'", "''") + "'"
Recordset2.CursorType = 0
Recordset2.CursorLocation = 2
Recordset2.LockType = 3
Recordset2.Open()
%>
<%
set Recordset3 = Server.CreateObject("ADODB.Recordset")
Recordset3.ActiveConnection = MM_StudentConn_STRING
Recordset3.Source = "SELECT * FROM " & strSheetName & " WHERE StudentNum = '" + Replace(strStudentNum, "'", "''") + "'"
Recordset3.CursorType = 0
Recordset3.CursorLocation = 2
Recordset3.LockType = 3
Recordset3.Open()
%>
<!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">
</HEAD>
<BODY text=#000000 bgColor=#f7f7ff leftMargin=0 topMargin=0>
<!--#include file="ScoreManage_Top.asp"-->
<TABLE width="760" border=0 align="center" cellPadding=0 cellSpacing=0>
<TR>
<TD bgcolor="#F7f7ff">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<TD align="center" valign="top" bgcolor="f7f7ff">
<form action="ScoreModify.asp" method="post" name="form1">
<b><font color="#FF0000"><br><br>月库名称:</font></b><%=strSheetName%><br><br>
<table width="200" border=1 align="center" cellpadding="3" cellspacing=1 bordercolor="#CCCCFF" style="border-collapse:collapse">
<tr>
<td width=66 height="20" align=right bgcolor="#E8E8FF">编号:</td>
<td width=118 height="20" align=left bgcolor="#E8E8FF">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<%=(Recordset1.Fields.Item("StudentNum").Value)%>
<% End If %></td>
</tr>
<tr>
<td width=66 height="20" align=right bgcolor="#E8E8FF">姓名:</td>
<td width=118 height="20" align=left bgcolor="#E8E8FF">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<%=(Recordset1.Fields.Item("Name").Value)%>
<% End If %></td>
</tr>
<tr>
<td width=66 height="20" align=right bgcolor="#E8E8FF">科室:</td>
<td width=118 height="20" align=left bgcolor="#E8E8FF">
<% If Not Recordset1.EOF Or Not Recordset1.BOF Then %>
<%=(Recordset1.Fields.Item("ClassName").Value)%>
<% End If %></td>
</tr>
<%
strSubject=""
For i=4 to Recordset3.Fields.Count-1
if Recordset3.Eof or Recordset3.bof then exit for
response.write "<tr>"
response.write "<td align=right width=66 bgcolor=#E8E8FF>" & Recordset3.Fields.Item(i).Name & "</td>"
response.write "<td align=left width=118 bgcolor=#E8E8FF><input maxlength=10 size=10 Name='" & Recordset3.Fields.Item(i).Name & "' value='" & (Recordset3.Fields.Item(i).Value) &"'>"
response.write "</td></tr>"
if strSubject<>"" then
strSubject=strSubject & "|" & Recordset3.Fields.Item(i).Name & "|value"
else
strSubject= Recordset3.Fields.Item(i).Name & "|value"
end if
Next
%>
</table>
<input type="hidden" Name="MM_update" value="Update">
<input type="hidden" Name="StudentNum" value="<%=Request("StudentNum")%>">
<input type="hidden" name="Subject" value="<%=strSubject%>">
<input type="hidden" name="SheetName" value="<%=Request("SheetName")%>"><br>
<input type="submit" Name="Submit" value="保存修改结果"><br><br>
</form></td>
</tr>
</table></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>
<%
Recordset1.Close()
Recordset2.Close()
Recordset3.Close()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -