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

📄 manage_stu_rewrite.asp

📁 eayanQuery思燕大学成绩查询系统 版本 V1.6
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%option explicit%>
<!--#include file="Conn.asp"-->
<!--#include file="include/md5.asp"-->
<!--#include file="include/ReplaceHtml.asp"-->
<!--#include file="include/PublicFunction.asp"-->
<!--#include file="include/TeacherSession.asp"-->
<% call checkouterurl()
'强制浏览器重新访问服务器下载页面
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
'***************************
Dim Action
Action=request.QueryString("Action")
Select Case  Action
  Case "ShowStudentInputForm"
  Call Main()
 Case else
   Call InputClassStudentNun()
End Select
'****************************
Sub Main()
%>
<!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>思燕Seayan成绩查询系统SQL版本v1.0----现代教学管理信息系统</title>
		<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
		<meta http-equiv="Content-Language" content="gb2312">
		<meta content="all" name="robots">
		<meta content="websvc@163.com" name="author">
		<meta content="版权所有:Seagreen 2005-2008" name="Copyright">
		<meta content="思燕Seayan成绩查询系统SQL版本v1.0, 由 赵海 先生模仿方正教务管理系统开发。" name="description">
		<link rel="icon" href="/favicon.ico" type="image/x-icon">
		<link rel="stylesheet" rev="stylesheet" href="images/main.css" type="text/css" media="all">
		<SCRIPT language="javascript" src="images/Menu.js"></SCRIPT>
<link href="images/my_style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<iframe src="images/head.htm" frameborder="0" scrolling="no" width="100%" height="59"></iframe>
<div id="menu" STYLE='width:100%'>
<!--#include file="menu.asp"--></div>
<div id="welcome">
				<span id="xhxm"><font color="red"> </font></span>
				<table width="100%" height="707" border="0" cellpadding="0" cellspacing="0" background="axhucj/images/admin_MainBg.gif">
  <tr>
    <td width="3%" height="16">&nbsp;</td>
    <td colspan="2">&nbsp;</td>
    <td width="2%">&nbsp;</td>
  </tr>
  <tr>
    <td height="23">&nbsp;</td>
     <td align="left" colspan="2"><div align="center">
 &nbsp;&nbsp;当前学期是:<% call ShowCurrentTerm(0)'此处返回当前学期的名称 %>&nbsp;<font color="green">如果此处的信息有错误,请联系管理员:&nbsp;13855170575</font>
	 <hr width="100%"></div> </td>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td height="34" colspan="4"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="3%" height="28">&nbsp;</td>
        <td width="64%">&nbsp; </td>
        <td width="33%">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
   <tr>
    <td valign="top" height="620" colspan="3">
 <p style="text-indent:0.3in">您可以选<a href="Manage_stu.asp?class_name=<%=request("class_name")%>&class_id=<%=request("class_id")%>"><font color="red">择逐个添加学生</font></a>.
 <%Dim ClassStudentNum : ClassStudentNum = HtmlEncode(request("StudentNumberOfClass"))%>
 当前执行的操作是:批量编辑学生.&nbsp;当前班级是:<font color="red"><%=request("class_name")%>. </font>
 当前班级中共有学生:&nbsp; <font color="red"><% If ClassStudentNum="0" then 
                                                    Call ShowCurrentClassStuNum()
												 else'如果已经添加,则从数据库中读出班级的总人数
												     Response.Write(ClassStudentNum)
												 End if  %></font>人.</p>
 <% If ClassStudentNum<>"0" then 
       Call InputStudentList(ClassStudentNum)
	   Response.End()'此时结束的目的是调用这个过程之后,不再显示编辑页面,只显示输入页面,防止出错。
    End if 'EditStudentList()如果请求表单的ClassStudentNum为空,则说明已经添加过该班级的人数,现在请求该页面是 编辑模式
     %>	
         <% '**********************************************************************
		  '这段代码 判断所选班级的当前班级的学生列表是否已经添加过,如果该班级的学生列表已经
		  '添加过了,那么此时要从student表中读出这些学生列表,以方便辅导员修改。
		   Dim ScoreArray(),ShowHaveBeenAdd,Add_or_Edit_Sql,CurrentScoreNum,iiiii,iiiiii
		   iiiiii=0 '代表是保存分数的数组的索引变量
     Add_or_Edit_Sql="select count(*) from [student] where [department_id]='"&request.Cookies("department_id")&"' and [teacher_id]='"&request.Cookies("teacher_id")&"' and [class_id]='"&request("class_id")&"'"
     Set ShowHaveBeenAdd=Initialize_Conn.execute(Add_or_Edit_Sql) 
	 CurrentScoreNum=ShowHaveBeenAdd(0)
	 ShowHaveBeenAdd.close: Set ShowHaveBeenAdd=nothing
	 Redim ScoreArray(CurrentScoreNum-1,CurrentScoreNum-1,2)'此处重新定义三维数组大小,下面将打开CurrentScoreNum条记录数
	 '下面把记录保存到一个名为 ScoreArray的二维数组中
IF CurrentScoreNum <> 0 Then '如果记录数不等于0,则从数据库中读出这些分数
    Dim ReadOutScoreByClassID,ReadOutScoreSql
	    ReadOutScoreSql="select [student_no],[student_name],[student_id] from [student] where [department_id]='"&request.cookies("department_id")&"' and [teacher_id]='"&request.cookies("teacher_id")&"' and [class_id]='"&request("class_id")&"'"
    Set ReadOutScoreByClassID=server.CreateObject("adodb.recordset")
		ReadOutScoreByClassID.open ReadOutScoreSql,Initialize_Conn,1,1
	   For iiiii=0 to CurrentScoreNum-1
		     ScoreArray(iiiii,iiiii,0)=trim(ReadOutScoreByClassID(0))'学号
		     ScoreArray(iiiii,iiiii,1)=trim(ReadOutScoreByClassID(1))'姓名
		     ScoreArray(iiiii,iiiii,2)=trim(ReadOutScoreByClassID(2))'学生的信息在数据库中的唯一标识,
			                                                    'student_id,用于修改时根据id来查找修改, 此处使用隐藏域
		 	ReadOutScoreByClassID.movenext
			IF ReadOutScoreByClassID.eof then exit for
        Next
	ReadOutScoreByClassID.close: Set ReadOutScoreByClassID=nothing	
End if		
'********************二维数组帮助
'redim ArrayList(n,1)'定义变长数组,n+1条记录 
'j=0 
'do while not rs.eof 
'ArrayList(j,0)=rs("id") 
'ArrayList(j,1)=rs("name") 
'j=j+1 
'rs.movenext 
'loop**********%>
 <form id="form1" name="StudentList" method="post" action="SaveStudentList.ASP" target="_blank">
	  <table width="100%" border="0" bgcolor="#8ab105" cellspacing="1" cellpadding="0">
<tr bgcolor="#FFFFFF">
<%
Dim iiii,sTr11,sTr22,jj,ClassStudentNum2'这个就是上面从数据库中读出的班级的学生的记录数
ClassStudentNum2=CurrentScoreNum
sTr11 = ""
sTr22 = ""
For iiii = 0 To ClassStudentNum2 -1
    If iiii>0 And iiii Mod 3 = 0 Then
        Response.Write(sTr11)
        Response.Write("</tr><tr bgcolor=""#FFFFFF"">")
        Response.Write(sTr22)
        Response.Write("</tr><tr bgcolor=""#FFFFFF"">")
        sTr11 = ""
        sTr22 = ""
    End If
    sTr11 = sTr11 & "<td align=""center"" width="""" height=""18"">学号</td>"
    sTr11 = sTr11 & "<td align=""center"" width="""">姓名</td>"
    sTr11 = sTr11 & "<td align=""center"" width=""1""  bgcolor=""#8ab105""></td>"
    sTr22 = sTr22 & "<td align=""center"" height=""18""><input type=""text"" value="""&ScoreArray(iiii,iiii,0)&""" onkeydown=""if(event.keyCode==13)event.keyCode=9"" name=StuNo"&iiii&" size=""12""></td>"
    sTr22 = sTr22 & "<td align=""center"" height=""18""><input type=""text"" value="""&ScoreArray(iiii,iiii,1)&""" onkeyup=""value=value.replace(/[ -~]/g,'')"" onkeydown=""if(event.keyCode==13)event.keyCode=9"" name=StuName"&iiii&" size=""7""><input type=""hidden"" value="""&ScoreArray(iiii,iiii,2)&""" name=StuID"&iiii&"></td>"
    sTr22 = sTr22 & "<td align=""center"" bgcolor=""#8ab105""></td>"
Next
For jj = 1 To 3 -1
    If iiii Mod 3 = 0 Then Exit For
    iiii = iiii + 1
    sTr11 = sTr11 & "<td align=""center"" width="""" height=""18""></td>"
    sTr11 = sTr11 & "<td align=""center"" width=""""></td>"
    sTr11 = sTr11 & "<td align=""center"" width=""1""  bgcolor=""#8ab105""></td>"
    sTr22 = sTr22 & "<td align=""center"" height=""18""></td>"
    sTr22 = sTr22 & "<td align=""center"" height=""18""></td>"
    sTr22 = sTr22 & "<td align=""center"" bgcolor=""#8ab105""></td>"
Next
Response.Write(sTr11)
Response.Write("</tr><tr bgcolor=""#FFFFFF"">")
Response.Write(sTr22)
%>
</tr>
        <tr bgcolor="#FFFFFF">
          <td height="50" colspan="12" align="center">
             <input type="hidden" name="teacher_id" value="<%=request.cookies("teacher_id")%>" />
            <input type="hidden" name="department_id" value="<%=request.cookies("department_id")%>"/>
			<input type="hidden" name="class_id" value="<%=request("class_id")%>"/>
			<!--input type="hidden" name="class_name" value="<=request.Form("class_name")>"/--><!--这个隐藏域没有太大用处-->
           <input type="hidden" name="StudentRsNum" value="<%=ClassStudentNum2%>" />
  		  <input type="submit" name="Submit" value="保存学生列表" />&nbsp;&nbsp;&nbsp;
          <input type="reset" name="Submit2" value="全部重填" />
    		  </td>
        </tr>
       </table>
	   </form> 	</td>
    <td>&nbsp;</td>
  </tr>
</table>
</div>
	 <div id="bottom">
 	 <iframe src="images/bottom.htm" frameborder="0" scrolling="no" width="100%" height="28"></iframe>
	 </div>
</body>
</html>
<%end sub
 '搜索教师的过程调用,显示页面************************************************************
 '显示辅导员所在院系的过程调用************************
Sub Show_teacher_department(id,Show_OR_Edit)''show的意思是数据显示模式,当要显示辅导员列表时是show模式,出于要和显示列表中表格一致的考虑,此时要打印出<td></td>;
'当要修改辅导员的信息是,此时要显示的是edit模式,只需要根据call传递过来的department_id显示辅导员所在院系的汉字描述;
    Dim ShowSql,ShowRs
	Set ShowRs=server.CreateObject("adodb.recordset")
	 ShowSql="select department_name from [department] where department_id="&id&""
     ShowRs.open ShowSql,Initialize_Conn,1,1
  IF Show_OR_Edit=0 Then
	response.Write "<td>"&ShowRs("department_name")&"</td>"

⌨️ 快捷键说明

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