<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_PublicAffairsBookView")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_BookMain":Orderby="":action=request("action"):keywords=request("keywords")
if action="search" then Orderby=Orderby&"  where WS_Booknum like '%"&keywords&"%' or WS_Bookname like '%"&keywords&"%' or WS_Bookconcern like '%"&keywords&"%' or WS_Bookdetail like '%"&keywords&"%' or WS_Bookauthor like '%"&keywords&"%'"
set rs=WS_S.HX_SetRSD(ColumnName,Tablename,Orderby)
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><tr bgcolor='#BF9B73'><td width='10%'><div align='center'><font color='#000000'>编号</font></div></td><td width='34%'><div align='center'>书名</div></td><td width='25%'><div align='center'>出版社</div></td><td width='12%'><div align='center'><font color='#000000'>借者</font></div></td><td width='19%'><div align='center'><font color='#000000'>申请借书</font></div></td></tr>"
    if rs.recordcount<=0 then
		response.Write "<tr><td colspan=5 bgcolor=FFFBE8 height=25 align=center>暂无记录！</td></tr>"							
	else
    rs.PageSize =15 '每页记录条数
	iCount=rs.RecordCount '记录总数
	iPageSize=rs.PageSize
    	maxpage=rs.PageCount 
    	page=request("page")
    
    if Not IsNumeric(page) or page="" then
        page=1
    else
        page=cint(page)
    end if
    if page<1 then
        page=1
    elseif  page>maxpage then
        page=maxpage
    end if
    rs.AbsolutePage=Page
	if page=maxpage then
		x=iCount-(maxpage-1)*iPageSize
	else
		x=iPageSize
	end if
	ii=0
	do while not rs.EOF 
	   response.write "<tr bgcolor=FFFBE8  onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#FFFBE8'><td width='10%'><div align='center'>"
	   if rs("WS_BookNUM")<>"" then response.Write rs("WS_BookNUM")
	   response.write "</div></td><td><div align='left'>"
	   if rs("WS_BookName")<>"" then response.write "<a href='javascript:' onClick=""openwin(520,230,'Bookdetail.asp?WS_BOID="&rs("WS_BOID")&"')"" title='点击查看<"&rs("WS_BookName")&"'>"&rs("WS_BookName")&"</a></div></td><td width='21%'><div align='center'>"
	   if rs("WS_BookConcern")<>"" then response.write rs("WS_BookConcern")
	   response.write "</div></div></td><td><div align='center'>"
	   set brs=WS_S.HX_SetRSD(ColumnName,"HX_BookBorrow"," where WS_BOID="&rs("WS_BOID")&" and WS_BookSign=1")
	   if brs.recordcount>0 then Call WS_S.HX_OutUserInfo(brs("WS_BookBorrowMan")):response.Write OutName
	   response.write "</div></td><td><div align='center'>"
       set brs=WS_S.HX_SetRSD(ColumnName,"HX_BookBorrow"," where WS_BOID="&rs("WS_BOID")&" and WS_BookSign=0")
	   if rs("WS_BookBorrow")=1 then
	       response.write"<font color=FF0000>本书已出借</font>"
	   else
	   if brs.recordcount<=0 then
		response.write "<a href=""bookapply.asp?WS_BOID="&rs("WS_BOID")&"""><font color='blue'>申请</font></a>"
	   else 
	   Call WS_S.HX_OutUserInfo(brs("WS_BookBorrowMan"))
       response.write "<font color=green title=""申请者"&OutName&",请过段时间再申请！！！！""><font color=red>已有申请</font> "
       end if
	   end if
	   response.write "</div></td></tr>"
	  ii=ii+1
	  if ii>=rs.PageSize then Exit Do
	  rs.movenext
      loop
      call WS_S.PageControl(iCount,maxpage,page,"border=0 align=right","<p align=right>",5)
	   end if
	  call WS_S.HX_RSClose(rs) 
	 response.write "</table></td></tr><form name='form1' method='post' action='?action=search'><tr><td height='40' bgcolor=7a553e class=td4>　关键字：<input type='text' name='keywords' title='请输入要查询的编号或书名或出版社或作者或内容简介'> <input type='submit' name='Submit' value=' 查 询 '><font color=FFFBE8><br> 注：此查询可以按编号、书名、出版社、作者、内容简介进行搜索</font></td></tr></form></table>"
%>