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

📄 admin_list.asp

📁 政府网站集成OA办公考勤新闻发布网站信息管理会员管理
💻 ASP
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetActicle")<>1 then HX_GoBack "对不起,您的权限不够!",""
    const MaxPerPage=15
    dim totalPut
    dim CurrentPage
    dim TotalPages
    dim idlist,SqlSort,RsSort,SortID
  
    title=request("txtitle")
    if not isempty(request("page")) then
    currentPage=cint(request("page"))
    else
    currentPage=1
    end if
    if not isempty(request("selAnnounce")) then
    idlist=request("selAnnounce")
    if instr(idlist,",")>0 then
    dim idarr
    idArr=split(idlist)
    for i = 0 to ubound(idarr)
    id=clng(idarr(i))
    call deleteannounce(id)
    next
    else
    call deleteannounce(clng(idlist))
    end if
    end if 
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT LANGUAGE="JavaScript">
    <!-- Begin
    var checkflag = "false";
    function check(field) {
    if (checkflag == "false") {
    for (i = 0; i < field.length; i++) {
    field[i].checked = true;}
    checkflag = "true";
    return " 不 选 "; }
    else {
    for (i = 0; i < field.length; i++) {
    field[i].checked = false; }
    checkflag = "false";
    return " 全 选 "; }
    }
    //  End -->
</script>
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
</head>
<body topmargin='20' leftmargin='0' bottommargin='0'>
<table border="0" width="590" cellspacing="0" cellpadding="0" align="center">
  <tr>
 <td width="100%" align="center"> 
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <form name="searchsoft" method="POST" action="Admin_List.asp"><tr>
 <td>
  &nbsp;&nbsp;查找文章: 
  <input name="txtitle" type="text" class=smallInput size="13">
  &nbsp; 
  <input type="submit" value="查 询" name="title" class="buttonface">
  </td>
  </tr> </form>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="3">
<%
    SqlSort = "Select * from a125_type where a125_big_id=0 and a125_setting<4 order by a125_order"
    Set RsSort = Conn.Execute(SqlSort )
    if RsSort.eof and RsSort.bof then
    Response.write("<div align=center>还没有设置分类.......</div>")
    response.end
    else
%>
<tr>
<td height="30" align="center"><a href="Admin_list.asp">全部信息</a></td>
<% do while not RsSort.eof %>
<td align="center"><a href="Admin_list.asp?SortID=<%=RsSort("ID")%>"><%=RsSort("a125_names")%></a></td>
<%
    RsSort.movenext
    loop
    end if
    RsSort.close
    set RsSort=nothing
%>
</tr>
</table>
<table width="590" border="0" cellspacing="0" cellpadding="0">
<form method=Post action="Admin_List.asp"><tr>
<td>
<%
    SortID=Request("SortId")
    if SortID<>"" then
    if WS_S.MemberPriv("WS_FrontSetadmin")=1 then
    sql="select * from Info where Sort1="&SortID&" order by ID desc"
    else
    sql="select * from Info where Sort1="&SortID&" and writerid="&LOGINUid&" order by ID desc"
    end if
    end if
    if title<>"" then
    if WS_S.MemberPriv("WS_FrontSetadmin")=1 then
    sql="select * from Info where title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%' order by ID desc"
    else
    sql="select * from Info where (title like '%"&trim(title)&"%' or content like '%"&trim(title)&"%') and writerid="&LOGINUid&" order by ID desc"
    end if
    end if
    if SortID="" and title="" then
    if WS_S.MemberPriv("WS_FrontSetadmin")=1 then
    sql="select * from Info order by ID desc"
    else
    sql="select * from Info where writerid="&LOGINUid&" order by ID desc"
    end if
    end if
    Set rs= Server.CreateObject("ADODB.Recordset")
    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
    response.write "<p align='center'> 还 没 有 任 何 文 章 </p>"
    else
    totalPut=rs.recordcount
    if currentpage<1 then
    currentpage=1
    end if
    if (currentpage-1)*MaxPerPage>totalput then
    if (totalPut mod MaxPerPage)=0 then
    currentpage= totalPut \ MaxPerPage
    else
    currentpage= totalPut \ MaxPerPage + 1
    end if
    end if
    if currentPage=1 then
    showContent
    showpage totalput,MaxPerPage,"Admin_list.asp"
    else
    if (currentPage-1)*MaxPerPage<totalPut then
    rs.move  (currentPage-1)*MaxPerPage
    dim bookmark
    bookmark=rs.bookmark
    showContent
    showpage totalput,MaxPerPage,"Admin_list.asp"
    else
    currentPage=1
    showContent
    showpage totalput,MaxPerPage,"Admin_list.asp"
    end if
    end if
    rs.close
    end if
    set rs=nothing  
    conn.close
    set conn=nothing
    
    
sub showContent
    dim i
    i=0
%>
<table width='596'  border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
 <table width='100%'  border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>信息列表</font></td></tr></table>
 <table width='100%'  border='0' cellspacing='1' cellpadding='3' bgcolor='#f1f1f1'>
    <tr bgcolor='#A1BBE0' class='td4'>
<td width="41" height="23" align="center"><span class="STYLE1">ID</span></td>
<td width="380" align="center"><span class="STYLE1">信 息 标 题</span></td>
<td colspan="3" align="center"><span class="STYLE1">操作</span></td>
 </tr>
<%do while not rs.eof%>
 <tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'> 
<td width="41" height="23"> <p align="center"><%=rs("ID")%></td>
<td width="380">&nbsp;&nbsp;<%=rs("title")%></td>
<td width="47"> <div align="center"><a href="../typenews.asp?id=<%=rs("ID")%>" target="_blank">查看</a></div></td>
<td width="47"> <div align="center"><a href="Admin_Edit.asp?id=<%=rs("ID")%>">修改</a></div></td>
<td width="79"> <p align="center"> 
 <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("ID"))%>' style="border:0px">
</td>
 </tr>
<%
    i=i+1
    if i>=MaxPerPage then exit do
    rs.movenext
    loop
%>
 <tr bgcolor='#F6F6F6'> 
<td colspan="5"align="right">&nbsp;

 <input name="button" type=button onClick="this.value=check(this.form.selAnnounce)" value=" 全 选 ">
 <input name="submit" type='submit' class=buttonface value=' 删 除 '>

</td></tr></table></td></tr></table>
<%
    end sub
    
    function showpage(totalnumber,maxperpage,filename)
    dim n
    if totalnumber mod maxperpage=0 then
    n= totalnumber \ maxperpage
    else
    n= totalnumber \ maxperpage+1
    end if
    response.write "<p align='center'>&nbsp;"
    if CurrentPage<2 then
    response.write "首页 上一页&nbsp;"
    else
    response.write "<a href="&filename&"?SortID="&SortID&"&page=1>首页</a>&nbsp;"
    response.write "<a href="&filename&"?SortID="&SortID&"&page="&CurrentPage-1&">上一页</a>&nbsp;"
    end if
    if n-currentpage<1 then
    response.write "下一页 尾页"
    else
    response.write "<a href="&filename&"?SortID="&SortID&"&page="&(CurrentPage+1)&">"
    response.write "下一页</a> <a href="&filename&"?SortID="&SortID&"&page="&n&">尾页</a>"
    end if
    response.write "&nbsp;页次:<strong>"&CurrentPage&"/"&n&"</strong>页"
    response.write "&nbsp;共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/页"
    end function
    
    sub deleteannounce(id)
    sql="delete from Info where ID="&cstr(id)
    conn.execute sql
    if err.Number<>0 then
    err.clear
    response.write "删 除 失 败 !<br>"
    else
    'response.write "操作成功!<br>"
    end if
    End sub
%>
</td>
  </tr><tr height=15><td></td>
  </tr></form>
</table> </td>
  </tr>
</table>

⌨️ 快捷键说明

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