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

📄 admin_bumeng.asp

📁 夏茂政府网站
💻 ASP
字号:
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%> 
<%Session.CodePage=936%>
<!--#include file="setting.asp"-->
<!--#include file="../include/Conn.asp"-->
<!--#include file="../include/char.asp" -->
<!--#include file="../Include/check.asp"-->
<!--#include FILE="../Include/Admin_Function.asp"-->
<%CheckAdmin2%>
<% Set rs = Server.CreateObject("ADODB.Recordset") %>
<html>
<title><%=zf11_Title%> >> 管理网站部门_中国站长俱乐部-Club.Cn0797.Cn</title>
<meta http-equiv="content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" type="text/JavaScript">
<!--
    function doSubmit(){
		if (document.zf11_n_info.Title.value==""){
			alert("部门标题不能为空!");
			return false;
		}		
		if (document.zf11_n_info.content.value==""){
			alert("部门内容不能为空!");
			return false;
		}
		if (document.zf11_n_info.lingdao.value==""){
			alert("部门内容不能为空!");
			return false;
		}
		if (document.zf11_n_info.jigou.value==""){
			alert("部门内容不能为空!");
			return false;
		}
		if (document.zf11_n_info.banshi.value==""){
			alert("部门内容不能为空!");
			return false;
		}
		if (document.zf11_n_info.lianxi.value==""){
			alert("部门内容不能为空!");
			return false;
		}
		return true;
	}
//-->
</script>
<link href="../other/Admin.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FFFFFF}
-->
</style>
</head>
<body>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="20" align="center"><a href="Admin_bumeng.asp?action=Add">添加部门</a> | <a href="Admin_bumeng.asp">管理部门</a></td>
</tr>
</table>
<br>
<%if request("action")="Edit" then
Id=request.querystring("Id")
rs.Open "Select * From zf11_n_info where Id="&Id, conn,3,3
%>
<form action="Admin_bumeng.asp?Action=Modify" method="POST" name="zf11_n_info" Id="zf11_n_info" > 
  <table width="482" height="223" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#ff9933" bordercolordark="#ff9933" bgcolor="#ff9933">
    
<tr bgcolor="#Ff9933"> 
<td height="24" colspan=2 align=center><span class="STYLE1">修 改 部 门</span></td>
  </tr>
 
<tr bgcolor="#FFFFFF"> 
<td width="114" height="23"> 
<div align="center">标题:</div></td>
<td width="365" height="23"> <input type="text" name="Title" size="30" value="<%=rs("Title")%>"> 
<input type=hidden name=Id value="<%=rs("Id")%>">
</td>
  </tr>  
         <tr bgcolor="#FFFFFF"> 
            <td width="17%">所属分类</td>
            <td width="83%"> 
              <select name="piccatid" id="piccatid">
                <%
sql="select * from zf11_navigation where B_ID=1"
set rs2=server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
do while not rs2.eof%>
                <option value="<%=rs2("ID")%>" <%if rs2("ID")=rs("Sort2") then response.write "selected" end if%>><%=rs2("Names")%></option>
                <%rs2.movenext
loop
if rs2.eof and rs2.bof then%>
                <option value="0">当前没有分类</option>
                <%end if%>
              </select>
            </td>
          </tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">部门介绍:</div></td>
<td> <textarea name="content" rows="10" cols="50"><%=rs("content")%></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">领导班子:</div></td>
<td> <textarea name="lingdao" rows="10" cols="50"><%=rs("lingdao")%></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">内设机构:</div></td>
<td> <textarea name="jigou" rows="10" cols="50"><%=rs("jigou")%></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">办事项目:</div></td>
<td> <textarea name="banshi" rows="10" cols="50"><%=rs("banshi")%></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">联系方式:</div></td>
<td> <textarea name="lianxi" rows="10" cols="50"><%=rs("lianxi")%></textarea> 
</td>
</tr>
    <tr bgcolor="#F6F6F6"> 
      <td height="24" colspan=2 align=center> 
        <input type="submit" name="Submit" value="提交" onClick="return doSubmit()"> 
      <input type="reset" name="reset" value="清除"></td>
  </tr>
</table>
</form>
<% end if %>
<% if request("action")="Add" then %>
<form action="Admin_bumeng.asp?Action=Save" method="post" name="zf11_n_info" Id="zf11_n_info">
  
<table width="455" height="224" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#ff9933">
<tr> 
      
<td height="24" colspan=2 align=center bgcolor="#ff9933"><span class="STYLE1">添 加 部 门</span></td>
    </tr>
    
<tr bgcolor="#FFFFFF"> 
<td width="114" height="23"> 
<div align="center">标题:</div></td>
<td width="365"> 
<input name="Title" type="text" Id="Title" size="35">
<input type=hidden name=Id value="<%=rs("Id")%>">
</td>
    </tr>
          <tr  bgcolor="#FFFFFF"> 
            <td width="17%">所属分类</td>
            <td width="83%"> 
              <select name="piccatid">
<%
sql="select * from zf11_navigation where B_ID=1"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
do while not rs.eof%><option value="<%=rs("ID")%>"><%=rs("Names")%></option>
<%rs.movenext
loop
if rs.eof and rs.bof then%><option value="0">当前没有分类</option>
<%end if%>
              </select>
            </td>
          </tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">部门介绍:</div></td>      
<td> <textarea name="content" cols="50" rows="10" Id="部门介绍"></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">领导班子:</div></td>      
<td> <textarea name="lingdao" cols="50" rows="10" Id="领导班子"></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">内设机构:</div></td>      
<td> <textarea name="jigou" cols="50" rows="10" Id="内设机构"></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">办事项目:</div></td>      
<td> <textarea name="banshi" cols="50" rows="10" Id="办事项目"></textarea> 
</td>
</tr>
<tr bgcolor="#FFFFFF"> 
<td height="147"> 
<div align="center">联系方式:</div></td>      
<td> <textarea name="lianxi" cols="50" rows="10" Id="联系方式"></textarea> 
</td>
</tr>
    <tr bgcolor="#F6F6F6"> 
      <td height="24" colspan=2 align=center> 
        <input type="submit" name="Add" value="添加" onClick="return doSubmit()"> 
        <input type="reset" name="Reset" value="清除"></td>
    </tr>
  </table>
</form>
<% end if %>
<%
    if request("action") = "" then
    If Request.QueryString("CurPage") = "" or Request.QueryString("CurPage") = 0 then
    CurPage = 1
    Else
    CurPage = CINT(Request.QueryString("CurPage"))
    End If
    rs.Open "Select * From zf11_n_info Order By Id DESC", conn, 1,1
    if rs.eof and rs.bof then
    Response.Write("<p align='center'>暂时没有任何记录!</p>")
    else
    RS.PageSize=20 '设置每页记录数
    Dim TotalPages
    TotalPages = RS.PageCount
    If CurPage>RS.Pagecount Then
    CurPage=RS.Pagecount
    end if
    RS.AbsolutePage=CurPage
    rs.CacheSize = RS.PageSize'设置最大记录数
    Dim Totalcount
    Totalcount =INT(RS.recordcount)
    StartPageNum=1
    do while StartPageNum+10<=CurPage
    StartPageNum=StartPageNum+10
    Loop
    EndPageNum=StartPageNum+9
    If EndPageNum>RS.Pagecount then EndPageNum=RS.Pagecount
%>
<table width="500" border="0" align="center" cellpadding="0" cellspacing="1" bordercolorlight="#999999" bordercolordark="#FFFFFF" bgcolor="#ff9933">
  <tr> 
    <td width="258" height="20" bgcolor="#ff9933"><div align="center" class="STYLE1">&nbsp;部门标题</div></td>
 
    <td width="110" height="23" align="center" bgcolor="#ff9933"><span class="STYLE1">操 作</span></td>
  </tr>
 <%
    I=0
    p=RS.PageSize*(Curpage-1)
    do while (Not RS.Eof) and (I<RS.PageSize)
    p=p+1
%>
  <tr bgcolor="#FFFFFF" onMouseOut="this.style.backgroundColor=''" onMouseOver="this.style.backgroundColor='#F7F8F8'"> 
    
<td height="19" align=left bordercolorlight="#C0C0C0">&nbsp;<img src="../images/zf11_doc.gif">&nbsp;<%=left(rs("Title"),18)%>...</td>

    <td height="23" align=middle bordercolorlight="#c0c0c0" bgcolor="#FFFFFF"><div align="center"><a href="Admin_bumeng.asp?Action=Edit&Id=<%=rs("Id")%>">修改</a> 
| <a href="Announce_Modify.asp?Id=<%=rs("Id")%>"></a><a href="Admin_bumeng.asp?Action=Del&Id=<%=rs("Id")%>">删除</a><a href="Announce_Modify.asp?Id=<%=rs("Id")%>"></a></div></td>
  </tr>
<%
    I=I+1
    RS.MoveNext
    Loop
%>
  <tr bgcolor="#FFFFFF"> 
    <td height="23" colspan=4 align="center" bordercolorlight="#C0C0C0">页次: <font color="#CC0000"><%=CurPage%></font>/<%=TotalPages%> 
      页数: <a href="Admin_bumeng.asp?CurPage=<%=StartPageNum-1%>">&lt;&lt;</a> 
      <% For I=StartPageNum to EndPageNum
      if I<>CurPage then %>
      <a href="Admin_bumeng.asp?CurPage=<%=I%>"><%=I%></a> 
      <% else %>
      <%=I%>
      <% end if %>
      <% Next %>
      <% if EndPageNum<RS.Pagecount then %>
      <a href="Admin_bumeng.asp?CurPage=<%=EndPageNum+1%>">下页</a> 
      <%end if%>
|<a href="Admin_bumeng.asp">刷 新</a></td>
  </tr>
</table>
</body>
</html>
<%
    end if
    rs.close
    set rs=nothing
    end if
%> 
<%
    function strFilter(str)
		str=Replace(str,"'","''")
		str=replace(str,"|","/")
        str=Replace(str,"' ","'")
		strFilter=str
    end function
%>
<%
    if request("Action")="Save" then
    Title=strFilter(request("Title"))
    content=strFilter(request("content"))
    lingdao=strFilter(request("lingdao"))
    jigou=strFilter(request("jigou"))
    banshi=strFilter(request("banshi"))
    lianxi=strFilter(request("lianxi"))
    piccatid=cint(request.form("piccatid"))
    If piccatid="" Then
    Response.Write "<script>alert(""请选择分类!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If Title="" Then
    Response.Write "<script>alert(""请输部门标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If content="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If lingdao="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If jigou="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If banshi="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If lianxi="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    sql="select * from zf11_n_info "
    rs.open sql,conn,3,2
    rs.addnew
    rs("Title")=Title
    rs("content")=content
    rs("lingdao")=lingdao
    rs("jigou")=jigou
    rs("banshi")=banshi
    rs("lianxi")=lianxi
    rs("Sort2")=piccatid
    rs("Sort1")=1  
    rs.update
    rs.close 
    response.redirect "Admin_bumeng.asp"
    end if
%>
<%
    if request("Action")="Modify" then
    Id=request.form("Id")
    Title=strFilter(request.form("Title"))
    content=strFilter(request.form("content"))
    lingdao=strFilter(request("lingdao"))
    jigou=strFilter(request("jigou"))
    banshi=strFilter(request("banshi"))
    lianxi=strFilter(request("lianxi"))
    piccatid=cint(request.form("piccatid"))
    If piccatid="" Then
    Response.Write "<script>alert(""请选择分类!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If Title="" Then
    Response.Write "<script>alert(""请输部门标题!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If content="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If lingdao="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If jigou="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If banshi="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    If lianxi="" Then
    Response.Write "<script>alert(""请输部门内容!"");location.href=""javascript:history.back()"";</script>"
    Response.end()
    end if
    rs.open "select * from zf11_n_info where Id="&Id,conn,3,2
    rs("Title")=Title
    rs("content")=content
    rs("lingdao")=lingdao
    rs("jigou")=jigou
    rs("banshi")=banshi
    rs("lianxi")=lianxi
    rs("Sort2")=piccatid
    'if request("SetMarquee")=1 then
    'rs("Marquee")=1
    'else
    'rs("Marquee")=0
    'end if

    rs.update 
    rs.close 
    response.Redirect("Admin_bumeng.asp")
    end if 
%>
<%
    if request("Action")="Del" then
    Id=Request.QueryString("Id")
    delsql="delete from zf11_n_info where Id="&Id
    conn.execute(delsql)
    conn.close
    response.redirect"Admin_bumeng.asp"
    end if
%>

⌨️ 快捷键说明

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