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

📄 admin_dj.asp

📁 不错的asp论坛,大家可以看看啊和呵呵.
💻 ASP
字号:
<!--#include file="../inc/config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="inc/error.asp"-->
<!--#include file="inc/FORMAT.asp"-->
<!--#include file="inc/admindj_body.asp"-->
<title>舞曲管理</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")="newdjcat" then
sql="select * from djcat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim djcatname
djcatname=trim(replace(request.form("djcat_name"),"'",""))
if djcatname="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
  rs("djcat_name")=djcatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_dj.asp?action=djcat"
end if
elseif request.form("action")="newdj" then
sql="select * from dj"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim djcatid,djname,djurl,djpic,djdesc,djisbest
djcatid=cint(request.form("djcatid"))
djname=trim(replace(request.form("name"),"'",""))
djurl=trim(replace(request.form("url"),"'",""))
djpic=trim(replace(request.form("pic"),"'",""))
djdesc=trim(replace(request.form("desc"),"'",""))
djisbest=request.form("isbest")
if djname="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲名称!"
else
  rs("dj_name")=djname
end if
if djcatid<1 then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须选择舞曲所属分类!"
else
  rs("djcat_id")=djcatid
end if
if djurl="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲地址!"
else
  rs("dj_url")=djurl
end if
if djpic="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲的图片地址!"
else
  rs("dj_pic")=djpic
end if
if djdesc="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲的简要说明!"
else
  rs("dj_desc")=djdesc
end if
if cint(djisbest)=1 then
  rs("isbest")=cint(djisbest)
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close

  response.redirect "admin_dj.asp?action=dj"
end if
elseif request.form("action")="editdj" 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 dj where dj_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
djcatid=cint(request.form("djcatid"))
djname=trim(replace(request.form("name"),"'",""))
djurl=trim(replace(request.form("url"),"'",""))
djpic=trim(replace(request.form("pic"),"'",""))
djdesc=trim(replace(request.form("desc"),"'",""))
djisbest=request.form("isbest")
error=request.form("error")
if djname="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲名称!"
else
  rs("dj_name")=djname
end if
if djcatid<1 then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须选择舞曲所属分类!"
else
  rs("djcat_id")=djcatid
end if
if djurl="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲地址!"
else
  rs("dj_url")=djurl
end if
if djpic="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲的图片地址!"
else
  rs("dj_pic")=djpic
end if
if djdesc="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写舞曲的简要说明!"
else
  rs("dj_desc")=djdesc
end if
rs("isbest")=cint(djisbest)
rs("error")=0
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_dj.asp?action=dj"
end if
elseif request.form("action")="deldj" 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 dj where dj_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
  rs.delete
  rs.close

    response.redirect "admin_dj.asp?action=dj"
 elseif request.form("action")="editdjcat" 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 djcat where djcat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
djcatname=trim(replace(request.form("djcat_name"),"'",""))
if djcatname="" then
  founderr=true
  errmsg=errmsg+"<br>"+"<li>你必须填写分类名称!"
else
  rs("djcat_name")=djcatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_dj.asp?action=djcat"
end if
elseif request.form("action")="deldjcat" 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 djcat where djcat_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_dj.asp?action=djcat"
end if

end if
call admindj_body()
end if
%>

⌨️ 快捷键说明

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