📄 tree.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Connections/conn.asp" -->
<%
' *** 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")) = "zaixiao1" 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 = "tree.asp"
MM_fieldsStr = "在校情况1|value"
MM_columnsStr = "在校情况|none,none,NULL"
' 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: set variables
If (CStr(Request("MM_update")) = "zaixiao2" 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 = "tree.asp"
MM_fieldsStr = "在校情况2|value"
MM_columnsStr = "在校情况|none,none,NULL"
' 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 tree__MMColParam
tree__MMColParam = "1"
If (Session("MM_Username") <> "") Then
tree__MMColParam = Session("MM_Username")
End If
%>
<%
Dim tree
Dim tree_numRows
Set tree = Server.CreateObject("ADODB.Recordset")
tree.ActiveConnection = MM_conn_STRING
tree.Source = "SELECT * FROM user_name WHERE class = '" + Replace(tree__MMColParam, "'", "''") + "' and 在校情况= 1 ORDER BY pianhao ASC"
tree.CursorType = 0
tree.CursorLocation = 2
tree.LockType = 1
tree.Open()
tree_numRows = 0
%>
<%
Dim admin_2__MMColParam
admin_2__MMColParam = "1"
If (Session("MM_username") <> "") Then
admin_2__MMColParam = Session("MM_username")
End If
%>
<%
Dim admin_2
Dim admin_2_numRows
Set admin_2 = Server.CreateObject("ADODB.Recordset")
admin_2.ActiveConnection = MM_conn_STRING
admin_2.Source = "SELECT * FROM admin_name WHERE class = '" + Replace(admin_2__MMColParam, "'", "''") + "' ORDER BY ID ASC"
admin_2.CursorType = 0
admin_2.CursorLocation = 2
admin_2.LockType = 1
admin_2.Open()
admin_2_numRows = 0
%>
<%
Dim zhuanchu__MMColParam
zhuanchu__MMColParam = "1"
If (Session("MM_Username") <> "") Then
zhuanchu__MMColParam = Session("MM_Username")
End If
%>
<%
Dim zhuanchu
Dim zhuanchu_numRows
Set zhuanchu = Server.CreateObject("ADODB.Recordset")
zhuanchu.ActiveConnection = MM_conn_STRING
zhuanchu.Source = "SELECT * FROM user_name WHERE class = '" + Replace(zhuanchu__MMColParam, "'", "''") + "' and 在校情况=2 ORDER BY pianhao ASC"
zhuanchu.CursorType = 0
zhuanchu.CursorLocation = 2
zhuanchu.LockType = 1
zhuanchu.Open()
zhuanchu_numRows = 0
%>
<%
Dim jdcshtg__MMColParam
jdcshtg__MMColParam = "1"
If (Session("MM_username") <> "") Then
jdcshtg__MMColParam = Session("MM_username")
End If
%>
<%
Dim jdcshtg
Dim jdcshtg_numRows
Set jdcshtg = Server.CreateObject("ADODB.Recordset")
jdcshtg.ActiveConnection = MM_conn_STRING
jdcshtg.Source = "SELECT * FROM user_name WHERE class = '" + Replace(jdcshtg__MMColParam, "'", "''") + "' and 在校情况=3 ORDER BY pianhao ASC"
jdcshtg.CursorType = 0
jdcshtg.CursorLocation = 2
jdcshtg.LockType = 1
jdcshtg.Open()
jdcshtg_numRows = 0
%>
<%
Dim diaochu__MMColParam
diaochu__MMColParam = "1"
If (Session("MM_username") <> "") Then
diaochu__MMColParam ="原"&Session("MM_username")&"班"
End If
%>
<%
Dim diaochu
Dim diaochu_numRows
Set diaochu = Server.CreateObject("ADODB.Recordset")
diaochu.ActiveConnection = MM_conn_STRING
diaochu.Source = "SELECT * FROM user_name WHERE 调班情况 = '" + Replace(diaochu__MMColParam, "'", "''") + "' ORDER BY pianhao ASC"
diaochu.CursorType = 0
diaochu.CursorLocation = 2
diaochu.LockType = 1
diaochu.Open()
diaochu_numRows = 0
%>
<%
Dim diaojin__MMColParam
diaojin__MMColParam = "原"
If (Request("MM_EmptyValue") <> "") Then
diaojin__MMColParam = Request("MM_EmptyValue")
End If
%>
<%
Dim diaojin
Dim diaojin_numRows
Set diaojin = Server.CreateObject("ADODB.Recordset")
diaojin.ActiveConnection = MM_conn_STRING
diaojin.Source = "SELECT * FROM user_name WHERE 调班情况 and class= '" +Session("MM_username")+ "' ORDER BY 调班原因 ASC"
diaojin.CursorType = 0
diaojin.CursorLocation = 2
diaojin.LockType = 1
diaojin.Open()
diaojin_numRows = 0
%>
<%
Dim Repeat1__numRows
Dim Repeat1__index
Repeat1__numRows = -1
Repeat1__index = 0
jdcshtg_numRows = jdcshtg_numRows + Repeat1__numRows
%>
<%
Dim Repeat4__numRows
Dim Repeat4__index
Repeat4__numRows = -1
Repeat4__index = 0
diaochu_numRows = diaochu_numRows + Repeat4__numRows
%>
<%
Dim Repeat3__numRows
Dim Repeat3__index
Repeat3__numRows = -1
Repeat3__index = 0
diaojin_numRows = diaojin_numRows + Repeat3__numRows
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = -1
Repeat2__index = 0
zhuanchu_numRows = zhuanchu_numRows + Repeat2__numRows
%>
<%
Dim MM_paramName
%>
<%
' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
Dim MM_keepNone
Dim MM_keepURL
Dim MM_keepForm
Dim MM_keepBoth
Dim MM_removeList
Dim MM_item
Dim MM_nextItem
' create the list of parameters which should not be maintained
MM_removeList = "&index="
If (MM_paramName <> "") Then
MM_removeList = MM_removeList & "&" & MM_paramName & "="
End If
MM_keepURL=""
MM_keepForm=""
MM_keepBoth=""
MM_keepNone=""
' add the URL parameters to the MM_keepURL string
For Each MM_item In Request.QueryString
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item))
End If
Next
' add the Form variables to the MM_keepForm string
For Each MM_item In Request.Form
MM_nextItem = "&" & MM_item & "="
If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then
MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item))
End If
Next
' create the Form + URL string and remove the intial '&' from each of the strings
MM_keepBoth = MM_keepURL & MM_keepForm
If (MM_keepBoth <> "") Then
MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1)
End If
If (MM_keepURL <> "") Then
MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1)
End If
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -