<%if session("admin")="" then
response.write"你没有登录或是非法用户!<meta http-equiv=refresh content='1;url=../index.asp'>"
response.End()
end if%>
<!--#include file=conn.asp-->
<!--#include file="../config.asp"-->
<head>
<link href=../iknow.css rel=stylesheet type=text/css>
</head>
<table width="95%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" height="109">
  <tr>
    <td height="23" colspan="6" align="center" bgcolor="eeeeee"><font style="font-size:14px">删除共享资料</font></td>
  </tr>
  <%if request("del")="删除" then
  rs.open"select * from Share where id="&cint(request("id")),conn,1,3
  set objfilesys=server.createobject("scripting.filesystemobject")
ss="../Sharefile/"&rs("ffname")
ss=server.mappath(ss)
if objfilesys.FILEExists(ss) then
objfilesys.deleteFILE ss
end if
rs2.open"select * from Sharep where upid="&cint(request("id")),conn,1,1
if not rs2.eof then
 rs1.open"select * from Sharep where upid="&cint(request("id")),conn,1,3
  rs1.delete
  rs1.close
  rs2.close
  end if
  rs.delete
  rs.close
  response.write"<tr><td colspan=6>资料删除成功!</td></tr><meta http-equiv=refresh content='1;url=adminshare.asp'>"
  response.End()
    end if
  %>
  <tr>
    <td align="center" height="12">资料</td>
    <td align="center" height="12">发布人</td>
    <td align="center" height="12">文件</td>
    <td align="center" height="12">大小</td>
    <td align="center" height="12">发布时间</td>
    <td align="center" height="12">操作</td>
  </tr>
  <%rs.open"select * from Share order by id desc",conn,1,1
  if rs.eof then
  %><tr>
    <td colspan="6" align="center" height="12" >暂时没有资料!</td>
  </tr>
  <%else
  maxnum=rs.recordcount
  rs.pagesize=15
  maxpage=rs.pagecount
  if request("p")="" then
  p=1
  else
  p=cint(request("p"))
  end if
  if p>maxpage then
  p=maxpage
  end if
  if p=0 then
  p=1
  end if
  if p<>1 then
  rs.move (p-1)*rs.pagesize
  end if
  for i=1 to rs.pagesize
  %>
  <form method=post action=adminshare.asp?id=<%=rs("id")%>>
    <tr>
    <td align="center" height="25"><a href=../sharev.asp?id=<%=rs("id")%> target=_blank>查看</a></td>
    <td align="center" height="25"><%=rs("upuser")%></td>
    <td align="center" height="25"><%=rs("fname")%></td>
    <td align="center" height="25"><%=rs("b")%>字节</td>
    <td align="center" height="25"><%=rs("uptime")%></td>
    <td align="center" height="25"><input name="del" type="submit" id="del" value="删除"></td>
  </tr></form>
  <%
  rs.movenext
  if rs.eof then exit for
  next%>
   <tr>
    <td colspan="6" align="center" bgcolor="#EEEEEE" height="27">
      <p align="left">共<font color=red><%=maxnum%></font>个评论，15个每页，页次:<font color=red><%=p%></font>/<%=maxpage%>
	<a href=adminsharep.asp?p=1>首页</a>    
	<a href=adminsharep.asp?p=<%=p-1%>>上页</a>    
	<a href=adminsharep.asp?p=<%=p+1%>>下页</a>    
	<a href=adminsharep.asp?p=<%=maxpage%>>尾页</a></p>   
    </td> 
  </tr>
  <%end if
  rs.close%>
</table>
