<% if session("admid")="" or Session("pwd")="" then response.redirect "default.asp"%>
<!--#include file="conn.asp"-->
<%
tclass=request("txtclass")
teacher=request("Teacher")
tSemester=request("Semester")
%>


<%set rs1=server.createobject("ADODB.Recordset") 
     sql1="select * from dateset  "
     rs1.open sql1,conntmp,1,1

%>	  

<html>

<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>CIC School Report Edit  - <%=teacher%></title>
<link rel="stylesheet" href="style/t.css" type="text/css">
</head>
<body bgcolor="#D6D3CE">
<p align="center" class=header>กก</p>


	<center>

  <table border="1" width="550" bordercolorlight="#848284" cellspacing="0" cellpadding="4" bordercolordark="#FFFFFF">
    <tr>
      <td colspan="6">
        <p align="center"><b><font size="3">CIC School Report Edit  - <%=teacher%></font></b></td>   
    </tr>
    <tr>
      <td  align="center" class="altbg1">Class</td>
      <td  align="center" class="altbg2">Chinese Name</td>   
      <td align="center" class="altbg2">English Name</td>
      <td  align="center" class="altbg2">Edit</td>
      <td  align="center" class="altbg2">Print</td>
      <td  align="center" class="altbg2">State</td>
	  
    </tr>
	  <%
	 set rs=server.createobject("ADODB.Recordset") 
	 if teacher="Supervisor" then
	 sql="select * from student  where  class='"&tclass&"'"

	 else
     sql="select * from student  where class='"&tclass&"' and student."&teacher&"=true  "
     
     end if
     rs.open sql,conntmp,3,3
		do while not rs.eof 
		%>
		 	
	<tr>
      <td  align="center" class="altbg1"><%=rs("class")%></td>
      <td align="center" class="altbg2"><%=rs("name_cn")%></td>   
      <td align="center" class="altbg2"><%=rs("name_en")%></td> <form method="POST" action="report.asp" name="form1">
      <td align="center" class="altbg2">
     	
	<input type="hidden" value="<%=tclass%>" name="txtclass"> 
	<input type="hidden" value="<%=rs("name_cn")%>" name="txtname"> 
    <input type="hidden" value="<%=Teacher%>" name="Teacher"> 
    <input type="hidden" value="<%=tSemester%>" name="Semester"> 
    	<input type="submit" value="  Edit  " name="B1">
	</td></form>

	
	<form method="POST" action="reportprint.asp" name="form2" target="_blank">
	     <td align="center" class="altbg2">
      	
	<input type="hidden" value="<%=tclass%>" name="txtclass"> 
	<input type="hidden" value="<%=rs("name_cn")%>" name="txtname"> 
    <input type="hidden" value="<%=Teacher%>" name="Teacher"> 
    <input type="hidden" value="<%=tSemester%>" name="Semester"> 
	<input type="submit" value=" Print " name="B1"> 

	</td></form>

	
	  <td  align="center" class="altbg2">&nbsp;
<%
if tSemester="Semester1" then
	if teacher="Supervisor" then 
		if rs("general1")<>"" or not isnull(rs("general1")) then response.write "Edited" 
	else
		if rs(teacher&"1")<>"" or not isnull(rs(teacher&"1")) then response.write "Edited" 
	
	end if
end if

if tSemester="Semester2" then
	if teacher="Supervisor" then 
		if rs("general2")<>"" or (not isnull(rs("general2"))) then response.write "Edited" 
	else
		if rs(teacher&"2")<>"" or not isnull(rs(teacher&"2")) then response.write "Edited" 
	
	end if
end if


%>
	  </td>
      </tr>
		 
		
		<%

		rs.movenext
		loop
		rs.close
		set rs=nothing

	  %>
	 <tr> 
	 <td colspan="6" align=center><br>
     <%
	 if teacher="Supervisor" then %>
	<form method="POST" action="reportprintall.asp" name="form3"  target="_blank">
	<input type="hidden" value="<%=tclass%>" name="txtclass"> 
    <input type="hidden" value="<%=tSemester%>" name="Semester"> 
    	<input type="submit" value="      Print all      " name="B1">
	</form>	
	<%
	end if
	 
	 %>
	</td>
      </tr>  
  </table>
 
  <br>

  </center>
	

</body>

</html>
