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

📄 s_edit_student.asp

📁 学籍管理功能,能实现调班注销学籍等,中小学通用
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@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 = "s_chenggong.asp"
  MM_fieldsStr  = "sfz|value|户口|value|csnyr|value|曾用名|value|省|value|市|value|县|value|镇|value|性别|value|民族|value|健康状况|value|入队时间|value|入团时间|value|常用电话|value|户口簿地址|value|变更地址|value|家庭住址|value|邮码|value|家庭住址变更|value|邮码变更|value|主要成员名_1|value|主要成员称_1|value|主要成员单位_1|value|主要成员电话_1|value|主要成员名_2|value|主要成员称_2|value|主要成员单位_2|value|主要成员电话_2|value|主要成员名_3|value|主要成员称_3|value|主要成员单位_3|value|主要成员电话_3|value|经历_时1|value|经历_学校1|value|经历_证明1|value|经历_时2|value|经历_学校2|value|经历_证明2|value|经历_时3|value|经历_学校3|value|经历_证明3|value|xjh|value"
  MM_columnsStr = "身份证号|',none,''|户口|',none,''|出生年月日|',none,''|曾用名|',none,''|省|',none,''|市|',none,''|县|',none,''|镇|',none,''|性别|',none,''|民族|',none,''|健康状况|',none,''|入队时间|',none,''|入团时间|',none,''|常用电话|',none,''|户口簿地址|',none,''|变更地址|',none,''|家庭住址|',none,''|邮码|none,none,NULL|家庭住址变更|',none,''|邮码变更|',none,''|主要成员名_1|',none,''|主要成员称_1|',none,''|主要成员单位_1|',none,''|主要成员电话_1|',none,''|主要成员名_2|',none,''|主要成员称_2|',none,''|主要成员单位_2|',none,''|主要成员电话_2|',none,''|主要成员名_3|',none,''|主要成员称_3|',none,''|主要成员单位_3|',none,''|主要成员电话_3|',none,''|经历_时1|',none,''|经历_学校1|',none,''|经历_证明1|',none,''|经历_时2|',none,''|经历_学校2|',none,''|经历_证明2|',none,''|经历_时3|',none,''|经历_学校3|',none,''|经历_证明3|',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 steudent_name__MMColParam
steudent_name__MMColParam = "1"
If (Session("MM_Username") <> "") Then 
  steudent_name__MMColParam = Session("MM_Username")
End If
%>
<%
Dim steudent_name
Dim steudent_name_numRows

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

steudent_name_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>
<style type="text/css">
<!--
.STYLE1 {font-size: 12px;
	font-weight: normal;
	color: #0000FF;
}
.STYLE3 {font-size: 12px;
	font-weight: bold;
}
.STYLE7 {font-size: 24px}
.STYLE8 {color: #000000; font-weight: bold;}
.STYLE9 {color: #FF0000}
body {
	background-image: url(greystrip.gif);
}
-->
</style>
</head>

<body>
<div align="center" class="STYLE1">

<script language="vbscript">
<!--
function aa()

		text1.innerText=form1.sfz.value
		form1.xjh.value=form1.sfz.value
		form1.csnyr.value=mid(form1.sfz.value,7,8)
		text2.innerText=mid(form1.sfz.value,7,8)
			
End function
-->
</script>

  <form action="<%=MM_editAction%>" method="POST" name="form1" id="form1">
    <table width="658" height="690" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td colspan="2" height="61" ><div align="center" class="STYLE7"><span class="STYLE8">广东省义务教育阶段学生学籍卡</span>(<%=(steudent_name.Fields.Item("name").Value)%>)</div></td>
      </tr>
      <tr>
        <td width="355" height="26" class="STYLE1"><span class="STYLE3">建卡学校:&nbsp;<%=(steudent_name.Fields.Item("建卡学校").Value)%></span></td>
        <td width="275" class="STYLE1">建卡日期:&nbsp;<%=(steudent_name.Fields.Item("建卡日期").Value)%></td>
      </tr>
      <tr>
        <td height="42" colspan="2">
        <div align="center">
        <table width="680" height="59" border="1" cellpadding="0" cellspacing="0" bordercolor="#0000FF" style="border-collapse: collapse" bgcolor="#99CCFF">
          <tr class="STYLE1">
            <td width="92"><div align="center">身份证号 </div></td>
            <td width="305" ><p align="left">
              <input name="sfz" type="text" id="sfz" value="<%=(steudent_name.Fields.Item("身份证号").Value)%>" size="20" maxlength="18"   onkeyup="aa()" />
            没申办户口的填441622+出生年月日</p>
              </td>
            <td colspan="2"><p align="center">建卡原因:新生入学(<span class="STYLE9">V</span>)转入( )</p></td>
          </tr>
          <tr class="STYLE1">
            <td><p align="center">学籍号</p></td>
            <td ><p align="left" style="margin-top: 1px; margin-bottom: 0"><span id=text1><%=(steudent_name.Fields.Item("学籍号").Value)%></span><span class="STYLE9">(学籍根据身份证自动生成)</span></p>
              <p align="left" style="margin-top: 1px; margin-bottom: 0"><span class="STYLE1">户口性质:</span>
                <label>
                  <select name="户口" id="户口">
                    <option value="<%=(steudent_name.Fields.Item("户口").Value)%>" selected="selected"><%=(steudent_name.Fields.Item("户口").Value)%></option>
                    <option value="非农户口(隆)">非农户口(隆)</option>
                    <option value="非农户口(乡)">非农户口(乡)</option>
                    <option value="农业户口(隆)">农业户口(隆)</option>
                    <option value="农业户口(乡)">农业户口(乡)</option>
                    </select>
                  </label>
                </p></td>
            <td width="102">
			<p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0">出生年月日</p></td>
            <td width="191">
			<p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
              <span id=text2><%=(steudent_name.Fields.Item("出生年月日").Value)%></span><input name="csnyr" type="hidden" id="csnyr" />
            </p>
              <p align="center" style="line-height: 150%; margin-top: 0; margin-bottom: 0">
				<font color="#FF0000">(出生年月不录,身份证自动生成)</font> </p></td>
          </tr>
        </table>
          </div>
            <table width="680" height="174" border="1" cellpadding="0" cellspacing="0" bordercolor="#0000FF" style="border-collapse: collapse" bgcolor="#99CCFF">
              <tr>
                <td width="92" class="STYLE1"><div align="center">现名</div></td>
                <td width="108" class="STYLE1"><div align="center" class="STYLE9"><%=(steudent_name.Fields.Item("name").Value)%></div></td>
                <td width="78" class="STYLE1"><div align="center">曾用名</div></td>
                <td width="114" class="STYLE1"><div align="center">
                    <input name="曾用名" type="text" id="曾用名" value="<%=(steudent_name.Fields.Item("曾用名").Value)%>" size="10" maxlength="8" />
                </div></td>
                <td colspan="2" class="STYLE1"><div align="center">籍贯:
                  <input name="省" type="text" id="省" value="<%=(steudent_name.Fields.Item("省").Value)%>" size="4" maxlength="10" />
                  <input name="市" type="text" id="市" value="<%=(steudent_name.Fields.Item("市").Value)%>" size="4" maxlength="10" />
                  <input name="县" type="text" id="县" value="<%=(steudent_name.Fields.Item("县").Value)%>" size="4" maxlength="10" />
                  <input name="镇" type="text" id="镇" value="<%=(steudent_name.Fields.Item("镇").Value)%>" size="4" maxlength="10" />
                  镇</div></td>
              </tr>
              <tr>
                <td class="STYLE1"><div align="center">性别</div></td>
                <td class="STYLE1"><div align="center">
                  <label>
                  <select name="性别" id="性别">
					<option value="<%=(steudent_name.Fields.Item("性别").Value)%>" selected="selected"><%=(steudent_name.Fields.Item("性别").Value)%></option>
                    <option value="男">男</option>
                    <option value="女">女</option>
                  </select>
                  </label>
                </div></td>
                <td class="STYLE1"><div align="center">民族</div></td>
                <td class="STYLE1"><div align="center">
                  <select name="民族" id="民族">
					<option value="<%=(steudent_name.Fields.Item("民族").Value)%>" selected="selected"><%=(steudent_name.Fields.Item("民族").Value)%></option>

⌨️ 快捷键说明

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