📄 admin_down.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetDown")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim rscat,sqlcat,colparam1,rsclass,sqlclass,rstotal,none,showye,founderr
function cutstr(str,strlen,more,url)
if len(str)>strlen then
str=left(str,strlen) & "......"
end if
if (len(str)>strlen) and more then
str=str+" [url="+url+"]点这里查看详情[/url]"
end if
cutstr=str
end function
Rem 判断数字是否整形
function isInteger(para)
on error resume next
dim str
dim l,i
if isNUll(para) then
isInteger=false
exit function
end if
str=cstr(para)
if trim(str)="" then
isInteger=false
exit function
end if
l=len(str)
for i=1 to l
if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
isInteger=false
exit function
end if
next
isInteger=true
if err.number<>0 then err.clear
end function
%>
<HTML><HEAD><TITLE> 下载管理</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
<SCRIPT LANGUAGE="JavaScript">
function chk1()
{
if (form1.colname.value=="0")
{
alert("请选择搜索范围...");
return false;
}
if (form1.keyword.value=="")
{
alert("请输入关键词...");
return false;
}
}
function doSubmit()
{
if (document.form1.name.value=="")
{
alert("下载标题不能为空!");
return false;
}
if (Content.getHTML()=="")
{
alert("下载内容不能为空!");
return false;
}
return true;
}
</SCRIPT>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) topmargin='20' leftmargin='0' bottommargin='0'>
<%
if request.querystring("action")="list" then
dim keyword,class_id,cat_id,colname,totalsoft,Currentpage,totalpages
keyword=trim(replace(request.form("keyword"),"'",""))
cat_id=request("cat_id")
class_id=request("class_id")
colname=request("colname")
if WS_S.MemberPriv("WS_FrontSetadmin")=1 then
sql="select id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode from a125_d_news order by soft_joindate desc"
if cat_id<>"" and class_id="" then
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news where soft_catid="&cat_id&" order by soft_joindate desc"
elseif class_id<>"" and keyword="" then
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news where soft_classid="&class_id&" order by soft_joindate desc"
elseif keyword<>"" and colname<>"0" then
sql="select id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode from a125_d_news where "&colname&" like '%"&keyword&"%' order by soft_joindate desc"
else
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news order by soft_joindate desc"
end if
else
sql="select id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode from a125_d_news where writerid="&LOGINUid&" order by soft_joindate desc"
if cat_id<>"" and class_id="" then
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news where soft_catid="&cat_id&" and writerid="&LOGINUid&" order by soft_joindate desc"
elseif class_id<>"" and keyword="" then
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news where soft_classid="&class_id&" and writerid="&LOGINUid&" order by soft_joindate desc"
elseif keyword<>"" and colname<>"0" then
sql="select id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode from a125_d_news where "&colname&" like '%"&keyword&"%' and writerid="&LOGINUid&" order by soft_joindate desc"
else
sql="SELECT id,soft_name,soft_joindate,soft_catname,soft_classname,soft_rcount,soft_dcount,soft_desc,review,reviewcount,author,soft_mode FROM a125_d_news where writerid="&LOGINUid&" order by soft_joindate desc"
end if
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<p align="center"><a href="admin_down.asp?action=newsoft">添加下载</a> | <a href="admin_down.asp?action=list">修改下载</a></p>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center >
<tr><form name="form1" method="post" action="admin_down.asp?action=list"><td>
<select name="colname"><option value="0" selected>--==搜索范围==--</option><option value="soft_name">软件名称</option><option value="soft_desc">软件描述</option></select> <input type="text" name="keyword" class="textarea" size="20"> <input type="submit" name="Submit" value="搜索" class="button" onclick="return chk1()"></td></form></tr></table>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><form name="form3" method="post" action=""><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>下载列表</font></td>
<td align="right" width="20%" colspan="4" style="padding-top:2px;" background='../hximages/titleline_2.gif'>
<select style="margin:-3px" name="go" onChange='window.location=form.go.options[form.go.selectedIndex].value'>
<option value="">选择显示方式</option>
<option value="admin_down.asp?action=list">显示所有下载</option>
<%Set rscat = Server.CreateObject("ADODB.Recordset")
sqlcat="SELECT * FROM a125_down"
rscat.OPEN sqlcat,Conn,1,1
do while not rscat.eof
%>
<option value="admin_down.asp?action=list&cat_id=<%=rscat("cat_id")%>"><%=rscat("cat_name")%></option>
<%
Set rsclass = Server.CreateObject("ADODB.Recordset")
sqlclass="SELECT * FROM a125_d_class where cat_id="&rscat("cat_id")
rsclass.OPEN sqlclass,Conn,1,1
do while not rsclass.eof
%>
<option value="admin_down.asp?action=list&class_id=<%=rsclass("class_id")%>"><%=rsclass("class_name")%></option>
<%
rsclass.movenext
loop
rscat.movenext
loop
rsclass.close
set rsclass=nothing
rscat.close
set rscat=nothing
%>
</select>
</td></tr></form></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
<tr bgcolor='#A1BBE0' class='td4'>
<td width="55%" height="23" ><div align="center">名称</div></td>
<td width="12%" height="23"><div align="center">时间</div></td>
<td width="15%" height="23"><div align="center">发布者</div></td>
<td width="18%" height="23"><div align="center">操作</div></td>
</tr>
<%
dim softperpage
softperpage = 10
if not rs.eof then
rs.movefirst
rs.pagesize=softperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalsoft=rs.recordcount
if currentpage<>1 then
if (currentpage-1)*softperpage<totalsoft then
rs.move(currentpage-1)*softperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalsoft mod softperpage)=0 then
totalpages=totalsoft\softperpage
else
totalpages=totalsoft\softperpage+1
end if
i=0
do while not rs.eof and i<softperpage
%>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td><%=rs("soft_name")%></td>
<td><%=rs("soft_joindate")%></td>
<td><div align="center"><%=rs("author")%></div></td>
<!-- <td width="20%" align="center"><font color=red><%=rs("reviewcount")%></font></span>篇评论</td> -->
<td align="center"> <!-- <a href="admin_view.asp?action=down&id=<%=rs("id")%>">评论</a> -->
<a href="../downnews.asp?id=<%=rs("id")%>" target="blank">查看</a>
<a href="admin_down.asp?id=<%=rs("id")%>&action=editsoft">编辑</a>
<a href="admin_down.asp?id=<%=rs("id")%>&action=delsoft">删除</a></td>
</tr>
<%i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then%>
<tr>
<td align="center">当前没有下载!</td><td></td><td></td><td></td>
</tr>
<%end if
end if%>
</table>
<table width="100%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<form name="form3" method="post" action="admin_down.asp?action=list&cat_id=<%=request("cat_id")%>&keyword=<%=request("keyword")%>&colname=<%=request("colname")%>">
<tr>
<td align="right"><%=currentpage%> /<%=totalpages%>页,<%=totalsoft%>条记录/<%=softperpage%>个每页.
<%
i=1
showye=totalpages
if showye>10 then
showye=10
end if
for i=1 to showye
if i=currentpage then
%>
<%=i%>
<%else%>
<a href="admin_down.asp?action=list&page=<%=i%>&cat_id=<%=request("cat_id")%>&keyword=<%=request("keyword")%>&colname=<%=request("colname")%>"><%=i%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=1
else
page=request("page")+1
end if%>
<a href="admin_down.asp?action=list&page=<%=i%>&cat_id=<%=request("cat_id")%>&class_id=<%=request("class_id")%>" title="下一页">>></a>
<%end if%>
<input type="text" name="page" class="textarea" size="4">
<input type="submit" name="Submit" value="Go" class="button">
</td>
</tr>
</form>
</table></td></tr></table><br>
<%
rs.close
set rs=nothing
conn.Close
Set conn=nothing
end if
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -