⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_cityedit.asp

📁 网上学生心里调查系统
💻 ASP
字号:
<!--#include file="config.asp" -->
<!--#include file="admin_check.asp" -->
<!--#include file="check.asp" -->

<%
call manager(session("grade"),session("adminname"),2)

id=request("id")
if id="" then
  response.write "<a href='javascript:history.back(1)'>请选择编号!</a>"
  response.end
end if

cityid=trim(request.form("cityid"))
city=trim(request.form("city"))
pov=trim(request.form("pov"))
quhao=trim(request.form("quhao"))
about=trim(request.form("about"))
renqi=trim(request.form("renqi"))
glxx=trim(request.form("glxx"))
gl=trim(request.form("gl"))
ctype=trim(request.form("ctype"))
if ctype="ok" then
  ctype="-1"
else
  ctype="0"
end if

set rs=server.CreateObject("adodb.recordset")
if city<>"" and quhao<>"" and pov<>"" and about<>"" then
  rs.open"select * from city where 编号="&id,conn,3,3
  
  rs("城市")=city
  rs("省份")=pov
  rs("区号")=quhao
  rs("简介")=about
  rs("审核")=ctype '0未审核,-1已审核
  rs("日期")=date()
  rs("人气")=renqi
  rs("管理")=gl
  rs("老板信息")=glxx
  
  rs.update
  rs.close
  set rs=nothing
  response.write "<font color=red>修改成功!</font>"
else 
end if
%>

<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>后台管理 - 城市信息修改</title>
<link href="admin.css" rel="stylesheet" type="text/css">
<script language="VBScript">
<!--
''=======================================================''
''函数作用:检测添加城市时的信息是否符合要求
''=======================================================''
function checkmodicity()
if admin_city.pov.value="" then
  msgbox"请输入城市所在省份!"
  admin_city.pov.focus
elseif admin_city.city.value="" then
  msgbox"请输入城市名称!"
  admin_city.city.focus
elseif Right(admin_city.city.value,1)="市" then
  msgbox"城市名称后请不要带“市”!例如北京,请填写“北京”,不要填写“北京市”" 
  admin_city.city.value=Replace(admin_city.city.value,"市","")
  admin_city.city.focus
elseif admin_city.quhao.value="" then
  msgbox"请城市电话区号!如北京010"
  admin_city.quhao.focus
elseif Len(admin_city.about.value)>80 then
  msgbox"请输入文字介绍!(80汉字内)"
  admin_city.about.focus 
elseif Len(admin_city.gl.value)=0 then
  msgbox"请输入管理密码!(70汉字内)"
  admin_city.gl.focus
else
admin_city.submit
end if
end function
-->
</script>
</head>
<body>

<table width="760" border="0" align="center" cellpadding="1" cellspacing="0">
  <tr>
    <td width="160" valign="top"> 
      <!--#include file="admin_left.asp" -->
    </td>
    <td width="600" align="center" valign="top">
    <%set rs=server.CreateObject("adodb.recordset")
     rs.open"select * from city where 编号="&id,conn,1,1
     if not rs.eof then
     %>
<!--表单开始-->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="560">
  <form method="POST" action="admin_cityedit.asp?id=<%=id%>" name="admin_city">
  <tr>
    <td width="80" align="right" height="40" bgcolor="#EBF4FA">城市编号:</td>
    <td width="480" height="35" bgcolor="#EBF4FA">
      <input type="text" name="id" size="17" maxlength="4" value="<%=rs("编号")%>" readonly style=background:#d3d3d3>&nbsp;&nbsp;
      <a target="_blank" href="citybook.asp?ct=<%=rs("区号")%>">查看该城市留言</a></td>
  </tr>
  <tr>
    <td width="80" align="right" height="40">所在省份:</td>
    <td width="480" height="35">
      <input type="text" name="pov" size="17" maxlength="4" value="<%=rs("省份")%>"></td>
  </tr>
    <tr>
    <td width="80" align="right" height="40" bgcolor="#EBF4FA">添加城市:</td>
    <td width="480" height="35" bgcolor="#EBF4FA">
      <input type="text" name="city" size="17" maxlength="4" value="<%=rs("城市")%>">(4汉字内)</td>
  </tr>
  <tr>
    <td width="80" align="right" height="40">城市区号:</td>
    <td width="480" height="35">
    <input type="text" name="quhao" size="17" maxlength="4" value="<%=rs("区号")%>">(该地区电话区号,如北京010)</td>
  </tr>
  <tr>
    <td width="80" align="right" height="80" bgcolor="#EBF4FA">城市简介:</td>
    <td width="480" height="77" bgcolor="#EBF4FA">    <textarea rows="4" name="about" cols="45"><%=rs("简介")%></textarea>(80汉字内)</td>
  </tr>
  <tr>
    <td width="80" align="right" height="50">管 理 员:</td>
    <td width="480" height="35">
      <textarea rows="4" name="glxx" cols="45"><%=rs("老板信息")%></textarea></td>
  </tr>
  <tr>
    <td width="80" align="right" height="50">管理密码:</td>
    <td width="480" height="35">
    <input type="text" name="gl" size="17" value="<%=rs("管理")%>"></td>
  </tr>
  <tr>
    <td width="80" align="right" height="50">更新日期:</td>
    <td width="480" height="35">
      <input type="text" name="cdate" size="15" value="<%=rs("日期")%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;人气:<input type="text" name="renqi" size="6" value="<%=rs("人气")%>">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 审核
    :<input type="checkbox" name="ctype" value="ok" <%if rs("审核")=-1 then%>checked<%end if%>></td>
  </tr>
  <tr>
    <td width="80" align="right" height="50" bgcolor="#EBF4FA"></td>
    <td width="480" height="35" bgcolor="#EBF4FA">
    <input type="button" value=" 提 交 " name="add" onclick="checkmodicity()">&nbsp;&nbsp;
    <input type="reset" value=" 重 置 " name="B2"></td>
  </tr></form>
</table>
<!--表单结束-->
 <%
 end if
  rs.close
  set rs=nothing
  %>
    </td>
  </tr>
</table>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -