<!--#include file="../SQLconn.asp"-->
<%      
		  
		'生产新纪录  
		curdate=date()  
	    Set MyOAASPObj = Server.CreateObject("YFSchoolOApro2.YFSchoolDll2")
		MyOAASPObj.KaoqinNew(curdate)
	    set MyOAASPObj=nothing
   
	 
	 
     zubie="默认组"	
     set Rszu=server.createobject("adodb.recordset")
     sqlRszu="select * from teacherGroup where tname='"&request.cookies("tname")&"'  and owner='考勤管理'" 
     Rszu.open sqlRszu,conn,1,3
	    zubie=Rszu("GroupName")
	 zubie.close
	 
	 set Rszuvar=server.createobject("adodb.recordset")
     sqlRszuvar="select * from kaoqinvar where   组名='"&zubie&"' " 
     Rszuvar.open sqlRszuvar,conn,1,3
		  swCD=formatdatetime(now,2)&" "&Rszuvar("早上迟到")    '早上迟到
		  swZT=formatdatetime(now,2)&" "&Rszuvar("早上早退")     '早上早退
		  xwCD=formatdatetime(now,2)&" "&Rszuvar("下午迟到")     '下午迟到 
		  xwZT=formatdatetime(now,2)&" "&Rszuvar("下午早退")     '下午早退
		  wsCD=formatdatetime(now,2)&" "&Rszuvar("晚上迟到")    '晚上迟到 
		  wsZT=formatdatetime(now,2)&" "&Rszuvar("晚上早退")      '晚上早退
		  
		  swCome=formatdatetime(now,2)&" "&Rszuvar("上午上班打卡截止")           '上午上班打卡截止
		  swGo=formatdatetime(now,2)&" "&Rszuvar("上午下班打卡截止")               '上午下班打卡截止
		  xwCome=formatdatetime(now,2)&" "&Rszuvar("下午上班打卡开始")          '下午上班打卡开始
		  xwGo=formatdatetime(now,2)&" "&Rszuvar("下午下班打卡截止")              '下午下班打卡截止
		  wsCome=formatdatetime(now,2)&" "&Rszuvar("晚上上班打卡开始")           '晚上上班班打卡开始
		  wsGo=formatdatetime(now,2)&" "&Rszuvar("晚上下班打卡开始")              '晚上
	 	 
	 Rszuvar.close
				
		'''''''''''''''''''''''''''''''''''''''''''''''''''''varset 放在这里开始
   dakatype=""
   zhuangtai="正常"
   qdtime=now()
 

   if datediff("s",swCome,qdtime)<0 then 
      dakatype="上午上班"
	  if  datediff("s",swCD,qdtime)>0 then
	      zhuangtai="迟到"
	  end if
   end if 
   
   if datediff("s",swGo,qdtime)>0  and  datediff("s",xwCome,qdtime)<0 then 
      dakatype="上午下班"
	  
   end if 
   
   if datediff("s",xwCome,qdtime)>0  and  datediff("s",xwGo,qdtime)<0 then 
      dakatype="下午上班"
	  if  datediff("s",xwCD,qdtime)>0 then
	      zhuangtai="迟到"
	  end if
   end if 
   
   if datediff("s",xwGo,qdtime)>0  and  datediff("s",wsCome,qdtime)<0 then 
      dakatype="下午下班"
   end if 
   
   if datediff("s",wsCome,qdtime)>0  and  datediff("s",wsGo,qdtime)<0 then 
      dakatype="晚上上班"
	   if  datediff("s",wsCD,qdtime)>0 then
	      zhuangtai="迟到"
	  end if
   end if 
   if datediff("s",wsGo,qdtime)>0 then 
      dakatype="晚上下班"
   end if 

     
		 
		 
       
		   
       set RsCheck=server.createobject("adodb.recordset")
       sqlCheck="select * from kaoqin where tname='"&request.cookies("tname")&"'  and  convert(datetime,curdate)='"&date()&"'  and  qdtype='"&dakatype&"'" 
       RsCheck.open sqlCheck,conn,1,3
	   if   (dakatype<>"") and  (RsCheck("zhuangtai")<>"") then    
           response.redirect   "GeRenjilu.asp?dakatype="&dakatype
	   else 
	       response.redirect   "SheXiang.asp?dakatype="&dakatype&"&zhuangtai="&zhuangtai
	     
	   end if


    
 %>
 
 <% =zubie%>   <% =sqlRszuvar%> <% =sqlRszu%><% =swCD%><% =swZT%><% =xwCD%><% =xwZT%>
 -----<% =ttttttt%><% =request.cookies("kaoqinzu") %> ----------
 
   <% =dakatype%>
   ---------- 
   <% =swCome%> ---------- 
   <% =swCD%>
   
 <p></p>
   