<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<!--#INCLUDE FILE="../HXINCLUDE/SelectDate.asp"-->
<%if WS_S.MemberPriv("WS_PublicAffairsMeetingModify")<>1 then HX_GoBack "对不起,您的权限不够!",""
action=request("action"):ColumnName="":Tablename="HX_MeetingApply":Tablename1="HX_MeetingMain"
WS_MAID=request("WS_MAID")
if WS_MAID="" or isnull(WS_MAID) or (WS_MAID<>"" and not isnumeric(WS_MAID)) then 	HX_GoBack "非法操作",""  
Orderby=" where WS_MAID="&WS_MAID
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
if rs.recordcount<=0 then 	HX_GoBack "非法操作",""  
select case action
  case "saveinfo"
     WS_MMID=request("WS_MMID")
     rs("WS_MeetingFirstDate")=request("Date1")&" "&request("xx1")&":"&"00"&":"&"00"
     rs("WS_MeetingLastDate")=request("Date2")&" "&request("xx2")&":"&"59"&":"&"00"
	 if WS_MMID<>"" and isnumeric(WS_MMID) then
     rs("WS_MMID")=WS_MMID	 
	 end if
	 rs("WS_MeetingSpremark")=request("spremark")
	 rs("WS_MeetingSpsign")=1
     rs.update
	 conn.execute("insert into HX_MailChit(WS_MailObject,WS_MailToUid,WS_MailSendUid,WS_MailBody,WS_MailSendDate) values('会议室申请通知！',"&rs("WS_MeetingApplyMan")&","&LOGINUID&",'您使用会议室的申请已通过审批<br>审批意见："&request("spremark")&"<br>会议室："&conn.execute("select WS_MeetingName from HX_MeetingMain where WS_MMID="&WS_MMID)(0)&"<br>时间："&rs("WS_MeetingFirstDate")&"-"&rs("WS_MeetingLastDate")&"',#"&now&"#)")
     conn.execute("update HX_MeetingMain set WS_MeetingState=1 where WS_MMID="&WS_MMID)
	 HX_GoBack "审批成功！","Meetingmanage.asp"  
  case "cancle"
	 conn.execute("insert into HX_MailChit(WS_MailObject,WS_MailToUid,WS_MailSendUid,WS_MailBody,WS_MailSendDate) values('会议室申请通知！',"&rs("WS_MeetingApplyMan")&","&LOGINUID&",'您使用会议室的申请未通过审批,退回原因为：暂时没有空闲会议室！',#"&now&"#)")
     rs.delete
	 HX_GoBack "取消成功！","Meetingmanage.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'><script src='../HXinclude/HX_Function.js'></script></head><body topmargin='20' leftmargin='0' bottommargin='0'><table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8><table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>会议室审批</font></td></tr></table><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=FFFBE8><form name='form1' method='post' action='?action=saveinfo&WS_MAID="&WS_MAID&"'><tr bgcolor='#FFFBE8'><td width='12%'>开会地点</td><td width='20%'>"&rs("WS_Meetingarea")&"</td><td width='14%'><div align='right'>使用人数</div></td><td width='54%'>"&rs("WS_Meetingmannum")&"人</td></tr><tr bgcolor='#FFFBE8'><td>指定会议室</td><td colspan='3'>"
     msg=True
	 set crs=WS_S.HX_SetRSD(ColumnName,Tablename1," where WS_MeetingState=0")
	 if crs.recordcount<=0 then
	  response.write "<font color='red'>没有空闲会议室</font>"
	  msg=False
	 else
	response.Write "<select name='WS_MMID'>"
	do until crs.eof
	response.Write "<option value='"&crs("WS_MMID")&"'>"&crs("WS_MeetingName")&"</option>" 
	   crs.movenext
	   loop
	 response.Write "</select>"
	   msg=True
	   end if
	   response.Write "</td></tr><tr bgcolor='#FFFBE8'><td>申 请 者</td><td colspan='3'>"
	   Call WS_S.HX_OutUserInfo(rs("WS_MeetingApplyMan")):response.Write "<a href='javascript:' onclick=""openwin(700,550,'../HXManpowerResource/userinfolook.asp?WS_Uid="&rs("WS_MeetingApplyMan")&"');"">"&OutName&"</a></td></tr><tr bgcolor='#FFFBE8'><td width='12%'>简要描述</td><td colspan='3'>"&rs("WS_MeetingRemark")&"</td></tr><tr bgcolor='#FFFBE8'><td width='12%' height='27'>使用时间</td><td height='27' colspan='3'><input type='text' name='Date1' value='"&year(rs("WS_MeetingFirstDate"))&"-"&month(rs("WS_MeetingFirstDate"))&"-"&day(rs("WS_MeetingFirstDate"))&"' size=10 readonly> <input onclick=""popUpcalendar(this, form1.Date1, 'yyyy/mm/dd')"" type='button' value='选择' title='选择开始时间'>日 <select name='xx1' classname='5'  size='1' ><option value='0'>00</option>"
	   for i=1 to 23
	   response.Write "  <option value='"&i&"'"
	    if i=hour(rs("WS_MeetingFirstDate")) then response.Write " selected" 
		response.Write ">"
		if i<10 then response.Write"0"&i else response.Write i 
		response.Write "</option>"
	   next
	   response.Write "</select>点 ～<input type='text' name='Date2' value='"&year(rs("WS_MeetingLastDate"))&"-"&month(rs("WS_MeetingLastDate"))&"-"&day(rs("WS_MeetingLastDate"))&"' size=10 readonly> <input onclick=""popUpcalendar(this, form1.Date2, 'yyyy/mm/dd')"" type='button' value='选择' title='选择结束时间'>日<select name='xx2' classname='5'  size='1' ><option value='0'>00</option>"
	   for i=1 to 23
	     response.Write "  <option value='"&i&"'"
	     if i=hour(rs("WS_MeetingLastDate")) then response.Write " selected"
		 response.Write">"
		 if i<10 then response.Write "0"&i else response.Write i
		 response.Write"</option>"
		 next
		 response.Write "</select>点 </td></tr><tr bgcolor='#FFFBE8'><td width='12%' valign='top'>申请原因</td><td colspan='3' title='"&rs("WS_MeetingExcuse")&"'>"&rs("WS_MeetingExcuse")&"</td></tr><tr bgcolor='#FFFBE8'><td valign='top'>申请时间</td><td colspan='3'>"&rs("WS_MeetingApplyDate")&"</td></tr><tr bgcolor='#FFFBE8'><td width='12%' valign='top'>审批意见</td><td colspan='3'><textarea rows='8' name='spremark' cols='50' class='bgLine'></textarea></td></tr><tr bgcolor='#FFFBE8'><td valign='top'>&nbsp;</td><td colspan='3'><input type='submit' name='Submit' value=' 同 意 申 请 ' "
		 if msg=False then response.write "disabled title='暂时还没有空闲会议室，所以无法审批！'"
		 response.Write "> <input type='button' name='Submit' value=' 取 消 申 请 ' onclick=""javascript:location.href='?action=cancle&WS_MAID="&WS_MAID&"';""> <input name='WS_MAID' type='hidden' id='WS_MAID' value='"&WS_MAID&"'><font color=FF0000>取消无需填写审批意见</a></td></tr></form></table></td></tr></table>"
%>