<% if session("admid")="" or Session("pwd")="" then response.redirect "default.asp"%>
<!--#include file="conn.asp"-->
<%
tclass=request("tclass")
tcourse=request("tcourse")
tweek=request("tweek")
weekinfo=request("weekinfo")
totalscore=cint(trim(request("txttotal")))
if totalscore<>0 then

	 set rs5=server.createobject("ADODB.Recordset") 
     sql5="select * from "&tcourse&"  where class='"&tclass&"total'"
     rs5.open sql5,conntmp,3,3
		  rs5(tweek)=totalscore
		  rs5.update
		  rs5.close
		  set rs5=nothing
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>Score edit save</title>
</head>

<body  bgcolor="#D6D3CE">



<%  ' 成绩添加结果-------------------------------------------------------


 cj=TRIM(Request.form("cj"))
 xh=TRIM(Request.form("xuehao"))
 name_cn=TRIM(Request.form("txtname_cn"))
  name_en=TRIM(Request.form("txtname_en"))
 num=session("num")
num=num-1
if cj<>"" then
   chji=split(cj,",")
   xuehao=split(xh,",")
   tname_cn=split(name_cn,",")
   tname_en=split(name_en,",")
   
  for i=0 to num
    xh=trim(xuehao(i))
    xm_cn = trim(tname_cn(i))
	xm_en= trim(tname_en(i))
    c=chji(i)
    c=trim(c)
if c<>"" then
call Checkchengji(xm_cn,xm_en,c)    
   
  else
     
     kong=1
     s_id=s_id+1
     
end if
if c="" then c=" "
 if c<>"" then 
 	
     sqledit="update "&tcourse&" set "&tweek&"='"&c&"'  where id="&xh	
     set list=server.createobject("adodb.recordset")
     conntmp.execute sqledit
 
  end if    
      
     next  
     
     if kong=1 then
         response.write "<script language='javascript'>" & chr(13)
       
         response.write "alert(' "&s_id&"  student score is null ,please input later!');" & Chr(13)
         c = " "
         response.write "</script>" & Chr(13)
        
     end if 
     %>
	   <center>
	    <p align="center">   
<p align="center">   <br><br><br>
<table border="1" width="60%" bordercolorlight="#848284" cellspacing="0" cellpadding="4" bordercolordark="#FFFFFF">
    <tr>
      <td colspan="5">
        <p align="center">        
        <p align="center"><b><font size="3">Academic Record <br>
        <%=tclass%> - <%=tcourse%> - <%=weekinfo%> <br>  has finished.
          
          
          </font></b><br><br><br><br>
          
        <p align="center">
     <input type=button name=fanhui value="Go to select menu" onclick="window.location.href='search.asp'"><br>
     <form action="register.asp" method="post">
<input name="txtclass" type="hidden" value="<%=tclass%>">
<input name="course" type="hidden" value="<%=tcourse%>">
<input name="weeks" type="hidden" value="<%=tweek%>">	
<input name="txtscore" type="hidden" value="<%=totalscore%>">	
 <input type="submit"   value="Edit score again" >
	 </form>
	 </p>
		
	  </td>
    </tr>
</body>
   <% 
ELSE 
  %>
  <center>
 <input type=button name=fanhui value="Go to select menu" onclick="window.location.href='search.asp'"><br>
     <form action="register.asp" method="post">
<input name="txtclass" type="hidden" value="<%=tclass%>">
<input name="course" type="hidden" value="<%=tcourse%>">
<input name="weeks" type="hidden" value="<%=tweek%>">	
<input name="txtscore" type="hidden" value="<%=totalscore%>">	
 <input type="submit"   value="Edit score again" >
	 </form>
	 </center>
<%
end if
%>

 <!--response.write "<script language='javascript'>" & chr(13)
  response.write "alert('Edit score again！');" & Chr(13)
  response.write "history.go(-1);"&Chr(13)  
  response.write "</script>" & Chr(13)
  response.end    
  -->



 <%function Checkchengji(xm_cn,xm_en,c)   '******************检查成绩有效性

   if Isnumeric(c)=false then
     response.write "<script language='javascript'>" & chr(13)
     response.write "alert('『"&xm_cn&"<"&xm_en&">』,the score must input number!');" & Chr(13)
     response.write "window.document.location.href='javascript:history.back(-1);';"&Chr(13)
     response.write "</script>" & Chr(13)
      Response.end
   end if
   

  end function%>










</body>
</html>
