admin_city_mod.asp
来自「CityCN V2.1 是自主开发的基于ASP+Access的新型资讯信息系统。」· ASP 代码 · 共 259 行
ASP
259 行
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="admin_admininfo.asp"-->
<!--#include file="sub_change.asp" -->
<%
if session("adminname")<>adminname or session("adminpwd")<>adminpwd then
response.Redirect("admin_login.asp")
end if
dim ct,ok
ct=trim(request.QueryString("ct"))
if len(ct)=0 or len(ct)>citynamemax then response.redirect "error.asp?v=city_error" end if
ok=strchange(left(trim(request.QueryString("ok")),1))
dim errormax,pov,povmax,city,quhao,quhaomax,about,aboutmax,gonggao,gonggaomax,pass,tui,hot,paiming
aboutmax=150
gonggaomax=200
errormax=""
if ok="y" then
pass=strchange(cint(trim(request.form("pass"))))
if pass<0 or pass>1 then errormax=errormax&"请重新选择审核是否通过!<br>" end if
tui=strchange(trim(request.form("tui")))
if len(tui)=0 or tui="-1" then errormax=errormax&"推荐数不能为空!<br>" end if
hot=strchange(trim(request.form("hot")))
if not IsNumeric(hot) then errormax=errormax&"人气只能是数字!<br>" end if
paiming=strchange(trim(request.form("paiming")))
if not IsNumeric(paiming) then errormax=errormax&"排名只能是数字!<br>" end if
pov=strchange(trim(request.form("pov")))
if len(pov)=0 or pov="0" then errormax="省份名称不能为空!<br>" end if
city=strchange(trim(request.form("city")))
if len(city)=0 or city="0" then errormax=errormax&"城市名称不能为空!<br>" end if
if len(city)>citynamemax then errormax=errormax&"城市名称超过系统最大字符数" &citynamemax&",目前字符数:"&len(city)&"!<br>" end if
if len(guolv(city))>0 then errormax=errormax&"城市名称中数据“"&guolv(city)&"”被系统过滤!<br>" end if
if right(city,1)="县" then errormax=errormax&"暂不接受县级地方,请谅解!<br>" end if
if right(city,1)="乡" then errormax=errormax&"暂不接受乡级地方,请谅解!<br>" end if
if right(city,1)="镇" then errormax=errormax&"暂不接受镇级地方,请谅解!<br>" end if
if right(city,1)="区" then errormax=errormax&"暂不接受区级地方,请谅解!<br>" end if
if right(city,1)="市" then errormax=errormax&"请取消城市后缀,如西安市填写 西安 !<br>" end if
quhao=strchange(trim(request.form("quhao")))
if len(quhao)>4 or len(quhao)<3 then errormax=errormax&"城市区号请填写数字,<font face='Arial'>3~4</font>,目前字符数:"&len(quhao)&"!<br>" end if
if len(guolv(quhao))>0 then errormax=errormax&"城市区号中数据“"&guolv(quhao)&"”被系统过滤!<br>" end if
about=strchange(trim(request.form("about")))
if len(about)=0 then errormax=errormax&"城市介绍不能为空!<br>" end if
if len(about)>aboutmax then errormax=errormax&"城市介绍超过系统最大字符数" &aboutmax&",目前字符数:"&len(about)&"!<br>" end if
if len(guolv(about))>0 then errormax=errormax&"城市介绍中数据“"&guolv(about)&"”被系统过滤!<br>" end if
gonggao=strgl(trim(request.form("gonggao")))
if len(gonggao)=0 then errormax=errormax&"城市公告不能为空!<br>" end if
if len(gonggao)>gonggaomax then errormax=errormax&"城市公告超过系统最大字符数" &gonggaomax&",目前字符数:"&len(gonggao)&"!<br>" end if
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
if len(errormax)>0 then
errormax="抱歉:以下字段数据需要修改。<br>" & errormax
else
set rs=server.CreateObject("adodb.recordset")
rs.open"select * from 城市 where 城市='"&ct&"'",conn,3,3
if rs.recordcount<>1 then
errormax="抱歉!该城市名称不存在或者信息不唯一,请检查!"
else
set rs_is=server.CreateObject("adodb.recordset")
rs_is.open"select * from 城市 where 城市='"&city&"'",conn,1,1
if rs_is.recordcount>1 then
errormax="抱歉!您修改的城市名称与其它城市名称相同!请修改!"
else
dim mod_old,mod_new
mod_old=""
mod_new=""
if cint(rs("审核"))<>cint(pass) then
mod_old=mod_old&"审核:"&rs("审核")&"<br>"
mod_new=mod_new&"审核:"&pass&"<br>"
end if
if cint(rs("推荐数"))<>cint(tui) then
mod_old=mod_old&"推荐数:"&rs("推荐数")&"<br>"
mod_new=mod_new&"推荐数:"&tui&"<br>"
end if
if cint(rs("人气"))<>cint(hot) then
mod_old=mod_old&"人气:"&rs("人气")&"<br>"
mod_new=mod_new&"人气:"&hot&"<br>"
end if
if cint(rs("排名"))<>cint(paiming) then
mod_old=mod_old&"排名:"&rs("排名")&"<br>"
mod_new=mod_new&"排名:"&paiming&"<br>"
end if
if rs("省份")<>pov then
mod_old=mod_old&"省份:"&rs("排名")&"<br>"
mod_new=mod_new&"省份:"&paiming&"<br>"
end if
if rs("城市")<>city then
mod_old=mod_old&"城市:"&rs("城市")&"<br>"
mod_new=mod_new&"城市:"&city&"<br>"
end if
if rs("区号")<>quhao then
mod_old=mod_old&"区号:"&rs("区号")&"<br>"
mod_new=mod_new&"区号:"&quhao&"<br>"
end if
if rs("简介")<>about then
mod_old=mod_old&"简介:"&rs("简介")&"<br>"
mod_new=mod_new&"简介:"&about&"<br>"
end if
if rs("公告")<>gonggao then
mod_old=mod_old&"公告:"&rs("公告")&"<br>"
mod_new=mod_new&"公告:"&gonggao&"<br>"
end if
if mod_old="" then
errormax="您什么也没有修改阿!"
else
rs("城市")=city
rs("省份")=pov
rs("区号")=quhao
rs("简介")=about
rs("公告")=gonggao
rs("审核")=pass
rs("推荐数")=tui
rs("人气")=hot
rs("排名")=paiming
rs("修改")="系统管|"&now()&"|"&userip
rs.update
rs.close
set rs=nothing
errormax="城市修改成功!"
end if
end if
rs_is.close
set rs_is=nothing
end if
end if
end if
if ok="" then
set rs=server.CreateObject("adodb.recordset")
rs.open"select *,(select COUNT (*) FROM 资讯 WHERE 审核=1 and 推荐=1 and 城市='"&ct&"') as citytui from 城市 where 城市='"&ct&"'",conn,1,1
if rs.recordcount<>1 then response.redirect "error.asp?v=city_no" end if
pass=rs("审核")
tui=rs("推荐数")
hot=rs("人气")
paiming=rs("排名")
pov=rs("省份")
city=rs("城市")
quhao=rs("区号")
about=rs("简介")
gonggao=rs("公告")
backup=rs("修改")
citytui=rs("citytui")
rs.close
set rs=nothing
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>【后台管理】<%=city%> 城市信息修改 - <%=sitename%></title>
<link href="admin.css" rel="stylesheet" type="text/css">
<SCRIPT language='javascript' src='inc/pop.js'></SCRIPT>
</head>
<body leftmargin="0" topmargin="0">
<div align="center">
<!--#include file="admin_top_city.asp" -->
<br>
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td height="60" align="center" style="line-height: 16pt">
<b>城市信息管理<font color="#FF0000">[<a target="_blank" href="city.asp?ct=<%=city%>"><%=city%></a>]</font></b><br>
<a href="admin_info.asp?order=cityall&ct=<%=city%>">该城市所有资讯</a> | <a href="admin_info.asp?order=yescitytui&ct=<%=city%>&ctmax=<%=tui%>">推荐资讯 <%=citytui%>/<%=tui%> 条</a> | <a href="?ct=<%=city%>">刷新</a>
</td>
</tr>
</table>
<table border="0" cellpadding="10" style="border-collapse: collapse" width="90%" height="30">
<tr>
<td align="left" style="color: #FF0000; font-size: 10pt"><%=errormax%></td>
</tr>
</table>
<table border="1" cellpadding="5" style="border-collapse: collapse;" width="90%" bordercolor="#FFFFFF">
<form method="POST" action="admin_city_mod.asp?ct=<%=ct%>&ok=y" name="admin_city">
<tr>
<td width="200" align="center" height="6" bgcolor="#3399FF"></td>
<td width="*" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td align="center" height="35" bgcolor="#B3DEE8">常用管理:</td>
<td bgcolor="#F5F5F5">
<select name="pass">
<option value="0" <%if pass=0 then response.write "selected class='red'"%>>未通过审核</option>
<option value="1" <%if pass=1 then response.write "selected class='red'"%>>已通过审核</option>
</select>
<select size="1" name="tui">
<option value="-1">目前推荐数</option>
<option value="-1">------------</option>
<option value="0" <%if tui=0 then response.write "selected class='red'"%>>不设推荐栏</option>
<option value="1" <%if tui=1 then response.write "selected class='red'"%>>推荐1条资讯</option>
<option value="2" <%if tui=2 then response.write "selected class='red'"%>>推荐2条资讯</option>
</select> 人气<input type="text" name="hot" size="8" value="<%=hot%>">
排名<input type="text" name="paiming" size="8" value="<%=paiming%>"><br>最后修改:<font color="#0000FF"><%=backup%></font></td>
</tr>
<tr>
<td width="200" align="center" height="35" bgcolor="#B3DEE8">所在省份:</td>
<td bgcolor="#F5F5F5">
<select name="pov" style="width: 150" size="1">
<option value='0'>请选择省份</option>
<option value='0'>-----------------</option>
<%set rspov=server.CreateObject("adodb.recordset")
rspov.open "select * from 省份 where 审核=1 order by 排名 desc",conn,1,1
do while not (rspov.eof or rspov.bof)
if rspov("省份")=pov then
response.write"<option value='" &rspov("省份")& "' selected class='red'>" &rspov("省份全称")& "</option>"
else
response.write"<option value='" &rspov("省份")& "'>" &rspov("省份全称")& "</option>"
end if
rspov.movenext
loop
rspov.close
set rspov=nothing%>
</select><br>单项选择
</td>
</tr>
<tr>
<td align="center" height="35" bgcolor="#B3DEE8">城市名称:</td>
<td bgcolor="#F5F5F5">
<input type="text" name="city" size="21" maxlength="16" value="<%=city%>">最多<%=citynamemax%>字符<br>
填写城市名称请勿填写“市、县、乡”等后缀,例:北京市填写<b>北京</b>。<font color="red">暂不接受县、乡等地方。</font>
</td>
</tr>
<tr>
<td align="center" height="35" bgcolor="#B3DEE8">城市区号:</td>
<td bgcolor="#F5F5F5">
<input type="text" name="quhao" size="21" maxlength="16" value="<%=quhao%>"><br><font face="Arial">3~4</font>位,例如:深圳填写0755</td>
</tr>
<tr>
<td align="center" height="35" bgcolor="#B3DEE8">城市介绍:</td>
<td bgcolor="#F5F5F5"><textarea rows="6" name="about" cols="61"><%=about%></textarea><br>最多<%=aboutmax%>字符,当前字符数:<%=len(about)%></td>
</tr>
<tr>
<td align="center" height="35" bgcolor="#B3DEE8">城市公告:</td>
<td bgcolor="#F5F5F5"><textarea rows="3" name="gonggao" cols="61"><%=gonggao%></textarea><br>最多<%=gonggaomax%>字符,当前字符数:<%=len(gonggao)%></td>
</tr>
<tr>
<td width="200" align="center" height="6" bgcolor="#3399FF"></td>
<td bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td align="center" height="69" colspan="2">
<input type="submit" value=" 提 交 " name="add"> <input type="reset" value=" 重 置 " name="B2"></td>
</tr></form>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?