📄 diaoban2.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../Connections/conn.asp" -->
<%
' *** Restrict Access To Page: Grant or deny access to this page
MM_authorizedUsers="3,4"
MM_authFailedURL="../zx/shibai1.asp"
MM_grantAccess=false
If Session("MM_Username") <> "" Then
If (false Or CStr(Session("MM_UserAuthorization"))="") Or _
(InStr(1,MM_authorizedUsers,Session("MM_UserAuthorization"))>=1) Then
MM_grantAccess = true
End If
End If
If Not MM_grantAccess Then
MM_qsChar = "?"
If (InStr(1,MM_authFailedURL,"?") >= 1) Then MM_qsChar = "&"
MM_referrer = Request.ServerVariables("URL")
if (Len(Request.QueryString()) > 0) Then MM_referrer = MM_referrer & "?" & Request.QueryString()
MM_authFailedURL = MM_authFailedURL & MM_qsChar & "accessdenied=" & Server.URLEncode(MM_referrer)
Response.Redirect(MM_authFailedURL)
End If
%>
<%
' *** Edit Operations: declare variables
Dim MM_editAction
Dim MM_abortEdit
Dim MM_editQuery
Dim MM_editCmd
Dim MM_editConnection
Dim MM_editTable
Dim MM_editRedirectUrl
Dim MM_editColumn
Dim MM_recordId
Dim MM_fieldsStr
Dim MM_columnsStr
Dim MM_fields
Dim MM_columns
Dim MM_typeArray
Dim MM_formVal
Dim MM_delim
Dim MM_altVal
Dim MM_emptyVal
Dim MM_i
MM_editAction = CStr(Request.ServerVariables("SCRIPT_NAME"))
If (Request.QueryString <> "") Then
MM_editAction = MM_editAction & "?" & Server.HTMLEncode(Request.QueryString)
End If
' boolean to abort record edit
MM_abortEdit = false
' query string to execute
MM_editQuery = ""
%>
<%
' *** Update Record: set variables
If (CStr(Request("MM_update")) = "form1" And CStr(Request("MM_recordId")) <> "") Then
MM_editConnection = MM_conn_STRING
MM_editTable = "user_name"
MM_editColumn = "ID"
MM_recordId = "" + Request.Form("MM_recordId") + ""
MM_editRedirectUrl = "zxchenggong.asp"
MM_fieldsStr = "调班情况|value|classyi|value|classer|value|pianhao|value|调班原因|value"
MM_columnsStr = "调班情况|',none,''|class|',none,''|class_1|none,none,NULL|pianhao|',none,''|调班原因|',none,''"
' create the MM_fields and MM_columns arrays
MM_fields = Split(MM_fieldsStr, "|")
MM_columns = Split(MM_columnsStr, "|")
' set the form values
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_fields(MM_i+1) = CStr(Request.Form(MM_fields(MM_i)))
Next
' append the query string to the redirect URL
If (MM_editRedirectUrl <> "" And Request.QueryString <> "") Then
If (InStr(1, MM_editRedirectUrl, "?", vbTextCompare) = 0 And Request.QueryString <> "") Then
MM_editRedirectUrl = MM_editRedirectUrl & "?" & Request.QueryString
Else
MM_editRedirectUrl = MM_editRedirectUrl & "&" & Request.QueryString
End If
End If
End If
%>
<%
' *** Update Record: construct a sql update statement and execute it
If (CStr(Request("MM_update")) <> "" And CStr(Request("MM_recordId")) <> "") Then
' create the sql update statement
MM_editQuery = "update " & MM_editTable & " set "
For MM_i = LBound(MM_fields) To UBound(MM_fields) Step 2
MM_formVal = MM_fields(MM_i+1)
MM_typeArray = Split(MM_columns(MM_i+1),",")
MM_delim = MM_typeArray(0)
If (MM_delim = "none") Then MM_delim = ""
MM_altVal = MM_typeArray(1)
If (MM_altVal = "none") Then MM_altVal = ""
MM_emptyVal = MM_typeArray(2)
If (MM_emptyVal = "none") Then MM_emptyVal = ""
If (MM_formVal = "") Then
MM_formVal = MM_emptyVal
Else
If (MM_altVal <> "") Then
MM_formVal = MM_altVal
ElseIf (MM_delim = "'") Then ' escape quotes
MM_formVal = "'" & Replace(MM_formVal,"'","''") & "'"
Else
MM_formVal = MM_delim + MM_formVal + MM_delim
End If
End If
If (MM_i <> LBound(MM_fields)) Then
MM_editQuery = MM_editQuery & ","
End If
MM_editQuery = MM_editQuery & MM_columns(MM_i) & " = " & MM_formVal
Next
MM_editQuery = MM_editQuery & " where " & MM_editColumn & " = " & MM_recordId
If (Not MM_abortEdit) Then
' execute the update
Set MM_editCmd = Server.CreateObject("ADODB.Command")
MM_editCmd.ActiveConnection = MM_editConnection
MM_editCmd.CommandText = MM_editQuery
MM_editCmd.Execute
MM_editCmd.ActiveConnection.Close
If (MM_editRedirectUrl <> "") Then
Response.Redirect(MM_editRedirectUrl)
End If
End If
End If
%>
<%
Dim diaoban__MMColParam
diaoban__MMColParam = "1"
If (Request.Form("pianhao") <> "") Then
diaoban__MMColParam = Request.Form("pianhao")
End If
%>
<%
Dim diaoban
Dim diaoban_numRows
Set diaoban = Server.CreateObject("ADODB.Recordset")
diaoban.ActiveConnection = MM_conn_STRING
diaoban.Source = "SELECT * FROM user_name WHERE pianhao = '" + Replace(diaoban__MMColParam, "'", "''") + "'"
diaoban.CursorType = 0
diaoban.CursorLocation = 2
diaoban.LockType = 1
diaoban.Open()
diaoban_numRows = 0
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>调班管理2</title>
<style type="text/css">
<!--
.STYLE1 {
color: #003300;
font-size: 18px;
}
.STYLE3 {color: #FF0000}
.STYLE4 {font-size: 36px}
-->
</style>
</head>
<script language="VBScript" type="text/vbscript">
<!--
function aa()
form1.classyi.value=form1.nianji.value&form1.ban.value
form1.classer.value=form1.nianji.value&form1.ban.value
form1.pianhao.value=form1.nianji.value&form1.ban.value&"90"
End function
-->
</script>
<body>
<p class="STYLE1">需调班的学生是<span class="STYLE3">
<% if left((diaoban.Fields.Item("class").Value),1)="1" then
response.write "一"
ElseIf left((diaoban.Fields.Item("class").Value),1)="2" then
response.write "二"
ElseIf left((diaoban.Fields.Item("class").Value),1)="3" then
response.write "三"
ElseIf left((diaoban.Fields.Item("class").Value),1)="4" then
response.write "四"
ElseIf left((diaoban.Fields.Item("class").Value),1)="5" then
response.write "五"
ElseIf left((diaoban.Fields.Item("class").Value),1)="6" then
response.write "六"
ElseIf left((diaoban.Fields.Item("class").Value),1)="7" then
response.write "七"
ElseIf left((diaoban.Fields.Item("class").Value),1)="8" then
response.write "八"
else
response.write "九"
end if
%>
(
<% if right((diaoban.Fields.Item("class").Value),2)<"10" then
response.write right((diaoban.Fields.Item("class").Value),1)
else
response.write right((diaoban.Fields.Item("class").Value),2)
end if
%>
)班</span>:<span class="STYLE3"><%=(diaoban.Fields.Item("name").Value)%></span>同学吗,如是,</p>
<p class="STYLE1">请在下面选择要调入的班、调班原因,然后按确定</p>
<form id="form1" name="form1" method="POST" action="<%=MM_editAction%>">
<table width="414" height="80" border="0" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF" bgcolor="#CCCCFF">
<tr>
<td width="109" height="16"> </td>
<td width="291"> </td>
<td width="14"> </td>
</tr>
<tr>
<td height="39"> </td>
<td><div align="center">
<p align="left"><font size="2">
<input name="nianji" type="hidden" id="nianji" value="<%=left((diaoban.Fields.Item("class").Value),1)%>" />
<input name="调班情况" type="hidden" id="调班情况" value="原<%=(diaoban.Fields.Item("class_1").Value)%>班" />
<input name="classyi" type="hidden" id="classyi" />
<input name="classer" type="hidden" id="classer" />
<input name="pianhao" type="hidden" id="pianhao" />
<span class="STYLE1">拟调入<span class="STYLE1">
<% if left((diaoban.Fields.Item("class").Value),1)="1" then
response.write "一"
ElseIf left((diaoban.Fields.Item("class").Value),1)="2" then
response.write "二"
ElseIf left((diaoban.Fields.Item("class").Value),1)="3" then
response.write "三"
ElseIf left((diaoban.Fields.Item("class").Value),1)="4" then
response.write "四"
ElseIf left((diaoban.Fields.Item("class").Value),1)="5" then
response.write "五"
ElseIf left((diaoban.Fields.Item("class").Value),1)="6" then
response.write "六"
ElseIf left((diaoban.Fields.Item("class").Value),1)="7" then
response.write "七"
ElseIf left((diaoban.Fields.Item("class").Value),1)="8" then
response.write "八"
else
response.write "九"
end if
%>
</span>(</span></font><font size="2" >
<select name="ban" id="ban" class="STYLE3" onchange="aa()" >
<option value="未编" selected="selected">---</option>
<option value="01">1班</option>
<option value="02">2班</option>
<option value="03">3班</option>
<option value="04">4班</option>
<option value="05">5班</option>
<option value="06">6班</option>
<option value="07">7班</option>
<option value="08">8班</option>
<option value="09">9班</option>
<option value="10">10班</option>
<option value="11">11班</option>
<option value="12">12班</option>
<option value="13">13班</option>
<option value="14">14班</option>
<option value="15">15班</option>
<option value="16">16班</option>
</select>
</font><font size="2"><span class="STYLE1">)班</span><font size="2"><span class="STYLE1">;</span></font></font></p>
<p align="left"><font size="2" ><font size="2">
<span class="STYLE1">调班原因</span>
<label>
<input name="调班原因" type="text" class="STYLE1" id="调班原因" value="换环境等" size="12" />
<br />
<br />
</label>
<input name="Submit" type="submit" class="STYLE1" id="Submit" style="color: #008000; border: 1px solid #C0C0C0; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" value="确定调班" />
</font></font></p>
</div></td>
<td> </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td> </td>
</tr>
</table>
<input type="hidden" name="MM_update" value="form1">
<input type="hidden" name="MM_recordId" value="<%= diaoban.Fields.Item("ID").Value %>">
</form>
<% If diaoban.EOF And diaoban.BOF Then %>
<p class="STYLE1"><img src="../zx/images/cat008.gif" width="90" height="80" /><span class="STYLE4">没有找到所需调班的学生!</span></p>
<% End If ' end diaoban.EOF And diaoban.BOF %>
</body>
</html>
<%
diaoban.Close()
Set diaoban = Nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -