admin_editdel.asp

来自「旅游管理系统 用ASP+SQL 2」· ASP 代码 · 共 255 行

ASP
255
字号
<html>
<head>
<meta name=vs_targetSchema content="HTML 4.0">
<title>编辑旅游线路</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css/css1.css" type="text/css">
</head>
<body bgcolor="#FFFFFF" style="background-color: #999999" text="#000000" topmargin="5">
<script id=clientEventHandlersVBS language=vbscript>
<!--
Sub mfkiqpl_onclick
 if form1.t2.value="" then
 window.alert ("线路名称不能为空!")
 form1.t2.focus
 else
 if len(form1.t2.value)>32 then
 window.alert ("线路名称的字数不能大于32!")
 form1.t2.focus 
 else
 if form1.t3.value="" then
 window.alert ("线路报价没正确填写!")
 form1.t3.focus
 else
 if form1.t4.value="" then
 window.alert ("线路类型忘了填写了!")
 form1.t4.focus
 else
 if form1.t5.value="" then
 window.alert ("线路游完需要的时候没填写!")
 form1.t5.focus
 else
 if form1.t6.value="" then
 window.alert ("线路说明必需填写其中一个!")
 form1.t6.focus
 else
 if form1.t8.value="" then
 window.alert ("线路所包含的景点必须填写!")
 form1.t8.focus
 else
 if form1.t9.value="" then
 window.alert ("线路行程安排未填写!")
 form1.t9.focus
 else
 form1.submit
 end if
 end if
 end if
 end if
 end if
 end if
 end if
 end if
End Sub
Sub yesno_onclick
	if form1.t12.value="" then
	window.alert ("图片地址不正确!请用完整的http路径。")
	else
	dim photoadd
	photoadd=form1.t12.value
	window.open (photoadd)
	end if
End Sub

-->
</script>
<%
if session("administrator")<>"administrator" then
Response.Redirect "admin_login.asp"
end if
%>
<!--#include file="includefile/conn.asp" -->
<!--#include file="includefile/shoubu.asp" -->
<br>
<%
dim id,action
id=Request("id")
action=Request("action")
if id="" then
session("errormsg")="找不到指定的ID号!"
response.Redirect "error.asp"
else
if action="" then
session("errormsg")="您的动作不明确。无法完成!"
response.Redirect "error.asp"
end if 
end if
if action="del" then
sl="delete  from xianlu where id = " + id
	conn.Execute sl
conn.close
session("1")="按您的要求删除线路以成功!"
Response.Redirect "ok.asp"
end if
%>
<%
dim photo
if action="edit" then
sql="select * from xianlu where id=" +id
rs.open sql,,1,2
if rs("x_jingdiantupian").value="nophoto" then
photo=""
else
photo=rs("x_jingdiantupian").value
end if
%>
<form name="form1" method="post" action="admin_editdel.asp?id=<%=rs("id")%>&action=editok&action1=ok" ID=Form1>
  <table width="735" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#CCCCCC">
    <tr> 
      <td height="22" align="center" class="title">修改第<B><%=rs("id")%></B>条线路</td>
    </tr>
  </table>
  <table width="735" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#EFEFEF">
    <tr> 
      <td height="23" width="176" align="left">  ID号:</td>
      <td height="23" width="516"> 
        <input type="text" name="t1" class="input" readonly ID=Text1 value =<%=rs("id")%>>
      </td>
      <td height="23" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="23" width="176" align="left">  线路名称:</td>
      <td height="23" width="516"> 
        <input type="text" name="t2" size="60" class="input" ID=Text2 value=<%=rs("x_name")%>>
      </td>
      <td height="23" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="23" width="176" align="left">  线路报价:</td>
      <td height="23" width="516"> 
        <input type="text" name="t3" size="20" class="input" ID=Text3 value=<%=rs("x_baojia")%>>
      </td>
      <td height="23" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="23" width="176" align="left">  线路类型:</td>
      <td height="23" width="516"> 
        <input type="text" name="t4" size="30" class="input" ID=Text4 value=<%=rs("x_leixun")%>>
      </td>
      <td height="23" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="23" width="176" align="left">  线路游完时间:</td>
      <td height="23" width="516"> 
        <input type="text" name="t5" size="15" class="input" ID=Text5 value=<%=rs("x_shijian")%>>
      </td>
      <td height="23" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  线路说明(1):</td>
      <td height="90" width="516"> 
        <textarea name="t6" cols="50" rows="5" class="input" ID=Textarea1 ><%=rs("x_shuoming")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  线路说明(2):</td>
      <td height="90" width="516"> 
        <textarea name="t7" cols="50" rows="5" class="input" ID=Textarea2 ><%=rs("x_shuoming_1")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  线路景点:</td>
      <td height="90" width="516"> 
        <textarea name="t8" cols="50" rows="5" class="input" ID=Textarea3><%=rs("x_jingdian")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  线路行程安排(1):</td>
      <td height="90" width="516"> 
        <textarea name="t9" cols="50" rows="5" class="input" ID=Textarea4><%=rs("x_anpai")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  线路行程安排(2):</td>
      <td height="90" width="516"> 
        <textarea name="t10" cols="50" rows="5" class="input" ID=Textarea5><%=rs("x_anpai_1")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="90" width="176" align="left">  注释:</td>
      <td height="90" width="516"> 
        <textarea name="t11" cols="50" rows="5" class="input" ID=Textarea6><%=rs("x_zhushi")%></textarea>
      </td>
      <td height="90" width="43">&nbsp;</td>
    </tr>
    <tr> 
      <td height="23" width="176" align="left">  线路景点图片:</td>
      <td height="23" width="516"> 
        <input type="text" name="t12" size="50" class="input" ID=Text6 value=<%=photo%>>
        <input type="button" name="yesno" value="查看此图片" class="button" id=Button1>
      </td>
      <td height="23" width="43">&nbsp; </td>
    </tr>
    <tr align="center"> 
      <td height="31" colspan="3"> 
        <input type="button" name="mfkiqpl" value="确定修改" class="button" ID=Button2>
             
        <input type="reset" name="Submit2" value="还原所有" class="button" ID=Reset1>
      </td>
    </tr>
  </table>
</form>
<%
rs.close
conn.close
end if
%>
<%
dim action1
action1=request("action1")
if action1="ok" then
sql="select * from xianlu where id=" +id
rs.open sql,,1,2
dim t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12
t2=Request("t2")
t3=request("t3")
t4=request("t4")
t5=request("t5")
t6=request("t6")
t7=request("t7")
t8=request("t8")
t9=request("t9")
t10=request("t10")
t11=request("t11")
t12=request("t12")
if t12="" then
t12="nophoto"
end if
rs("x_name")=t2
rs("x_baojia")=t3
rs("x_leixun")=t4
rs("x_shijian")=t5
rs("x_shuoming")=t6
rs("x_shuoming_1")=t7
rs("x_jingdian")=t8
rs("x_anpai")=t9
rs("x_anpai_1")=t10
rs("x_zhushi")=t11
rs("x_jingdiantupian")=t12
rs.update
rs.close
conn.close
Session("1")="旅游线路修改成功!"
Response.Redirect "ok.asp"
end if
%>
<br>
<!--#include file="includefile/weibu.asp" -->
</body>
</html>

⌨️ 快捷键说明

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