Hotel Documentation
Hotel Documentation
Hotel Documentation
1. INTRODUCTION
Hotel Management System is a system that provides us to reserving rooms, checking whether
the rooms are vacant are or not etc by using online browsing. This system is very useful to all
especially for business people.
For Business people they don’t have sufficient time for these then they can use these type of
online Hotel Management Systems. By this project we will reduce the faults in bills of their
expenditure and decrease time of delayto give the bills to the customers. We can also save the
bills of the customer. By this project we can also include all the taxes on the bills according to
their expenditures. It has a scope to reduce the errors in making the bills. Computerized bill
can be printed within fraction of seconds. Online ordering of Booking is possible by using
this software. This Project is based on php. If any one wants to book the room for few days
then they can specify the specific number by seeing the types of rooms we have. The bill of
this online booking is based on the type of room they can select is displayed.
HOTEL MANAGEMENT SYSTEM is a hotel reservation site script where site users will be
able to search rooms availability with an online booking reservations system.Siteusers can also
browse hotels, view room inventory, check availability, and book reservations in real-time.Site
users enter check in date and check out date then search for availability and rates. After
choosing the right room in the wanted hotel – all booking and reservation process is done on
the site and an SMS is sent to confirm the booking
users can also browse hotels, view room inventory, check availability, and book reservations in
real-time.Site users enter check in date and check out date then search for availability and rates.
After choosing the right room in the wanted hotel – all booking and reservation process is done
on the site and an SMS is sent to confirm the booking.
The present scenario offers manual data entry. A lot of time is wasted in creating the reports as
well as maintaining them. In case, if any query arises to get the information about the booking,
queries and registered users, the whole report is re-typed or xeroxed. This seriously affects the
authentication of the system. This kind of hotel management system is totally outdated and
involves high risk of ambiguity and redundancy.
1.2 Objective:
Project title “Hotel Management” (a project for keeping customers record and also
calculate customer bill slip and managers salary).
1. The objective of the project is to computerize the system of the hotel.
2. “Hotel Management”is the project not only keeps the record of various users like
customers, manager etc. but as well as it reduce the extensive paper work in the
present system.
3. It wills maker the system more versatile and user friendly.
4. It also calculates the proper billing slip of high level and middle level customers. 5. It
maintains the database and also allows Adding new employee details, daily
attendance, and salary calculation of the employee.
6. This system generates a report which will be having details of daily transaction.
This application can be easily implemented under various situations. We can add new
features as and when require. Reusability is possible as and when require in this
application. There is flexibility in all the modules. The software to be developed deals
with creating a Hotel Management system which will automate the major hotel
operations such as generating COD, billing and keeping track of records of daily
2
Hotel booking system 79
transaction.Admin have the authority to control and modify the database. The project
has a wide scope, as it is not intended to a particular organization. This project is going
to develop generic software, which can be applied by any businesses organization. More
over it provides facility to its customer. Also the software is going to provide a huge
amount of summary data. At present this software does not contain Credit card facility.
We can make this application as online so that we can reserve the tables and do the
online payment. So as the demand increases we can add these modules as a future scope.
At present this software does not contain Credit card facility. We can make this
application as online so that we can reserve the tables and do the online payment. So as
the demand increases we can add these modules as a future scope.
As earlier mentioned the project study covers Reception, accommodation, finance and account,
catering, food ordering, administrative, security, and general services transactions in the Hotel
management.
However The project has limitation based on these facts
1. It is not a large Scale System.Only Limited information will be Provided By the
System.
2. At present this software does not contain Credit card facility. We can make this
application as online so that we can reserve the tables and do the online payment. So as the
demand increases we can add these modules as a future scope.
3. The transactions are executed in off-line mode.
4. Due to time constraints certain fields were not included; the software was therefore
reduced to covering critical aspect of hotel management.
4. People who are with computers can’t use this software.
5. If there is a power failure, the hotel runs a high risk of loosing all the stored
informations.
4
Hotel booking system 79
2. SYSTEM ANALYSIS
2.1 General
• Multi-core – 1.8 GHz processor or better
• 4GB RAM
• Windows 7, 8, 8.1, 10, or 11
• 80 GB hard drive or more (160 GB highly recommended)
• Mouse
• Monitor with 1024 X 768 resolution or higher
• Windows compatible printer (laser printer recommended)
• Gigabit Ethernet port and router (for networking computers)**
• 1 serial port or a USB to serial adapter (only required for certain software options)
• Wired, high speed internet connection (only required for certain software/service
options)
The existing system of Hotel Management was manual. All the daily routines are carried out
manually and the records are maintained in the record books or the registers.As computer has
merged with man as single entity so a computerized application can be developed that can
handle Hotel Management System(HMS). All the above activity such as Booking,Customer
Check In,Bill Generations,Making Reports takes place manually, manually carrying out this
activity in very tedious time consuming. As we have tried to develop computerized application
so as to handle all the activity that takes place in Hotel. As all the activities that happen in the
Hotel such as enquiry, check status booking, etc. can be handled on this system simultaneously.
1. Existing keyword suggestion techniques do not consider the locations of the users
and the query results; i.e., the spatial proximity of a user to the retrieved results is not taken
as a factor in the recommendation.
4. Coordinating various departments in this respect is not only time taking but is also a
6
Hotel booking system 79
cumbersome process.
7. This manuål does not help Head of the hotel in taking decisions at various levels.
All above points define the disadvantages of conventional methods & suggest developing the
new system.
With the help of this project we reduced task deployed for data/information collection
to a large extent thereby elllülnating the human errors considerably.
Therefore the organization has realized the need for automating the various daily
routine activities of hotel & task of data/information collection with the help of database
designing.
And with this realization our project "HOTEL MANAGEMENT SYSTEM" comes
into practical usage & also benefiting the organization as a whole.
Everything that comes into existence must have an objective for its existence. It holds
true for our project also. It has been conceived as a powerful tool to help the company in
maintaming the various activities of the hotel. It has several benefits over other already existing
applications.
1. This LKS framework providing keyword suggestions that are relevant to the user information
needs and at the same time can retrieve relevant documents near the user location.
4. The system is useful as it calculates an exact cost of rooms for requested number of days.
The present scenario offers manual data entry. A lot of time is wasted in creating the reports as
well as maintaining them. In case, if any query arises to get the information about the booking,
queries and registered users, the whole report is re-typed or xeroxed. This seriously affects the
authentication of the system. This kind of hotel management system is totally outdated and
involves high risk of ambiguity and redundancy.
In this, one has to test whether the system can be developed using existing technology or not.
We have used Visual Basic as front-end and MS ACCESS as back-end. It is evident that
necessary hardware and software are available for development and implementation of
8
Hotel booking system 79
proposed system. We acquired the technical knowledge of working in Visual Basic language,
and then only we have started designing our project.
The hotels are already using various software for managing their information and since it is
acceptable by both hotel administration as well as hotel staff, it is proven to be operationally
feasible.
As a part of this, the costs and benefits associated with the proposed system are compared and
the project is economically feasible only if tangible and intangible benefits outweigh the cost.
The cost for proposed hotel management system is outweighing the cost and efforts involved
in maintaining the registers, books, files and generation of various repotts. The system also
reduces the administrative and technical staff to do various jobs that smgle software can do.
So, th1S system is economically feasible.
Legal feasibility detennines whether the proposed system conflicts with legål requirements,
e.g.
the Data Protection Act. It Will be done by some legal advisory
Requirement analysis for java application encompasses The proposed Hotel Booking
Management System is to have everything completely automated and computerized.
The software is very easy to use and manage even for a non technical person. The
redundancy and ambiguity will be removed by assigning every booking a unique
number (i.e Booking Number).three major tasks:Formulation,requirements gathering
and analysis modeling.During formulation,the basic motivation and goals for the java
application are identified, and the categories of users are defined.In the requirements
gathering phase,the content and functional requirements are listed and interaction
scenarios written from end users point of view are developed .This intent is to establish
a basic understanding of why the java application are built ,who will use it ,and what
problems it will solve for its users.
software.Software is the part of Computer System ,which enables the users to interact
with several physical hardware devices.
The minimum software requirement specification for developing this project are as
follows:
The Collection of internal electronic circuits and external physical devices used in
building a computer is called the Hardware.
The Minimum Hardware Requirement specuification for developing this project are as
follows:
10
Hotel booking system 79
3. SYSTEM DESIGN
Signin
ADMINISTRATOR:
Home
Add Facility
Manage Room
Manage Facility
Add Room
Manage Room
(Add/Update
Manage Booking
Manage Enquiry
Generate Reports
Search
Update Profile
Change Password
12
Hotel booking system 79
The data -flow diagram is part of the structured -analysis modellin g tools. When using
UML, the activity diagram typically takes over the role of the data -flow diagram. A
special form of data-flow plan is a site-oriented data
Hotel Reservation
Customer Management Subsystem
System
DFD Level 1:
2
1 Choose facility Book Room Hotel
Facilities Monitor Process Get Confirmation Customer
Customer
Reservation Registration
Get Feedback
Send Send Provide
Confirmation Request Data
3 Change data
Cancellation Database
And
Reservation
13
Hotel booking system 79
14
Hotel management system 226662
16
Hotel management system 226662
3.3 ER DIAGRAM
Entity – Relationship Diagram: This depicts relationship between data
objects. The attribute of each data o bjects noted in the entity- relationship
diagram can be described using a data object description. Data flow
diagram serves two purposes:
1. To provide an indication of how data are transformed as they move
through the system.
2. To depict the functions that transformation the data flow
Room No
ID
Room Type
Name
Hotel Has Rooms
Price
Location
Bed Type
Phone
Number
Reserve
Name
Bill ID
Email ID
P_method
Identity
proof
Address
18
Hotel booking system 79
19
Hotel booking system 79
20
Hotel booking system 79
A class diagram describes the static structure of the symbols in your new system. It is a graphic
presentation of the static view that shows a collection of declarati ve (static) model elements,
such as classes, types, and their contents and relationships. Classes are arranged in hierarchies
sharing common structure and behavior, and are associated with other
21
Hotel booking system 79
4. OUTPUT SCREENS:
SIGNUP PAGE:
LOGIN PAGE
22
Hotel booking system 79
MANAGE ROOM :
23
Hotel booking system 79
CUSTOMER CHECKIN:
CUSTOMER CHECKOUT:
24
Hotel booking system 79
25
Hotel booking system 79
26
Hotel booking system 79
5. SYSTEM IMPLEMENTATION:
5.1 Introduction:
Implementation is the stage of the project when the theoretical design is turned out into a
working system. Thus, it can be most critical stage in achieving a successful new system and
in giving the user, confidence that the new system will work and be effective.
The implementation stage involves careful planning, investigation of the existing system and
it’s constraints on implementation, designing of methods to achieve changeover and evaluation of
changeover methods.
5.2 Code: Signup.java:
Project.InsertUpdateDelete; import
java.awt.Color; import
java.util.regex.Matcher; import
java.util.regex.Pattern; import
javafx.scene.control.Alert; import
java.awt.event.KeyEvent; import
javafx.scene.control.Alert.AlertType;
/**
*/
27
Hotel booking system 79
28
Hotel booking system 79
@SuppressWarnings("unchecked")
29
Hotel booking system 79
30
Hotel booking system 79
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
31
Hotel booking system 79
32
Hotel booking system 79
jLabel3.setText("Password");
questions");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
jTextField1ActionPerformed(evt);
33
Hotel booking system 79
34
Hotel booking system 79
});
jTextField1KeyReleased(evt);
{ jTextField1KeyTyped(evt);
});
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(650, 230, 201, -1));
jTextField2.addActionListener(new java.awt.event.ActionListener() {
jTextField2ActionPerformed(evt);
});
jTextField2KeyPressed(evt);
evt) { jTextField2KeyReleased(evt);
35
Hotel booking system 79
36
Hotel booking system 79
jTextField2KeyTyped(evt);
});
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(650, 270, 201, -1));
passwordActionPerformed(evt);
});
passwordKeyReleased(evt);
{ passwordKeyTyped(evt);
});
getContentPane().add(password, neworg.netbeans.lib.awtextra.AbsoluteConstraints(650,
310, 201, -1));
37
Hotel booking system 79
38
Hotel booking system 79
jTextField3.addActionListener(new java.awt.event.ActionListener() {
jTextField3ActionPerformed(evt);
});
jTextField3KeyReleased(evt);
{ jTextField3KeyTyped(evt);
} });
getContentPane().add(jTextField3, org.netbeans.lib.awtextra.AbsoluteConstraints(650,
400, 201, 30));
jTextField4KeyReleased(evt);
39
Hotel booking system 79
40
Hotel booking system 79
});
getContentPane().add(jTextField4,neworg.netbeans.lib.awtextra.AbsoluteConstraints(650,
450, 201, -1));
actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
});
41
Hotel booking system 79
42
Hotel booking system 79
jButton2ActionPerformed(evt);
});
jButton3.setText("Login"); jButton3.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
});
jButton4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
jButton4ActionPerformed(evt);
43
Hotel booking system 79
44
Hotel booking system 79
});
getContentPane().add(jButton4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1330, 10, 30, -1));
jLabel9.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/signup.PNG"))); // NOI18N
getContentPane().add(jLabel9, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0,
45
Hotel booking system 79
46
Hotel booking system 79
setLocationRelativeTo(null);
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
setVisible(false); new
ForgotPassword().setVisible(true);
String name=jTextField1.getText();
String Email=jTextField2.getText();
String Password=password.getText();
String Securityquestions=(String)jComboBox1.getSelectedItem();
Address=jTextField4.getText();
Pattern patt=Pattern.compile(PATTERN);
Matcher match=patt.matcher(password.getText());
if(!match.matches()){
JOptionPane.showMessageDialog(null,"Invalid password");
47
Hotel booking system 79
48
Hotel booking system 79
} if(!(Pattern.matches("^[a-zA-Z0-9]+[@]+gmail+[.]+com$",jTextField2.getText()))){
else
String Query;
InsertUpdateDelete.setData(Query,"Registered Successfully");
System.exit(0);
setVisible(false); new
login().setVisible(true);
49
Hotel booking system 79
50
Hotel booking system 79
evt) {
c=evt.getKeyChar();
if(!(Character.isAlphabetic(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c
==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_AMPERSAND)||(c==KeyEvent.VK_BACK
_SPACE))){
JOptionPane.showMessageDialog(null,"Alphabets only");
getToolkit().beep(); evt.consume();
} else{
elab.setText(null);
Pattern patt=Pattern.compile(PATTERN);
Matcher match=patt.matcher(password.getText());
51
Hotel booking system 79
52
Hotel booking system 79
if(!match.matches()){ pass.setText("weak
Password");
} else{ pass.setText("Strong
password");
pass.setForeground(Color.green);
c=evt.getKeyChar();
if(!(Character.isAlphabetic(c)||(Character.isDigit(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEv
ent.VK_DELETE)||(c==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_BACK_SPACE)))){
getToolkit().beep(); evt.consume();
}}
c=evt.getKeyChar();
if(!(Character.isAlphabetic(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c
==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_BACK_SPACE)||(c==KeyEvent.VK_SHIF
T))){
53
Hotel booking system 79
54
Hotel booking system 79
getToolkit().beep(); evt.consume();
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEV ERE,
null, ex);
java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEV ERE,
null, ex);
java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEV ERE,
null, ex);
java.util.logging.Logger.getLogger(signup.class.getName()).log(java.util.logging.Level.SEV ERE,
null, ex);
55
Hotel booking system 79
56
Hotel booking system 79
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
});
57
Hotel booking system 79
58
Hotel booking system 79
javax.swing.JPasswordField password;
Login.java: import
javax.swing.JOptionPane; import
javax.swing.JLabel; import
initComponents();
cap.setImageCaptcha(captcha);
@SuppressWarnings("unchecked")
59
Hotel booking system 79
60
Hotel booking system 79
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout()); jLabel1.setFont(new
61
Hotel booking system 79
62
Hotel booking system 79
jLabel2.setText("Email");
255)); jLabel3.setText("Password");
NOI18N jTextField1.addKeyListener(new
keyReleased(java.awt.event.KeyEvent evt) {
jTextField1KeyReleased(evt);
});
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(580, 340, 318, -1));
jButton4.setText("Login"); jButton4.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
});
63
Hotel booking system 79
64
Hotel booking system 79
jButton1.setText("Signup"); jButton1.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton1ActionPerformed(evt);
});
jButton2.setText("Forgot Password");
jButton2.addActionListener(new java.awt.event.ActionListener()
jButton2ActionPerformed(evt);
});
getContentPane().add(jPasswordField1,org.netbeans.lib.awtextra.AbsoluteConstraints(580,
380, 320, -1));
jButton3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
65
Hotel booking system 79
66
Hotel booking system 79
jButton3ActionPerformed(evt);
});
getContentPane().add(jButton3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1320, 0, 40, -1));
jButton5.setText("Verify"); jButton5.addMouseListener(new
mouseClicked(java.awt.event.MouseEvent evt) {
jButton5MouseClicked(evt);
});
VerifyActionPerformed(evt);
67
Hotel booking system 79
68
Hotel booking system 79
Captcha");
jLabel4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/login.PNG"))); // NOI18N
pack(); setLocationRelativeTo(null);
System.exit(0);
check=0;
String Email=jTextField1.getText();
69
Hotel booking system 79
70
Hotel booking system 79
Enter=Verify.getText(); if(Email.equals("") ||
Password.equals("")||(Enter.equals("")))
{ check=1;
else if(!(cap.Validate(captcha,Verify.getText()))){
check=1;
JOptionPane.showMessageDialog(null,"Invalid captcha");
adminHome().setVisible(true);
} else
try
{ if(rs.next())
71
Hotel booking system 79
72
Hotel booking system 79
{ check=1;
if(rs.getString(7).equals("true"))
{ setVisible(false); new
home().setVisible(true);
else
}}
catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
} if(check==0)
setVisible(false); new
signup().setVisible(true);
73
Hotel booking system 79
74
Hotel booking system 79
setVisible(false); new
ForgotPassword().setVisible(true);
if(cap.Validate(captcha,Verify.getText()))
JOptionPane.showMessageDialog(this,"correct captcha");
else
JOptionPane.showMessageDialog(this,"Incorreect captcha");
} try
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
75
Hotel booking system 79
76
Hotel booking system 79
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE RE,
null, ex);
java.util.logging.Logger.getLogger(login.class.getName()).log(java.util.logging.Level.SEVE RE,
null, ex);
java.awt.EventQueue.invokeLater(new Runnable() {
});
77
Hotel booking system 79
78
Hotel booking system 79
javax.swing.JTextField jTextField1;
ForgotPassword.java:
import java.util.regex.Pattern;
import javax.swing.JOptionPane;
public ForgotPassword() {
79
Hotel booking system 79
80
Hotel booking system 79
initComponents();
String Email;
@SuppressWarnings("unchecked")
81
Hotel booking system 79
82
Hotel booking system 79
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
PASSWORD");
questions");
83
Hotel booking system 79
84
Hotel booking system 79
password");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
jTextField1ActionPerformed(evt);
});
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(550, 280, 297, -1));
jTextField3KeyReleased(evt);
});
getContentPane().add(jTextField3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(550, 360, 300, -1));
85
Hotel booking system 79
86
Hotel booking system 79
jButton2.setText("Save"); jButton2.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
});
jButton3.setText("Signup"); jButton3.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
});
87
Hotel booking system 79
88
Hotel booking system 79
jButton4.setText("Login"); jButton4.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton4ActionPerformed(evt);
});
jButton5.setText("Search"); jButton5.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton5ActionPerformed(evt);
});
jButton6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
jButton6.addActionListener(new java.awt.event.ActionListener() { public
void actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
89
Hotel booking system 79
90
Hotel booking system 79
});
getContentPane().add(jButton6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1330, 0, 30, 30));
jTextField2ActionPerformed(evt);
});
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(550, 320, 300, -1));
passwordKeyReleased(evt);
});
getContentPane().add(password, new
org.netbeans.lib.awtextra.AbsoluteConstraints(550, 400, 300, -1));
91
Hotel booking system 79
92
Hotel booking system 79
jLabel7.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/forgot
password.PNG"))); // NOI18N
pack(); setLocationRelativeTo(null);
}// </editor-fold>
System.exit(0);
93
Hotel booking system 79
94
Hotel booking system 79
int check=0;
Email=jTextField1.getText(); if(Email.equals(""))
{ check=1;
} else
{ if(rs.next())
{ check=1;
jTextField2.setEditable(false);
jTextField1.setEditable(false);
jTextField2.setText(rs.getString(4));
}}
catch(Exception e)
JOptionPane.showMessageDialog(null,e);
} if(check==0)
95
Hotel booking system 79
96
Hotel booking system 79
JOptionPane.showMessageDialog(null,"Incorrect Email");
}}
check=0;
String Securityquestions=jTextField2.getText();
Newpassword=password.getText();
{ check=1;
if(!(Pattern.matches("^[a-zA-Z0-9]{8,15}[@#%&*][a-zA-Z0-
9]{0,10}$",password.getText())))
} else
try {
97
Hotel booking system 79
98
Hotel booking system 79
if(rs.next())
{ check=1;
setVisible(false); new
ForgotPassword().setVisible(true);
}}
catch(Exception e)
JOptionPane.showMessageDialog(null,e);
} if(check==0)
JOptionPane.showMessageDialog(null,"Incorrect Answer");
}}
setVisible(false); new
signup().setVisible(true);
99
Hotel booking system 79
100
Hotel booking system 79
setVisible(false); new
login().setVisible(true);
if(!(Pattern.matches("^[a-zA-Z0-9]{8,15}[@#%&*][a-zA-Z0-
9]{0,10}$",password.getText())))
{ pass.setText("Weak passsword");
pass.setForeground(Color.red);
} else{ pass.setText("Strong
password");
pass.setForeground(Color.green);
101
Hotel booking system 79
102
Hotel booking system 79
if(!(Pattern.matches("^[a-zA-Z]{0,20}$",jTextField3.getText())))
{ anslab.setText("Incorrect Answer");
} else{
anslab.setText(null);
}}
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
103
Hotel booking system 79
104
Hotel booking system 79
java.util.logging.Logger.getLogger(ForgotPassword.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
java.util.logging.Logger.getLogger(ForgotPassword.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
java.util.logging.Logger.getLogger(ForgotPassword.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
java.util.logging.Logger.getLogger(ForgotPassword.class.getName()).log(java.util.logging.Le
vel.SEVERE, null, ex);
//</editor-fold>
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
ForgotPassword().setVisible(true);
});
105
Hotel booking system 79
106
Hotel booking system 79
javax.swing.JPasswordField password;
Home.java:
107
Hotel booking system 79
108
Hotel booking system 79
@SuppressWarnings("unchecked")
javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setUndecorated(true); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
java.awt.Color(102, 0, 0));
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/manage
room.png"))); // NOI18N jButton1.setText("MANAGE ROOM");
jButton1.addActionListener(new java.awt.event.ActionListener() {
jButton1ActionPerformed(evt);
});
109
Hotel booking system 79
110
Hotel booking system 79
java.awt.Color(102, 0, 0));
jButton2.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/Customer Registration & Check
IN.png"))); // NOI18N jButton2.setText("CUSTOMER CHECK IN");
jButton2.addActionListener(new java.awt.event.ActionListener() {
jButton2ActionPerformed(evt);
});
java.awt.Color(102, 0, 0));
jButton3.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/Customer Check Out.png"))); //
NOI18N jButton3.setText("CUSTOMER CHECK OUT");
jButton3.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
111
Hotel booking system 79
112
Hotel booking system 79
});
java.awt.Color(102, 0, 0));
jButton4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/Customer Details Bill.png"))); //
NOI18N jButton4.setText("CUSTOMER DETAIL BILLS");
jButton4.addActionListener(new java.awt.event.ActionListener() {
jButton4ActionPerformed(evt);
});
java.awt.Color(102, 0, 0));
jButton5.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/logout.png"))); // NOI18N
jButton5.setText("LOGOUT"); jButton5.addActionListener(new
java.awt.event.ActionListener() { public void
actionPerformed(java.awt.event.ActionEvent evt) {
113
Hotel booking system 79
114
Hotel booking system 79
jButton5ActionPerformed(evt);
});
java.awt.Color(102, 0, 0));
jButton6.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/exit.png"))); // NOI18N
jButton6.setText("EXIT"); jButton6.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton6ActionPerformed(evt);
});
jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/home.png"))); // NOI18N
jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
pack(); setLocationRelativeTo(null);
115
Hotel booking system 79
116
Hotel booking system 79
}// </editor-fold>
{ setVisible(false); new
login().setVisible(true);
}}
System.exit(0);
} private void
jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
Manageroom().setVisible(true);
117
Hotel booking system 79
118
Hotel booking system 79
CustomerCheckIn().setVisible(true);
new CustomerCheckOut().setVisible(true);
new CustomerDetailBill().setVisible(true);
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> try
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
119
Hotel booking system 79
120
Hotel booking system 79
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVE
RE, null, ex);
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVE RE,
null, ex);
java.util.logging.Logger.getLogger(home.class.getName()).log(java.util.logging.Level.SEVE RE,
null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
});
121
Hotel booking system 79
122
Hotel booking system 79
javax.swing.JLabel jLabel1;
Manageroom.java:
Project.Select; import
com.sun.glass.events.KeyEvent; import
java.util.regex.Pattern; import
javax.swing.JOptionPane; import
javax.swing.table.DefaultTableModel; /*
*/
/**
* @author Lenovo
*/
123
Hotel booking system 79
124
Hotel booking system 79
/**
*/
/**
* This method is called from within the constructor to initialize the form. *
WARNING: Do NOT modify this code. The content of this method is always *
*/
@SuppressWarnings("unchecked")
void initComponents() {
125
Hotel booking system 79
126
Hotel booking system 79
javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/manage
room.png"))); // NOI18N jLabel1.setText("MANAGE
ROOM");
127
Hotel booking system 79
128
Hotel booking system 79
jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
jButton1ActionPerformed(evt);
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1230, 10, 31, -1));
Object [][] {
}, new String
[] {
));
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(83, 81, 598, -1));
129
Hotel booking system 79
130
Hotel booking system 79
jLabel2.setText("Room Number");
jTextField1KeyReleased(evt);
{ jTextField1KeyTyped(evt);
});
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(800, 110, 465, -1));
Type");
getContentPane().add(jComboBox1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(800, 200, 465, -1));
131
Hotel booking system 79
132
Hotel booking system 79
jLabel4.setText("Bed");
getContentPane().add(jComboBox2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(800, 280, 465, -1));
jTextField2KeyReleased(evt);
{ jTextField2KeyTyped(evt);
});
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(800, 360, 460, -1));
133
Hotel booking system 79
134
Hotel booking system 79
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
});
pack(); setLocationRelativeTo(null);
}// </editor-fold>
135
Hotel booking system 79
136
Hotel booking system 79
setVisible(false);
String roomNo=jTextField1.getText();
String roomType=(String)jComboBox1.getSelectedItem();
String bed=(String)jComboBox2.getSelectedItem();
String price=jTextField2.getText();
values('"+roomNo+"','"+roomType+"','"+bed+"','"+price+"','Not Booked')";
InsertUpdateDelete.setData(Query,"Successfully updated");
DefaultTableModel model=(DefaultTableModel)jTable1.getModel();
try
137
Hotel booking system 79
138
Hotel booking system 79
{ while(rs.next())
model.addRow(new
Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5)});
} rs.close();
} catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
}}
if(!(Pattern.matches("^[0-9]{0,4}$",jTextField1.getText())))
} else{
room.setText(null);
139
Hotel booking system 79
140
Hotel booking system 79
if(!(Pattern.matches("^[0-9]{0,9}$",jTextField2.getText())))
{ price.setText("Incorrect Price");
} else{
price.setText(null);
}}
c=evt.getKeyChar();
if(!(Character.isDigit(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c==Ke
yEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE)||(c==KeyEvent.VK_SHIFT))){
getToolkit().beep(); evt.consume();
}}
141
Hotel booking system 79
142
Hotel booking system 79
char c=evt.getKeyChar();
if(!(Character.isDigit(c)||(c==KeyEvent.VK_DELETE)||(c==KeyEvent.VK_PERIOD)||(c==K
eyEvent.VK_BACKSPACE))){
JOptionPane.showMessageDialog(null,"Incorrect Price");
getToolkit().beep(); evt.consume();
/**
args[]) {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
*/ try
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
143
Hotel booking system 79
144
Hotel booking system 79
java.util.logging.Logger.getLogger(Manageroom.class.getName()).log(java.util.logging.Leve
l.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Manageroom.class.getName()).log(java.util.logging.Leve
l.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Manageroom.class.getName()).log(java.util.logging.Leve
l.SEVERE, null, ex);
java.util.logging.Logger.getLogger(Manageroom.class.getName()).log(java.util.logging.Leve
l.SEVERE, null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
Manageroom().setVisible(true);
});
145
Hotel booking system 79
146
Hotel booking system 79
room;
Customercheckin.java:
import Project.InsertUpdateDelete;
import Project.Select; import
com.sun.glass.events.KeyEvent;
import java.text.SimpleDateFormat;
import java.util.Calendar; import
java.sql.*;
147
Hotel booking system 79
148
Hotel booking system 79
javax.swing.JOptionPane; import
project.*;
/*
*/
/**
* @author Lenovo
javax.swing.JFrame {
/**
*/ public CustomerCheckIn() {
initComponents();
jTextField7.setEditable(false);
jTextField8.setEditable(false);
Calendar cal=Calendar.getInstance();
149
Hotel booking system 79
150
Hotel booking system 79
jTextField7.setText(myFormat.format(cal.getTime()));
String bed;
String roomType;
Price;
{ jComboBox4.removeAllItems();
jTextField8.setText("");
bed=(String)jComboBox2.getSelectedItem();
roomType=(String)jComboBox3.getSelectedItem();
try
while(rs.next())
{ jComboBox4.addItem(rs.getString(1));
}}
catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
151
Hotel booking system 79
152
Hotel booking system 79
/**
* This method is called from within the constructor to initialize the form. *
WARNING: Do NOT modify this code. The content of this method is always
*/
@SuppressWarnings("unchecked")
void initComponents() {
153
Hotel booking system 79
154
Hotel booking system 79
javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));
setLocation(new java.awt.Point(50, 118)); setUndecorated(true);
155
Hotel booking system 79
156
Hotel booking system 79
getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());
java.awt.Color(102, 0, 0));
jLabel1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/Customer Registration & Check
IN.png"))); // NOI18N jLabel1.setText("CUSTOMER CHECKIN");
jTextField1.addActionListener(new java.awt.event.ActionListener() {
jTextField1ActionPerformed(evt);
});
jTextField1KeyTyped(evt);
}); getContentPane().add(jTextField1,
new
157
Hotel booking system 79
158
Hotel booking system 79
Number");
jTextField2KeyTyped(evt);
});
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(12, 242, 350, -1));
jLabel4.setText("Nationality");
jTextField3KeyTyped(evt);
});
159
Hotel booking system 79
160
Hotel booking system 79
getContentPane().add(jTextField3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(12, 333, 350, -1));
jTextField5KeyReleased(evt);
});
getContentPane().add(jTextField5, new
org.netbeans.lib.awtextra.AbsoluteConstraints(12, 515, 350, -1));
getContentPane().add(jComboBox1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(12, 418, 350, -1));
161
Hotel booking system 79
162
Hotel booking system 79
Proof");
getContentPane().add(jTextField4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(440, 200, 350, -1));
jLabel8.setText("Address");
jTextField6KeyTyped(evt);
});
getContentPane().add(jTextField6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(440, 290, 350, -1));
jLabel9.setText("Check IN Date(Today)");
163
Hotel booking system 79
164
Hotel booking system 79
getContentPane().add(jTextField7, new
org.netbeans.lib.awtextra.AbsoluteConstraints(440, 380, 350, -1));
jLabel10.setText("Bed");
actionPerformed(java.awt.event.ActionEvent evt) {
jComboBox2ActionPerformed(evt);
});
getContentPane().add(jComboBox2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(860, 152, 298, -1));
jLabel11.setText("Room Type");
165
Hotel booking system 79
166
Hotel booking system 79
jComboBox3ActionPerformed(evt);
});
getContentPane().add(jComboBox3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(860, 242, 298, -1));
Number");
jComboBox4.addActionListener(new java.awt.event.ActionListener() {
jComboBox4ActionPerformed(evt);
});
jComboBox4KeyTyped(evt);
});
getContentPane().add(jComboBox4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(860, 333, 298, -1));
167
Hotel booking system 79
168
Hotel booking system 79
jTextField8KeyTyped(evt);
});
getContentPane().add(jTextField8, new
org.netbeans.lib.awtextra.AbsoluteConstraints(860, 418, 298, -1));
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
});
169
Hotel booking system 79
170
Hotel booking system 79
jButton3.setText("Clear"); jButton3.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
});
getContentPane().add(jComboBox5, new
org.netbeans.lib.awtextra.AbsoluteConstraints(437, 152, 350, -1));
jButton4.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
jButton4ActionPerformed(evt);
});
171
Hotel booking system 79
172
Hotel booking system 79
getContentPane().add(jButton4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1170, 0, 30, -1));
pack(); setLocationRelativeTo(null);
}// </editor-fold>
setVisible(false); new
CustomerCheckIn().setVisible(true);
173
Hotel booking system 79
174
Hotel booking system 79
roomNo=(String)jComboBox4.getSelectedItem();
try
while(rs.next())
{ jTextField8.setText(rs.getString(4));
} catch(Exception e)
JOptionPane.showMessageDialog(null, e); }
175
Hotel booking system 79
176
Hotel booking system 79
int id=1;
String name=jTextField1.getText();
String mobileNumber=jTextField2.getText();
String nationality=jTextField3.getText();
String gender=(String)jComboBox1.getSelectedItem();
String email=jTextField5.getText();
String idProof=jTextField4.getText();
String address=jTextField6.getText();
String checkIn=jTextField7.getText();
String bed=(String)jComboBox2.getSelectedItem();
String roomType=(String)jComboBox3.getSelectedItem();
String roomNo=(String)jComboBox4.getSelectedItem();
String Price=jTextField8.getText();
if(name.equals("")||mobileNumber.equals("")||nationality.equals("")||gender.equals("")||email.
equals("")||idProof.equals("")||address.equals("")||checkIn.equals("")||bed.equals("")||roomTyp
e.equals("")||roomNo.equals("")||Price.equals("")){
if(!(Pattern.matches("^[a-zA-Z0-9]+[@]+gmail+[.]+com",jTextField5.getText()))){
177
Hotel booking system 79
178
Hotel booking system 79
else{
try
ResultSet rs=Select.getData(Query);
while(rs.next()) id=rs.getInt(1);
id=id+1;
if(!Price.equals(""))
InsertUpdateDelete.setData(Query,"");
Query="insert into
Customer(id,name,mobileNumber,nationality,gender,email,idProof,address,checkIn,roomNo,
bed,roomType,pricePerDay)
values("+id+",'"+name+"','"+mobileNumber+"','"+nationality+"','"+gender+"','"+email+"','"+i
dProof+"','"+address+"','"+checkIn+"','"+roomNo+"','"+bed+"','"+roomType+"','"+Price+"')";
}}
catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
179
Hotel booking system 79
180
Hotel booking system 79
c=evt.getKeyChar();
if(!(Character.isAlphabetic(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c
==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE))){
JOptionPane.showMessageDialog(null,"Alphabets only");
getToolkit().beep(); evt.consume();
}}
c=evt.getKeyChar();
if(!(Character.isAlphabetic(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c
==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE))){
181
Hotel booking system 79
182
Hotel booking system 79
evt.consume();
}}
c=evt.getKeyChar();
if(!(Character.isDigit(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c==Ke
yEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE))){
JOptionPane.showMessageDialog(null,"Digits
c=evt.getKeyChar();
if(!(Character.isDigit(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c==Ke
yEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE))){
JOptionPane.showMessageDialog(null,"Digits
183
Hotel booking system 79
184
Hotel booking system 79
c=evt.getKeyChar();
if(!(Character.isDigit(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEvent.VK_DELETE)||(c==Ke
yEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE))){
JOptionPane.showMessageDialog(null,"Digits
}}
c=evt.getKeyChar();
if(!(Character.isDigit(c)||(Character.isAlphabetic(c)||(c==KeyEvent.VK_SPACE)||(c==KeyEv
ent.VK_DELETE)||(c==KeyEvent.VK_PERIOD)||(c==KeyEvent.VK_BACKSPACE)))){
JOptionPane.showMessageDialog(null,"Incorrect Address");
getToolkit().beep(); evt.consume();
}}
185
Hotel booking system 79
186
Hotel booking system 79
setVisible(false);
if(!(Pattern.matches("^[a-zA-Z0-9]+[@]+gmail+[.]+com$",jTextField5.getText()))){
elab.setText("Incorrect Format");
} else{
elab.setText(null);
/**
args[]) {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and
feel.
187
Hotel booking system 79
188
Hotel booking system 79
try {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
java.util.logging.Logger.getLogger(CustomerCheckIn.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerCheckIn.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerCheckIn.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerCheckIn.class.getName()).log(java.util.logging.
Level.SEVERE, null, ex);
//</editor-fold>
189
Hotel booking system 79
190
Hotel booking system 79
new CustomerCheckIn().setVisible(true);
});
191
Hotel booking system 79
192
Hotel booking system 79
javax.swing.JTextField jTextField8;
CustomerCheckOut.java:
import Project.InsertUpdateDelete;
import Project.Select; import
com.itextpdf.text.Paragraph; import
com.itextpdf.text.pdf.PdfPTable; import
com.itextpdf.text.pdf.PdfWriter; import
java.awt.Desktop; import java.io.File;
import java.io.FileOutputStream;
import java.sql.*; import
java.text.SimpleDateFormat;
193
Hotel booking system 79
194
Hotel booking system 79
java.util.Locale; import
javax.swing.JOptionPane; import
javax.swing.table.DefaultTableModel; import
*/
/**
* @author Lenovo
javax.swing.JFrame {
/**
*/
195
Hotel booking system 79
196
Hotel booking system 79
jTextField2.setEditable(false);
jTextField3.setEditable(false);
jTextField4.setEditable(false);
jTextField5.setEditable(false);
jTextField6.setEditable(false);
jTextField7.setEditable(false);
jTextField8.setEditable(false);
jTextField9.setEditable(false);
} int
id=0;
String roomType;
String bed;
/**
* This method is called from within the constructor to initialize the form. *
WARNING: Do NOT modify this code. The content of this method is always
*/
@SuppressWarnings("unchecked")
void initComponents() {
197
Hotel booking system 79
198
Hotel booking system 79
199
Hotel booking system 79
200
Hotel booking system 79
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
java.awt.Color(102, 0, 0));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Customer
Check Out.png"))); // NOI18N jLabel1.setText("CUSTOMER
CHECKOUT");
jButton1.setIcon(new
javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); // NOI18N
jButton1ActionPerformed(evt);
});
getContentPane().add(jButton1, new
201
Hotel booking system 79
202
Hotel booking system 79
Number");
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(406, 98, 107, -1));
jButton2.setText("Search"); jButton2.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
});
Object [][] {
},
203
Hotel booking system 79
204
Hotel booking system 79
new String [] {
));
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(10, 390, 1200, 200));
jLabel3.setText("Customer Name");
jTextField2.addActionListener(new java.awt.event.ActionListener() {
jTextField2ActionPerformed(evt);
});
getContentPane().add(jTextField2, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 206, 252, -1));
jLabel4.setText("Check IN Date");
205
Hotel booking system 79
206
Hotel booking system 79
getContentPane().add(jTextField3, new
org.netbeans.lib.awtextra.AbsoluteConstraints(347, 206, 252, -1));
getContentPane().add(jTextField4, new
org.netbeans.lib.awtextra.AbsoluteConstraints(634, 206, 252, -1));
jTextField5.addActionListener(new java.awt.event.ActionListener() {
jTextField5ActionPerformed(evt);
});
getContentPane().add(jTextField5, new
org.netbeans.lib.awtextra.AbsoluteConstraints(954, 206, 252, -1));
207
Hotel booking system 79
208
Hotel booking system 79
Per Day");
getContentPane().add(jTextField6, new
org.netbeans.lib.awtextra.AbsoluteConstraints(60, 291, 252, -1));
getContentPane().add(jTextField7, new
org.netbeans.lib.awtextra.AbsoluteConstraints(347, 291, 252, -1));
getContentPane().add(jTextField8, new
org.netbeans.lib.awtextra.AbsoluteConstraints(634, 291, 252, -1));
209
Hotel booking system 79
210
Hotel booking system 79
jLabel10.setText("Email");
getContentPane().add(jTextField9, new
org.netbeans.lib.awtextra.AbsoluteConstraints(954, 291, 252, -1));
actionPerformed(java.awt.event.ActionEvent evt) {
jButton3ActionPerformed(evt);
});
211
Hotel booking system 79
212
Hotel booking system 79
});
pack(); setLocationRelativeTo(null);
}// </editor-fold>
setVisible(false);
213
Hotel booking system 79
214
Hotel booking system 79
DefaultTableModel model=(DefaultTableModel)jTable1.getModel();
try
{ while(rs.next())
model.addRow(new
Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getStr
ing(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getStri
ng(12),rs.getString(13)});
} rs.close();
} catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
}}
String roomNo=jTextField1.getText();
try
215
Hotel booking system 79
216
Hotel booking system 79
if(rs.next())
{ jTextField1.setEditable(false);
id=rs.getInt(1);
jTextField2.setText(rs.getString(2));
jTextField3.setText(rs.getString(9));
jTextField5.setText(rs.getString(3));
jTextField6.setText(rs.getString(13));
SimpleDateFormat myFormat=new
SimpleDateFormat("yyyy/MM/dd"); Calendar
cal=Calendar.getInstance();
jTextField4.setText(myFormat.format(cal.getTime())); String
dateBeforeString=rs.getString(9); java.util.Date
dateBefore=myFormat.parse(dateBeforeString); String
dateAfterString=myFormat.format(cal.getTime()); java.util.Date
dateAfter=myFormat.parse(dateAfterString); long
difference=dateAfter.getTime()-dateBefore.getTime(); int
noofDayStay=(int) (difference/(1000*60*60*24)); if(noofDayStay==0)
noofDayStay=1; jTextField7.setText(String.valueOf(noofDayStay));
217
Hotel booking system 79
218
Hotel booking system 79
float Price=Float.parseFloat(jTextField6.getText());
jTextField8.setText(String.valueOf(noofDayStay*Price));
jTextField9.setText(rs.getString(6));
roomType=rs.getString(12); bed=rs.getString(11);
else
} catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
setVisible(false); new
CustomerCheckOut().setVisible(true);
String name=jTextField2.getText();
219
Hotel booking system 79
220
Hotel booking system 79
String mobileNumber=jTextField5.getText();
String email=jTextField9.getText();
String checkOut=jTextField4.getText();
String numberofDaysStay=jTextField7.getText();
String totalAmount=jTextField8.getText();
String roomNo=jTextField1.getText();
InsertUpdateDelete.setData(Query,"");
try
doc.add(paragraph1);
Paragraph paragraph2=new
Paragraph("*****************************************************************
***********************************************");
doc.add(paragraph2);
221
Hotel booking system 79
222
Hotel booking system 79
doc.add(paragraph3); doc.add(paragraph2);
doc.add(paragraph4); doc.add(paragraph2);
tb1.addCell("Check IN
Date:"+jTextField3.getText()); tb1.addCell("Check
Stay:"+numberofDaysStay); tb1.addCell("Total
doc.add(paragraph2);
doc.add(paragraph5);
catch(Exception e)
JOptionPane.showMessageDialog(null,e);
} doc.close();
{ try
223
Hotel booking system 79
224
Hotel booking system 79
File("D:\\"+id+".pdf")).exists())
{ if(Desktop.isDesktopSupported())
Desktop.getDesktop().open(pdfFile);
else{
else{
} catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
} } setVisible(false); new
CustomerCheckOut().setVisible(true);
225
Hotel booking system 79
226
Hotel booking system 79
/**
args[]) {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
/* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
*/ try
for(javax.swing.UIManager.LookAndFeelInfo info :
javax.swing.UIManager.getInstalledLookAndFeels()) {
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
java.util.logging.Logger.getLogger(CustomerCheckOut.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerCheckOut.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
227
Hotel booking system 79
228
Hotel booking system 79
java.util.logging.Logger.getLogger(CustomerCheckOut.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerCheckOut.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
//</editor-fold>
java.awt.EventQueue.invokeLater(new Runnable() {
CustomerCheckOut().setVisible(true);
});
229
Hotel booking system 79
230
Hotel booking system 79
javax.swing.JTextField jTextField9;
BillDetailsCustomer.java: import
java.text.SimpleDateFormat; import
java.util.Calendar; import
java.sql.*; import Project.*; import
java.awt.Desktop;
231
Hotel booking system 79
232
Hotel booking system 79
javax.swing.JOptionPane; import
javax.swing.table.DefaultTableModel; import
javax.swing.table.TableModel;
/*
* and open the template in the editor. public class CustomerDetailBill extends
javax.swing.JFrame {
Calendar cal=Calendar.getInstance();
jTextField1.setText(myFormat.format(cal.getTime())); }
*/
@SuppressWarnings("unchecked")
void initComponents() {
233
Hotel booking system 79
234
Hotel booking system 79
javax.swing.JLabel();
setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
componentShown(java.awt.event.ComponentEvent evt) {
formComponentShown(evt);
}); getContentPane().setLayout(new
org.netbeans.lib.awtextra.AbsoluteLayout());
java.awt.Color(102, 0, 0));
jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/Customer
Details Bill.png"))); // NOI18N jLabel1.setText("CUSTOMER
DETAIL BILL");
jButton1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/images/close.png"))); //
NOI18N
235
Hotel booking system 79
236
Hotel booking system 79
jButton1ActionPerformed(evt);
});
getContentPane().add(jButton1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(1230, 10, 30, -1));
getContentPane().add(jTextField1, new
org.netbeans.lib.awtextra.AbsoluteConstraints(560, 110, 200, -1));
jButton2.setText("Search"); jButton2.addActionListener(new
actionPerformed(java.awt.event.ActionEvent evt) {
jButton2ActionPerformed(evt);
237
Hotel booking system 79
238
Hotel booking system 79
Object [][] {
}, new String
[] {
));
jTable1MouseClicked(evt);
});
jScrollPane1.setViewportView(jTable1);
getContentPane().add(jScrollPane1,new org.netbeans.lib.awtextra.AbsoluteConstraints(20,
150, 1230, 410)); jLabel4.setFont(new java.awt.Font("Algerian",
To Open Bill");
239
Hotel booking system 79
240
Hotel booking system 79
pack(); setLocationRelativeTo(null);
}// </editor-fold>
setVisible(false);
DefaultTableModel model=(DefaultTableModel)jTable1.getModel();
try
{ while(rs.next())
model.addRow(new
Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getStr
ing(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getStri
ng(12),rs.getString(13),rs.getString(14),rs.getString(15),rs.getString(16)});
} rs.close();
} catch(Exception
e)
241
Hotel booking system 79
242
Hotel booking system 79
JOptionPane.showMessageDialog(null,e);
evt) {
String checkoutDate=jTextField1.getText();
try
{ while(rs.next())
model.addRow(new
Object[]{rs.getString(1),rs.getString(2),rs.getString(3),rs.getString(4),rs.getString(5),rs.getStr
ing(6),rs.getString(7),rs.getString(8),rs.getString(9),rs.getString(10),rs.getString(11),rs.getStri
ng(12),rs.getString(13),rs.getString(14),rs.getString(15),rs.getString(16)});
} rs.close();
} catch(Exception
e)
JOptionPane.showMessageDialog(null,e);
243
Hotel booking system 79
244
Hotel booking system 79
index=jTable1.getSelectedRow();
TableModel model=jTable1.getModel();
File("D:\\"+id+".pdf")).exists())
{ if(Desktop.isDesktopSupported())
Desktop.getDesktop().open(pdfFile);
else{
else{
} catch(Exception e)
JOptionPane.showMessageDialog(null,e);
245
Hotel booking system 79
246
Hotel booking system 79
args[]) {
//<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) "> try
if ("Nimbus".equals(info.getName())) {
javax.swing.UIManager.setLookAndFeel(info.getClassName()); break;
java.util.logging.Logger.getLogger(CustomerDetailBill.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerDetailBill.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerDetailBill.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
java.util.logging.Logger.getLogger(CustomerDetailBill.class.getName()).log(java.util.loggin
g.Level.SEVERE, null, ex);
//</editor-fold>
247
Hotel booking system 79
248
Hotel booking system 79
java.awt.EventQueue.invokeLater(new Runnable() {
CustomerDetailBill().setVisible(true);
});
javax.swing.JTextField jTextField1;
249
Hotel booking system 79
250
Hotel booking system 79
6. CONCLUSION
Finally, in the Online hotel management system, we have developed a secure, user-friendly
Hotel Management System. This System can take care of each member whether its Owner or
Customer. This System will Help them to properly Manage their hotel and help in growth
without creating any hassle.
This system is completely secure since every user is provided with a user ID and Password so
there is no chance of any unauthorized access. Online Payment, Booking, and cancellation
make it easier to use. So, using this system will help in reducing the labor and provide more
facility for Customer to like Hotel and visit again and again.
7. REFERENCES:
• www.java.sun.com/docs/books/tutorial
• Kathy Sierra book
• Wrox professional Java
• www.javatpoint.com
• Btech days youtube
251
Hotel booking system 79
252