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

📄 plane_edit.asp

📁 ASP程序实现的酒店预定系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="../Include/choosedate.inc"-->
<!--#include file="../Include/AdoConn.asp"-->
<%
	dim tableName	'下面函数的入口参数,表名
	dim KeyWord	'各表主关键字名称
	dim KeyType	'主键类型,自动增加型为"空",字符型为 " ' "
	dim Num		'保存取得的各字段个数
	tableName="xt_td_plane"
	KeyWord="航班编码"
	KeyType=""
	Num=21
	
redim var(Num)
for i=0 to Num
	var(i)=""
next
	
code=request.querystring("code")'修改
if code<>"" then 
set rst=server.createobject("adodb.recordset")
strsql="select * from "&tableName&" where "&KeyWord&"="&KeyType&code&KeyType
rst.open strsql,conn
	if not rst.eof then 
		for i=0 to rst.fields.count-1
			var(i)=rst(i)
		next
	end if
	rst.Close
	set rst=nothing
end if
if Request.QueryString ("submit")="submit" then'是否是提交状态
	set rst=server.CreateObject ("adodb.recordset")
	strsql="select top 1 * from "&tableName
	rst.Open strsql,conn
	N=Num
	code=Request.Form ("code")
	if code<>"" then'修改
	for i=1 to N
		if i=19 or i=20 then
			if isnumeric(Request.Form(i)) then
				strSet=strSet&rst(i).name&"="&Request.Form(i)
			else 
				strSet=strSet&rst(i).name & "=0"
			end if	
		else
			strSet=strSet&rst(i).name&"="&"'"&Request.Form(i)&"'"
		end if	
		if i<>N then 
		strSet=strSet+","
		end if
	next
	strsql="update "&tableName&" set "&strSet&" where "&KeyWord&"="&KeyType&code&KeyType
	conn.execute (strsql)
	info="您已提交修改成功!"

	else'新增
	
	dim strTitle,strValue'记录自动生成form\rst.fields语句的变量
	strTitle=""
	strValue=""
	for i=1 to N
		strTitle=strTitle&rst(i).name
		if i=19 or i=20 then
			if isnumeric(Request.Form(i)) then
				strValue=strValue & Request.Form(i)
			else 
				strValue=strValue&"0"
			end if	
		else
			strValue=strValue&"'"&Request.Form(i)&"'"
		end if	
		if i<>N then 
		strTitle=strTitle+","
		strValue=strValue+","
		end if
	next
	strsql="insert into "&tableName&"("&strTitle&")values("&strValue&")"
	conn.execute (strsql)
	info="您已提交成功!"
	end if
	rst.Close
	set rst=nothing
end if
'<input type="hidden" name="code" value="<%=var(0)>此隐藏域用于提交主键,将其入到所有输入变量之后。
%>
<html>
<head>
<title>注册航班</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="/Css/All.css">
<script language="javascript">

//Define calendar(s): addCalendar ("Unique Calendar Name", "Window title", "Form element's name", Form name")
addCalendar("Calendar1", "Select Date", "textfield13", "form1");
addCalendar("Calendar2", "Select Date", "textfield14", "form1");
addCalendar("Calendar3", "Select Date", "textfield23", "form1");

// default settings for English
// Uncomment desired lines and modify its values
 setFont("verdana", 12);
 setWidth(90, 1, 15, 1);
// setColor("#cccccc", "#cccccc", "#ffffff", "#ffffff", "#333333", "#cccccc", "#333333");
// setFontColor("#333333", "#333333", "#333333", "#ffffff", "#333333");
 setFormat("yyyy-mm-dd");
// setSize(200, 200, -200, 16);

// setWeekDay(0);
 setMonthNames("一月", "二月", "三月", "四月", "五月", "六月", "七月", "八月", "九月", "十月", "十一", "十二");
 setDayNames("日", "一", "二", "三", "四", "五", "六");
 setLinkNames("[关闭]", "[清除]");
</script>

<script language="javascript">
ArrayString=new Array(0,"textfield0","中文酒店名称不能为空!");
</script>
<script language="javascript" src="../js/checkForm.js"></script>
<script language="javascript" src="../js/Check_email_num.js"></script>
</head>

<body bgcolor="#FFFFFF" text="#000000">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td align="center"><font size="2"><%=info%></font></td>
  </tr>
</table>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" background="../Images/title_edit.gif">
  <tr > 
    <td width="199" height="30">&nbsp;</td>
    <td width="112" height="30" align="center"><font size="2">注 册 航 班</font></td>                                        
    <td width="189" height="30"><font size="2">&nbsp;</font></td>                                       
  </tr>                                       
</table>                                       
<table width="500"  border="0" cellspacing="0" cellpadding="0" align="center" class="snd">                                       
  <form name="form1" method="post" action="plane_edit.asp?submit=submit" onsubmit="return CheckForm(this)">                                      
    <tr>                                        
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                       
      <td width="55" align="right"><font size="2">&nbsp;</font></td>                                       
      <td width="28" align="center"><font size="2">&nbsp;</font></td>                                       
      <td width="250"><font size="2">&nbsp;</font></td>                                       
      <td width="119"><font size="2">&nbsp;</font></td>                                       
      <td width="24"><font size="2">&nbsp;</font></td>                                       
    </tr>                                       
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">出发城市</font></td>                                     
      <td width="28" align="center"><font size="2">(中)</font></td>                                     
      <td width="250"> <font size="2"> 
        <input type="text" name="textfield" size="20" maxlength="20" value="<%=var(1)%>">
        **</font> </td>                                     
      <td width="119"><font size="2">(**为必填项,下同)</font></td>                                     
      <td width="24"><font size="2">&nbsp;</font></td>                                     
    </tr>                                     
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="28" align="center"><font size="2">(韩)</font></td>                                     
      <td width="250"> <font size="2"> 
        <input type="text" name="textfield2" size="20" maxlength="20" value="<%=var(2)%>">
        </font> </td>                                     
      <td width="119"><font size="2">&nbsp;</font></td>                                     
      <td width="24"><font size="2">&nbsp;</font></td>                                     
    </tr>                                     
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">到达城市</font></td>                                     
      <td width="28" align="center"><font size="2">(中)</font></td>                                     
      <td width="250">                                      
        <font size="2">                                      
        <input type="text" name="textfield3" size="20" maxlength="20" value="<%=var(3)%>">                                     
        **</font> </td>                                     
      <td width="119"></td>                                     
      <td width="24"><font size="2">&nbsp;</font></td>                                     
    </tr>                                     
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="28" align="center"><font size="2">(韩)</font></td>                                     
      <td width="250">                                      
        <font size="2">                                      
        <input type="text" name="textfield4" size="20" maxlength="20" value="<%=var(4)%>">                                     
        </font>                                     
      </td>                                     
      <td width="119"><font size="2">&nbsp;</font></td>                                     
      <td width="24"><font size="2">&nbsp;</font></td>                                     
    </tr>                                     
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">出发机场</font></td>                                     
      <td width="28" align="center"><font size="2">(中)</font></td>                                     
      <td width="250">                                      
        <font size="2">                                      
        <input type="text" name="textfield5" size="20" maxlength="20" value="<%=var(5)%>">                                     
        **</font> </td>                                     
      <td width="119"></td>                                     
      <td width="24"><font size="2">&nbsp;</font></td>                                     
    </tr>                                     
    <tr>                                      
      <td width="24" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="55" align="right"><font size="2">&nbsp;</font></td>                                     
      <td width="28" align="center"><font size="2">(韩)</font></td>                                     
      <td width="250">                                      
        <font size="2">                                      
        <input type="text" name="textfield6" size="20" maxlength="20" value="<%=var(6)%>">                                     
        </font>                                     

⌨️ 快捷键说明

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