⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 filemanage.asp

📁 关于网络渗透技术的详细讲解
💻 ASP
字号:
<%
if session("username")="" then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
%>

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" type="text/css" href="../images/style.css">
<style type="text/css">
<!--
@import url("wsbs.css");
-->
</style>
</head>

<body bgcolor=#ccccff>
<!--#include file="conn.asp"-->
<%
   	const MaxPerPage=10
   	dim totalPut
   	dim CurrentPage
   	dim TotalPages
   	dim i,j
   	dim idlist
   	dim title

	title=request("txtitle")
   	if not isempty(request("page")) then
      		currentPage=cint(request("page"))
   	else
      		currentPage=1
   	end if
   	dim sql
   	dim rs
%>

<body>
<div align="center"><center>
<br><br>
<table border="0" width="92%" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100%"><p align="center">
<form name="searchsoft" method="POST" action="filemanage.asp">
查找文件:  <input class=input1 type="text" name="txtitle" size="13">&nbsp;<input class=button9 type="submit" value="查 询" name="title">
</form>
<form method=Post action="filemanage.asp">
    <div align="center">
<%
	if title<>"" then
	sql="select * from wj where filename like '%"&trim(title)&"%' order by id desc"
	elseif session("username")="admin" then
	sql="select * from wj order by id desc"
        else
	sql="select * from wj where userid='"&session("userid")&"' order by id desc"
	end if
	Set rs= Server.CreateObject("ADODB.Recordset")
	rs.open sql,conn,1,1

  	if rs.eof and rs.bof then
       		response.write "<p align='center'>没有你要找的文件资料!</p>"
   	else
      		totalPut=rs.recordcount
      		if currentpage<1 then
          		currentpage=1
      		end if
      		if (currentpage-1)*MaxPerPage>totalput then
	   		if (totalPut mod MaxPerPage)=0 then
	     			currentpage= totalPut \ MaxPerPage
	  		else
	      			currentpage= totalPut \ MaxPerPage + 1
	   		end if

      		end if
       		if currentPage=1 then
           		showpage totalput,MaxPerPage,"filemanage.asp"
            		showContent
       		else
          		if (currentPage-1)*MaxPerPage<totalPut then
            			rs.move  (currentPage-1)*MaxPerPage
           			showpage totalput,MaxPerPage,"filemanage.asp"
            			showContent
        		else
	        		currentPage=1
           			showpage totalput,MaxPerPage,"filemanage.asp"
           			showContent
	      		end if
	   	end if
   	rs.close
   	end if
	        
   	set rs=nothing  
   	conn.close
   	set conn=nothing
  
   	sub showContent
       	dim i
	   i=0
%>
      <div align="center"><center><table border="0" cellspacing="2" width="710" cellpadding="0" bordercolorlight="#000000" bordercolordark="#ccccff">
        <tr>
          <td bgcolor=#ffffcc width="35"  height="28" align="center"><strong>ID</strong></td>
          <td bgcolor=#ffffcc width="200"  height="20" align="center"><strong>企业名称</strong></td>
          <td bgcolor=#ffffcc width="230" align="center"><strong>文件名</strong></td>
          <td bgcolor=#ffffcc width="80" align="center"><strong>所属年月</strong></td>
          <td bgcolor=#ffffcc width="45" align="center"><strong>审批否</strong></td>
          <td bgcolor=#ffffcc width="120" align="center"><strong>操作</strong></td>
        </tr>
<%do while not rs.eof%>
        <tr>
          <td bgcolor=#ffffff height="28" width="35" align="center"><%=rs("ID")%></td>
          <td bgcolor=#ffffff width="200"><div style="margin-left:5px;"><%=rs("copname")%></div></td>
          <td bgcolor=#ffffff width="230"><div style="margin-left:5px;"><%=rs("filename")%></div></td>
          <td bgcolor=#ffffff height="20" width="80"><div style="margin-left:5px"><%=rs("zyyear")%>年<%=rs("zymon")%>月</div></td>
          <td bgcolor=#ffffff width="45" align="center"><%if rs("shenpi")=0 then%><font color=red>×</font><%else%><font color=blue>√</font><%end if%></td>
          <td bgcolor=#ffffff width="120" align="left"><div style="margin-left:4px;"><a href=showfile.asp?fn=<%=rs("filepath")%>&ft=<%=rs("filename")%>_<%=rs("copname")%><%=rs("zyyear")%>年<%=rs("zymon")%>月 target=blank>下载</a>
<%if session("flag")=1 or (rs("shenpi")=0 and session("flag")=2) then%>
<a href=delefile.asp?delfn=<%=rs("filepath")%>&delid=<%=rs("id")%>>删除</a>
<%end if%>
<%
if session("flag")=1 then
%>
<a href="shenpi.asp?id=<%=rs("id")%>&sp=<%if rs("shenpi")=0 then%>1<%else%>0<%end if%>">审批</a>
<%else%>
<%if rs("shenpi")=0 then%>
<a href="reupfile.asp?fp=<%=rs("filepath")%>&zyyear=<%=rs("zyyear")%>&zymon=<%=rs("zymon")%>&fn=<%=rs("filename")%>">重新上传<%end if%>
</a>
<%end if%>
</div>
</td>
        </tr>
<%
	i=i+1
	      if i>=MaxPerPage then exit do
	      rs.movenext
	loop
%>
      </table>
      </center></div>
<%
   end sub 

function showpage(totalnumber,maxperpage,filename)
  dim n
  if totalnumber mod maxperpage=0 then
     n= totalnumber \ maxperpage
  else
     n= totalnumber \ maxperpage+1
  end if
  response.write "<p align='center'>&nbsp;"
  if CurrentPage<2 then
    response.write "<font color='#000080'>首页 上一页</font>&nbsp;"
  else
    response.write "<a href="&filename&"?page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?page="&CurrentPage-1&">上一页</a>&nbsp;"
  end if
  if n-currentpage<1 then
    response.write "<font color='#000080'>下一页 尾页</font>"
  else
    response.write "<a href="&filename&"?page="&(CurrentPage+1)&">"
    response.write "下一页</a> <a href="&filename&"?page="&n&">尾页</a>"
  end if
   response.write "<font color='#000080'>&nbsp;页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000080'>/"&n&"</strong>页</font> "
    response.write "<font color='#000080'>&nbsp;共<b>"&totalnumber&"</b>个文件 <b>"&maxperpage&"</b>个文件/页</font> "
       
end function

%>
    </div></td>
  </tr>
</table></form>
</center></div>
</body>
</html>




⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -