📄 cityedit_three.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="../md5.asp"-->
<%if session("china_admin")="" then
response.redirect "login.asp"
end if%>
<%dim action,id,dcity
threeid=HtmlEncode(request.QueryString("threeid"))
twoid=HtmlEncode(request.QueryString("twoid"))
id=HtmlEncode(request.QueryString("id"))
action=HtmlEncode(request.querystring("action"))
dcity=HtmlEncode(trim(request("city")))
dcityadmin=HtmlEncode(trim(request("cityadmin")))
dcitypass=HtmlEncode(trim(request.form("citypass")))
if dcity="" and action<>"" then
response.write "<script LANGUAGE='javascript'>alert('请认真填写!');history.go(-1);</script>"
response.end
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_city where id="&id&" and twoid=0",conn,1,3
mname=rs("city")
rs.close
rs.open "select * from china_city where id="&id&" and twoid="&twoid&"",conn,1,3
mname2=rs("city")
rs.close
set rs=nothing
select case action
case "add"
if dcity<>"" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_city where id="&id&" and twoid="&twoid&" and threeid<>0 and city='"&dcity&"'",conn,1,3
if rs.eof then
rs.close
rs.open "select * from china_city where id="&id&" and twoid="&twoid&" order by threeid desc",conn,1,3
three=rs("threeid")+1
rs.close
rs.open "china_city",conn,1,3
rs.AddNew
rs("id")=id
rs("city")=dcity
rs("cityadmin")=dcityadmin
rs("citypass")=md5(dcitypass)
rs("indexid")=trim(request("indexid"))
rs("indexshow")=trim(request("indexshow"))
rs("twoid")=twoid
rs("threeid")=three
rs.Update
rs.Close
set rs=nothing
end if
end if
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_city where threeid="&threeid&" and twoid="&twoid&" and id="&id,conn,1,3
ycity=rs("city")
rs("city")=dcity
rs("cityadmin")=dcityadmin
rs("indexid")=trim(request("indexid"))
rs("indexshow")=trim(request("indexshow"))
if dcitypass<>rs("citypass") then
rs("citypass")=md5(dcitypass)
end if
rs.Update
rs.Close
set rs=nothing
sql="update china_data set city_three='"&dcity&"' where city_oneid="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
conn.execute sql
case "del"
set rs=server.CreateObject("adodb.recordset")
conn.execute ("delete from china_city where threeid="&threeid&" and id="&id&" and twoid="&twoid&"")
sql="select * from china_data where city_oneid ="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
set rs=server.createobject("adodb.recordset")
Set fdel = CreateObject("Scripting.FileSystemObject")
if not rs.eof then
For iPage = 1 To rs.recordcount
adid=rs("adid")
pic=rs("pic")
rs.delete
rs.update
sql1="delete from china_message where adid ="&adid&""
conn.execute(sql1)
rs.movenext
'''''''''''删除html开始''''''''''''''''
tempImageDir = Server.MapPath("../html/"&adid&".htm")
fdel.DeleteFile(tempImageDir)
if pic<>"" and lcase(left(pic,7))<>"http://" then
fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
end if
'''''''''''删除html结束'''''''''''''''
if rs.eof then exit for
next
rs.close
sql="select * from news_data where city_oneid ="&id&" and city_twoid="&twoid&" and city_threeid="&threeid&""
if not rs.eof then
For iPage = 1 To rs.recordcount
adid=rs("adid")
pic=rs("pic")
rs.delete
rs.update
sql1="delete from news_message where adid ="&adid&""
conn.execute(sql1)
rs.movenext
'''''''''''删除html开始''''''''''''''''
tempImageDir = Server.MapPath("../html/news"&adid&".htm")
fdel.DeleteFile(tempImageDir)
if pic<>"" and lcase(left(pic,7))<>"http://" then
fdel.DeleteFile(Server.MapPath("../adpic/"&pic&""))
end if
'''''''''''删除html结束'''''''''''''''
if rs.eof then exit for
next
end if
end if
set fdel=nothing
rs.close:set rs=nothing
conn.close:set conn=nothing
response.Redirect "cityedit_three.asp?id="&id&"&twoid="&twoid&""
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>地区分类管理</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
<tr>
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">三 级 地 区 分 类 管 理</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"> [<a href="cityedit.asp">首页</a>]->[<a href="cityedit_two.asp?id=<%=id%>"><%=mname%></a>]-><%=mname2%><br>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
<tr align="center" bgcolor="#FFFFFF" height="20">
<td width="30">编号</td>
<td>地区名称</td>
<td>显示顺序</td>
<td>首页显示</td>
<td>地区管理员</td>
<td>地区管理密码</td>
<td>管理操作</td>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from china_city where id="&id&" and twoid="&twoid&" and threeid<>0 order by threeid",conn,1,1
dim follows
if rs.EOF and rs.BOF then
response.write"<tr bgcolor=#FFFFFF><td colspan='5'><p align='center'><font color='red'>暂无地区分类!</font></td></tr></table><br>"
follows=0
else
do while not rs.EOF
i=i+1
%>
<form name="form1" method="post" action="?action=edit&id=<%=int(rs("id"))%>&twoid=<%=int(rs("twoid"))%>&threeid=<%=int(rs("threeid"))%>">
<tr bgcolor="#FFFFFF" align="center">
<td><%=i%></td>
<td>
<input name="city" type="text" id="city" value="<%=trim(rs("city"))%>" size="8">
</td>
<td>
<input name="indexid" type="text" size="2" value="<%=trim(rs("indexid"))%>">
</td>
<td>
<select name="indexshow">
<option value="yes" <%if rs("indexshow")="yes" then%>selected<%end if%>>显示</option>
<option value="no" <%if rs("indexshow")="no" then%>selected<%end if%>>隐藏</option>
</select>
</td>
<td>
<input name="cityadmin" type="text" id="cityadmin" value="<%=trim(rs("cityadmin"))%>" size="12">
</td>
<td>
<input name="citypass" type="password" id="citypass" value="<%=trim(rs("citypass"))%>" size="12">
</td>
<td>
<input type="submit" name="Submit" value="修 改">
<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="删除" >
</td>
</tr>
</form>
<%
rs.MoveNext
loop
follows=rs.RecordCount
end if%>
</table>
<br></td>
</tr>
</table>
<br>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#799AE1">
<tr>
<td height="20" bgcolor="#799AE1" align="center"><font color="#FFFFFF" style="font-size:14px">添 加 三 级 地 区</font></td>
</tr>
<tr>
<td bgcolor="#FFFFFF">
<br>
<table width="98%" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#D6DFF7">
<tr align="center" bgcolor="#FFFFFF" height="20">
<td width="30">编号 </td>
<td>地区名称</td>
<td>显示顺序</td>
<td>首页显示</td>
<td>地区管理员</td>
<td>地区管理密码</td>
<td>确定操作</td>
</tr>
<form name="form1" method="post" action="?action=add&id=<%=id%>&twoid=<%=twoid%>">
<tr align="center" bgcolor="#FFFFFF">
<td><%=rs.RecordCount+1%></td>
<td>
<input name="city" type="text" id="city" size="12">
</td>
<td>
<input name="indexid" type="text" value="0" size="2">
</td>
<td>
<select name="indexshow">
<option value="yes">显示</option>
<option value="no" selected>隐藏</option>
</select>
</td>
<td>
<input name="cityadmin" type="text" id="cityadmin" size="12">
</td>
<td>
<input name="citypass" type="password" id="citypass" size="12">
</td>
<td>
<input type="submit" name="Submit3" value="添 加">
</td>
</tr>
</form>
</table>
<br></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -