📄 admin_photo.asp
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/format.asp"-->
<!--#include file="inc/error.asp"-->
<!--#include file="inc/adminphoto_body.asp"-->
<title><%=webname%>-酷站管理</title>
<%
dim founderr,errmsg
founderr=false
errmsg=""
if session("adminlogin")<>sessionvar then
founderr=true
errmsg=errmsg+"<br>"+"<li>你尚未登录,或者超时了!请<a href='admin.asp'>重新登录</a>!"
call diserror()
response.end
else
if request.form("MM_insert") then
if request.form("action")="newphcat" then
opensites
sql="select * from phcat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim phcatname
phcatname=trim(replace(request.form("phcat_name"),"'",""))
if phcatname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
rs("phcat_name")=phcatname
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_photo.asp?action=phcat"
end if
elseif request.form("action")="newph" then
sql="select * from photo"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim phcatid,phname,phpic,phdesc,phisbest
phcatid=cint(request.form("phcatid"))
phname=trim(replace(request.form("name"),"'",""))
phpic=trim(replace(request.form("pic"),"'",""))
phdesc=trim(replace(request.form("desc"),"'",""))
phisbest=request.form("isbest")
if phname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写酷站名称!"
else
rs("ph_name")=phname
end if
if phcatid<1 then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须选择酷站所属分类!"
else
rs("phcat_id")=phcatid
end if
if phpic="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写酷站的图片地址!"
else
rs("ph_pic")=phpic
end if
if phdesc="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写酷站的简要说明!"
else
rs("ph_pic")=phpic
rs("ph_desc")=phdesc
end if
if cint(phisbest)=1 then
rs("isbest")=cint(phisbest)
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
openadmin
sql="update allcount set coolsitescount = coolsitescount + 1"
conn.execute(sql)
closedatabase
response.redirect "admin_photo.asp?action=sites"
end if
elseif request.form("action")="editph" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的酷站id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from photo where ph_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
phcatid=cint(request.form("phcatid"))
phname=trim(replace(request.form("name"),"'",""))
phpic=trim(replace(request.form("pic"),"'",""))
phdesc=trim(replace(request.form("desc"),"'",""))
phisbest=request.form("isbest")
if phname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写酷站名称!"
else
rs("ph_name")=phname
end if
if phcatid<1 then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须选择酷站所属分类!"
else
rs("phcat_id")=phcatid
end if
if phdesc="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写酷站的简要说明!"
else
rs("ph_pic")=phpic
rs("ph_desc")=phdesc
end if
rs("isbest")=cint(phisbest)
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_photo.asp?action=sites"
end if
elseif request.form("action")="delph" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的酷站id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from photo where ph_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
openadmin
sql="update allcount set coolsitescount = coolsitescount - 1"
conn.execute(sql)
closedatabase
response.redirect "admin_photo.asp?action=sites"
elseif request.form("action")="editphcat" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的酷站分类id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from phcat where phcat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
phcatname=trim(replace(request.form("phcat_name"),"'",""))
if phcatname="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
rs("phcat_name")=phcatname
end if
if founderr then
call diserror()
response.end
else
rs.update
rs.close
set rs=nothing
response.redirect "admin_photo.asp?action=phcat"
end if
elseif request.form("action")="delphcat" then
if request.Form("id")="" then
founderr=true
errmsg=errmsg+"<br>"+"<li>你必须指定操作的对象!"
else
if not isInteger(request.form("id")) then
founderr=true
errmsg=errmsg+"<br>"+"<li>非法的酷站分类id参数。"
end if
end if
if founderr then
call diserror()
response.End
end if
sql="select * from phcat where phcat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.delete
rs.close
set rs=nothing
response.redirect "admin_photo.asp?action=phcat"
end if
end if
call adminphoto_body()
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -