<% if session("admid")="" or Session("class")<>"1" then response.redirect"login.asp"%>
<!--#include file="conn.asp"-->
<title>学生成绩管理</title>
<link rel="stylesheet" type="text/css" href="style.css">
<%
function err(strin)                             'err("×　请填写...")
Response.Write("<script language=javascript>")
Response.Write("alert('")
Response.Write(strin)
Response.Write("');")
Response.Write("history.go(-1);")
Response.Write("</script>")
Response.End()
end function
%>
<!--显示-->

<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style>　<table width="80%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
<tr><td align="center" bgcolor="#006d63" style="border-bottom:1px solid #FFFFFF;">
	<font color="#FFFFFF"><b>学生成绩录入OR修改</b></font></td>
</tr>
<tr><td align="center" bgcolor="#FFFFFF">

<table width="100%" border="0" align="center" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
  <tr>
    <td colspan="8"></td>
  </tr>
<%
sql_stu="select * from user where id="&request("id")
set rs_stu=server.createobject("adodb.recordset")
rs_stu.open sql_stu,conn,1,1
if rs_stu.eof And rs_stu.bof then 
response.write "学生资料错误，请返回"
else
%>
     <tr>
    <td>
	<p align="right">考生信息：   Candidate No：</td>
    <td><%=rs_stu("c_no")%></td>
    <td>
	<p align="right">Candidate Name：</td>
    <td><%=rs_stu("name")%></td>
    <td>
	<p align="right">Class：</td>
    <td><%=rs_stu("class")%></td>
    <td>
	<p align="right">Username：</td>
    <td><%=rs_stu("username")%></td>
  </tr>
     
  
  
   <tr>
            <td style="border-bottom-style: dotted; border-bottom-width: 1px; padding: 0" colspan="8"></td>
   </tr> 
 </table>
 
 <table width="85%" border="0" align="center" cellpadding="5" cellspacing="0" style="border-collapse: collapse">
   <tr>
    <td align=center>
	<p><b>Subjects</b></td>
    <td align=center>
	<p><b>Syllabus & Component Information</b></td>
    <td align=center>
	<p align="left">Score</td>
  </tr>
 <tr><td colspan="3">
 
 <form action="cj_save.asp" method="POST">
 
 <table border="0" cellpadding="5" cellspacing="1" bgcolor="#006d63" style="border-collapse: collapse">
 <%

 sql_sub="select * from subject where class='"&left(rs_stu("class"),2)&"'"
set rs_sub=server.createobject("adodb.recordset")
rs_sub.open sql_sub,conn,1,1
if rs_sub.bof and rs_sub.eof then
	response.write "No Subjects，Please add！"
else
	do while not rs_sub.eof 
		sql_syll="select * from syllabus where subject_id="&rs_sub("subject_id")
		set rs_syll=server.createobject("adodb.recordset")
		rs_syll.open sql_syll,conn,1,1
		
		if rs_syll.bof and rs_syll.eof then
			response.write "No syllabus ，Please add！"
		else
			response.write "<tr bgcolor=#FFFFFF><td width=150  rowspan="&rs_syll.recordcount&">"&rs_sub("subject_name")&rs_syll.recordcount&"</td><td>"&rs_syll("syllabus_name")&"</td><td><input name=score  type=text  size=10></td></tr>"
			rs_syll.movenext
			do while not rs_syll.eof
				response.write "<tr bgcolor=#FFFFFF><td>"&rs_syll("syllabus_name")&"</td><td><input name=score  type=text  size=10></td></tr>"
			rs_syll.movenext
			loop
			set rs_syll=nothing
			rs_syll.close
		end if
	rs_sub.movenext
	loop
end if
set rs_sub=nothing
%>
 </table>
 
 </form>
 </td></tr>
 </table>  
 
<%
end if

set rs_stu=nothing
%>