📄 city.asp
字号:
<%'注意:防止多次发送,以及防止非法登录
server_v1=Cstr(Request.ServerVariables("HTTP_REFERER"))
server_v2=Cstr(Request.ServerVariables("SERVER_NAME"))
if not mid(server_v1,8,len(server_v2))=server_v2 then
Response.Write "<script language=JavaScript>{window.alert('系统错误,拒绝从非本服务器登陆!');window.history.go(-1);}</script>"
response.end
end if
if session("admin_login")<>true then
response.Write("<html><link href=../style.css rel=stylesheet type=text/css><body><table height=100% width=100% align=center valign=middle><tr><td align=center valign=center><p align=center>您没有登录或者已经超时!!请点击下面的链接,进入登录界面!!</p><p align=center>-->> <a href=../login/login.asp>登录</a> <<--</p></td></tr></table></body></html>")
response.end
end if
%>
<!--#include file="../../conn/conn.asp"-->
<!--#include file="../../conn/fun.asp"-->
<!--#include file="../../conn/fso.asp"-->
<%
action = trim(request.QueryString("action"))
select case action
case "add"
city_name = trim(request.Form("city_name"))
if city_name = "" then
response.Write("<script>window.alert(""请输入城市名!!"");history.back()</script>")
set fso = nothing
response.End()
end if
city_new = trim(request.Form("city_new"))
if city_new = "1" then
city_new = 1
else
city_new = 0
end if
sql = "select * from city where city_name='" & city_name & "'"
set rs = server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs.eof and rs.bof then
rs.addnew
rs("city_name") = city_name
'rs("city_fro") = city_fro
rs("city_new") = city_new
rs.update
'建立文件夹
'FolderName = "/city/" & city_fro
'Call createfolder(FolderName)
else
response.Write("<script>window.alert(""该城市名已经被用了,请重新选择!!"");history.back()</script>")
rs.close
set rs = nothing
set fso = nothing
response.End()
end if
rs.close
set rs = nothing
'call MakeCityArea
call MakeCityArea02
'call MakeAreaPlace
case "del"
id = clng(trim(request("id")))
set rsdel = server.CreateObject("ADODB.recordset")
rsdel.open "select * from city where id=" & id,conn,1,3
if not (rsdel.eof and rsdel.bof) then
rsdel.delete
rsdel.update
rsdel.close
set rsdel = nothing
'删除广告
conn.execute("delete from ad_mes where ad_city="&id)
conn.execute("delete from area where area_city="&id)
'conn.execute("delete from place where place_city="&id)
end if
'call MakeCityArea
call MakeCityArea02
'call MakeAreaPlace
case "change"
id = clng(trim(request("id")))
city_name = request.Form("city_name")
if city_name = "" then
response.Write("<script>window.alert(""请输入城市名!!"");history.back()</script>")
set fso = nothing
response.End()
end if
city_new = trim(request.Form("city_new"))
if city_new = "1" then
city_new = 1
else
city_new = 0
end if
sql = "update city set city_name='" & city_name & "',city_new=" & city_new & " where id=" & id
conn.execute(sql)
'call MakeCityArea
call MakeCityArea02
'call MakeAreaPlace
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!-- no cache headers -->
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="no-cache">
<meta http-equiv="Expires" content="-1">
<meta http-equiv="Cache-Control" content="no-cache">
<!-- end no cache headers -->
<link href="../style.css" rel="stylesheet" type="text/css">
<STYLE type="text/css">
<!--
BODY {
scrollbar-face-color:#ffffff;
scrollbar-arrow-color:#000000;
scrollbar-highlight-color:#C0C0C0;
scrollbar-3dlight-color:#ffffff;
scrollbar-shadow-color:#ffffff;
scrollbar-darkshadow-color:#ffffff;
scrollbar-track-color:#ffffff;
}
-->
</STYLE>
<title>城市管理</title>
</head>
<body>
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#003300">
<tr>
<td height="25" colspan="3" background="../Images/topbg.gif">城市管理 >> 修改及删除城市</td>
</tr
>
<tr>
<td width="38%" height="25" align="center" bgcolor="#FFFFFF">城市名称</td>
<td width="37%" align="center" bgcolor="#FFFFFF">是否标新</td>
<td width="25%" align="center" bgcolor="#FFFFFF">操作</td>
</tr>
<%
sql = "select * from city"
set rscity = server.CreateObject("adodb.recordset")
rscity.open sql,conn,1,1
while not rscity.eof
id = rscity("id")
%>
<script language="JavaScript">
function check(obj){
if(obj.city_name.value==''){
alert("请输入城市名称!!");
return false;
obj.city_name.focus();
}
}
</script>
<form name="form<%=id%>" method="post" action="?action=change" onSubmit="return check(this)">
<tr>
<td height="25" align="center" bgcolor="#FFFFFF">
<input name="city_name" type="text" class="txttable" value="<%=rscity("city_name")%>"></td>
<td height="25" align="center" bgcolor="#FFFFFF">
<input type="checkbox" name="city_new" value="1" <%if rscity("city_new") then response.Write("checked")%>>
<input type="hidden" name="id" value="<%=id%>"></td>
<td height="25" align="center" bgcolor="#FFFFFF">
<input type="submit" name="Submit<%=id%>" value="修改" class="button02" onMouseOver="this.className='button03'" onMouseOut="this.className='button02'">
<a href="?action=del&id=<%=id%>">删除</a></td>
</tr>
</form>
<%
rscity.movenext
wend
%>
</table>
<p> </p>
<script language="JavaScript">
function checkadd(){
if(document.formaddnew.city_name.value==''){
alert("请输入城市名称!!");
return false;
document.formaddnew.city_name.focus();
}
}
</script>
<form name="formaddnew" method="post" action="?action=add" onSubmit="return checkadd()">
<table width="90%" border="0" align="center" cellpadding="4" cellspacing="1" bgcolor="#003300">
<tr bgcolor="#FFFFFF">
<td height="25" colspan="3" background="../Images/topbg.gif">城市管理 >> 添加新城市</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="45%" height="25">城市名称:
<input type="text" name="city_name" id="city_name" class="txttable"> </td>
<td width="41%">是否标新
<input type="checkbox" name="city_new" value="1"> </td>
<td width="14%" align="center"> <input type="submit" name="Submit2" value="添加" class="button01">
</td>
</tr>
</table>
</form>
<p align="center"><font color="#FF0000">注意</font>:文件夹名请用<font color="#FF0000">英文</font>字母</p>
</body>
</html>
<%
conn.close
set conn = nothing
set fso = nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -