<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
set ours=WS_S.HX_SetRSD("","HX_AttendanceOutEnrol"," where WS_AttendanceOutEnrolLEADERID="&loginuid&" and WS_AttendanceOutEnrolFlag=0 order by WS_AOID asc")
set lers=WS_S.HX_SetRSD("","HX_AttendanceLeaveEnrol"," where WS_AttendanceLeaveEnrolLEADERID="&loginuid&" and WS_AttendanceLeaveEnrolFlag=0 order by WS_ALID asc")
set aers=WS_S.HX_SetRSD("","HX_AttendanceEvectionEnrol"," where WS_AttendanceEvectionEnrolLEADERID="&loginuid&" and WS_AttendanceEvectionEnrolFlag=0 order by WS_AEID asc")
action=request("action")
select case action
 case "outenrol"
   if WS_S.HX_ISNUM(request("CONFIRM")) and WS_S.HX_ISNUM(request("AOID")) then
     conn.execute("update HX_AttendanceOutEnrol set WS_AttendanceOutEnrolFlag="&request("CONFIRM")&" where WS_AOID="&request("AOID"))
     Call WS_S.HX_OutUserInfo(loginuid)
	 if request("CONFIRM")=1 then msg="已批准" else msg="未批准" 
     conn.execute("insert into HX_WebSMS(WS_Sendnmb,WS_recvnmb,WS_message,WS_SMSstype) values("&loginuid&","&ours("WS_AttendanceOutEnrolReplyID")&",'你提出的外出申请,"&OutName&msg&"！','考勤批示')")
   end if	 
   WS_S.HX_Redirect "AttendanceManageConfirm.asp"
 case "leaveenrol"
   if WS_S.HX_ISNUM(request("CONFIRM")) and WS_S.HX_ISNUM(request("ALID")) then
     conn.execute("update HX_AttendanceLeaveEnrol set WS_AttendanceLeaveEnrolFlag="&request("CONFIRM")&" where WS_ALID="&request("ALID"))
     Call WS_S.HX_OutUserInfo(loginuid)
	 if request("CONFIRM")=1 then msg="已批准" else msg="未批准" 
     conn.execute("insert into HX_WebSMS(WS_Sendnmb,WS_recvnmb,WS_message,WS_SMSstype) values("&loginuid&","&lers("WS_AttendanceLeaveEnrolReplyID")&",'你提出的外出申请,"&OutName&msg&"！','考勤批示')")
   end if	 
   WS_S.HX_Redirect "AttendanceManageConfirm.asp"
 case "leaveenrol"
   if WS_S.HX_ISNUM(request("CONFIRM")) and WS_S.HX_ISNUM(request("ALID")) then
     conn.execute("update HX_AttendanceLeaveEnrol set WS_AttendanceLeaveEnrolFlag="&request("CONFIRM")&" where WS_ALID="&request("ALID"))
     Call WS_S.HX_OutUserInfo(loginuid)
	 if request("CONFIRM")=1 then msg="已批准" else msg="未批准" 
     conn.execute("insert into HX_WebSMS(WS_Sendnmb,WS_recvnmb,WS_message,WS_SMSstype) values("&loginuid&","&lers("WS_AttendanceLeaveEnrolReplyID")&",'你提出的请假申请,"&OutName&msg&"！','考勤批示')")
   end if	 
   WS_S.HX_Redirect "AttendanceManageConfirm.asp"
 case "Evectionenrol"
   if WS_S.HX_ISNUM(request("CONFIRM")) and WS_S.HX_ISNUM(request("AEID")) then
     conn.execute("update HX_AttendanceEvectionEnrol set WS_AttendanceEvectionEnrolFlag="&request("CONFIRM")&" where WS_AEID="&request("AEID"))
     Call WS_S.HX_OutUserInfo(loginuid)
	 if request("CONFIRM")=1 then msg="已批准" else msg="未批准" 
     conn.execute("insert into HX_WebSMS(WS_Sendnmb,WS_recvnmb,WS_message,WS_SMSstype) values("&loginuid&","&aers("WS_AttendanceEvectionEnrolReplyID")&",'你提出的出差申请,"&OutName&msg&"！','考勤批示')")
   end if	 
   WS_S.HX_Redirect "AttendanceManageConfirm.asp"
 end select
 response.Write "<head><meta http-equiv='Content-Type' content='text/html; charset=gb2312'><title></title><link rel=stylesheet type=text/css href='../HXinclude/HX_Style.css'></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='611'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td width='619' colspan='2' bgcolor=FFFBE8><table width='609'  border='0' cellspacing='0' cellpadding='0'><tr><td width='609' height='25' background='../hximages/titleline.gif'><font class='fontmenu'>考勤审批</font></td></tr></table><table width='100%' cellspacing=1 cellpadding=3 bgcolor='#613c25'><tr bgcolor='6C8DBE' class=td4><td colspan='6'>外出审批</td></tr><tr bgcolor='BF9B73' class='td4'><td align='center'>部门</td><td align='center'>姓名</td><td align='center'>外出原因</td><td align='center'>外出时间</td><td align='center'>预计归来时间</td><td align='center'>操作</td></tr>"
	  if ours.recordcount<=0 then
	    response.Write "<tr><td bgcolor=FFFBE8 colspan=6 align=center>暂时无人申请</td></tr>"
	  else
	    do until ours.eof
		 Call WS_S.HX_OutUserInfo(ours("WS_AttendanceOutEnrolReplyID"))
	     response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td align='center'>"&Outdepartment&"</td><td align='center'>"&OutName&"</td><td align='center'>"&ours("WS_AttendanceOutEnrolTYPE")&"</td><td align='center'>"&ours("WS_AttendanceOutEnrolTime1")&"</td><td align='center'>"&ours("WS_AttendanceOutEnrolTime2")&"</td><td align='center'><a href='?action=outenrol&CONFIRM=1&AOID="&ours("WS_AOID")&"'>批准</a>&nbsp;<a href='?action=outenrol&CONFIRM=2&AOID="&ours("WS_AOID")&"'>不批准</a></td></tr>"
		ours.movenext
		loop
	  end if
	  response.Write "</table><br><table width='100%' cellspacing=1 cellpadding=3 bgcolor='#613c25'><tr bgcolor='6C8DBE' class=td4><td colspan='7'>请假审批</td></tr><tr bgcolor='BF9B73' class='td4'><td align='center'>部门</td><td align='center'>姓名</td><td align='center'> 请假原因</td><td align='center'> 开始时间 </td><td align='center'> 结束时间 </td><td align='center'>目前状态</td><td align='center'>操作</td></tr>"
	  if lers.recordcount<=0 then
	    response.Write "<tr><td bgcolor=FFFBE8 colspan=7 align=center>暂时无人申请</td></tr>"
	  else
	    do until lers.eof
		 Call WS_S.HX_OutUserInfo(lers("WS_AttendanceleaveEnrolReplyID"))
	     response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td align='center'>"&Outdepartment&"</td><td align='center'>"&OutName&"</td><td align='center'>"&lers("WS_AttendanceleaveEnrolTYPE")&"</td><td align='center'>"&lers("WS_AttendanceleaveEnrolTime1")&"</td><td align='center'>"&lers("WS_AttendanceleaveEnrolTime1")&"</td><td align='center'>"
		 select case lers("WS_AttendanceLeaveEnrolFlag")
          case 0:response.Write "待批"
          case 1:response.Write "已批准"
	      case 2:response.Write "未批准"
	      case 3:response.write "已销假" 
         end select
          response.Write "</td><td align='center'>"
		  if lers("WS_AttendanceLeaveEnrolFlag")=0 then response.Write "<a href='?action=leaveenrol&CONFIRM=1&ALID="&lers("WS_ALID")&"'>批准</a>&nbsp; <a href='?action=leaveenrol&CONFIRM=2&ALID="&lers("WS_ALID")&"'>不批准</a>" else response.write "无"
	      response.Write "</td></tr>"
	    lers.movenext
		loop
	  end if
	  response.Write "</table><br><table width='100%' cellspacing=1 cellpadding=3 bgcolor='#613c25'><tr bgcolor='6C8DBE' class=td4><td colspan='8'>出差审批</td></tr><tr bgcolor='BF9B73' class='td4'><td width='13%' align='center'>部门</td><td width='10%' align='center'>姓名</td><td width='14%' align='center'> 出差地点</td><td width='14%' align='center'>事因</td><td width='11%' align='center'> 开始时间 </td><td width='12%' align='center'> 结束时间 </td><td width='9%' align='center'>目前状态</td><td width='17%' align='center'>操作</td></tr>"
	  if aers.recordcount<=0 then
	    response.Write "<tr><td bgcolor=FFFBE8 colspan=8 align=center>暂时无人申请</td></tr>"
	  else
	   do until aers.eof
		 Call WS_S.HX_OutUserInfo(aers("WS_AttendanceEvectionEnrolReplyID"))
	     response.Write "<tr bgcolor='#FFFBE8' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td align='center'>"&Outdepartment&"</td><td align='center'>"&OutName&"</td><td align='center'>"&aers("WS_AttendanceEvectionEnrolADDRESS")&"</td><td align='center' title='"&aers("WS_AttendanceEvectionEnrolReason")&"'>"&left(aers("WS_AttendanceEvectionEnrolReason"),6)&"</td><td align='center'>"&aers("WS_AttendanceEvectionEnrolTime1")&"</td><td align='center'>"&aers("WS_AttendanceEvectionEnrolTime1")&"</td><td align='center'>"
	     select case aers("WS_AttendanceEvectionEnrolFlag")
           case 0:response.Write "待批"
           case 1:response.Write "已批准"
	       case 2:response.Write "未批准"
	       case 3:response.write "已销假" 
        end select
       response.Write "</td><td align='center'>"
	  if aers("WS_AttendanceEvectionEnrolFlag")=0 then response.Write "<a href='?action=Evectionenrol&CONFIRM=1&AEID="&aers("WS_AEID")&"'>批准</a>&nbsp; <a href='?action=Evectionenrol&CONFIRM=2&AEID="&aers("WS_AEID")&"'>不批准</a>" else response.write "无" end if
	  response.Write "</td></tr>"
	  aers.movenext
	loop
end if
response.Write "</table></td></tr></table>"%>
