📄 hotel_edit.asp
字号:
<!--#include file="../Include/choosedate.inc"-->
<!--#include file="../Include/AdoConn.asp"-->
<%
dim var(35)
for i=0 to 35
var(i)=""
next
N=35
code=request.querystring("code")'修改
if code<>"" then
set rst=server.createobject("adodb.recordset")
strsql="select * from xt_td_hotel where 酒店编码='"& code & "'"
rst.open strsql,conn
if not rst.eof then
for i=0 to N
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 xt_td_hotel"
rst.Open strsql,conn
N=Num
code=Request.Form ("code")
if code<>"" then'修改
for i=1 to 32
if i=5 or i=23 or i=24 then
if isDate(Request.Form(i)) then
strSet=strSet&rst(i).name&"=#"&Request.Form(i) & "#"
else
strSet=strSet&rst(i).name&"=#1900-01-01#"
end if
else
strSet=strSet&rst(i).name&"="&"'"&Request.Form(i)&"'"
end if
strSet=strSet+","
next
for i=33 to 35
if trim(Request.Form(i))="" then
strSet=strSet&rst(i).name & "=0"
else
strSet=strSet&rst(i).name&"=" & Request.Form(i)
end if
if i<35 then strSet=strSet+","
next
strsql="update xt_td_hotel set "&strSet&" where 酒店编码='"& code & "'"
conn.execute (strsql)
info="您已提交修改成功!"
else'新增
'''''''''''''''''''''检查数据库内是否有此酒店"判断中文名"
set rst2=server.CreateObject ("ADODB.recordset")
StrSQL="select 酒店名_cn from xt_td_hotel where 酒店名_cn='" & Request.Form(1) & "'"
strsql=strsql & " and 所在市='" & Request.form(3) & "'"
rst2.Open strsql,conn,3,2
if not rst2.EOF then
%>
<script Language="JavaScript">
<!--
alert("此酒店已注册!");
history.back(-1);
// -->
</script>
<%
Response.End
end if
strsql=" Select Max(clng(酒店编码)) From xt_td_hotel"
set rst2=conn.execute(strsql)
if rst2.eof then
sNumber="1"
else
sNumber=clng(rst2(0))+1
end if
rst2.Close
set rst2=nothing
'''''''''''''''''''''检查结束
dim strTitle,strValue'记录自动生成form\rst.fields语句的变量
strTitle=""
strValue=""
for i=0 to 35
strTitle=strTitle&rst(i).name
if i=0 then
strValue=strValue & "'" & sNumber & "'"
elseif i=5 or i=23 or i=24 then
if isDate(Request.Form(i)) then
strValue=strValue & "#" & Request.Form(i) & "#"
else
strValue=strValue & "#1900-01-01#"
end if
elseif i=33 or i=34 or i=35 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<>35 then
strTitle=strTitle+","
strValue=strValue+","
end if
next
strsql2="insert into xt_td_hotel ("&strTitle&")values("&strValue&")"
conn.execute (strsql2)
'取得编码,传入下一页房型注册页
'Response.Redirect "room_edit.asp?hotelName="&Request.Form(1)
info="您已提交成功!"
end if
rst.Close
set rst=nothing
end if
%>
<%
'取出地区
set rst1=server.CreateObject ("adodb.recordset")
strsql="select 中文城市名 from xt_td_city order by 中文城市名"
rst1.open strsql,conn,3,2
%>
<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", "textfield4", "form1");
addCalendar("Calendar2", "Select Date", "textfield22", "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"><%=info%></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"> </td>
<td width="112" height="30" align="center">注 册 酒 店</td>
<td width="189" height="30"> </td>
</tr>
</table>
<table width="500" border="0" cellspacing="0" cellpadding="0" align="center" class="snd">
<form name="form1" method="post" action="hotel_submit.asp" enctype="multipart/form-data" onsubmit="return CheckForm(this)">
<tr>
<td width="24" align="right"><font size="2"> </font></td>
<td width="55" align="right"><font size="2"> </font></td>
<td width="28" align="center"><font size="2"> </font></td>
<td width="240"><font size="2"> </font></td>
<td width="129"><font size="2"> </font></td>
<td width="24"><font size="2"> </font></td>
</tr>
<tr>
<td width="24" align="right"><font size="2"> </font></td>
<td width="55" align="right"><font size="2">酒店名称</font></td>
<td width="28" align="center"><font size="2">(中)</font></td>
<td width="240">
<font size="2">
<input type="text" name="textfield0" size="20" maxlength="20" value="<%=var(1)%>">
**</font> </td>
<td width="129"><font size="2">(**为必填项,下同)</font></td>
<td width="24"><font size="2"> </font></td>
</tr>
<tr>
<td width="24" align="right"><font size="2"> </font></td>
<td width="55" align="right"><font size="2"> </font></td>
<td width="28" align="center"><font size="2">(韩)</font></td>
<td width="240">
<font size="2">
<input type="text" name="textfield1" size="20" maxlength="20" value="<%=var(2)%>">
</font>
</td>
<td width="129"><font size="2"> </font></td>
<td width="24"><font size="2"> </font></td>
</tr>
<tr>
<td width="24" align="right"><font size="2"> </font></td>
<td width="55" align="right"><font size="2">所在市</font> </td>
<td width="28" align="center"><font size="2"> </font></td>
<td width="240">
<font size="2">
<select name="textfield2" size="1">
<%if rst1.RecordCount<>0 then
for i=1 to rst1.RecordCount
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -