<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_PublicAffairsBookManage")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_BookMain":WS_BOID=request("WS_BOID")
if WS_BOID="" or isnull(WS_BOID) or (WS_BOID<>"" and not isnumeric(WS_BOID)) then 	response.write "<script>alert('非法操作');window.close();</script>":response.end  
action=request("action"):Orderby=" where WS_BOID="&WS_BOID
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
select case action
  case "apply"
	 conn.execute("update HX_BookMain set WS_BookSign=0,WS_BookBorrow=1 where WS_BOID="&WS_BOID)'图书
	 conn.execute("update HX_BookBorrow set WS_BookSign=1,WS_BookBorrowTime=#"&now&"# where WS_BOID="&WS_BOID)'借出	 
	 conn.execute("insert into HX_MailChit(WS_MailToUid,WS_MailSendUid,WS_MailObject,WS_MailBody,WS_MailSendDate) values("&conn.execute("select WS_BookBorrowMan from HX_BookBorrow where WS_BOID="&WS_BOID)(0)&","&LOGINUID&",'借书通知！！','您想借《"&rs("WS_BookName")&"》已获批准，快去拿书吧！！',#"&now&"#)")
	 HX_GoBack "审批成功！","booksmanage.asp" 
  case "cancle"
	 conn.execute("update HX_BookMain set WS_BookSign=0 where WS_BOID="&WS_BOID)'图书	 
	  conn.execute("insert into HX_MailChit(WS_MailToUid,WS_MailSendUid,WS_MailObject,WS_MailBody,WS_MailSendDate) values("&conn.execute("select WS_BookBorrowMan from HX_BookBorrow where WS_BOID="&WS_BOID)(0)&","&LOGINUID&",'借书通知！！','对不起，您想借《"&rs("WS_BookName")&"》未获批准！！',#"&now&"#)")
	 conn.execute("delete from HX_BookBorrow where WS_BOID="&WS_BOID)
	 HX_GoBack "取消成功！","booksmanage.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='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' onSubmit='return modulecheck();'><tr bgcolor='#FFFBE8'><td width='27%' align='right'><table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor=FFFBE8><tr bgcolor='#FFFBE8'><td width='17%'>编　　号：</td><td width='27%'>"&rs("WS_BOOKNUM")&"</td><td width='17%'>书　　名：</td><td width='39%'>"&rs("WS_BOOKName")&"</td></tr><tr bgcolor='#FFFBE8'><td width='17%'>作　　者：</td><td width='27%'>"&rs("WS_BOOKAuthor")&"</td><td width='17%'>单　　价：</td><td width='39%'>"&rs("WS_BOOKPrice")&rs("WS_BookPriceUnit")&"</td></tr><tr bgcolor='#FFFBE8'><td width='17%'>出 版 社：</td><td width='27%'>"&rs("WS_BOOKConcern")&"</td><td width='17%'>出版时间：</td><td width='39%'>"&year(rs("WS_BOOKPublishDate"))&"年"&month(rs("WS_BOOKPublishDate"))&"月"&"</td></tr><tr bgcolor='#FFFBE8'><td width='17%'>内容简介：</td><td colspan='3'>"&rs("WS_BOOKDetail")&"</td></tr><tr bgcolor='#FFFBE8'><td width='13%'>申 请 者：</td><td width='87%' colspan='3'><font color=blue>"
WS_S.HX_OutUserInfo conn.execute("select WS_BookBorrowMan from HX_BookBorrow where WS_BOID="&rs("WS_BOID"))(0) :response.Write OutName&"</font></td></tr><tr bgcolor='#FFFBE8'><td colspan='4' align=right><input name='APPLY' type='button' value=' 同 意 ' onclick=""javascript:location.href='?action=apply&WS_BOID="&WS_BOID&"';""> <input name='CANCLE' type='button' value=' 取 消 ' onclick=""javascript:location.href='?action=cancle&WS_BOID="&WS_BOID&"';""> <input name='close' type='button' value=' 返 回 ' onclick=""javascript:history.go(-1);"">&nbsp;</td></tr></table></td></tr></form></table></td></tr></table>"%>
