📄 admin_down.asp
字号:
if request.form("MM_insert") then
if request.Form("action")="newsoft" then
sql="select * from a125_d_news"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim soft_name,soft_size,soft_mode,showpic,downisbest,url1,url2
soft_name=WS_s.HX_Replace(trim(replace(request.form("name"),"'","")))
soft_size=WS_s.HX_Replace(trim(replace(request.form("size"),"'","")))
showpic=WS_s.HX_Replace(trim(replace(request.form("showpic"),"'","")))
Content=WS_s.HX_Replace(trim(replace(request.form("Content"),"'","")))
downisbest=request.form("isbest")
url1=WS_s.HX_Replace(trim(replace(request.form("url1"),"'","")))
url2=WS_s.HX_Replace(trim(replace(request.form("url2"),"'","")))
if soft_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文件名称!');history.back(1);</script>")
else
rs("soft_name")=soft_name
end if
if soft_size="" then
rs("soft_size")="未知"
else
rs("soft_size")=soft_size
end if
if cint(downisbest)=1 then
rs("isbest")=cint(downisbest)
end if
if request("of")<>"" then
Set rsclass = Server.CreateObject("ADODB.Recordset")
sqlclass="SELECT * FROM a125_d_class where class_id="&request("of")
rsclass.OPEN sqlclass,Conn,1,1
rs("soft_classid")=rsclass("class_id")
rs("soft_classname")=rsclass("class_name")
rs("soft_catid")=rsclass("cat_id")
set rscat = Server.CreateObject("ADODB.Recordset")
sqlcat="select cat_name from a125_down where cat_id="&rsclass("cat_id")
rscat.open sqlcat,conn,1,1
rs("soft_catname")=rscat("cat_name")
rscat.close
rsclass.close
set rscat=nothing
set rsclass=nothing
else
founderr=true
Response.Write("<script language=javascript>alert('你必须选择所属分类,或者非法操作!');history.back(1);</script>")
end if
if showpic="" then
rs("soft_showpic")=""
else
rs("soft_showpic")=showpic
end if
if Content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文件简介!');history.back(1);</script>")
else
rs("soft_desc")=Content
end if
if url1="" and url2="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写下载地址!');history.back(1);</script>")
end if
if url1="" then
rs("soft_url1")=""
else
rs("soft_url1")=url1
end if
if url2="" then
rs("soft_url2")=""
else
rs("soft_url2")=url2
end if
rs("author")=LOGINUSERNAME
rs("department")=LOGdepartment
rs("writerid")=LOGINUid
rs("soft_joindate")=DATE()
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_down.asp?action=list"
end if
end if
if request.Form("action")="editsoft" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的软件id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from a125_d_news where id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
soft_name=WS_s.HX_Replace(trim(replace(request.form("name"),"'","")))
soft_size=WS_s.HX_Replace(trim(replace(request.form("size"),"'","")))
showpic=WS_s.HX_Replace(trim(replace(request.form("showpic"),"'","")))
Content=WS_s.HX_Replace(trim(replace(request.form("Content"),"'","")))
downisbest=request.form("isbest")
url1=WS_s.HX_Replace(trim(replace(request.form("url1"),"'","")))
url2=WS_s.HX_Replace(trim(replace(request.form("url2"),"'","")))
if soft_name="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文件名称!');history.back(1);</script>")
else
rs("soft_name")=soft_name
end if
if soft_size="" then
rs("soft_size")="未知"
else
rs("soft_size")=soft_size
end if
rs("isbest")=cint(downisbest)
if request("of")<>"" then
Set rsclass = Server.CreateObject("ADODB.Recordset")
sqlclass="SELECT * FROM a125_d_class where class_id="&request("of")
rsclass.OPEN sqlclass,Conn,1,1
rs("soft_classid")=rsclass("class_id")
rs("soft_classname")=rsclass("class_name")
rs("soft_catid")=rsclass("cat_id")
set rscat = Server.CreateObject("ADODB.Recordset")
sqlcat="select cat_name from a125_down where cat_id="&rsclass("cat_id")
rscat.open sqlcat,conn,1,1
rs("soft_catname")=rscat("cat_name")
rscat.close
rsclass.close
set rscat=nothing
set rsclass=nothing
else
founderr=true
Response.Write("<script language=javascript>alert('你必须选择所属分类,或者非法操作!');history.back(1);</script>")
end if
if showpic="" then
rs("soft_showpic")=""
else
rs("soft_showpic")=showpic
end if
if Content="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写文件简介!');history.back(1);</script>")
else
rs("soft_desc")=Content
end if
if url1="" and url2="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须填写下载地址!');history.back(1);</script>")
end if
if url1="" then
rs("soft_url1")=""
else
rs("soft_url1")=url1
end if
if url2="" then
rs("soft_url2")=""
else
rs("soft_url2")=url2
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_down.asp?action=list"
end if
end if
if request.Form("action")="delsoft" then
if request.Form("id")="" then
founderr=true
Response.Write("<script language=javascript>alert('你必须指定操作的对象!');history.back(1);</script>")
else
if not isInteger(request.form("id")) then
founderr=true
Response.Write("<script language=javascript>alert('非法的文件id参数。');history.back(1);</script>")
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from a125_d_news where id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
set rs=nothing
conn.Close
Set conn=nothing
response.redirect "admin_down.asp?action=list"
end if
end if
if request.QueryString("action")="newsoft" then%>
<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 bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>新增软件</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#A1BBE0'>
<form name="form1" method="post" action="admin_down.asp">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td width="16%">软件名称</td>
<td width="84%">
<input type="text" name="name" size="40" class="textarea"> </td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>软件大小</td>
<td><input type="text" name="size" size="20" class="textarea"></td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td>所属分类</td>
<td>
<select name="of">
<%
dim catname,classname,catid,classid
Set rs3 = Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM a125_down"
rs3.OPEN sql,Conn,1,1
if not (rs3.eof and rs3.bof) then
rs3.movefirst
do while not rs3.eof
sql="select * from a125_d_class where cat_id="&rs3("cat_id")
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,1,1
if not (rs2.eof and rs2.bof) then
do while not rs2.eof
catid=rs3("cat_id")
classid=rs2("class_id")
catname=rs3("cat_name")
classname=rs2("class_name")
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -