⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 saveadmintype.asp

📁 以朱朱相册为程序原型整合开发winds相册
💻 ASP
字号:
<!--#include file="checkthis.asp" -->
<!--#include file="data/conn.asp" -->
<!--#include file="info.asp" -->
<%

if Request.Form("cz")="" then
cz=Request.QueryString("cz")
else
cz=Request.Form("cz")
end if

if cz="addtype" or cz="editclass" then

if Request.Form("classname")="" then
Response.Redirect"info.asp?info=请填写分类名称"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
if cz="editclass" then
sql = "SELECT * FROM type where id="&Request.Form("classid")
rs.OPEN sql,Conn,1,3
else
sql = "SELECT * FROM type where (id is null)"
rs.OPEN sql,Conn,1,3
rs.addnew
end if
rs("name")=Request.Form("classname")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect"admintype.asp"

elseif cz="addtype" or cz="edittype" then

founderr=false
if trim(Request.Form("typename"))="" then
founderr=true
info=info+"<li>请填写分类名称</li>"
end if

if founderr=false then

Set rs = Server.CreateObject("ADODB.Recordset")
if cz<>"edittype" then
sql = "SELECT * FROM type where (id is null)"
rs.OPEN sql,Conn,1,3
rs.addnew
else
sql = "SELECT * FROM type where id="&Request.Form("typeid")
rs.OPEN sql,Conn,1,3
end if
rs("name")=Request.Form("typename")
if Request.Form("minipic")<>"" then
rs("minipic")=Request.Form("minipic")
else
rs("minipic")="images/nominipic.gif"
end if
rs("typeid")=Request.Form("typeid")
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
Response.Redirect"admintype.asp"
else
call infom()
end if

elseif cz="delclass" then

conn.execute "delete from type where id="&Request.Form("classid")
conn.execute "delete from desktop where typeid="&Request.Form("classid")
conn.close
Set conn=Nothing
Response.Redirect"admintype.asp"

elseif cz="deltype" then

conn.execute "delete from type where id="&Request.Form("typeid")
conn.execute "delete from desktop where typeid="&Request.Form("typeid")
conn.close
Set conn=Nothing
Response.Redirect"admintype.asp"

end if
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -