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

📄 admin_js.asp

📁 本系统(共享国际学校管理系统)具有的主要功能: 1、导航内容:学校概况、校内新闻、学校内务、德育工作、 教育科研、教师之窗、学生园地、学校党建、 校园相册、校内论坛(导航内容后台生成,可随
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="inc/config.asp"-->
<!--#include file="mdb.asp"-->
<!--#include file="inc/FORMAT.asp"-->
<%
if session("adminlogin")<>sessionvar then
  Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.top.location.href='admin.asp';</script>")
  response.end
else
if request.form("MM_insert") then
if request.form("action")="newjscat" then
sql="select * from jscat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim jscatname
jscatname=trim(replace(request.form("jscat_name"),"'",""))
if jscatname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
  rs("jscat_name")=jscatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_js.asp?action=jscat"
end if
elseif request.form("action")="newjs" then
sql="select * from js"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim jscatid,jsname,jsurl,jsdesc,jsisbest
jscatid=cint(request.form("jscatid"))
jsname=request.form("name")
jsdesc=request.form("desc")
jsisbest=request.form("isbest")
if jsname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写文章名称!');history.back(1);</script>")
else
  rs("js_name")=jsname
end if
if jscatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择文章所属分类!');history.back(1);</script>")
else
  rs("jscat_id")=jscatid
end if
if jsdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写文章脚本!');history.back(1);</script>")
else
  rs("js_desc")=jsdesc
end if
if cint(jsisbest)=1 then
  rs("isbest")=cint(jsisbest)
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  sql="update allcount set jscount = jscount + 1"
  conn.execute(sql)
  
  response.redirect "admin_js.asp?action=js"
end if
elseif request.form("action")="editjs" 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 js where js_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
jscatid=cint(request.form("jscatid"))
jsname=request.form("name")
jsdesc=request.form("desc")
jsisbest=request.form("isbest")
if jsname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写文章名称!');history.back(1);</script>")
else
  rs("js_name")=jsname
end if
if jscatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择文章所属分类!');history.back(1);</script>")
else
  rs("jscat_id")=jscatid
end if
if jsdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写文章脚本!');history.back(1);</script>")
else
  rs("js_desc")=jsdesc
end if
rs("isbest")=cint(jsisbest)

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_js.asp?action=js"
end if
elseif request.form("action")="deljs" 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 js where js_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
  rs.delete
  rs.close
  sql="update allcount set jscount = jscount - 1"
  conn.execute(sql)
  
  response.redirect "admin_js.asp?action=js"
elseif request.form("action")="editjscat" 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 jscat where jscat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
jscatname=trim(replace(request.form("jscat_name"),"'",""))
if jscatname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
  rs("jscat_name")=jscatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_js.asp?action=jscat"
end if
elseif request.form("action")="deljscat" 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 jscat where jscat_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_js.asp?action=jscat"
end if
end if
sql="select * from jscat order by jscat_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<HTML><HEAD><TITLE>管理中心</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gb2312">
<LINK href="inc/admin.css" type=text/css rel=StyleSheet>
<META content="MSHTML 6.00.2800.1126" name=GENERATOR>
</HEAD>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey))>
<%if request.querystring("action")="jscat" then%> 
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
  <tr class=lanyuss> <td colspan="3">文章分类管理</td></tr>
  <tr align="center" class=lanyuqs><td width="10%">编号</td><td width="70%">分类名称</td><td width="20%">操作</td></tr>
<%do while not rs.eof%>
  <tr class=lanyuds><td align="center"><%=rs("jscat_id")%></td><td><a href="#"><%=rs("jscat_name")%></a></td><td align="center"><a href="admin_js.asp?id=<%=rs("jscat_id")%>&action=editjscat">编辑</a> <a href="admin_js.asp?id=<%=rs("jscat_id")%>&action=deljscat">删除</a> <a href="js.asp?jscat_id=<%=rs("jscat_id")%>" target="_blank">查看</a></td></tr>
<%rs.movenext
loop
if rs.bof and rs.eof then%>
   <tr align="center" class=lanyuds><td colspan="3">当前没有分类!</td></tr>
<%rs.close
set rs=nothing
end if%>
</table>
<%end if
if request.querystring("action")="newjscat" then%> 
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" class=lanyubk style="border-collapse: collapse">
<form name="form1" method="post" action="">
<tr class=lanyuss><td >新增分类</td></tr>
<tr class=lanyuds><td>分类名称-<input type="text" name="jscat_name" size="40" class="textarea"></td></tr>
<tr class=lanyuqs><td align="center"><input type="submit" name="Submit" value="确定新增" class="button"><input type="reset" name="Reset" value="清空重填" class="button"></td></tr><input type="hidden" name="action" value="newjscat"><input type="hidden" name="MM_insert" value="true"></form>
</table>
<%end if
if request.QueryString("action")="editjscat" then
if request.querystring("id")="" then
Response.Write("<script language=javascript>alert('请指定操作的对象!');history.back(1);</script>")
response.end
else
if not isinteger(request.querystring("id")) then
Response.Write("<script language=javascript>alert('非法的分类ID参数!');history.back(1);</script>")
response.end

⌨️ 快捷键说明

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