<!--#include file="../checkLogin.asp"-->
<!--#include file="../SQLconn.asp"-->
<%
 
    tname=request.cookies("tname")
    gradename=request("gradename")
	classname=request("classname")
	abc=request("abc")
	fid=request("fid")
	if abc<>"" then
		   
		   set RsDel=server.createobject("adodb.recordset")
		   sqlDel="delete  from zuoyebanji  where     作业ID='"&fid& "' and  级别='"&gradename& "'  and  班别='"&classname& "'"
		   RsDel.open sqlDel,conn,1,1
		  
		   RsDel.close
		   set RsDel=nothing  
   else
           set RsDel=server.createobject("adodb.recordset")
		 '  sqlDel="insert into zuoyebanji(作业ID,级别,班别,学号,姓名)  values('"&fid& "','"&gradename& "','"&classname& "','"&gradename& "','"&classname& "')"
       
	       sqlDel="Insert into zuoyebanji(作业ID,级别,班别,统一编号,学号,姓名)  SELECT  '"&fid&"', grade,class,tongyibianhao,number,uname  FROM students  where   grade='"&gradename& "'  and  class='"&classname& "'  and  years='"&request.cookies("nowxueqi")& "'"  
		  
		   RsDel.open sqlDel,conn,1,1
		   RsDel.close
		   set RsDel=nothing  
   end if
   
    
   
   
   conn.close
   set conn=nothing
 
  response.redirect   "setpMyClass.asp?fid="&fid&"&curpage="&curpage
 %>
ss<%=fid%> 