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

📄 managenews.asp

📁 商城源码程序(上海数字商城整站) 功能列表: 商品管理
💻 ASP
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s3")=0  then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>
<%news_title=trim(request("news_title"))
typeid=trim(request("typeid"))
action=trim(request("action"))
%>

<form name="form1" method="post" action="managenews.asp?action=search">
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#f0f0f0" bordercolordark="#FFFFFF">
  <tr>
    <td width="15%" height="25">&nbsp;</td>
    <td>新闻标题:</td>
    <td><input name="news_title" type="text" size="20"></td>
    <td>所属类别:</td>
    <td><select name="typeid">
	<option value="">请选择</option>
	<%sql="select * from newsclass"
	  set rs=server.CreateObject("adodb.recordset")
	  rs.open sql,conn,1,1
	  if rs.eof and rs.bof then%>
      <option value="">暂无类别</option>
	  <%else
	    do while not rs.eof%>
      <option value="<%=rs("typeid")%>"><%=rs("news_type")%></option>
	  <%rs.movenext
	    loop
		end if
		rs.close:set rs=nothing%>
    </select></td>
    <td>
      <input type="submit" name="Submit" value="查询">    </td>
    <td width="15%">&nbsp;</td>
  </tr>
</table></form>
<table width="100%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#6699cc" bordercolordark="#FFFFFF">
  <tr align="center" bgcolor="6699cc">
    <td height="25">新闻标题</td>
    <td>所属类别</td>
    <td>浏览次数</td>
    <td>发布日期</td>
    <td>删除</td>
  </tr>
     <%
  set rs=server.createobject("adodb.recordset")
  if action="search" then
  sql="select * from news where 1=1"
  
  if news_title<>"" then
  sql=sql & " and news_title like '%"&news_title&"%'"
  end if
  if typeid<>"" then
  sql=sql & " and typeid = "&typeid
  end if
  
  sql = sql & " order by adddate DESC"
  else
  sql="select * from news order by adddate DESC"
  end if
    rs.open sql,conn,1,1
	if rs.eof and rs.bof then%>
	<tr><td colspan="6" height="25">暂无记录</td></tr>
		<%
	else
      rs.pagesize=18
      page = cint(request("page"))
      if page = "" then page = 1
      if not(isnumeric(page)) then page=1
      if page<1 then page=1
      if page >= rs.pagecount then page = rs.pagecount
      rs.absolutepage = page
    
for j=1 to rs.PageSize 
 %>
  <tr align="center">
    <td height="25"><a href="editnews.asp?newsid=<%=rs("newsid")%>"><%=rs("news_title")%></a></td>
    <td>
	<%set rsg=server.createobject("adodb.recordset")
	  rsg.open"select typeid,news_type from newsclass where typeid="&trim(rs("typeid")),conn,1,1
	  response.write (rsg("news_type"))
	  rsg.close:set rsg=nothing%>
	  </td>
    <td><%=rs("viewnum")%></td>
    <td><%=rs("adddate")%></td>
    <td><a href="save_news.asp?action=del&newsid=<%=rs("newsid")%>" onClick="return confirm('确定删除?')">删除</a></td>
  </tr>
    	  <%rs.movenext
if rs.eof then exit for
next
%>
<tr>
      <td height="25" colspan="6" align="center"> 
	                      <p align="center">共有记录<%=rs.recordcount%>条&nbsp;                   
                    <%=page%>/<%=rs.pagecount%>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <A href="<%request.servervariables("document_name")%>?page=<%=page-1%>&action=<%=action%>&news_title=<%=news_title%>&typeid=<%=typeid%>">上一页</A> <A href="<%request.servervariables("document_name")%>?page=<%=page+1%>&action=<%=action%>&news_title=<%=news_title%>&typeid=<%=typeid%>">下一页</A>&nbsp;&nbsp;&nbsp; 转到第 <SELECT onChange="window.location='?action=<%=action%>&news_title=<%=news_title%>&typeid=<%=typeid%>&page='+this.value" name=gopage>              
                    <%for x=1 to rs.pagecount%>
                    <OPTION <%if x=page then%>selected<%end if%> value=<%=x%>><%=x%></OPTION>
                    <%next%>      
      </SELECT> 页      </td>
</tr>
<%
end if
rs.close
set rs=nothing

%> 
</table>

</body>
</html>

⌨️ 快捷键说明

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