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

📄 admin_down.asp

📁 研究生会网站,,适合大中专门院校学生组织使用
💻 ASP
📖 第 1 页 / 共 3 页
字号:
<!--#include file="Include/Gaobei_setup.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="Include/check.asp"-->
<%CheckAdmin3%>

<%
function cutstr(str,strlen,more,url)
if len(str)>strlen then
	 str=left(str,strlen) & "......"
end if
if (len(str)>strlen) and more then
  str=str+"&nbsp;&nbsp;&nbsp;[url="+url+"]点这里查看详情[/url]"
end if
cutstr=str
end function

function AutoUrl(str)
	on error resume next
	Set url=new RegExp
	url.IgnoreCase =True
	url.Global=True
	url.MultiLine = True
	url.Pattern = "^(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
	str = url.Replace(str,"[url=$1]$1[/url]")
	url.Pattern = "(http://[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
	str = url.Replace(str,"[url=$1]$1[/url]")
	url.Pattern = "^(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)"
	str = url.Replace(str,"[url=http://$1]$1[/url]")
	url.Pattern = "(www.[A-Za-z0-9\./=\?%\-&_~`@:+!]+)$"
	str = url.Replace(str,"[url=http://$1]$1[/url]")
	set url=Nothing
	AutoUrl=str
end function

Rem 判断数字是否整形
function isInteger(para)
       on error resume next
       dim str
       dim l,i
       if isNUll(para) then 
          isInteger=false
          exit function
       end if
       str=cstr(para)
       if trim(str)="" then
          isInteger=false
          exit function
       end if
       l=len(str)
       for i=1 to l
           if mid(str,i,1)>"9" or mid(str,i,1)<"0" then
              isInteger=false 
              exit function
           end if
       next
       isInteger=true
       if err.number<>0 then err.clear
end function

Function FormatStr(String)
  on Error resume next
  String = Replace(String, CHR(13), "")
  String = Replace(String, CHR(32), "&nbsp;")
  String = Replace(String, "", "&nbsp;")
  String = Replace(String, "<", "&lt;")
  String = Replace(String, ">", "&gt;")
  String = Replace(String, CHR(10) & CHR(10), "<BR><BR>")
  String = Replace(String, CHR(10), "<BR>")
  FormatStr = String
End Function

Function Ubb2Html(str, showemot, showimg)
ON ERROR RESUME NEXT
if not str<>"" then exit function
  tmpstr="uNobwab"
  str=UbbStr(str,"url")
  str=UbbStr(str,"quote")
  str=UbbStr(str,"color")
  str=UbbStr(str,"size")
  str=UbbStr(str,"face")
  if showemot then
    for i=1 to 16
      str=replace(str,":em"&i&":","<img src='emot/em"&i&".gif'>",1,6,1)
      str=replace(str,":em"&i&":","",1,-1,1)
    next
  end if
  if showimg then
    str=UbbStr(str,"img")
    str=UbbStr(str,"swf")
	str=UbbStr(str,"dir")
	str=UbbStr(str,"rm")
	str=UbbStr(str,"mp")
	str=UbbStr(str,"qt")
  end if
  str=UbbStr(str,"frame")
  str=replace(str,"[b]","<b>",1,-1,1)
  str=replace(str,"[/b]","</b>",1,-1,1)
  str=replace(str,"[u]","<u>",1,-1,1)
  str=replace(str,"[/u]","</u>",1,-1,1)
  str=replace(str,"[br]","<br>",1,-1,1)
  str=replace(str,"[center]","<center>",1,-1,1)
  str=replace(str,"[/center]","</center>",1,-1,1)
  str=replace(str,"[fly]","<marquee>",1,-1,1)
  str=replace(str,"[/fly]","</marquee>",1,-1,1)
  str=replace(str,"["&tmpstr,"[",1,-1,1)
  str=replace(str,tmpstr&"]","]",1,-1,1)
  str=replace(str,"/"&tmpstr,"/",1,-1,1)
  Ubb2Html=str
End Function
%>




<%
    if request.form("MM_insert") then
    if request.form("action")="newcat" then
    sql="select * from d_cat"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    dim cat_name
    cat_name=trim(replace(request.form("cat_name"),"'",""))

    if cat_name="" then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
    else
    rs("cat_name")=cat_name
    end if
    if founderr then
    call diserror()
    response.end
    else
    rs.update
    rs.close
    set rs=nothing
    response.redirect "admin_down.asp"
    end if
    elseif request.form("action")="newclass" then
    sql="select * from d_class"
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    rs.addnew
    dim class_name,cat_id
    cat_id=cint(request.form("cat_id"))
    class_name=trim(replace(request.form("class_name"),"'",""))

    if cat_id<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须选择所属分类名称!');history.back(1);</script>")
    else
    rs("cat_id")=cat_id
    end if
    if class_name="" then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须填写子分类名称!');history.back(1);</script>")
    else
    rs("class_name")=class_name
    end if
    if founderr then
    call diserror()
    response.end
    else
    rs.update
    rs.close
    set rs=nothing
    response.redirect "admin_down.asp"
    end if
    elseif request.form("action")="editcat" then
    if cint(request.form("id"))<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
    response.end
    end if
    sql="select * from d_cat where cat_id="&request.form("id")
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    cat_name=trim(replace(request.form("cat_name"),"'",""))

    if cat_name="" then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须填写分类名称!');history.back(1);</script>")
    else
    rs("cat_name")=cat_name
    end if
    if founderr then
    call diserror()
    response.end
    else
    rs.update
    rs.close
    set rs=nothing
    response.redirect "admin_down.asp"
    end if
    elseif request.form("action")="editclass" then
    if cint(request.form("id"))<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
    response.end
    end if
    sql="select * from d_class where class_id="&request.form("id")
    set rs=server.createobject("adodb.recordset")
    rs.open sql,conn,1,3
    cat_id=cint(request.form("cat_id"))
    class_name=trim(replace(request.form("class_name"),"'",""))

    if cat_id<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须选择所属分类名称!');history.back(1);</script>")
    else
    rs("cat_id")=cat_id
    end if
    if class_name="" then
    founderr=true
    Response.Write("<script language=javascript>alert('你必须填写子分类名称!');history.back(1);</script>")
    else
    rs("class_name")=class_name
    end if
    if founderr then
    call diserror()
    response.end
    else
    rs.update
    rs.close
    set rs=nothing
    response.redirect "admin_down.asp"
    end if
    elseif request.form("action")="delcat" then
    if cint(request.form("id"))<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
    response.end
    end if
    sql="select * from d_cat where cat_id="&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_down.asp"
    elseif request.form("action")="delclass" then
    if cint(request.form("id"))<1 then
    founderr=true
    Response.Write("<script language=javascript>alert('非法的分类参数!');history.back(1);</script>")
    response.end
    end if
    sql="select * from d_class where class_id="&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_down.asp"
    end if
    end if
    sql="select * from d_cat"
    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="other/Admin.css" rel="stylesheet" type="text/css">
</HEAD>

<p align="center"><a href="admin_down.asp?action=newsoft">添加专题</a> | <a href="admin_down.asp?action=list">修改专题</a> | <a href="admin_down.asp">专题管理</a> | <a href="admin_down.asp?action=newcat">添加分类</a></p>
<body onkeydown=return(!(event.keyCode==78&&event.ctrlKey)) >

<%if request.querystring("action")="" then%>
<table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
<tr> 
          <td colspan="2">专题分类管理</font></td>
        </tr>
<%do while not rs.eof%><tr><td width="70%"><%=rs("cat_name")%>&nbsp;[<a href="admin_down.asp?action=newclass">新建子分类</a>]</td><td width="30%">[<a href="admin_down.asp?action=editcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">修改</a>]&nbsp;[<a href="admin_down.asp?action=delcat&id=<%=rs("cat_id")%>&name=<%=rs("cat_name")%>">删除</a>]</td></tr>
<%sql="select * from d_class where cat_id="&rs("cat_id")
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
<tr><td width="70%">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=rs2("class_name")%></td><td width="30%">[<a href="admin_down.asp?action=editclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">修改</a>]&nbsp;[<a href="admin_down.asp?action=delclass&id=<%=rs2("class_id")%>&cid=<%=rs("cat_id")%>&name=<%=rs2("class_name")%>">删除</a>]</td></tr>
<%
rs2.movenext
loop
response.write "<tr><td>"
if rs2.bof and rs2.eof then
response.write "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;当前没有子分类!"
end if
rs2.close
set rs2=nothing
rs.movenext
loop
if rs.bof and rs.eof then
response.write "<tr><td>当前没有分类!"
end if
%>
</td></tr></table>  
<%
end if
if request.querystring("action")="newcat" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
        <form name="form1" method="post" action="admin_down.asp">
		<tr> 
          <td>新建分类</td>
        </tr>
        <tr> 
          <td>分类名称-
            <input type="text" name="cat_name" size="40" class="textarea">
          </td>
        </tr>
        <tr> 
          <td align="center">
              <input type="submit" name="Submit" value="确定新增" class="button">
              <input type="reset" name="Reset" value="取消重填" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
        </tr>
		<input type="hidden" name="action" value="newcat">
		<input type="hidden" name="MM_insert" value="true">
		</form>
      </table>
<%end if
if request.querystring("action")="newclass" then%>
      <table align="center" width="98%" align="center" border="1" cellspacing="0" cellpadding="4" style="border-collapse: collapse">
	    <form name="form2" method="post" action="admin_down.asp">
        <tr> 
          <td>新建子分类</td>
        </tr>
        <tr> 
          <td>子分类名称-
              <input type="text" name="class_name" size="50" class="textarea">
              <br>
              所属分类-
              <select name="cat_id">
                <%sql="select * from d_cat"
set rs=conn.execute(sql)
do while not rs.eof
%><option value="<%=rs("cat_id")%>"><%=rs("cat_name")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">暂无分类</option>
<%end if%>
              </select>
            </td>
        </tr>
        <tr> 
            <td align="center"> 
              <input type="submit" name="Submit2" value="确定新增" class="button">
              <input type="reset" name="Reset2" value="取消重填" class="button">
<input type="button" value="返回"  onClick="location.href='admin_down.asp'" class="button"></td>
        </tr>
		<input type="hidden" name="action" value="newclass">
		<input type="hidden" name="MM_insert" value="true">

⌨️ 快捷键说明

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