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

📄 affiche_mb_manage.asp

📁 视频点播系统
💻 ASP
字号:
<!--#include file="chklogin.asp"-->
<%

call myobj.chkrq()
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网站公告管理</title>
<link href="images/style2.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body,td,th {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #000000;
}
a:link {
	color: #0000FF;
	text-decoration: none;
}
a:visited {
	color: #0000FF;
	text-decoration: none;
}
a:hover {
	color: #FF0000;
	text-decoration: underline;
}
a:active {
	text-decoration: none;
}
-->
</style>

<script language="vbscript">
function tb()
if document.GetElementById("tb_body").style.display="none" then
    document.GetElementById("tb_body").style.display="inline"
else
	document.GetElementById("tb_body").style.display="none"
end if
end function
</script>
<script language="JavaScript">
function tourl(form1_url){
    location=form1_url;
    for(var i=0;i<document.form1.elements.length;i++){
        document.form1.elements[i].options[0].selected=true
    }
}
</script>
</head>

<body leftMargin="0" topMargin="0" bgcolor="#FFFFFF">
<table width="550" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td>&nbsp;</td>
  </tr>
</table>
<table width="550" height="25" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#3975CE">
  <tr>
    <td align="center"><a href="<%=filename%>" class="lfont1">[所有网站公告]</a> <strong class="font1">网站公告列表</strong> <a href="vbscript:tb()" class="lfont1">[高级搜索]</a> <a href="affiche_mb_add.asp" class="lfont1">[发布新网站公告]</a></td>
  </tr>
</table>
<table width="550" height="100" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7" id="tb_body" style="display:none">
  <tr>
    <td align="center" bgcolor="#F7F7F7"><table width="500" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td>&nbsp;</td>
      </tr>
    </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><form name="form2" method="post" action="<%=filename%>?sql=1">●搜索标题中包含:
          <input name="var" type="text" class="input1" id="var" size="20">
          的网站公告
          <input name="Submit" type="submit" class="button1" value="确定"></form></td>
      </tr>
    </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><form name="form3" method="post" action="<%=filename%>?sql=2">●搜索正文中包含:
              <input name="var" type="text" class="input1" id="var" size="20">
      的网站公告
      <input name="Submit" type="submit" class="button1" value="确定"></form></td>
        </tr>
      </table>
      <table width="500" height="25" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td><form name="form4" method="post" action="<%=filename%>?sql=3">●列出所有置顶属性的网站公告
          <input name="Submit" type="submit" class="button1" value="确定"></form></td>
        </tr>
      </table></td>
  </tr>
</table>
<table width="550" height="30" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td align="center">当前查询条件:<%if request("sql")="" then%><span class="font3">所有网站公告</span><%end if%><%if request("sql")="1" then%>标题中包含:<span class="font3"><%=request("var")%></span>的网站公告<%end if%><%if request("sql")="2" then%>正文中包含:<span class="font3"><%=request("var")%></span>的网站公告<%end if%><%if request("sql")="3" then%><span class="font3">所有置顶的网站公告</span><%end if%></td>
  </tr>
</table>
<%
if request("sql")="" then
set rs=server.createobject("adodb.recordset")
rs.open "select * from affiche where a_type=1 order by id desc",conn,1,1
end if
if request("sql")=1 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from affiche where a_type=1 and a_title like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=2 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from affiche where a_type=1 and a_body like '%"&request("var")&"%' order by id desc",conn,1,1
end if
if request("sql")=3 then
set rs=server.createobject("adodb.recordset")
rs.open "select * from affiche where a_type=1 and on_top=1 order by id desc",conn,1,1
end if
if rs.eof and rs.bof then
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td height="100" align="center" bgcolor="#F7F7F7">没有查询到任何符合条件的网站公告</td>
  </tr>
</table>
<%
else

maxpage=10 '每页最大显示数
dim totalhow  '数据库中的总记录数
dim totalpage '总共页数
dim CurrentPage '当前处于的页数
currentPage=request.Querystring("page")
totalhow=rs.recordcount
if totalhow mod maxpage=0 then
totalpage= totalhow \ maxpage
else
totalpage = totalhow \ maxpage +1
end if


if currentpage<1 then
   currentpage=1
end if
if (currentpage-1)*MaxPage>totalhow then
   if (totalhow mod MaxPage)=0 then
      currentpage= totalhow \ MaxPage
	   else
      currentpage= totalhow \ MaxPage + 1
   end if
end if
if (currentPage-1)*MaxPage<totalhow then
    rs.move (currentPage-1)*MaxPage
    else
    currentPage=1
end if
%>
<table width="550" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#E7E7E7">
  <tr>
    <td height="25" align="center" bgcolor="#F7F7F7">标题</td>
    <td align="center" bgcolor="#F7F7F7">查看次数</td>
    <td align="center" bgcolor="#F7F7F7">置顶</td>
    <td align="center" bgcolor="#F7F7F7">发布时间</td>
    <td align="center" bgcolor="#F7F7F7">&nbsp;操作&nbsp;</td>
  </tr>
  <%
i=0
do while not rs.eof
i=i+1
%>
  <tr>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=left(rs("a_title"),25)%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=rs("see_count")%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%if rs("on_top")=true then%>
        <%else%>
        ×
        <%end if%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><%=rs("a_time")%></td>
    <td height="25" align="center" bgcolor="#FFFFFF"><a href="affiche_mb_edit.asp?id=<%=rs("id")%>" title="<%=rs("a_title")%>">编辑</a>/<a href="<%=filename%>?action=affiche_del&id=<%=rs("id")%>"  title="<%=rs("a_title")%>" onclick="javascript:{if(confirm('确定要删除该条网站公告吗?')){return true;}return false;}">删除</a></td>
  </tr>
  <%
if i>=maxpage then exit do
rs.movenext
loop
%>
</table>
<table width="550" height="40" border="0" align="center" cellpadding="0" cellspacing="0">
  <form name="form1" method="post">
    <tr>
      <td width="421" align="right"><!-- ########### 开始判断分页类型 ############### -->
          <font face="Webdings">7</font>&nbsp;
          <%if currentpage>1 then%><a href="<%=filename%>?sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>首页<%if currentpage>1 then%></a><%end if%>
&nbsp;&nbsp;
        <%if currentpage>1 then%><a href="<%=filename%>?page=<%=currentPage-1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>上一页<%if currentpage>1 then%></a><%end if%>
&nbsp;&nbsp;&nbsp;
        <%if cint(currentpage)<totalpage then%><a href="<%=filename%>?page=<%=currentPage+1%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>下一页<%if cint(currentpage)<totalpage then%></a><%end if%>
&nbsp;&nbsp;&nbsp;
        <%if cint(currentpage)<totalpage then%><a href="<%=filename%>?page=<%=totalpage%>&sql=<%=request("sql")%>&var=<%=request("var")%>"><%end if%>尾页<%if cint(currentpage)<totalpage then%></a><%end if%>
&nbsp;<font face="Webdings">8</font>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 共有<span class="font3"><%=totalhow%></span>条记录&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;共<span class="font3"><%=currentPage%></span>/<span class="font3"><%=totalpage%></span>页</td>
      <td width="129"> 
          <select name="topage" size="1" class="select1" onChange="JavaScript:tourl(document.form1.topage.options[document.form1.topage.selectedIndex].value)">
            <%
for j=1 to totalpage
%>
            <option value="<%=filename%>?page=<%=j%>&sql=<%=request("sql")%>&var=<%=request("var")%>" <%if cint(request.Querystring("page"))=j then%>selected<%end if%>> 第<%=j%>页 </option>
            <%next%>
        </select></td>
  </form>
  <!-- ############################ 判断分页类型结束 ######################## -->
</table>
<%
end if
%>
<%
if request.Querystring("action")="affiche_del" then
conn.execute"delete from affiche where a_type=1 and id="&request.Querystring("id")&""
response.write"<script language=javascript>alert('网站公告删除成功');location.href = '"&filename&"';</Script>"
response.end
end if
%>
</body>
</html>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

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