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

📄 admin_zxedit.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

city=trim(request.form("city"))
leibie=trim(request.form("leibie"))
name=trim(request.form("name"))
about=trim(request.form("about"))
address=trim(request.form("address"))
bus=trim(request.form("bus"))
site=trim(request.form("site"))
tel=trim(request.form("tel"))
pic1=trim(request.form("pic1"))
pic2=trim(request.form("pic2"))
pic3=trim(request.form("pic3"))
ctype=request.form("ctype")
tuijian=request.form("tuijian")
tui=request.form("tui")
if ctype="ok" then
  ctype="-1"
else
  ctype="0"
end if
if tui="ok" then
  tui="-1"
else
  tui="0"
end if

set rs=server.CreateObject("adodb.recordset")
if city<>"" and name<>"" and leibie<>"" and about<>"" then
  rs.open"select * from xinxi where 编号="&id,conn,3,3
  
  rs("名称")=name
  rs("城市")=city
  rs("类别")=leibie
  rs("介绍")=about
  rs("地址")=address
  rs("公交")=bus
  rs("网站")=site
  rs("电话")=tel
  rs("图片1")=pic1
  rs("图片2")=pic2
  rs("图片3")=pic3
  rs("推荐指数")=tuijian
  rs("审核")=ctype  
  rs("推荐")=tui
  rs("日期")=date()
 
  rs.update
  rs.close
  set rs=nothing
  response.write "<font color=red>修改成功!</font>"
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 checkadminzx()
if len(admin_zx.name.value)=0 or getstrlen(admin_zx.name.value)>16 then
  msgbox"请输入资讯名称!(8汉字内)"
  admin_zx.name.focus
elseif admin_zx.city.value="0" then
  msgbox"请选择所在城市!"
  admin_zx.city.focus
elseif admin_zx.leibie.value="0" then
  msgbox"请选择资讯类别!"
  admin_zx.leibie.focus
elseif len(admin_zx.about.value)=0 or Len(admin_zx.about.value)>240 then
  msgbox"请输入文字介绍!(240字内)"
  admin_zx.about.focus
elseif Len(admin_zx.address.value)>200 then 
  msgbox"您输入的地址太长了,请控制在200个字内!"
  admin_zx.address.focus
elseif Len(admin_zx.bus.value)>200 then 
  msgbox"您输入的公交地址太长了,请控制在200个字内!"
  admin_zx.bus.focus
elseif Len(admin_zx.site.value)>150 then 
  msgbox"您输入的网址太长了,请控制在150字内!"
  admin_zx.site.focus
elseif len(admin_zx.tel.value)>200 then 
  msgbox"您输入的电话信息太长了,请控制在200个字符内!"
  admin_zx.tel.focus  
elseif len(admin_zx.pic1.value)>200 then 
  msgbox"您输入的图片地址太长了,请控制在200个字符内!"
  admin_zx.pic1.focus  
elseif admin_zx.pic2.value<>"http://" and (admin_zx.pic1.value="http://" or len(admin_zx.pic1.value)=0) then 
  msgbox"请先填写图片1的地址"
  admin_zx.pic1.focus  
elseif len(admin_zx.pic2.value)>200 then 
  msgbox"您输入的图片地址太长了,请控制在200个字符内!"
  admin_zx.pic2.focus  
elseif admin_zx.pic3.value<>"http://" and (admin_zx.pic1.value="http://" or len(admin_zx.pic1.value)=0 or admin_zx.pic2.value="http://" or len(admin_zx.pic2.value)=0) then 
  msgbox"请先填写图片1和图片2的地址"
  admin_zx.pic1.focus  
elseif len(admin_zx.pic3.value)>200 then 
  msgbox"您输入的图片地址太长了,请控制在200个字符内!"
  admin_zx.pic3.focus   
elseif not(asc(admin_zx.tuijian.value)>=49 and asc(admin_zx.tuijian.value)<=53) then 
  msgbox"请输入数字1~5!"
  admin_zx.tuijian.focus
else
  admin_zx.submit
end if
end function
-->
</script>

</head>
<body>

<table width="960" 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 xinxi where 编号="&id,conn,1,1
     if not rs.eof then
     %>
<!--表单开始-->
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" width="800">
  <form method="POST" action="admin_zxedit.asp?id=<%=id%>" name="admin_zx">
  <tr>
    <td width="100" align="right" height="35" bgcolor="#EBF4FA">所在城市:</td>
    <td width="700" bgcolor="#EBF4FA">
      <select size="1" name="city">
      <option selected value="0">---请选择城市---</option>
       <%set rscity=server.CreateObject("adodb.recordset")
        rscity.open "select * from city where 审核=-1 order by 省份,人气 desc",conn,1,1
        while not rscity.eof
          if rscity("区号")=rs("城市")  then
            response.write"<option value='" &rscity("区号")& "' selected>" &rscity("城市") & " (" & rscity("区号") & " | " & rscity("省份") &")</option>"
          else
            response.write"<option value='" &rscity("区号")& "'>" &rscity("城市")& " (" & rscity("区号") & " | " & rscity("省份") &")</option>"
          end if
        rscity.movenext
        wend
		rscity.close
		set rscity=nothing%>
      </select>&nbsp;&nbsp;&nbsp;<a target="_blank" href="city.asp?ct=<%=rs("城市")%>">查看该城市所有资讯</a>&nbsp;&nbsp;&nbsp;<a target="_blank" href="xinxi.asp?id=<%=rs("编号")%>"><%=rs("名称")%></a>
   </td>
  </tr>
  <tr>
    <td align="right" height="35">资讯类别:</td>
    <td>
      <select size="1" name="leibie">
      <option selected value="0">---请选择类别---</option>
       <%set rslb=server.CreateObject("adodb.recordset")
        rslb.open "select * from leibie order by 类别编号",conn,1,1
        while not rslb.eof
          if rslb("类别编号")=rs("类别")  then
            response.write"<option value='" &rslb("类别编号")& "' selected>" &rslb("类别名")& "</option>"
          else
            response.write"<option value='" &rslb("类别编号")& "'>" &rslb("类别名")& "</option>"
          end if
        rslb.movenext
        wend
		rslb.close
		set rslb=nothing%>
      </select>
    </td>
  </tr>
  <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">名 称 :</td>
    <td bgcolor="#EBF4FA">
      <input type="text" name="name" size="46" value="<%=rs("名称")%>">(8汉字内)</td>
  </tr>
    <tr>
    <td align="right" height="35">介 绍 :</td>
    <td><textarea rows="5" name="about" cols="81"><%=rs("介绍")%></textarea>(240字内)</td>
  </tr>
    <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">地 址 :</td>
    <td bgcolor="#EBF4FA"><textarea rows="3" name="address" cols="81"><%=rs("地址")%></textarea>(200字内)</td>
  </tr>
  <tr>
    <td align="right" height="35">公 交 :</td>
    <td><textarea rows="2" name="bus" cols="81"><%=rs("公交")%></textarea>(200字内)</td>
  </tr>
    <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">网 站 :</td>
    <td bgcolor="#EBF4FA">
      <input type="text" name="site" size="61" value="<%=rs("网站")%>"></td>
  </tr>
    <tr>
    <td align="right" height="35">电 话 :</td>
    <td>
      <input type="text" name="tel" size="61" value="<%=rs("电话")%>"></td>
  </tr>
  <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">图片1 :</td>
    <td bgcolor="#EBF4FA">
      <input type="text" name="pic1" size="61" value="<%=rs("图片1")%>"><%if rs("图片1")<>"" and rs("图片1")<>"http://" then response.write ("<a target='_blank' href='"&rs("图片1")&"'><img src='"&rs("图片1")&"' title='点击看大图' border=0 height=150 width=200></a>") end if%>
</td>
  </tr>
    <tr>
    <td align="right" height="35">图片2 :</td>
    <td>
      <input type="text" name="pic2" size="61" value="<%=rs("图片2")%>"><%if rs("图片2")<>"" and rs("图片2")<>"http://" then response.write ("<a target='_blank' href='"&rs("图片2")&"'><img src='"&rs("图片2")&"' title='点击看大图' border=0 height=150 width=200></a>") end if%>
</td>
  </tr>
    <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">图片3 :</td>
    <td bgcolor="#EBF4FA">
      <input type="text" name="pic3" size="61" value="<%=rs("图片3")%>"><%if rs("图片3")<>"" and rs("图片3")<>"http://" then response.write ("<a target='_blank' href='"&rs("图片3")&"'><img src='"&rs("图片3")&"' title='点击看大图' border=0 height=150 width=200></a>") end if%>
</td>
  </tr>
  <tr>
    <td align="right" height="35" bgcolor="#FFFFFF">推荐指数:</td>
    <td bgcolor="#FFFFFF">
      <input type="text" name="tuijian" size="5" value="<%=rs("推荐指数")%>" maxlength="1">&nbsp;
      <img border="0" src="images/level<%=rs("推荐指数")%>.gif"></td>
  </tr>
  <tr>
    <td align="right" height="35" bgcolor="#EBF4FA">更新日期:</td>
    <td bgcolor="#EBF4FA">
      <input type="text" name="cdate" size="15" 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%>>&nbsp;&nbsp; 
    推荐:<input type="checkbox" name="tui" value="ok" <%if rs("推荐")=-1 then%>checked<%end if%>></td>
  </tr>
  <tr>
    <td align="right" height="35" bgcolor="#FFFFFF"> </td>
    <td bgcolor="#FFFFFF">
    <input type="button" value=" 提 交 " name="admin"  onclick="checkadminzx()">&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 + -