📄 news.asp
字号:
<!--#include file="../inc/conn.asp"-->
<!--#include file="../inc/sort.asp" -->
<!--#include file = "../inc/getPartStrAndBytesLen.asp"-->
<!--#include file="fyasp_mange_check.asp"-->
<%
OpenDataConn
action=changechr(request("action"))
%>
<html>
<head>
<title>后台管理系统</title>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../ht.css" type="text/css">
</head>
<body bgcolor="#d6dff7" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="../inc/top.asp" -->
<br>
<%
if session("news")="1" then
Select case action
Case "del"
call del
Case "add"
call add
Case "saveadd"
call saveadd
Case "edit"
call edit
Case "saveedit"
call saveedit
Case "tj"
call tj
Case else
call list
End Select
else
Response.Write "权限不足!"
Response.end
end if
sub list%>
<script language="javascript">
<!--
function openwin(url)
{
window.open(url,"_blank","height=320,width=500,resizable=no,scrollbars=yes,statue=no,toolbar=no,menubar=no,location=no,left=150,top=80");
}
//-->
</script> <script language="JavaScript">
function saveexit()
{
if (chk()==0)
{
return false;
};
document.form3.submit();
}
function chk()
{
if (document.form3.sort.value.length==0)
{
alert("请选择新闻类型。");
document.form3.sort.focus();
return 0;
};
if (document.form3.topic.value.length==0)
{
alert("请填写新闻标题。");
document.form3.topic.focus();
return 0;
};
if (document.form3.comment.value.length==0)
{
alert("请填写新闻内容。");
document.form3.comment.focus();
return 0;
};
return 1;
}
</script>
<script language="javascript">
function CheckAll()
{
for (var i=0;i<document.form1.elements.length;i++)
{
document.form1.elements[i].checked=document.form1.chkall.checked
}
}
</script><form method="post" action="?action=del" name="form1">
<div align="center">
请选择新闻类型:
<select name="sort" id="select" onChange="MM_jumpMenu('self',this,0)">
<option value=news.asp>全部类型</option>
<%for idi=1 to sortcount
sortnum=idi
%>
<option value="news.asp?sort=<%=idi%>" <%if request("sort")=cstr(sortnum) then Response.write("selected") end if%>><!--#include file="../inc/sort.asp" --></option>
<%next%>
</select>
<br>
<div align="center">
<center>
<table border="0" width="93%" cellspacing="1" cellpadding="0">
<tr bgcolor="#AABFEC" align="center">
<td width="6%" height="28"> </td>
<td width="16%">新闻类型</td>
<td width="40%">新闻标题</td>
<td width="24%">发布时间</td>
<td width="14%"> </td>
</tr>
<%
dim curpage
if request.querystring("curpage")="" then
curpage=1
else
curpage=request.querystring("curpage")
end if
const numperpage=15
sort=trim(request("sort"))
set rs=server.createobject("adodb.recordset")
sql="select * from news "
if sort<>"" then
sql=sql & " where sort="&sort&""
end if
sql=sql & " order by dnt desc "
rs.open sql,conn,1,1
if rs.eof then
response.write "<table><tr><td><br></br><center>现在还没有记录!</center><br></br></td></tr></table>"
response.end
end if
if not rs.eof then
rs.pagesize=numperpage
dim totalpages
totalpages=rs.pagecount
rs.absolutepage=curpage
end if
dim count
count=0
do while not rs.eof and count<numperpage
sortnum=rs("sort")
%>
<tr bgcolor="#f3f3f3">
<td width="6%" align="center" height="28"> <input type="checkbox" name="newsid" value="<%=rs("newsid")%>" class="mul">
</td>
<td width="16%" align="center">
<!--#include file="../inc/sort.asp"--> </td>
<td>·<a href=../house/liuchen_detail.asp?newsid=<%=rs("newsid")%> target=_blank><%=rs("topic")%></a> </td>
<td width="24%" align="center"><%=year(rs("dnt"))%>-<%=month(rs("dnt"))%>-<%=day(rs("dnt"))%> </td>
<td width="14%" align="center"><a href="?action=edit&newsid=<%=rs("newsid")%>">[修改]</a></td>
</tr>
<%
rs.movenext
count=count+1
loop
rs.close
set rs=nothing
%>
<tr bgcolor="#DEF0FA">
<td width="100%" colspan="8"> <input type="checkbox" name="chkall" value="on" onClick="CheckAll()" class="mul">
选取以上全部记录
<input type="submit" value="删除所选新闻" name="B2"></td>
</tr>
<tr>
<td colspan="5" align="center" height="50"><div align="center">
<% if cint(curpage)<>1 then %>
<a href="news.asp?curpage=1&sort=<%=sort%>">首页 </a>
<% else %>
首页
<% end if %>
<% if cint(curpage)>1 then %>
<a href="news.asp?curpage=<%=curpage-1%>&sort=<%=sort%>">上一页 </a>
<% else %>
上一页
<% end if %>
<% if cint(curpage)<>cint(totalpages) then %>
<a href="news.asp?curpage=<%=curpage+1%>&sort=<%=sort%>"> 下一页
<% else %>
下一页
<% end if %>
<% if cint(curpage)<>cint(totalpages) then %>
</a><a href="news.asp?curpage=<%=totalpages%>&sort=<%=sort%>"> 末页
<% else %>
末页
<% end if %>
</a> 第<font color="#FFCC00"><%=curpage%></font>页/共<%=totalpages%>页
<select name="menu1" onChange="MM_jumpMenu('self',this,0)">
<option value="#" selected>请选择</option>
<%
k=1
do while k<=totalpages
%>
<option value="news.asp?curpage=<%=k%>&sort=<%=sort%>">第<%=k%>页</option>
<%
k=k+1
loop
%>
</select>
</div></td>
</tr>
</table>
</center>
</div>
</div>
</form><%end sub
sub edit
%>
<script language="JavaScript">
function saveexit()
{
if (chk()==0)
{
return false;
}
document.form3.submit();
}
function chk()
{
if (document.form3.sort.value.length==0)
{
alert("请选择新闻类型。");
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -