📄 down_save.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Const.asp" -->
<!--#include file="../Inc/Config.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
ID=Request.Form("ID")
Title=Trim(request.form("Title"))
BigClassName=trim(request.form("BigClassName"))
SmallClassName=trim(request.form("SmallClassName"))
Content=trim(request.form("Content"))
System=trim(request.form("System"))
Language=trim(request.form("Language"))
Softclass=trim(request.form("Softclass"))
PhotoUrl=trim(request.form("PhotoUrl"))
DownloadUrl=trim(request.form("DownloadUrl"))
FileSize=trim(request.form("FileSize"))
AddDate=trim(request.form("AddDate"))
Action=trim(request("Action"))
if BigClassName="" then
founderr=true
errmsg=errmsg+"<li>未指定下载所属大类</li>"
end if
if Content="" then
founderr=true
errmsg=errmsg+"<li>下载说明不能为空</li>"
end if
if Softclass="" then
founderr=true
errmsg="<li>软件类型不能为空</li>"
end if
if FileSize="" then
founderr=true
errmsg="<li>文件大小不能为空</li>"
end if
if founderr=false then
Title=dvhtmlencode(Title)
if AddDate<>"" and IsDate(AddDate)=true then
AddDate=CDate(AddDate)
else
AddDate=now()
end if
set rs=server.createobject("adodb.recordset")
select case Action
case "Add"
sql="select * from 0791idc_Download where (id is null)"
rs.open sql,conn,1,3
rs.addnew
call SaveData()
rs.update
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select top 1 ID from 0791idc_Download order by ID desc"
rs.open sql,conn,1,1
ID=rs("ID")
rs.close
set rs=Nothing
if ISHTML = 1 then
call htmll("","",""&DownNameShow&""&Separated&""&ID&"."&HTMLName&"","DownloadShow.asp","ID=",ID,"","")
End If
response.redirect "Down_Manage.asp"
case "Modify"
if ID<>"" then
sql="select * from 0791idc_Download where id="&ID
rs.open sql,conn,1,3
if not (rs.bof and rs.eof) then
call SaveData()
rs.update
rs.close
set rs=nothing
if ISHTML = 1 then
call htmll("","",""&DownNameShow&""&Separated&""&ID&"."&HTMLName&"","DownloadShow.asp","ID=",ID,"","")
End If
response.redirect "Down_Manage.asp"
else
founderr=true
errmsg=errmsg+"<li>找不到此下载,可能已经被删除。</li>"
call WriteErrMsg()
end if
else
founderr=true
errmsg=errmsg+"<li>不能确定下载ID的值</li>"
call WriteErrMsg()
end if
Case else
founderr=true
errmsg=errmsg+"<li>没有选定参数</li>"
call WriteErrMsg()
end select
call CloseConn()
else
WriteErrMsg
end if
%>
<%
sub SaveData()
rs("Title")=Title
rs("Content")=Content
rs("BigClassName")=BigClassName
rs("SmallClassName")=SmallClassName
rs("System")=System
rs("Language")=Language
rs("Softclass")=Softclass
rs("PhotoUrl")=PhotoUrl
rs("DownloadUrl")=DownloadUrl
rs("FileSize")=FileSize
rs("AddDate")=AddDate
end sub
%>
<!--#include file="Admin_htmlconfig.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -