⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhuxiaoxj.asp

📁 学籍管理功能,能实现调班注销学籍等,中小学通用
💻 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")) = "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|注销原因|value"
  MM_columnsStr = "在校情况|none,none,NULL|注销原因|',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 zhuxiaoxj__MMColParam
zhuxiaoxj__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then 
  zhuxiaoxj__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim zhuxiaoxj
Dim zhuxiaoxj_numRows

Set zhuxiaoxj = Server.CreateObject("ADODB.Recordset")
zhuxiaoxj.ActiveConnection = MM_conn_STRING
zhuxiaoxj.Source = "SELECT * FROM user_name WHERE ID = " + Replace(zhuxiaoxj__MMColParam, "'", "''") + ""
zhuxiaoxj.CursorType = 0
zhuxiaoxj.CursorLocation = 2
zhuxiaoxj.LockType = 1
zhuxiaoxj.Open()

zhuxiaoxj_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>无标题文档</title>
</head>

<body>
<p>&nbsp;</p>
<form ACTION="<%=MM_editAction%>" METHOD="POST" id="form1" name="form1">
  <table width="389" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td height="51" colspan="3">&nbsp;&nbsp;&nbsp;&nbsp;你确定要注销<font color="#FF0000" size="4">
        <% if left((zhuxiaoxj.Fields.Item("class").Value),1)="1" then 
response.write "一" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="2" then 
	    response.write "二" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="3" then 
	    response.write "三" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="4" then 
	    response.write "四" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="5" then 
	    response.write "五" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="6" then 
	    response.write "六" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="7" then 
	    response.write "七" 
ElseIf  left((zhuxiaoxj.Fields.Item("class").Value),1)="8" then 
	    response.write "八" 
else 
response.write "九"
end if 
%>
<% if right((zhuxiaoxj.Fields.Item("class").Value),2)<"10" then 
response.write right((zhuxiaoxj.Fields.Item("class").Value),1) 

else 
response.write right((zhuxiaoxj.Fields.Item("class").Value),2)
end if 
%>
)班<%=(zhuxiaoxj.Fields.Item("name").Value)%></font>同学的<font color="#003300">学籍</font>信息吗?如果不是请取消,如果是,请填写原因:
<input name="在校情况" type="hidden" id="在校情况" value="3" /></td>
    </tr>
    <tr>
      <td width="6" height="13">&nbsp;</td>
      <td width="367">&nbsp;</td>
      <td width="8">&nbsp;</td>
    </tr>
    <tr>
      <td height="42" colspan="3"><label>
        <textarea name="注销原因" cols="60" rows="3" id="注销原因">转出XX学校就读</textarea>
      </label></td>
    </tr>
    <tr>
      <td height="13">&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><div align="center"><font size="2">
        <input name="Submit" type="submit" id="Submit" style="color: #008000; border: 1px solid #C0C0C0; padding-left: 4px; padding-right: 4px; padding-top: 1px; padding-bottom: 1px" value="确定注销<%=(zhuxiaoxj.Fields.Item("name").Value)%>同学学籍" />
      </font></div></td>
      <td>&nbsp;</td>
    </tr>
  </table>

    

  <input type="hidden" name="MM_update" value="form1">
  <input type="hidden" name="MM_recordId" value="<%= zhuxiaoxj.Fields.Item("ID").Value %>">
</form>
<p>&nbsp;</p>
</body>
</html>

<%
zhuxiaoxj.Close()
Set zhuxiaoxj = Nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -