📄 downloadmanage.asp
字号:
<!--#include file="CheckAdminLogined.asp"-->
<!--#include file="../include/connstr.asp"-->
<!--#include file="../include/DefFunction.asp"-->
<%
'----------------------------------------------
if request("cur_action")="delete" then
conn.cursorlocation=3
set rs_delete=conn.execute("select * from tDownLoad where ID="&request("EditID"))
Set fso = CreateObject("Scripting.FileSystemObject")
strUploadFiles=rs_delete("UploadFile") '删除文章所包括的图片文件
if strUploadFiles<>"" then
if instr(strUploadFiles,"$")>0 then
arrUploadFiles=split(strUploadFiles,"$")
for i=0 to ubound(arrUploadFiles)
if fso.FileExists(server.MapPath("/UploadFile/Download/" & arrUploadfiles(i))) then
fso.DeleteFile(server.MapPath("/UploadFile/Download/" & arrUploadfiles(i)))
end if
next
end if
end if
ProductPicTemp="/UploadFile/Download/"&rs_delete("DownFile")
if fso.FileExists(server.MapPath(ProductPicTemp)) then fso.DeleteFile(server.MapPath(ProductPicTemp))
Set fso = nothing
rs_delete.close()
set rs_delete=nothing
sql_delete="delete from tDownLoad where ID="&request("EditID")
conn.execute sql_delete
response.write "<script>location.replace('DownLoadManage.asp?PageNo="&request("PageNo")&"&Key="&request("Key")&"&ClassID="&request("ClassID")&"&ClassName="&request("ClassName")&"')</script>"
response.end '
end if
'----------------------------------------------------------
PageNo=request("PageNo")
if request("ClassID")="" then ClassID=0 else ClassID=request("ClassID")
ClassName=request("ClassName")
Key=request("Key")
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Images/AdminCss.css" rel="stylesheet" type="text/css">
<script src="/include/jchar.js"></script>
<script language="JavaScript" type="text/JavaScript">
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
function Edit(EditID){
document.form1.action="DownLoadManageEdit.asp?EditID="+EditID
document.form1.submit();
}
function Dele(EditID,Title){
if(confirm("你确定要删除"+Title+"吗,删除后数据无法恢复!")){
document.form1.action="?cur_action=delete&EditID="+EditID
document.form1.submit();
}
}
</script>
</head>
<body leftmargin="0" topmargin="0">
<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8" colspan="2"></td>
</tr>
<tr>
<td width="76" height="20" rowspan="2"><img src="Images/TopBt.gif" width="67" height="36"></td>
<td width="887" height="10"></td>
</tr>
<tr>
<td>我的位置:后台管理系统._资料下载管理._
<% if ClassName="" then response.write "查询" else response.write ClassName%></td>
</tr>
<tr>
<td height="4" colspan="2"></td>
</tr>
<tr>
<td colspan="2"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="E7E7E7">
<tr>
<td height="20"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="159" height="20" align="center" background="images/title1.gif" class="fontwintitle"><strong>
资料下载管理</strong> </td>
<td align="right" background="images/title2.gif"><img src="Images/Topicon.gif" width="11" height="11" align="absmiddle"> <a href="DownLoadManageAdd.asp"><font color="#FF0000"><strong>发布资料下载</strong></font></a></td>
<td width="10"><img src="images/title3.gif" width="10" height="20"></td>
</tr>
</table></td>
</tr>
<tr valign="top">
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="6" background="images/midder1.gif"><img src="images/midder1.gif" width="6" height="3"></td>
<td height="100%" align="center" valign="top"><br>
<table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#666666"><form name="form2" method="post" action="DownLoadManage.asp">
<tr>
<td height="25" bgcolor="#FFFFFF"> 关键字:
<input name="Key" type="text" id="Key">
<input type="submit" name="Submit" value="查询"></td>
</tr>
</form></table>
<%'----------------------------
PERPAGE =15
set rs=server.createobject("ADODB.recordset")
if Key<>"" then
sql="select * from tDownLoad where Title like '%"&Key&"%' order by AddTime desc"
else
sql="select * from tDownLoad order by AddTime desc"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂时没有数据!"
else
rs.pagesize = PERPAGE
if isempty(PageNo) or cstr(PageNo)<"1" then PageNo = 1
CurPage=PageNo
if int(PageNo)>=int(rs.pagecount) then CurPage=cint(rs.pagecount)
rs.absolutepage = CurPage
%>
<br> <table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr align="center">
<td colspan="2"><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<form name="form1" method="post" action="" onsubmit="checkdata()">
<tr align="center" bgcolor="#FFFFFF">
<td width="5%" height="22"><strong>ID</strong></td>
<td width="41%"><strong>资料下载名称</strong></td>
<td width="18%" height="22"><strong>发布时间</strong></td>
<td width="24%" height="22"><strong>功能操作</strong></td>
</tr>
<% for i = 1 to rs.pagesize %>
<tr align="center" onMouseOver="this.style.backgroundColor='#e7e7e7';" onMouseOut="this.style.backgroundColor='#ffffff'" bgcolor="#FFFFFF">
<td height="22"><%=rs("ID")%></td>
<td height="22"> <%response.write "<a href='/Aboutus/ShowNews.asp?ID="&rs("ID")&"' target='_blank'>"&rs("Title")&"</a>"%></td>
<td height="22"><%=rs("AddTime")%></td>
<td height="22"> <%
response.write "<a href=javascript:Edit('"&rs("ID")&"')>修改</a>|"
response.write "<a href=""javascript:Dele('"&rs("ID")&"','"&rs("Title")&"')"">删除</a>"
%> </td>
</tr>
<% rs.movenext
if rs.eof then
i = i + 1
exit for
end if
next %>
<tr>
<td height="1" colspan="4" bgcolor="#FFFFFF"> <input type="hidden" name="Key" value=<%=Key%>>
<input type="hidden" name="PageNo" value=<%=PageNo%>>
<input name="ClassID" type="hidden" id="ClassID" value=<%=ClassID%>>
<input name="ClassName" type="hidden" id="ClassName" value=<%=ClassName%>>
</td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td height="8" colspan="2"></td>
</tr>
<tr>
<td width="33%"> 页次:<b><%=CurPage%></b>/<b><%=rs.pagecount %></b>页 共<b><%=rs.recordcount %></b>条记录</td>
<td width="67%" align="right">
<%
if CurPage = 1 then
response.write " 首页 | 上一页 | "
else
response.write "<a href='?PageNo=1&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"'><b> 首页 </b></a> | <a href='?PageNo="&CurPage-1&"&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"'><b>上一页</b></a>| "
end if
if CurPage = rs.pagecount then
response.write "后一页 | 尾页 "
else
response.write "<a href='?PageNo="&CurPage+1&"&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"'><b>后一页</b> </a>| <a href='?PageNo="&rs.pagecount&"&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"'><b>尾页</b> </a>"
end if
%>
跳转到:<select name="menu1" onChange="MM_jumpMenu('parent.frames[\'right\']',this,0)">
<% for i=1 to rs.pagecount
if CurPage=i then
response.write "<option value='?PageNo="&i&"&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"' selected>第"&i&"页</option>"
else
response.write "<option value='?PageNo="&i&"&Key="&Key&"&ClassID="&ClassID&"&ClassName="&ClassName&"'>第"&i&"页</option>"
end if
next
%>
</select></td>
</tr>
</table>
<%end if%>
<br> <br> </td>
<td width="2" background="images/midder2.gif"><img src="images/midder2.gif" width="2" height="3"></td>
</tr>
<tr>
<td valign="top"><img src="images/bottom1.gif" width="6" height="14"></td>
<td height="14" valign="top" background="images/bottom2.gif"><img src="images/bottom2.gif" width="2" height="14"></td>
<td valign="top"><img src="images/bottom3.gif" width="2" height="14"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -