newslist2.asp

来自「管理登录system 管理员:admin 密码:admin888 数据」· ASP 代码 · 共 196 行

ASP
196
字号
<!--#include file="check_login.asp"-->
<!--#include file="conn.asp"-->

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="text.css" rel="stylesheet" type="text/css">
<%
if request.QueryString("Lcalss")="" then
idd=trim(request.Form("Lcalss"))
else
idd=trim(request.QueryString("Lcalss"))
end if
CLassname=trim(request.QueryString("CLassname"))

set rs = server.createobject("adodb.recordset")
rs.source = "select * from newtree where Pid="&idd&" order by id desc "
rs.open rs.source,conn,1,1

dim i,intPage,page,pre,last,filepath
set rsp = server.createobject("adodb.recordset")
productsSQL= "select id,TreeName,Newtitle,Putman,Putout,addtime from news where TreeID like '%"&idd&"%' order by id desc "

rsp.PageSize = 12  '这里设定每页显示的记录数
rsp.CursorLocation = 3
rsp.Open productsSQL,conn,0,2,1  '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
 if len(page) = 0 then
    intpage = 1
    pre = false
 else
    if cint(page) =< 1 then
       intpage = 1
       pre = false
    else
        if cint(page)>=rsp.PageCount then
        intpage = rsp.PageCount
        last = false
        else
        intpage = cint(page)
     end if
   end if
end if
   if not rsp.eof then
         rsp.AbsolutePage = intpage
   end if
%>
</head>
<body  topmargin="0" leftmargin="0" rightmargin="0" <%=kkk%>>
<!--#include file="top/Ltop04.asp"-->
<table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0" style='BORDER-BOTTOM:#666666 1px solid; BORDER-LEFT:#CECFCE 1px solid; BORDER-RIGHT:#CECFCE 1px solid; BORDER-TOP: #666666 0px solid;'>
  <tr>
    <td valign="top">
      <table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td height="26" align="center" bgcolor="#F2F2F2" ><table width="99%"  border="0" align="center" cellpadding="0" cellspacing="0">
              <tr>
                <form name="form1" method="post" action="NewsSeek.asp">
                  <td>新闻检索:从
                      <script language=javascript> 
  var myDate=new dateSelector(); 
  myDate.year--; 
  myDate.inputName='start_date';  //注意这里设置输入框的name,同一页中日期输入框,不能出现重复的name。 
  myDate.display(); 
                </script>
              <script language=javascript> 
  myDate.year++; 
  myDate.inputName='end_date';  //注意这里设置输入框的name,同一页中的日期输入框,不能出现重复的name。 
  myDate.display(); 
 </script>
              名称:
              <input name="namework" type="text" id="namework" size="10">
              <input type="submit" name="Submit2" value="检索" class="btnadd_1">
                  </td>
                </form>
              </tr>
          </table></td>
        </tr>
      </table>
      <table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1" >
        <tr>
          <td width="60%" bgcolor="#CCCCCC" style='BORDER-BOTTOM:#666666 1px solid '><strong> 栏目列表:</strong><a href="NewsList.asp">首页</a> -&gt; <a href="NewsList2.asp?Lcalss=<%=idd%>&CLassname=<%=CLassname%>"><%=CLassname%></a></td>
          <td width="40%" align="center" bgcolor="#CCCCCC" style='BORDER-BOTTOM:#666666 1px solid '> 操 作</td>
        </tr>
        <% 
if not rs.EOF then 
while not rs.eof
%>
        <tr bgcolor="#F2F2F2" >
          <td bgcolor="#F2F2F2"  style='BORDER-BOTTOM:#CCCCCC 1px solid;'>&nbsp;┣&nbsp;<a href='JavaScript:void(null);'><%=rs("content")%></a>&nbsp;[ID号:<%=rs("id")%>]</td>
          <td  style='BORDER-BOTTOM:#CCCCCC 1px solid;'><%response.write "&nbsp;<a href='javascript:confirmdel2(" & rs("id") & ")'>"%>删除</A>&nbsp;|&nbsp;<a href="NewAdd.asp?ModifyID=<%=rs("id")%>">添加新闻</a></td>
        </tr>
        <%
rs.movenext
wend
else
response.Write"<tr bgcolor='#e4f1d8' height='40'>"
response.Write"<td colspan='2'align='center' bgcolor='#F1FAF1'  style='BORDER-BOTTOM:#CCCCCC 1px solid;'><font color=red>未设下级新闻类别</font>&nbsp;&nbsp;&nbsp;&nbsp;<input type=button value='&nbsp;返回&nbsp;' onclick=history.go(-1) class=sbttn ></td>"
response.Write"</tr>"
End if 
rs.close
set rs=nothing
%>
      </table>
	  
      <table width="100%"  border="0" align="center" cellpadding="1" cellspacing="1">
        <tr>
          <td bgcolor="#CECFCE" style='BORDER-BOTTOM:#666666 1px solid '><strong> 新闻列表:</strong><a href="NewsList.asp">首页</a> -&gt; <a href="NewsList2.asp?Lcalss=<%=idd%>&CLassname=<%=CLassname%>"><%=CLassname%></a> (&quot;<font color="#0000FF"><B>√</B></font>&quot;表示该信息已发布;&quot;<font color="#0000FF"><B>×</B></font>&quot;表示该信息已有数据未发布)</td>
        </tr>
        <tr>
          <td bgcolor="#F1F1F1"><table width="100%"  border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
            <form action="Del_News.asp" method="post" name="form2" >
              <tr bgcolor="#DEDBDE">
                <td width="4%">&nbsp;</td>
                <td width="5%">&nbsp;编号</td>
                <td width="21%" bgcolor="#DEDBDE">&nbsp;新闻类别</td>
                <td width="39%">&nbsp;新闻标题</td>
                <td width="12%">&nbsp;添加时间</td>
                <td height="26" colspan="2">&nbsp;操作&nbsp;&nbsp;<input onclick="CheckAll(this.form)" name="All" type="button" value="全选" style=" FONT: 12px;HEIGHT: 18px;WIDTH: 30px;">&nbsp;<input onclick="CheckOthers(this.form)" name="Others" type="button" value="反选" style=" FONT: 12px;HEIGHT: 18px;WIDTH: 30px;"></td>
              </tr>
              <%
if rsp.BOF then
  response.write "<tr><td colspan='7' width='100%' height='50'' align='center'>无相关内容!</td>"
end if
for i=1 to rsp.PageSize
if rsp.EOF or rsp.BOF then exit for
dim Lpt,Lstr
Lpt=rsp("Putout")
if Lpt=true then
Lstr="<font color='#0000FF'><b>√</b></font>"
else
Lstr="<font color='#0000FF'><b>×</b></font>"
end if
%>
              <tr bgcolor="#F2F2F2" onMouseOver = "this.style.backgroundColor = '#EEEEEE'" onMouseOut = "this.style.backgroundColor = ''" style="CURSOR:hand">
                <td>&nbsp;<%=Lstr%></td>
                <td>&nbsp;<%=rsp("id")%></td>
                <td>&nbsp;<%=rsp("TreeName")%></td>
                <td>&nbsp;<%=rsp("Newtitle")%></td>
                <td>&nbsp;<%=rsp("addtime")%></td>
                <td width="10%"><a href="NewAdd2.asp?NewsID=<%=rsp("id")%>&AtionD=UpdateD">&nbsp;修改</a></td>
                <td width="9%">&nbsp;
                    <input name="selectid" type="checkbox" id="selectid" value="<%=rsp("id")%>"></td>
              </tr>
              <%
              rsp.movenext
              next
             %>
              <tr bgcolor="#F2F2F2" onMouseOver = "this.style.backgroundColor = '#EEEEEE'" onMouseOut = "this.style.backgroundColor = ''" style="CURSOR:hand">
                <td height="26" colspan="5">&nbsp;</td>
                <td height="26" colspan="2" align="center"><input name="Submit" type="button" id="Submit"  value="删除所选" onclick="javascript:return ConfirmDelNews();"></td>
              </tr>
            </form>
          </table>
          <table width="100%" border="0" align="center" cellpadding="1" cellspacing="1" borderColorLight=#808080 borderColorDark=#ffffff bgcolor="#DEDBDE">
   <tr>
     <%if rsp.pagecount>0 then%>
     <td width="13%" height="23" align="left">当前页<%=intpage%>/<%=rsp.PageCount%> </td>
     <%else%>
    <td width="15%" height="23" align="left">当前页0/0</td>
	<%end if%>
	<td width="26%" align="left">|共有<%=rsp.recordcount%>条记录,每页12条记录</td>
    <td width="46%" align="right"> <a href="NewsList2.asp?page=1&Lcalss=<%=idd%>&CLassname=<%=CLassname%>">首页</a>| 
     <%if pre then%>
     <a href="NewsList2.asp?page=<%=intpage -1%>&Lcalss=<%=idd%>&CLassname=<%=CLassname%>">上页</a>|
	 <%end if%>
     <%if last then%>
      <a href="NewsList2.asp?page=<%=intpage +1%>&Lcalss=<%=idd%>&CLassname=<%=CLassname%>">下页</a>|
	  <%end if%>
      <a href="NewsList2.asp?page=<%=rsp.PageCount%>&Lcalss=<%=idd%>&CLassname=<%=CLassname%>">尾页</a>|转到第
      <select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
      <%
       for i = 1 to rsp.PageCount
       if i = intpage then%>
       <option value="NewsList2.asp?page=<%=i%>&Lcalss=<%=idd%>&CLassname=<%=CLassname%>"selected><%=i%></option>
     <%else%>
       <option value="NewsList2.asp?page=<%=i%>&Lcalss=<%=idd%>&CLassname=<%=CLassname%>"><%=i%></option>
      <%
       end if
        next
        %>
     </select>页</font> 
    </td>
    </tr>
   </table></td>
        </tr>
    </table></td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

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