📄 admin_soft.asp
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/code.asp"-->
<!--#include file="../inc/SqlIn.Asp"-->
<!--#include file="../inc/check.asp"-->
<!--#include file="../inc/public.asp"-->
<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("╲、衡少゛")="wgdel" then'=============批量删除
dim delsel
sel=htmlencode(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("╲、衡少゛")="ltop" then'=============批量固顶
dim ltopsel
sel=htmlencode(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("╲、衡少゛")="jtop" then'=============批量解固
sel=htmlencode(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("╲、衡少゛")="top" then
dim wgid,wgact
id=htmlencode(request("id"))
act=htmlencode(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("╲、衡少゛")="add" then
dim rs,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=htmlencode(trim(request.Form("wgtype")))
title=htmlencode(trim(request.Form("title")))
url=htmlencode(trim(request.Form("url")))
Content=htmlencode(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
id=trim(request.form("id"))
if id="" or (not isnumeric(id)) then
response.write "<script>alert('参数不正确!!!');history.back()</script>"
response.end
end if
wgtype=htmlencode(trim(request.Form("wgtype")))
title=htmlencode(trim(request.Form("title")))
url=htmlencode(trim(request.Form("url")))
content=htmlencode(request.form("content"))
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.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")
%>
<html>
<head>
<meta NAME="GENERATOR" Content="Microsoft FrontPage 4.0">
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<LINK href="admin_style.css" rel=stylesheet>
<title><%=webname%> ≡ 公告管理</title>
</head>
<script language=javascript>
function ConfirmDel()
{
if(confirm("确定要删除此外挂吗?\n删除后不可恢复哦!"))
return true;
else
return false;
}
</script>
<script>
function chkid()
{
document.form╲、衡少゛.action="?╲、衡少゛=wgdel";
document.form╲、衡少゛.submit()
}
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<script>
function chktopid()
{
document.form╲、衡少゛.action="?╲、衡少゛=jtop";
document.form╲、衡少゛.submit()
}
function CheckAll(form) {
for (var i=0;i<form.elements.length;i++) {
var e = form.elements[i];
if (e.name != 'chkall') e.checked = form.chkall.checked;
}
}
</script>
<body leftMargin=0 bgcolor="#EFEFEF" topMargin=15>
<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%>
<table width=98% align="center" border="0" cellspacing="1" cellpadding="2" class="tableBorder">
<form method=post name=form╲、衡少゛ action=?╲、衡少゛=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
rs.pagesize=cint(adminpage)
i=1
mypage=request("page")
if mypage="" then
mypage=1
else
mypage=cint(mypage)
end if
pages=rs.pagecount
rs.absolutepage=mypage
do while not rs.eof%>
<tr>
<td align="center" class=tablerow1><input name="sel" type="checkbox" id="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&╲、衡少゛=top>固顶</a>" else response.write "<a href=?id="&rs("id")&"&act=utop&╲、衡少゛=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&╲、衡少゛=add" onClick="return ConfirmDel();">删除</a></td>
</tr>
<%
if i=rs.pagesize then exit do end if
i=i+1
rs.movenext
loop%>
<tr>
<td class=tablerow1 colspan="8">
<input type='checkbox' name='chkall' value='on' onclick='CheckAll(this.form)'> 全选/反选
<input type=submit value=批量固顶> <input type=button value=批量解固 onclick=chktopid()> <input type=button value=批量删除 onclick=chkid()>
</td>
</tr>
<tr>
<td class=tablerow1 colspan="8"><%call page%></td>
</tr>
</form>
</table>
<%end if
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?╲、衡少゛=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 name=addwg type=submit id="addwg" onclick="form.options.value='add'" value=" 确 定 "> <INPUT type=reset value=" 清 除 " name=cmdcancel></td>
</tr>
</FORM>
</table>
<%end if%>
<%
if request.querystring("action")="edit" then
dim id
id=htmlencode(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?╲、衡少゛=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=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 name=addwg type=submit id="addwg" onclick="form.options.value='edit'" value=" 确 定 "> <INPUT type=reset value=" 清 除 " name=cmdcancel></td>
</tr>
</FORM>
</table>
<%end if
%>
<table width=98% align="center" border="0" cellspacing="0" cellpadding="0">
<tr align="middle">
<td height="30" valign="bottom">Copyright (c) 2004-2006 <a target="_blank" href="http://www.xuncms.cn"><b><font color="#708796">XunCms</font><font color="#cc0000">.Cn</font></b></font></a>. All Rights Reserved .</td>
</tr>
<tr align="middle">
<td>Powered by:<a href="http://www.xuncms.cn" target="_blank"><b><font color="#708796">讯图</font><font color="#cc0000">设计</font></b></font> XunCms <%=Version%></a></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -