?? admin_zxedit.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"請輸入資訊名稱?。?漢字內)"
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"請輸入文字介紹?。?40字內)"
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> <a target="_blank" href="city.asp?ct=<%=rs("城市")%>">查看該城市所有資訊</a> <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">
<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("日期")%>">
審核:<input type="checkbox" name="ctype" value="ok" <%if rs("審核")=-1 then%>checked<%end if%>>
推薦:<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()">
<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 + -