<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%if WS_S.MemberPriv("WS_PublicAffairsOfficeEdit")<>1 or WS_S.MemberPriv("WS_PublicAffairsOfficeDel")<>1 then HX_GoBack "对不起,您的权限不够!",""
ColumnName="":Tablename="HX_Office":Orderby=" ORDER BY WS_OfficeAddDate,WS_OFID DESC"
action=request("action")
if action="del" then
  WS_OFID=request("WS_OFID")
  if WS_OFID<>"" and isnumeric(WS_OFID) then
    conn.execute("delete from HX_Office where WS_OFID="&WS_OFID)
    conn.execute("delete from HX_OfficeUseed where WS_OFID="&WS_OFID)
  end if
  response.redirect "officelist.asp"
  response.end
end if
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='700'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#613c25'><tr><td colspan='2' bgcolor=FFFBE8 background='../hximages/titlelinebg.gif'><table width='590'  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' class='td4'><td width='6%' height='26'><div align='center'>序 号</div></td><td width='19%'><div align='center'>名 称</div></td><td width='20%'><div align='center'>价 格</div></td><td width='17%'><div align='center'>保管员</div></td><td width='13%'><div align='center'>使用情况</div></td><td width='15%'><div align='center'>入库时间</div></td><td width='10%'><div align='center'>操 作</div></td></tr>"
if rs.recordcount<=0 then
    response.Write "<tr><td colspan=5 bgcolor=FFFBE8></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><div align='center'>"&rs("WS_OFID")&"</div></td><td><a href='javascript:' onclick=""openwin(650,380,'OfficeView.asp?WS_OFID="&rs("WS_OFID")&"')"" title='查看"&rs("WS_OfficeName")&"具体信息'>"&rs("WS_OfficeName")&"</a></td><td>￥"&rs("WS_OfficeUnitPrice")&"×"&rs("WS_OfficeNum")&""&rs("WS_OfficeMeasurement")&"="&rs("WS_OfficeUnitPrice")*rs("WS_OfficeNum")&"元</td><td>"
	if rs("WS_OfficeManageID")>0 then
	  Call WS_S.HX_OutUserInfo(rs("WS_OfficeManageID"))
	  response.write Outdepartment&OutAppointment&OutName
	else
	  response.write "<font color=red title='可以通过修改指定保管员'>无人保管</font>"  
	end if
	response.write "</td><td>"
	set Urs=WS_S.HX_SetRSD("WS_USID","HX_OfficeUseed"," where WS_OFID="&rs("WS_OFID")) 
	if Urs.recordcount>0 then
	  num=conn.execute("select sum(WS_OfficeReplyNum) as ReplyNum from HX_OfficeUseed where WS_OFID="&rs("WS_OFID"))(0)
	  if num=rs("WS_OfficeNum") then
	    response.write "<a href='javascript:' onclick=""openwin(650,480,'OfficeUseed.asp?action=View&WS_OFID="&rs("WS_OFID")&"&WS_USID="&Urs("WS_USID")&"')"" title='查看分发/申领情况'><font color=red>全部申领</font></a>"
	  else
	    response.write "<a href='javascript:' onclick=""openwin(650,480,'OfficeUseed.asp?action=View&WS_OFID="&rs("WS_OFID")&"&WS_USID="&Urs("WS_USID")&"')"" title='查看分发/申领情况'><font color=red>"&num&rs("WS_OfficeMeasurement")&"申领</font></a><br>"
	    response.write "<a href='javascript:' onclick=""openwin(650,480,'OfficeUseed.asp?action=reply&WS_OFID="&rs("WS_OFID")&"')"" title='申请使用'><font color=blue>"&(rs("WS_OfficeNum")-num)&rs("WS_OfficeMeasurement")&"库存</font></a>"
	  end if
	else
	  response.write "<a href='javascript:' onclick=""openwin(650,480,'OfficeUseed.asp?action=reply&WS_OFID="&rs("WS_OFID")&"')"" title='申请使用'><font color=blue>全部库存</font></a>"
	end if
	response.write "</td><td>"&WS_S.Format_Time(rs("WS_OfficeAddDate"),5)&"</td><td align='center'>"
	if WS_S.MemberPriv("WS_PublicAffairsOfficeEdit")=1 then response.Write "<a href=""javascript:"" onclick=""openwin(650,380,'OfficeEidt.asp?WS_OFID="&rs("WS_OFID")&"')"">"
	   response.Write "修改</a>  "
	 if WS_S.MemberPriv("WS_PublicAffairsOfficeDel")=1 then response.Write "<a href=""?action=del&WS_OFID="&rs("WS_OFID")&""">"
	 response.Write "删除</a>"
	 response.write "</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>",7)
	   end if
	  call WS_S.HX_RSClose(rs) 
	  response.Write "</table></td></tr></table>"%>