<%@ page language="java" import="java.sql.*" %>
|
Online Reservation Form |
Reservation
Information
Guest Name : |
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConn = DriverManager.getConnection("jdbc:odbc:Clientdb1");
Statement stmt = myConn.createStatement();
ResultSet myResultSet = stmt.executeQuery("select * from title");
if (myResultSet != null)
{
while (myResultSet.next()) {
String dpid = myResultSet.getString("stid");
String dpname = myResultSet.getString("name");
%>
'><%= dpname %>
<%
} /* of while */
} /* of if */
%>
|
Email Address : |
**IMPORTANT**
|
Address : (optional) |
|
Telephone No : |
|
Fax No : |
|
Reservation Details |
|
Types of Rooms Required : |
<%
myResultSet = stmt.executeQuery("select * from Carlton_RoomType");
if (myResultSet != null)
{
while (myResultSet.next()) {
String typeid = myResultSet.getString("Room_TypeId");
String typenum = myResultSet.getString("Room_Type");
%>
'><%= typenum %>
<%
} /* of while */
} /* of if */
%>
**IMPORTANT**
|
Number of Rooms Required : |
|
Please
also furnish names of the guests for the additional rooms
(Please put NA if it is not avaliable.)
|
Date of check in : |
<%
myResultSet = stmt.executeQuery("select * from Day");
if (myResultSet != null)
{
while (myResultSet.next()) {
String dayid = myResultSet.getString("Dayid");
String daynum = myResultSet.getString("DayNum");
%>
'><%= daynum %>
<%
} /* of while */
} /* of if */
%>
<%
myResultSet = stmt.executeQuery("select * from Month");
if (myResultSet != null)
{
while (myResultSet.next()) {
String monthid = myResultSet.getString("Monthid");
String monthnum = myResultSet.getString("Month");
%>
'><%= monthnum %>
<%
} /* of while */
} /* of if */
%>
<%
myResultSet = stmt.executeQuery("select * from Year");
if (myResultSet != null)
{
while (myResultSet.next()) {
String yearid = myResultSet.getString("Yearid");
String yearnum = myResultSet.getString("Year");
%>
'><%= yearnum %>
<%
} /* of while */
} /* of if */
%>
**IMPORTANT**
|
Days of Stay : |
<%
myResultSet = stmt.executeQuery("select * from Duration");
if (myResultSet != null)
{
while (myResultSet.next()) {
String dayid = myResultSet.getString("Durationid");
String daynum = myResultSet.getString("Number_of_days");
%>
'><%= daynum %>
<%
} /* of while */
} /* of if */
%>
|
|
Flight Information |
|
Flight name and no. (Arrival) : Time of Arrival :
**IMPORTANT**
|
Indicate here for any special request eg: connecting rooms,
no smoking, etc. (Please put NA if it is not avaliable.)
|
Credit Card Information **IMPORTANT** |
|
Credit Card Number : |
Credit Card Expiry Date :
<%
myResultSet = stmt.executeQuery("select * from Month");
if (myResultSet != null)
{
while (myResultSet.next()) {
String monthid = myResultSet.getString("Monthid");
String monthnum = myResultSet.getString("Month");
%>
'><%= monthnum %>
<%
} /* of while */
} /* of if */
%>
<%
myResultSet = stmt.executeQuery("select * from Year_Exp");
if (myResultSet != null)
{
while (myResultSet.next()) {
String yearid = myResultSet.getString("Yearid");
String yearnum = myResultSet.getString("Year");
%>
'><%= yearnum %>
<%
} /* of while */
} /* of if */
%>
|
Type of Credit Card :
<%
myResultSet = stmt.executeQuery("select * from CreditC");
if (myResultSet != null)
{
while (myResultSet.next()) {
String cardid = myResultSet.getString("CreditCid");
String cardtype = myResultSet.getString("Cards_Type");
%>
'><%= cardtype %>
<%
} /* of while */
} /* of if */
%>
|
Noted that Credit Card Guarantee Required for all late check-in after 5pm, weekends and holidays. No transaction will
be carried out, credit card merely to guarantee reservation
unless there is a event of no-show or late cancellation (two
days prior to check-in date) where 1 night room rate will be
imposed. Please furnish valid credit card details after you
have clicked send.
If you encounter any difficulties sending your booking details
through this form, you may send your booking details to our
reservation center at Online Hotel Booking
|
|
<%
stmt.close();
myConn.close();
%>
Title:
Hotel Registration Processing
<%@ page language="java" import="java.sql.*" %>
|
Processing Request |
|
Thank you, your request is submitted. Please check your E-Mail for the results half an hour from now.
<%
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
Connection myConn = DriverManager.getConnection("jdbc:odbc:Clientdb1");
String ititle = request.getParameter("inptitle");
String iname = request.getParameter("inpname");
String iemail = request.getParameter("inpemail");
String iadd = request.getParameter("inpadd");
String itel = request.getParameter("inptel");
String ifax = request.getParameter("inpfax");
String itype = request.getParameter("inptype");
String inum = request.getParameter("inpnum");
String iguest = request.getParameter("inpguest");
String idayin = request.getParameter("inpdayin");
String imonthin = request.getParameter("inpmonthin");
String iyearin = request.getParameter("inpyearin");
String iduration = request.getParameter("inpduration");
String iflightin = request.getParameter("inpflightin");
String itimein = request.getParameter("inptimein");
String ireq = request.getParameter("inpreq");
String icardnum = request.getParameter("inpcardnum");
String imonthexp = request.getParameter("inpmonthexp");
String iyearexp = request.getParameter("inpyearexp");
String icardtype = request.getParameter("inpcardtype");
Statement stmt = myConn.createStatement();
int rowsAffected = stmt.executeUpdate("insert into Carlton_Hotel(Title,Name,Email,Address,TelNum,FaxNum,Room_Type,Num_of_Room,Guest,DayIn,MonthIn,YearIn,Duration,FlightIn,TimeIn,Request,Credit_Card_Number,Expiry_Month,Expiry_Year,Card_Type) values('" + ititle +"','" + iname +"','" + iemail + "','" + iadd + "','" + itel + "','" + ifax + "','" + itype + "','" + inum + "','" + iguest + "','" + idayin + "','" + imonthin + "','" + iyearin + "','" + iduration + "','" + iflightin + "','" + itimein + "','" + ireq + "','" + icardnum + "','" + imonthexp + "','" + iyearexp + "','" + icardtype + "')");
if (rowsAffected == 1)
{
%>
<% }
else
{
%> Sorry Update fails!
<%
}
stmt.close();
myConn.close();
%>
|
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]
| |
|
| | |