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

📄 admin_web.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")="newcscat" then
sql="select * from cscat"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim cscatname
cscatname=trim(replace(request.form("cscat_name"),"'",""))
if cscatname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
  rs("cscat_name")=cscatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_web.asp?action=cscat"
end if
elseif request.form("action")="newcs" then
sql="select * from coolsites"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
rs.addnew
dim cscatid,csname,csurl,cspic,csdesc,csisbest
cscatid=cint(request.form("cscatid"))
csname=trim(replace(request.form("name"),"'",""))
csurl=trim(replace(request.form("url"),"'",""))
cspic=trim(replace(request.form("pic"),"'",""))
csdesc=trim(replace(request.form("desc"),"'",""))
csisbest=request.form("isbest")
if csname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写名称!');history.back(1);</script>")
else
  rs("cs_name")=csname
end if
if cscatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择网站所属分类!');history.back(1);</script>")
else
  rs("cscat_id")=cscatid
end if
if csurl="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站地址!');history.back(1);</script>")
else
  rs("cs_url")=csurl
end if
if cspic="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站的图片地址!');history.back(1);</script>")
else
  rs("cs_pic")=cspic
end if
if csdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站的简要说明!');history.back(1);</script>")
else
  rs("cs_desc")=csdesc
end if
if cint(csisbest)=1 then
  rs("isbest")=cint(csisbest)
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  sql="update allcount set coolsitescount = coolsitescount + 1"
  conn.execute(sql)
  
  response.redirect "admin_web.asp?action=sites"
end if
elseif request.form("action")="editcs" 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 coolsites where cs_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
cscatid=cint(request.form("cscatid"))
csname=trim(replace(request.form("name"),"'",""))
csurl=trim(replace(request.form("url"),"'",""))
cspic=trim(replace(request.form("pic"),"'",""))
csdesc=trim(replace(request.form("desc"),"'",""))
csisbest=request.form("isbest")
if csname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站名称!');history.back(1);</script>")
else
  rs("cs_name")=csname
end if
if cscatid<1 then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须选择网站所属分类!');history.back(1);</script>")
else
  rs("cscat_id")=cscatid
end if
if csurl="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站地址!');history.back(1);</script>")
else
  rs("cs_url")=csurl
end if
if cspic="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站的图片地址!');history.back(1);</script>")
else
  rs("cs_pic")=cspic
end if
if csdesc="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写网站的简要说明!');history.back(1);</script>")
else
  rs("cs_desc")=csdesc
end if
rs("isbest")=cint(csisbest)

if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_web.asp?action=sites"
end if
elseif request.form("action")="delcs" 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 coolsites where cs_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 coolsitescount = coolsitescount - 1"
  conn.execute(sql)
  
  response.redirect "admin_web.asp?action=sites"
elseif request.form("action")="editcscat" 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 cscat where cscat_id="&cint(request.form("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,3
cscatname=trim(replace(request.form("cscat_name"),"'",""))
if cscatname="" then
  founderr=true
  Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
else
  rs("cscat_name")=cscatname
end if
if founderr then
  call diserror()
  response.end
else
  rs.update
  rs.close
  set rs=nothing
  response.redirect "admin_web.asp?action=cscat"
end if
elseif request.form("action")="delcscat" 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 cscat where cscat_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_web.asp?action=cscat"
end if
end if%>
<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")="cscat" then
sql="select * from cscat order by cscat_id DESC"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1%> 
<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">网站分类管理</font></td>
        </tr>
        <tr class=lanyuqs align="center"> 
          <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("cscat_id")%> </td>
          <td><a href="#"><%=rs("cscat_name")%></a> </td>
          <td align="center"><a href="admin_web.asp?id=<%=rs("cscat_id")%>&action=editcscat">编辑</a> 
            <a href="admin_web.asp?id=<%=rs("cscat_id")%>&action=delcscat">删除</a> <a href="showcs.asp?cscat_id=<%=rs("cscat_id")%>" target="_blank">查看</a></td>
        </tr>
        <%rs.movenext
loop
if rs.bof and rs.eof then%>
        <tr class=lanyuds align="center"> 
          <td colspan="3">当前没有网站分类!</td>
        </tr>
        <%rs.close
set rs=nothing
		end if%>
      </table>
     <%end if
	 if request.querystring("action")="newcscat" 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>新增网站分类</font></td>
        </tr>
        <tr class=lanyuds> 
            <td>分类名称- 
              <input type="text" name="cscat_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="newcscat">
		<input type="hidden" name="MM_insert" value="true">
		</form>
      </table>
	  <%end if
	  if request.QueryString("action")="editcscat" 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
  end if
end if
sql="select * from cscat where cscat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
	  %>
 <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>修改网站分类</font></td>
          </tr>
          <tr class=lanyuds> 
            <td>分类名称- 
              <input name="cscat_name" type="text" class="textarea" id="cscat_name" size="40" value="<%=rs("cscat_name")%>"> 
            </td>
          </tr>
          <tr class=lanyuqs> 
            <td align="center"> <input name="Submit" type="submit" class="button" id="Submit" value="确定修改"> 
              <input name="Reset" type="reset" class="button" id="Reset" value="清空重填"> </td>
          </tr>
		  <input type="hidden" name="id" value="<%=rs("cscat_id")%>">
          <input type="hidden" name="action" value="editcscat">
          <input type="hidden" name="MM_insert" value="true">
        </form>
      </table>
	  <%end if
	  if request.QueryString("action")="delcscat" 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
  end if
end if
sql="select * from cscat where cscat_id="&cint(request.querystring("id"))
set rs=server.createobject("adodb.recordset")

⌨️ 快捷键说明

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