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

📄 admin_down.asp

📁 安全性好,适用于制作论坛和进行资源下载的个人和大型网站使用!
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="mdb.asp"-->
<%Admin="down"%>
<!--#include file="check.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/FORMAT.asp"-->
<HTML><HEAD><title>Hxcms管理系统——下载管理</title>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="inc/admin.css" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >
<%
'****************************************************
' Hxcms Ver7.5       Power by Hx66.net
' Web: http://www.Hx66.net,http://www.Hx66.net/home
' Copyright (C) 2006 Hx66.net All Rights Reserved.
'****************************************************
if session("adminlogin")<>sessionvar then
  Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.top.location.href='admin.asp';</script>")
  response.end
else
if request.form("MM_insert") then
if request.form("action")="newcat" then
dim cat_name
cat_name=trim(replace(request.form("cat_name"),"'",""))
if cat_name="" then
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
  response.end
end if
  conn.Execute ("Insert Into d_cat(cat_name) Values('"&cat_name&"')")
  response.redirect "admin_down.asp"

elseif request.form("action")="newclass" then
dim class_name,cat_id
cat_id=request.form("cat_id")
class_name=trim(replace(request.form("class_name"),"'",""))
if not isinteger(cat_id) then
   Response.Write("<script language=javascript>alert('你必须选择所属分类名称!');history.back(1);</script>")
   response.end
end if
if class_name="" then
   Response.Write("<script language=javascript>alert('你必须填写子分类名称!');history.back(1);</script>")
   response.end
end if
  conn.Execute ("Insert Into d_class(cat_id,class_name) Values("&cat_id&",'"&class_name&"')")
  response.redirect "admin_down.asp"

elseif request.form("action")="editcat" then
cat_name=trim(replace(request.form("cat_name"),"'",""))
if not isinteger(request.form("id")) then
   Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
   response.end
end if
if cat_name="" then
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
  response.end
end if
  conn.Execute ("Update d_cat Set cat_name='"&cat_name&"' where cat_id="&clng(request.form("id"))&"")
  response.redirect "admin_down.asp"

elseif request.form("action")="editclass" then
cat_id=request.form("cat_id")
class_name=trim(replace(request.form("class_name"),"'",""))
if not isinteger(request.form("id")) then
   Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
   response.end
end if
if not isinteger(cat_id) then
   Response.Write("<script language=javascript>alert('你必须选择所属分类名称!');history.back(1);</script>")
   response.end
end if
if class_name="" then
   Response.Write("<script language=javascript>alert('你必须填写子分类名称!');history.back(1);</script>")
   response.end
end if
  conn.Execute ("Update d_class Set cat_id="&clng(cat_id)&",class_name='"&class_name&"' where class_id="&clng(request.form("id"))&"")
  response.redirect "admin_down.asp"

elseif request.form("action")="delcat" then
if not isinteger(request.form("id")) then
   Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
   response.end
end if
  Conn.Execute "DELETE * FROM d_cat WHERE cat_id="&clng(request.form("id"))
  response.redirect "admin_down.asp"
elseif request.form("action")="delclass" then
if not isinteger(request.form("id")) then
   Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
   response.end
end if
  Conn.Execute "DELETE * FROM d_class WHERE class_id="&clng(request.form("id"))
  response.redirect "admin_down.asp"
end if
end if

if request.querystring("action")="" then
sql="select * from d_cat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
    <tr>
        <td colspan="2" class=Hxcmsss>下载分类管理</td>
    </tr>
<%do while not rs.eof%>
    <tr class=Hxcmsqs>
        <td width="70%"><%=rs("cat_name")%>&nbsp;[<a href="admin_down.asp?action=newclass">新建子分类</a>]</td>
         <td width="30%">[<a href="admin_down.asp?action=editcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">修改</a>]&nbsp;[<a href="admin_down.asp?action=delcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">删除</a>]</td>
    </tr>
<%
sql="select * from d_class where cat_id="&rs("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof
%>
    <tr class=Hxcmsds>
        <td width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=rs2("class_name")%></td>
        <td width="30%">[<a href="admin_down.asp?action=editclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">修改</a>]&nbsp;[<a href="admin_down.asp?action=delclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">删除</a>]</td>
    </tr>
<%
rs2.movenext
loop
response.write "<tr class=Hxcmsqs><td colspan=2>"
if rs2.bof and rs2.eof then
response.write "当前没有子分类!"
end if
rs2.close
set rs2=nothing
rs.movenext
loop
if rs.bof and rs.eof then
response.write "<tr class=Hxcmsqs><td>当前没有分类!"
end if
%>
</td></tr></table> 
<%
rs.close
set rs=nothing
end if

if request.querystring("action")="newcat" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
        <form name="form1" method="post" action="admin_down.asp">
	<tr> 
          <td class=Hxcmsss>新建分类</td>
        </tr>
        <tr> 
          <td class=Hxcmsds>分类名称-
            <input type="text" name="cat_name" size="40" class="textarea">
          </td>
        </tr>
        <tr> 
          <td class=Hxcmsqs align="center">
              <input type="submit" name="Submit" value="确定新增" class="button">
              <input type="reset" name="Reset" value="取消重填" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
        </tr>
		<input type="hidden" name="action" value="newcat">
		<input type="hidden" name="MM_insert" value="true">
		</form>
      </table>
<%end if
if request.querystring("action")="newclass" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
	    <form name="form2" method="post" action="admin_down.asp">
        <tr> 
          <td class=Hxcmsss>新建子分类</td>
        </tr>
        <tr> 
          <td class=Hxcmsds>子分类名称-
              <input type="text" name="class_name" size="50" class="textarea">
              <br>
              所属分类-
              <select name="cat_id">
                <%sql="select * from d_cat"
set rs=conn.execute(sql)
do while not rs.eof
%><option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">暂无分类</option>
<%end if
rs.close
set rs=nothing
%>
              </select>
            </td>
        </tr>
        <tr> 
            <td class=Hxcmsqs align="center"> 
              <input type="submit" name="Submit2" value="确定新增" class="button">
              <input type="reset" name="Reset2" value="取消重填" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
        </tr>
		<input type="hidden" name="action" value="newclass">
		<input type="hidden" name="MM_insert" value="true">
		</form>
      </table>
<%end if
if request.querystring("action")="editcat" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
	    <form name="form1" method="post" action="admin_down.asp">
        <tr> 
          <td class=Hxcmsss>修改分类</td>
        </tr>
        <tr> 
            <td class=Hxcmsds>分类名称- 
              <input type="text" name="cat_name" size="40" class="textarea" value="<%=request.querystring("name")%>">
          </td>
        </tr>
        <tr> 
            <td class=Hxcmsqs align="center">
              <input type="submit" name="Submit3" value="确定修改" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
        </tr>
		<input type="hidden" name="action" value="editcat">
		<input type="hidden" name="id" value="<%=request.querystring("id")%>">
		<input type="hidden" name="MM_insert" value="true">
		</form>
      </table>
<%end if
if request.querystring("action")="editclass" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
        <form name="form2" method="post" action="admin_down.asp">
          <tr> 
            <td class=Hxcmsss>修改子分类</td>
          </tr>
          <tr> 
            <td class=Hxcmsds>子分类名称- 
              <input type="text" name="class_name" size="50" class="textarea" value="<%=request.querystring("name")%>">
              <br>
              所属分类- 
              <select name="cat_id">
                <%sql="select * from d_cat"
set rs=conn.execute(sql)
do while not rs.eof
%>
                <option value="<%=rs("cat_id")%>" <%if rs("cat_id")=cint(request.querystring("cid")) then response.write "selected" end if%>><%=rs("cat_name")%></option>
                <%rs.movenext
loop
if rs.eof and rs.bof then%>
                <option value="0">暂无分类</option>
                <%end if
                  rs.close
                  set rs=nothing%>
              </select>
            </td>
          </tr>
          <tr> 
            <td class=Hxcmsqs align="center"> 
              <input type="submit" name="Submit" value="确定修改" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
          </tr>
          <input type="hidden" name="action" value="editclass">
		  <input type="hidden" name="id" value="<%=request.querystring("id")%>">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
<%end if
if request.querystring("action")="delcat" then%>
     <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
        <form name="form1" method="post" action="admin_down.asp">
          <tr> 
            <td class=Hxcmsss>删除分类</td>
          </tr>
          <tr> 
            <td class=Hxcmsds>分类名称- 
              <input type="text" name="cat_name2" size="40" class="textarea" value="<%=request.querystring("name")%>"> 
            </td>
          </tr>
          <tr> 
            <td class=Hxcmsqs align="center"> <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
          </tr>
          <input type="hidden" name="action" value="delcat">
          <input type="hidden" name="id" value="<%=request.querystring("id")%>">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
<%end if
if request.querystring("action")="delclass" then%>
     <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=Hxcmsbk style="border-collapse: collapse">
        <form name="form2" method="post" action="admin_down.asp">
          <tr> 
            <td class=Hxcmsss>删除子分类</td>
          </tr>
          <tr> 
            <td class=Hxcmsds>子分类名称-<%=request.querystring("name")%>
              <br>
              所属分类- 
<%sql="select * from d_cat where cat_id="&cint(request.querystring("cid"))
set rs=conn.execute(sql)
%>
<%=rs("cat_name")%>
</td>
          </tr>
          <tr> 
            <td class=Hxcmsqs align="center"> <input name="Submit" type="submit" class="button" id="Submit" value="确定删除">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
          </tr>
          <input type="hidden" name="action" value="delclass">
          <input type="hidden" name="id" value="<%=request.querystring("id")%>">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
<%end if
'================hx66.com.cn===============
if request.QueryString("action")="checkpass" then
sql="select * from soft where soft_id="&clng(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs("passed")=0
rs.update
tjuser=rs("tjuser")
rs.close
set rs=nothing
conn.execute ("UPDATE [user] SET points = points + "&fbpoints&" where username='"&tjuser&"'")
response.redirect Request.ServerVariables("http_referer")
end if
if request.form("operation")="DEL" then
    num=request.form("soft_id").Count
    for i=1 to num
      conn.execute("delete from soft where soft_id="&request.form("soft_id")(i))
    next
end if
if request.querystring("action")="list" then
Response.Write("<table align=""center"" width=""98%"" border=""1"" cellspacing=""0"" cellpadding=""4"" class=Hxcmsbk style=""border-collapse: collapse"">")
dim keyword,class_id,colname,i
keyword=trim(replace(request("keyword"),"'",""))
cat_id=request("cat_id")
class_id=request("class_id")
colname=request("colname")
Dim CurPage,Url_Add
Url_Add="?action=list&"
If Request.QueryString("Page")<>"" Then
   Curpage=Request.QueryString("Page")
   If IsInteger(Curpage)=False OR Curpage<0 Then Curpage=1
Else
   Curpage=1
End If
if cat_id<>"" and class_id="" then
   sql="SELECT * FROM soft where soft_catid="&clng(cat_id)&" order by soft_joindate desc"
   Url_Add=Url_Add&"cat_id="&cat_id&"&"
elseif class_id<>"" and keyword="" then
   sql="SELECT * FROM soft where soft_classid="&clng(class_id)&" order by soft_joindate desc"
   Url_Add=Url_Add&"class_id="&class_id&"&"
elseif keyword<>"" and colname<>"0" then
   sql="select * from soft where "&colname&" like '%"&keyword&"%' order by soft_joindate desc"
   Url_Add=Url_Add&"colname="&colname&"&keyword="&keyword&"&"
elseif request.querystring("t")="pass" then
   sql="select * from soft where passed=1 order by soft_joindate desc"
   Url_Add=Url_Add&"t=pass&"
else
   sql="SELECT * FROM soft where passed=0 order by istop desc,soft_joindate desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
  Response.Write("<tr align=""center""><td class=Hxcmsds colspan=9>当前没有图片!</td></tr>")
Else
   Dim down_Nums,MultiPages,j
   rs.PageSize=adflperpage
   rs.AbsolutePage=CurPage
   down_Nums=rs.RecordCount
   MultiPages="<tr><td class=Hxcmsqs colspan=""9"" align=""center"">共有软件:"&down_Nums&"个。&nbsp;&nbsp;"&MultiPage(down_Nums,adflperpage,CurPage,Url_Add)&"</td></tr>"
%>
<tr class=Hxcmsqs><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>&nbsp; <input type="text" name="keyword" class="textarea" size="20">&nbsp;&nbsp; <input type="submit" name="Submit" value="搜索" class="button"></td></form><form><td >跳转到<select name="go" onChange='window.location=form.go.options[form.go.selectedIndex].value'><option value="admin_down.asp?action=list">==选择分类==</option><option value="admin_down.asp?action=list">·管理首页</option><%
Set rscat = Server.CreateObject("ADODB.Recordset")
sqlcat="SELECT * FROM d_cat"

⌨️ 快捷键说明

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