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

📄 showscoreinputform.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"
'***************************
 Call Main(0)
 Sub Main(Add_Or_Edit)
    Dim Form_State 'Add_Or_Edit
	'说明,0代表添加数据,1代表编辑现有数据
	If Add_Or_Edit=0 then Form_State=0
	If Add_Or_Edit=1 then 
	   Form_State=1
	     Dim Edit_Teacher_sql,Edit_Teacher_rs
         'Call OpenConn()
         Edit_Teacher_sql="select [student_id],[student_no],[student_name],[stu_sex],[department_id],[teacher_id],[class_id] from [student] where student_id='"&request("teacher_id")&"'"
         Set Edit_Teacher_rs=server.CreateObject("adodb.recordset")
         Edit_Teacher_rs.open Edit_Teacher_sql,Initialize_Conn,1,3
 	End if
%>
<!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">当前班级是:<font color="red"><%=request("class_name")%></font> 
 &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%"><form name="InputScoreForm" method="post" action="ShowScoreInputForm.asp">请您选择待添加成绩的科目:
            <input type="hidden" name="term_id" value="<% call ShowCurrentTerm(1)'此处返回当前学期的编号 %>"/>
            <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("class_name")%>"/>
 		<select name="subject_id" onchange="InputScoreForm.submit()">
		<option value="">请选择课程</option>
		<% call TeacherSelectSubject() %></select>&nbsp;&nbsp;</form></td>
        <td width="33%">&nbsp;</td>
      </tr>
    </table></td>
    </tr>
   <tr>
    <td valign="top" height="620" colspan="3">
 <p style="text-indent:0.3in">当前添加成绩的课程是:
 <font color="red"><% call GetSubjectNameByID() %>&nbsp;&nbsp;
 当前班级中共有学生:&nbsp;<font color="red"><% call ShowCurrentClassStuNum() %></font>人.</p>
	<form id="form1" name="ScoreList" method="post" action="SaveScore.asp" target="_blank">
	  <table width="100%" border="0" bgcolor="#8ab105" cellspacing="1" cellpadding="0">
        <tr bgcolor="#FFFFFF">
          <td align="center" width="13%" height="18">学号 </td>
          <td align="center" width="9%"> 姓名</td>
          <td align="center" width="12%">分数</td>
          <td width="1%" align="center" bgcolor="#8ab105">&nbsp;</td>
          <td width="12%" height="18" align="center">学号 </td>
          <td width="9%" align="center"> 姓名</td>
          <td width="13%" align="center">分数</td>
          <td width="1%" bgcolor="#8ab105">&nbsp;</td>
          <td width="12%" height="18" align="center">学号 </td>
          <td width="8%" align="center"> 姓名</td>
          <td width="10%" align="center">分数</td>
        </tr>
        <% '**********************************************************************
		  '这段代码 判断所选班级的当前科目的成绩是否已经添加过,如果该科目的成绩已经
		  '添加过了,那么此时要从score表中读出这些分数,以方便辅导员修改。
		   Dim ScoreArray(),ShowHaveBeenAdd,Add_or_Edit_Sql,CurrentScoreNum,iiiii,iiiiii
		   iiiiii=0 '代表是保存分数的数组的索引变量
     Add_or_Edit_Sql="select count(*) from [score] where [term_id]='"&request.Form("term_id")&"' and [department_id]='"&request.Form("department_id")&"' and [teacher_id]='"&request.Form("teacher_id")&"' and [class_id]='"&request.Form("class_id")&"' and [subject_id]='"&request.Form("subject_id")&"'"
     Set ShowHaveBeenAdd=Initialize_Conn.execute(Add_or_Edit_Sql) 
	 CurrentScoreNum=ShowHaveBeenAdd(0)
	 ShowHaveBeenAdd.close: Set ShowHaveBeenAdd=nothing
	 Redim ScoreArray(CurrentScoreNum)'此处重新定义数组大小,下面将打开CurrentScoreNum条记录数
	 '下面把记录保存到一个名为 ScoreArray的数组中
IF CurrentScoreNum <> 0 Then '如果记录数不等于0,则从数据库中读出这些分数
    Dim ReadOutScoreByClassID,ReadOutScoreSql
	    ReadOutScoreSql="select [sore] from [score] where [term_id]='"&request.Form("term_id")&"' and [department_id]='"&request.Form("department_id")&"' and [teacher_id]='"&request.Form("teacher_id")&"' and [class_id]='"&request.Form("class_id")&"' and [subject_id]='"&request.Form("subject_id")&"'"
    Set ReadOutScoreByClassID=server.CreateObject("adodb.recordset")
		ReadOutScoreByClassID.open ReadOutScoreSql,Initialize_Conn,1,1
	   For iiiii=0 to CurrentScoreNum-1
		     ScoreArray(iiiii)=ReadOutScoreByClassID(0)
		 	ReadOutScoreByClassID.movenext
			IF ReadOutScoreByClassID.eof then exit for
        Next
	ReadOutScoreByClassID.close: Set ReadOutScoreByClassID=nothing	
End if		
		'*************************************************************************
		'这段代码 从student表中读出所选择的班级的所有学生列表
		Dim StudentRs,StudentSql,ScoreN
	      'StudentRs=server.CreateObject("adodb.recordset")
		  ScoreN=0
	      StudentSql="select [student_id],[student_no],[student_name] from [student] where department_id='"&request("department_id")&"'  and teacher_id='"&request("teacher_id")&"' and class_id='"&request("class_id")&"'"

⌨️ 快捷键说明

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