Admin_Soft.asp
资源名称:haohj.rar [点击查看]
上传用户:angela
上传日期:2022-05-11
资源大小:853k
文件大小:15k
源码类别:
外挂编程
开发平台:
ASP/ASPX
- <!--#include file="setup.asp"-->
- <!--#include file="check.asp"-->
- <%
- If Not CheckAdmin("SoftList") Then
- Server.Transfer("showerr.asp")
- Response.End
- End If
- '=====================================================================
- ' 作者声明:转载请保留版权信息,鄙视不要脸的人
- '=====================================================================
- ' 程序名称:蓝宇网络发布系统
- ' 程序作者:蓝宇 QQ:18159079 ╲、随心゛ QQ:6821845
- ' 文件名称:Admin_Soft.asp
- ' 更新日期:2007-6-5
- '=====================================================================
- ' 联系方式:Tel:13203117383,QQ:18159079,hi.baidu.com/hezeyu
- ' 程序开发:蓝宇,╲、随心゛
- ' 官方网站:蓝宇网络(http://hi.baidu.com/hezeyu)
- '=====================================================================
- ' Copyright 2004-2007 蓝宇 - All Rights Reserved.
- '=====================================================================
- Dim sel,act
- titlename="下载管理"
- Admin_header
- %>
- <SCRIPT language=JavaScript>
- function check(){
- if(document.form1.title.value=="")
- {
- alert("软件名称不能为空!");
- document.form1.title.focus();
- return false;
- }
- if(document.form1.url.value=="")
- {
- alert("软件下载地址不能为空!");
- document.form1.url.focus();
- return false;
- }
- if(document.form1.Content.value=="")
- {
- alert("软件介绍不能为空!");
- document.form1.Content.focus();
- return false;
- }
- }
- </SCRIPT>
- <%
- if request.QueryString("guiqi")="wgdel" then'=============批量删除
- dim delsel
- sel=tee5.CheckStr(request.form("sel"))
- if sel="" then
- response.write "<script>alert('没有选择任何记录,不能操作');history.back()</script>"
- call CloseConn()
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sel=split(sel,",")
- for i= 0 to ubound(sel)
- sql="delete * from Gq_soft where id="&sel(i)
- conn.execute sql
- next
- set rs=nothing
- conn.close
- set conn=nothing
- response.redirect request.ServerVariables("HTTP_REFERER")
- end if
- if request.QueryString("guiqi")="ltop" then'=============批量固顶
- dim ltopsel
- sel=tee5.CheckStr(request.form("sel"))
- if sel="" then
- response.write "<script>alert('没有选择任何记录,不能操作');history.back()</script>"
- call CloseConn()
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sel=split(sel,",")
- for i= 0 to ubound(sel)
- sql="select * from Gq_soft where id="&sel(i)
- rs.open sql,conn,1,3
- if rs.bof and rs.eof then
- rs.close
- else
- rs("top")=True
- rs.update
- rs.close
- end if
- next
- set rs=nothing
- conn.close
- set conn=nothing
- response.redirect request.ServerVariables("HTTP_REFERER")
- end if
- if request.QueryString("guiqi")="jtop" then'=============批量解固
- sel=tee5.CheckStr(request.form("sel"))
- if sel="" then
- response.write "<script>alert('没有选择任何记录,不能操作');history.back()</script>"
- call CloseConn()
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sel=split(sel,",")
- for i= 0 to ubound(sel)
- sql="select * from Gq_soft where id="&sel(i)
- rs.open sql,conn,1,3
- if rs.bof and rs.eof then
- rs.close
- else
- rs("top")=False
- rs.update
- rs.close
- end if
- next
- set rs=nothing
- conn.close
- set conn=nothing
- response.redirect request.ServerVariables("HTTP_REFERER")
- end if
- if request.QueryString("guiqi")="top" then
- dim wgid,wgact
- id=tee5.CheckStr(request("id"))
- act=tee5.CheckStr(request("act"))
- if id="" then
- response.write "<script>alert('变量参数不正确,请检查后再试');history.back()</script>"
- call CloseConn()
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sql="select * from Gq_soft where id="&id
- rs.open sql,conn,1,3
- if rs.bof and rs.eof then
- rs.close
- response.write "<script>alert('无此记录');history.back()</script>"
- else
- select case act
- case "top"
- rs("top")=True
- case "utop"
- rs("top")=False
- end select
- rs.update
- rs.close
- end if
- set rs=nothing
- conn.close
- set conn=nothing
- response.redirect request.ServerVariables("HTTP_REFERER")
- end if
- if request.QueryString("guiqi")="add" then
- dim options
- set rs = server.CreateObject("adodb.recordset")
- select case trim(request.form("options"))
- case "add"
- call add()
- case "edit"
- call edit()
- case "del"
- call del()
- end select
- if trim(request("options"))="del" then
- call del()
- end if
- call CloseConn()
- sub add()
- dim wgtype,title,url,Content,wgtime
- wgtype=tee5.CheckStr(trim(request.Form("wgtype")))
- title=tee5.CheckStr(trim(request.Form("title")))
- url=tee5.CheckStr(trim(request.Form("url")))
- Content=tee5.CheckStr(request.Form("Content"))
- wgtime=trim(request.Form("wgtime"))
- if title="" or Content="" then
- response.write "<script>alert('名称和介绍不能为空,请重新填写');history.back()</script>"
- call CloseConn()
- response.end
- end if
- if wgtime="" then
- wgtime=now()
- end if
- sql="select * from Gq_soft where title='"&title&"'"
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- rs.close
- sql="select * from Gq_soft"
- rs.open sql,conn,1,3
- rs.AddNew
- rs("wgtype") = wgtype
- rs("title") = title
- rs("url") = url
- rs("content") = content
- rs("wgtime") = wgtime
- rs("top") = 0
- rs.Update
- rs.Close
- response.Redirect "admin_soft.asp"
- else
- rs.close
- response.write "<script>alert('当前提交的软件已经存在n请不要重复提交信息');history.back()</script>"
- end if
- end sub
- sub edit()
- set rs = server.CreateObject("adodb.recordset")
- dim title,content,id,wgtype,url,hits,wgtime
- id=trim(request.form("id"))
- if id="" or (not isnumeric(id)) then
- response.write "<script>alert('参数不正确!!!');history.back()</script>"
- response.end
- end if
- wgtype=tee5.CheckStr(trim(request.Form("wgtype")))
- title=tee5.CheckStr(trim(request.Form("title")))
- url=tee5.CheckStr(trim(request.Form("url")))
- content=tee5.CheckStr(request.form("content"))
- hits=request.form("hits")
- wgtime=request.form("wgtime")
- if title="" or content="" then
- response.write "<script>alert('名称和介绍不能为空,请重新填写');history.back()</script>"
- call CloseConn()
- response.end
- end if
- if wgtime="" then
- wgtime=now()
- end if
- sql="select * from Gq_soft where id="&id
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- rs.close
- response.write "<script>alert('数据不存在!');history.back()</script>"
- else
- rs.close
- rs.open sql,conn,1,3
- rs("wgtype") = wgtype
- rs("title") = title
- rs("url") = url
- rs("content") = content
- rs("wgtime") = wgtime
- rs("hits") = hits
- rs.Update
- rs.Close
- response.Redirect "admin_soft.asp"
- end if
- end sub
- sub del()
- set rs = server.CreateObject("adodb.recordset")
- on error resume next
- dim id,sql
- id=trim(request("id"))
- if id="" or (not isnumeric(id)) then
- response.write "<script>alert('参数不正确!!!');history.back()</script>"
- call CloseConn()
- response.end
- end if
- sql="delete * from Gq_soft where id="&id
- conn.execute sql
- if err.Number<>0 then
- err.clear
- call closeconn()
- response.write "<script>alert('数据库操作失败! ');history.back()"
- else
- finished
- call closeconn()
- response.Redirect "admin_soft.asp"
- end if
- end sub
- end if
- %>
- <%
- if not isempty(request("page")) then
- currentPage=cint(request("page"))
- else
- currentPage=1
- end if
- set rs = server.createobject("adodb.recordset")
- %>
- <script language=javascript>
- function ConfirmDel()
- {
- if(confirm("确定要删除此软件吗?n删除后不可恢复哦!"))
- return true;
- else
- return false;
- }
- </script>
- <script>
- function chkid()
- {
- document.formguiqi.action="?guiqi=wgdel";
- document.formguiqi.submit()
- }
- </script>
- <script>
- function chktopid()
- {
- document.formguiqi.action="?guiqi=jtop";
- document.formguiqi.submit()
- }
- </script>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <tr>
- <th>软件管理操作</th>
- </tr>
- <tr>
- <td class=tablerow1><b>管理选项:</b><a href="admin_soft.asp">所有软件</a> | <a href="admin_soft.asp?action=add">发布软件</a></td>
- </tr>
- </table>
- <br>
- <%if request.querystring("action")="" then
- Dim tablestyle
- Dim maxperpage,CurrentPage,Pcount,totalrec,totalnumber
- maxperpage = AdminPage
- totalrec = 0
- Pcount = 1
- CurrentPage = tee5.ChkNumeric(Request("page"))
- If CurrentPage = 0 Then CurrentPage = 1
- Response.Write "<script src=""/js/showpage.js"" type=""text/javascript""></script>" & vbCrLf
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <form method=post name=formguiqi action=?guiqi=ltop>
- <tr align="center">
- <th width="4%">选择</th>
- <th width="10%">所属游戏</th>
- <th width="*">软件名称</th>
- <th width="17%">发布时间</th>
- <th width="12%">固顶状态</th>
- <th width="8%">人气</th>
- <th width="18%">操作</th>
- </tr>
- <%
- sql="select * from Gq_soft order by wgtime desc"
- rs.open sql,conn,1,1
- if rs.eof and rs.bof then
- response.write "<tr><td align='center' class=tablerow1 colspan='7'>当前没有任何软件!</td></tr>"
- else
- totalrec = Rs.RecordCount
- Pcount = CLng(totalrec / maxperpage) '得到总页数
- If Pcount < totalrec / maxperpage Then Pcount = Pcount + 1
- If CurrentPage < 1 Then CurrentPage = 1
- If CurrentPage > Pcount Then CurrentPage = Pcount
- Rs.PageSize = maxperpage
- Rs.AbsolutePage = CurrentPage
- i = 0
- Do While Not Rs.EOF And i < maxperpage
- If Not Response.IsClientConnected Then ResponseEnd
- %>
- <tr>
- <td align="center" class=tablerow1><input type='checkbox' name="sel" value="<%=rs("id")%>"></td>
- <td align="center" class=tablerow1><%=rs("wgtype")%></td>
- <td class=tablerow1><a href="admin_soft.asp?action=edit&id=<%=rs("id")%>" title="<%=rs("title")%>"><%=left(rs("title"),20)%></a></td>
- <td align="center" class=tablerow1><%=rs("wgtime")%></td>
- <td align="center" class=tablerow1><%if rs("top")=True then response.write "<font color=#0000FF>固顶中</font>" else response.write "<font color=#CCCCCC>未固顶</font>" end if%></td>
- <td align="center" class=tablerow1><%=rs("hits")%></td>
- <td align="center" class=tablerow1><%if rs("top")=false then response.write "<a href=?id="&rs("id")&"&act=top&guiqi=top>固顶</a>" else response.write "<a href=?id="&rs("id")&"&act=utop&guiqi=top><font color=red>解固</font></a>" end if%> ‖ <a href=admin_soft.asp?action=edit&id=<%=rs("id")%>><font color="#008000">编辑</font></a> ‖ <a href="admin_soft.asp?id=<%=rs("id")%>&options=del&guiqi=add" onClick="return ConfirmDel();">删除</a></td>
- </tr>
- <%
- Rs.movenext
- i = i + 1
- If i >= maxperpage Then Exit Do
- Loop
- End If
- Rs.Close:Set Rs = Nothing
- %>
- <tr>
- <td class=tablerow1 colspan="8"><B>操作选项:<B> <input class=Button type=button value="全选" onClick="CheckAll(this.form)"><input class=Button type=button value='撤消' onClick="CheckCel(this.form)"><input class=Button type=button value='反选' onClick="CheckSel(this.form)">
- <input class=Button type=submit value=批量固顶> <input class=Button type=button value=批量解固 onclick=chktopid()> <input class=Button type=button value=批量删除 onclick=chkid()>
- </td>
- </tr>
- </form>
- <tr>
- <td <%=RightClass%> colspan="8"><%tee5.ShowListPage CurrentPage,Pcount,totalrec,maxperpage,"","下载管理"%></td>
- </tr>
- </table>
- <%
- end if
- if request.querystring("action")="add" then%>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <FORM name=form1 onsubmit="return check()" action=admin_soft.asp?guiqi=add method=post language="javascript">
- <tr>
- <th colspan="2">软件管理--添加软件</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">所属游戏:</td>
- <td class="TableRow1"><INPUT name=wgtype id="wgtype" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">软件名称:</td>
- <td class="TableRow1"><INPUT name=title id="title" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">下载地址:</td>
- <td class="TableRow1"><INPUT name=url id="url" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">软件介绍:</td>
- <td class="TableRow1"><TEXTAREA id=Content name=Content rows=10 cols=75></TEXTAREA></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">发布时间:</td>
- <td class="TableRow1"><INPUT name=wgtime id="wgtime" value="<%=now()%>" maxLength=20> 默认为系统当前时间</td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="2" height="30" align="center"><input name="options" type="hidden" id="options"><INPUT class=Button name=addwg type=submit id="addwg" onclick="form.options.value='add'" value=" 确 定 "> <INPUT class=Button type=reset value=" 清 除 " name=cmdcancel></td>
- </tr>
- </FORM>
- </table>
- <%end if%>
- <%
- if request.querystring("action")="edit" then
- dim id
- id=tee5.CheckStr(request("id"))
- if id="" or (not isnumeric(id)) then
- response.write "<script>alert('参数不正确!!!');window.close()</script>"
- response.end
- end if
- set rs = server.createobject("adodb.recordset")
- sql="SELECT * FROM Gq_soft where id="&id
- rs.open sql,conn,1,1
- if rs.bof and rs.eof then
- rs.close
- response.write "<script>alert('无此数据!!!');window.close()</script>"
- response.end
- else
- end if
- %>
- <table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
- <FORM name=form1 onsubmit="return check()" action=admin_soft.asp?guiqi=add method=post language="javascript">
- <tr>
- <th colspan="2">软件管理--修改软件</th>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">所属游戏:</td>
- <td class="TableRow1"><INPUT name=wgtype id="wgtype" class="textarea" value="<%=rs("wgtype")%>" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">软件名称:</td>
- <td class="TableRow1"><INPUT name=title id="title" class="textarea" value="<%=rs("title")%>" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">下载地址:</td>
- <td class="TableRow1"><INPUT name=url id="url" class="textarea" value="<%=rs("url")%>" size="75" maxLength=50></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">软件介绍:</td>
- <td class="TableRow1"><TEXTAREA id=Content name=Content rows=10 cols=75><%=rs("content")%></TEXTAREA></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">下载次数:</td>
- <td class="TableRow1"><INPUT name=hits id="hits" class="textarea" value="<%=rs("hits")%>" maxLength=20></td>
- </tr>
- <tr>
- <td width="12%" align="right" class="TableRow1">发布时间:</td>
- <td class="TableRow1"><INPUT name=wgtime id="wgtime" class="textarea" value="<%=rs("wgtime")%>" maxLength=20> 时间格式为“年-月-日 时:分:秒”,如:<FONT color=#0000ff>2003-5-12 12:32:47</FONT></td>
- </tr>
- <tr>
- <td class="TableRow1" colspan="2" height="30" align="center">
- <input name="id" type="hidden" id="id" value="<%=rs("id")%>">
- <input name="options" type="hidden" id="options">
- <INPUT class=Button name=addwg type=submit id="addwg" onclick="form.options.value='edit'" value=" 确 定 "> <INPUT class=Button type=reset value=" 清 除 " name=cmdcancel></td>
- </tr>
- </FORM>
- </table>
- <%end if
- Admin_footer
- CloseConn
- %>