📄 cityedit.asp
字号:
<!--#include file="conn.asp"-->
<%if session("china_cityadmin")="" then
response.redirect "login.asp"
end if%>
<%dim action,id,dcity
id=request.QueryString("id")
action=request.querystring("action")
dcity=trim(request("city"))
dcityadmin=trim(request("cityadmin"))
dcitypass=trim(request("citypass"))
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_city",conn,1,3
rs.AddNew
rs("city")=dcity
rs("cityadmin")=dcityadmin
rs("citypass")=dcitypass
rs.Update
rs.Close
set rs=nothing
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from china_city where id="&id,conn,1,3
ycity=rs("city")
rs("city")=dcity
rs("cityadmin")=dcityadmin
rs("citypass")=dcitypass
rs.Update
rs.Close
set rs=nothing
sql="update china_data set city='"&dcity&"' where city='"&ycity&"'"
conn.execute sql
case "del"
set rs=server.CreateObject("adodb.recordset")
conn.execute ("delete from china_city where city = '"&dcity&"'")
sql="select * from china_data where city = '"&dcity&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,3,2
if not rs.eof then
For iPage = 1 To rs.recordcount
adid=rs("adid")
rs.delete
rs.update
sql1="delete from china_message where adid ="&adid&""
conn.execute(sql1)
rs.movenext
if rs.eof then exit for
next
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
response.Redirect "cityedit.asp"
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"> <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>
</tr>
<%set rs=server.CreateObject("adodb.recordset")
rs.Open "select * from china_city order by id",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"))%>">
<tr bgcolor="#FFFFFF" align="center">
<td><%=i%></td>
<td><input name="city" type="text" id="city" value="<%=trim(rs("city"))%>" size="12"></td>
<td><input name="cityadmin" type="text" id="cityadmin" value="<%=trim(rs("cityadmin"))%>" size="12"></td>
<td><input name="citypass" type="text" 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")%>&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>
</tr>
<form name="form1" method="post" action="?action=add">
<tr align="center" bgcolor="#FFFFFF">
<td><%=rs.RecordCount+1%></td>
<td><input name="city" type="text" id="city" size="12"></td>
<td><input name="cityadmin" type="text" id="cityadmin" size="12"></td>
<td><input name="citypass" type="text" 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 + -