Final Project

You might also like

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 168

HOTEL BILLING SYSTEM

Title of the Project

HOTEL BILLING

SYSTEM

SUBMITTED BY:-DEEPSHIKHA VERMA 1


HOTEL BILLING SYSTEM

INTRODUCTION

It is the time of information technology, so, now this era is

also called information era. In this era one very important device

that has played very crucial role is computer system. Because of the

existence of the computer and computer packages like JAVA and

oracle, the process of developing this project named “HOTEL

BILLING SYSTEM”.

The need of “HOTEL BILLING SYSTEM” in hotel is to

automate the various management schemes in the term of hotel

winsor and Information. This system provide us to easily maintain

the information about Guest, room, employee, guest_bill etc. This

system is easily handle by authorized Employee of the restaurant.

This system provide us security of information and random

accessing of data.

“HOTEL BILLING SYSTEM” is very successful in

information era because of its various feature shows on above.

In our fast life this system become more successful in

future.

SUBMITTED BY:-DEEPSHIKHA VERMA 2


HOTEL BILLING SYSTEM

OBJECTIVES
The objective of the project is making the existing system

systematic, fact, accurate and cheaper. And this can be

accomplished by total automation of the existing system.

With total computerization and with the help of required

software we fulfill are objective as: -

 Large volume of information is handled, with user-friendly

interface and increased speed.

 Updating of information is automatically achieved on

receiving of instructions.

 Stored information is displayed as per the requirement.

 It reduces the publishing and other costs, as it is now

possible with the help of printer and automation

software.

 It gives user-friendly environment and thus improves the

performance of bank manager and staff as a whole.

 Searching of a record is a matter of pressing a key.

SUBMITTED BY:-DEEPSHIKHA VERMA 3


HOTEL BILLING SYSTEM

INTRODUCTION OF ORGANIZATION
Hotel Windsor is a service provider for Hotel & Restaurant

executives, Started in 1988. The Restaurant is continuously rising

on the growth chart and setting very high quality standards. They

strict emphasis on quality is combined with the latest technology to

offer their customers a competitive edge.

Since its inception, the company has established a reputation for

itself as a supplier of quality products. They focus on quality and

aim to achieve total customer satisfaction, both in the products they

offer and in the service that follows.

Its highest priority is on customizing their products. They are

committed to provide what their customer wants and they provide

quality and consistency at the best value .

Hotel Windsor, Patna, is an air-conditioned restaurant serving

both vegetarian and non-vegetarian food. The menu of Hotel

Windsor, Patna includes Indian, Chinese and Continental cuisine.

Menu of Hotel Windsor Patna

* Tandoor Menu includes Kebabs, fish, and paneer items. There are

also naans, kulchas and rotis, etc.

* Continental Cuisine includes soups such as french onion soup,

SUBMITTED BY:-DEEPSHIKHA VERMA 4


HOTEL BILLING SYSTEM

chicken munchow, etc and vegetables,such as vegetable au-gretin,

etc.

* Chinese Menu includes varieties of rice and noodles, as well as

vegetables. You can also dine on a combo Chinese meal.

* Indian cuisine menu has a vast variety, with veggies, rice dishes,

stews and curries.

* Fruit Salads

* Raita

* Breakfasts

* Snacks

* Ice creams

* Beverages

* Sweets

Other Facilities of Hotel Windsor, Patna

* Food packets

* Hall Party Menus (hall available too for a party)

* Outside catering services

* Free home delivery

SUBMITTED BY:-DEEPSHIKHA VERMA 5


HOTEL BILLING SYSTEM

PROJECT CATEGORY
FRONT-END: Java

JAVA is pure object oriented programming language, which


has derived C syntax and C++ object oriented programming
features. Is compiled and interpreted language and is platform
independent and can do graphics, networking, multithreading. Java
was conceived by James Gosling, at Sun Microsystems Inc., in
1991. It took 18 months to develop the first working version. This
language was initially called “Oak”, but was renamed “Java” in
1995. The primary motivation of Java was the need for a platform
independent language that could be used to create software to be
embedded in various consumer electronic devices, such as
microwave ovens and remote controls.

Java have a following list of buzzwords:-

Java provides many features which are also known as Java


buzzwords. These are:

1)Simple
Java was designated to be very simple and easy to learn. The
syntax of Java has been kept nearer to C++ so that the usage of
Java does not require extensive training programs to be
undertaken. However, in Java the infrequently used, complex
features of C++ have not been included.

SUBMITTED BY:-DEEPSHIKHA VERMA 6


HOTEL BILLING SYSTEM

2) Object Oriented
Simply stated, object oriented design is a technique that
focuses design on the data and on the interfaces rather than
modularization of the functionalities or the tools used to develop
them. Java uses object-oriented concepts as for basis for S/W
design. Java provides a clean and efficient object-based
development platform.

3) Robust
The multi-platform environment of the web places high
demand on the reliability of the program to execute on a variety of
systems. Thus, high priority has been given to create robust and
highly reliable programs in the design of Java. It provides extensive
compile-time checking followed by a second level of runtime
checking. The most common problems in programming languages
are related to memory management and exception handling.
4) Secure
Java is designed to be used in networked and distributed
environments where security is of paramount importance. Java
supports the creation of applications that cannot be invaded from
outside. On the other side, Java programs are executed in their own
environment and do not go outside these boundaries unless They
are authorized to do so. The authentication techniques are based on
the public key encryption method.

5) Architecture Neutral
Java was designed to support applications on heterogeneous
network environments composed of a variety of processors, the
operating system architectures, and multiple programming
language interfaces. To enable a Java application to execute
anywhere on the network, the Java compiler generates the
bytecode instructions which are not dependent upon a particular

SUBMITTED BY:-DEEPSHIKHA VERMA 7


HOTEL BILLING SYSTEM

computer architecture. These instruction are then interpreted on


any machine and translated into the native machine code on the fly
by the Java runtime.

OVERVIEW OF RDBMS
The project work entitled "HOTEL BILLING SYSTEM” is able to
fully automate system. Hence before discussing anything about
the project, a brief discussion of the related basic concepts is
necessary.
As a software developer or as a programmer, we are expected to
design and develop every program that works correctly,
efficiently and at the same time easy to use by any person who
may or may not be well versed with the computer and its
capabilities. The application programs written in any language
must be such that the user of that program should find it
extremely friendly in the sense that not much effort is should be
required on the part of the user to understand and use the
application. The package should be user friendly.

BASIC DATABASE CONCEPTS ( Oracle )


A database is a collection of related information stored so that it
is available to many users for different purposes. It consists the
collection of interrelated data and a set of programs to access
those data. It is a coherent collection of data with some inherent
meaning, design, built and populated with data for a specific
purpose. A database stores data that is useful to us. This data is
only a part of the entire data available in the world around us.
To be able to successfully design and maintain database, we
have to do the following:
 Identity which part of the world's data is of interest to us.

SUBMITTED BY:-DEEPSHIKHA VERMA 8


HOTEL BILLING SYSTEM

 Identify what specific objects in that part of the world's


data are of interest to us.
 Identify a relationship between the objects.
 Hence, the objects, their attributes and the relationship
between them are of interest to us are in the database
that.
Characteristics of Relational Database Management
System:-
 It provides creating of a file, addition & deletion &
modification of Data, creation addition and deletion of
entire files.
 Database retrieving data collectively or selectively.
 The data stored can be stored or indexed at the user's
discretion and direction.
 Mathematical function can be performed and the data
stored in the database can be manipulated with function to
perform the desired calculation.
 It maintains data integrity and database use.
 Providing form based interface for easy accessibility and
data entry.
 It represents complex relationships between data.
 Keeps a tight control of data redundancy.
 Enforces user-defined rules to ensure the integrity of table
data.
 Has a centralized data dictionary for the storage of
information pertaining to data and its manipulation.
 Ensures that data can be shared across applications.
 Have different interfaces via which users can manipulate
data.
In the early days of computing the Data Base management
System (DBMS), used to manage data, were of the Hierarchic or
Network model. When these were placed into network operating

SUBMITTED BY:-DEEPSHIKHA VERMA 9


HOTEL BILLING SYSTEM

System and multiple users began to access table data


concurrently the Data Base Management System responded to
these user request very sluggishly and was not totally stable
when the number of users exceeded four of fives.
Oracle 10g implements around twelve codd's laws, Ingress nine,
Sybase ten and a half. However, research and development is
constantly going on at all these vendor's sites. Each vendor is
striving to implement all of Codd's laws in their products; this
constantly leads to products upgrades being brought out by the
product vendors. This is really good news for programmers.
Currently Oracle 10g implements all rules fully or partially. The
programming world is constantly getting easier and easier.
Characteristics of a Relational DBMS Model:-
 The relational data management model eliminated all
parent-child relationships and instead represented all data
in the database as simple row/column tables of data
values.
 A relation is similar to a table with row/column it's data
values. The rows of a table are referred to as tuples and
the columns are referred as Attributes. Several tuples of
equal length placed one below the other create a table.
 Each table is an independent entity and there is no physical
relationship between tables.
 Most data management system based on the relational
model has a built-in support for query language like ANSI
SQL or QBE (Query by Example). These queries are simple
English constructs that allow adhoc data manipulation from
a table.
 Relational model of data management is based on set
theory. Built-in query language is design in the RDBMS, so
that it can manipulate sets of data (one or more tuples).
The user interface used with relational models is non-

SUBMITTED BY:-DEEPSHIKHA VERMA 10


HOTEL BILLING SYSTEM

procedural because only what needs to be done is specified


and not how it has to be done. Using any of the other
methods, you have not only to be done but how it has to

be done well.

Tools and Platforms


 TOOLS

FRONT END : Core Java &NETBEANS (IDE)

BACK END : Oracle 10g

 PLATFORM

OPERATING SYSTEM : WINDOWS XP

 H/W SPECIFICATION

PROCESSOR : PANTIUM - IV

RAM : 1 GB

HDD : 40 GB

DRIVE CD : 52 X COMBO DRIVE

Reasons for proposing to use them

Because Java is platform independent, reliable, robust, and object-

oriented language, so we can run on existing software in any

platform efficiently, and also Oracle10g is fully secured database.

So we can secure records in our client information and including all

details.

SUBMITTED BY:-DEEPSHIKHA VERMA 11


HOTEL BILLING SYSTEM

ANALYSIS

Identification of the Need:

HOTEL BILLING SYSTEM did each and every work manually. By

doing the work manually, there were always great chances of

errors and dissatisfactions among management also. The

manual work is tedious and time consuming. It also get

pressurize the employees regarding their efficiency. Therefore

there was always need for a kind of software which can fulfill

all the above requirement with accuracy in a minimum amount

of time and sorting all relevant problems using less afford.

Preliminary Investigation:

Since all the works are done manually, that’s why there is

more time requires for little job. Always there is queue of customers

(clients) waiting for their turn. The simple work looks like

cumbersome one. As a result employees get pressurize and clients

get aggressive, because of suffering of a lot of time. This creates a

little more dissatisfaction among clients. All either employees or

clients want quick service, but this can’t be done manually.

SUBMITTED BY:-DEEPSHIKHA VERMA 12


HOTEL BILLING SYSTEM

Therefore management decides to convert manual system into

electronic i.e. computerization is required. By computerization any

type of query regarding investment/divestment can be done

instantly. Clients get information regarding any scheme in which

they’re interested in few seconds. Simultaneously, information can

be viewed in graphical representation such that easy for

understanding. Storing and retrieval of information are so fast that

many jobs can be done in respectively lesser time. This increases

satisfaction level of clients, simultaneously employees feel relax as

service is going fast and hence the efficiency of employees relatively

increases. Computerization makes information safer. Also,

management can generate several reports, which will help him to

plan future strategy for company behalf. Using RAD (Rapid

Application Development) model can easily develop this system.

This is an incremental software development process model that

emphasizes an extremely sort development cycle.

Feasibility Study:

An important outcome of the preliminary investigation phase

is that the package required is feasible and meets the efficiency

criterion, the workability standard; also it meets the user’s needs.

The various types of feasibility are-

Technical Feasibility:

This evaluation determines Whether the technology needed

for the proposed system is available.

SUBMITTED BY:-DEEPSHIKHA VERMA 13


HOTEL BILLING SYSTEM

How this technology integrated within the organization.

Technical evaluation must also assess whether the existing

system can be upgraded to use the new technology or the

organization has expertise to use it. In this case a totally new setup

needed which obviously suitable for proposed software. The

proposed system has enough capability to be expanded in future.

Proposed system will guarantee accuracy, reliability, and ease of

access and data security.

Economic Feasibility:

This evaluation looks at the financial aspect of the project. To

carry out an economical study it is necessary to place actual money

values against any activities needed to implement the proposed

system. It is also necessary to place money values against any

benefits that will come from a new system. Such calculations are

often described as cost benefit analysis. The proposed software is

economically feasible, as no big investment is required.

Schedule Feasibility: It is the probability that the developer can

complete the development of the project within the scheduled time

i.e. whether the time period is feasible or not.

Operational Feasibility:

Operational feasibility covers two aspects. The operational

feasibility determines how acceptable the software is within the

organization. The evaluation must then determine the general

SUBMITTED BY:-DEEPSHIKHA VERMA 14


HOTEL BILLING SYSTEM

attitude and skills whether such restructuring of the jobs will be

acceptable to the users.

The hardware and software as discussed before, are enough to run

the proposed budget, hence the system is supposed to be feasible

regarding all aspects of feasibility.

This feasibility are necessary to find all the facts about

organization to which the software is going to be developed because

if the company has economically feasible, it will overcome any

feasibility but if that company is not economically feasible then in

that case it will necessary to verify all the rest feasibility of the

company. If company is not technically feasible then in that case, it

will be useless to develop software for any organization.

Software Engineering Paradigm

Linear Sequential Model has been used in carrying out this project

work. The Linear Sequential Model is the oldest and the most widely

used paradigm for Software Engineering. Linear Sequential Model is

called sometimes the Classic Life Cycle or the Waterfall Model.

The Linear Sequential Model suggests a systematic, Sequential

approach to software development that begins at the system level

and progresses through Analysis, Design, Coding, Testing and

Support.

Linear Sequential Model contains the following activities:

System / Information Engineering and Modeling: -

SUBMITTED BY:-DEEPSHIKHA VERMA 15


HOTEL BILLING SYSTEM

Because software is always part of a larger system (or business),

work begins by establishing requirements for all system elements

and then allocating some subset of these requirements to software.

This system view is essential when software must interact with other

elements such as hardware, people and database. System

engineering and analysis encompass requirements gathering at the

system level with a small amount of top-level design and analysis.

Information engineering encompasses requirements gathering at the

strategic business level and at the business area level.

Software Requirements Analysis

Design: -

Software design is actually a multi step process that focuses on four

distinct attributes of a program data structure, software architecture,

interface representations, and procedural (algorithmic) detail. The

design process translates requirements into a

Representation of the software that can be accessed for quality

before coding begins. Like requirements, the design is documented

and becomes part of the software configuration.

Code Generation: -

The design must be translated into a machine-readable form. The

code generation step performs this task. If design is performed in a

detailed manner, code generation can be accomplished

mechanistically.

Testing: -

SUBMITTED BY:-DEEPSHIKHA VERMA 16


HOTEL BILLING SYSTEM

Once code has been generated, program testing begins. The testing

process focuses on the logical internals of the software, ensuring that

all statements have been tested and on the functional externals, that

is, conducting tests to uncover errors and ensure that defined input

will product actual results that agree with required results.

Requirement & Analysis


Specification

Design &
Specification

Coding
Module Testing

Integration
System Testing

Waterfall Model of Software Life Cycle


Delivery
Maintenance

SUBMITTED BY:-DEEPSHIKHA VERMA 17


HOTEL BILLING SYSTEM

System Design

The system design process is not a step adherence of clear

procedures and guidelines. Though, certain clear procedures and

guidelines have emerged in recent days, but still much of design

work depends on knowledge and experience of the designer.

When designer starts working on system design, he will face different

type of problems. Many of these will be due to constraints imposed

by the user or limitation of the hardware and software available in

the market. Sometimes, it is difficult to enumerate the complexity of

the problems and solutions therefore since the variety of likely

problems is so great and no solutions are exactly similar. However,

following considerations should be kept in mind during the system-

designing phase.

Design Objectives

The primary objective of the design, of course, is to deliver the

requirement as specified is the feasibility report. In general, the

following design objectives should be kept in mind.

A. Practicality:

The system must be stable and can be operated by people with

average intelligence.

B. Efficiency:

SUBMITTED BY:-DEEPSHIKHA VERMA 18


HOTEL BILLING SYSTEM

This involves accuracy, timeliness and comprehensiveness of the

system output.

C. Cost:

It is desirable to aim for a system with a minimum cost subject to the

condition that it must satisfy all the requirements.

D. Flexibility:

The system should be modifiable depending on the changing needs of

the user. Such modifications should not entail extensive

reconstructing or recreation of software. It should also be portable

to different computer system.

E. Security:

This is very important aspect of the design and should cover areas of

hardware reliability, fall back procedures, physical security of data

and provision for detection of fraud and abuse. In actually System

Design involves first logical design and then physical construction of

the system. The logical design describes the structure and

characteristics of features, like the outputs, inputs, files, databases

and procedures. The physical construction, which follows the logical

design, produces actual program software, files and a working

system.

Design Constraints

The designer normally will work under following constraints:

SUBMITTED BY:-DEEPSHIKHA VERMA 19


HOTEL BILLING SYSTEM

A) Hardware:

The existing hardware will obviously affect the system design.

B) Software:

The available software (Operating System, Utilities, Language

etc.) in the market will constrain the design?

C) Budget:

The budget allocated for the project will affect the scope and

depth of design.

D) Time-Scale:

The new system may be required by a particular time (e.g. the start

of a financial year). This may put a constraint on the designer to find

the best design.

E) Interface with other Systems:

The new system may require some data from another computerized

system or may provide data to another system in which case the files

must be compatible in the format and the system must operate with

a certain processing cycle.

In nutshell we can say that system design develops the architectural

details required to build a system of product the system design

contains the following activities.

 Partition the analysis model into subsystems.

 Identify concurrency that is dictated by the problem.

SUBMITTED BY:-DEEPSHIKHA VERMA 20


HOTEL BILLING SYSTEM

 Allocate subsystems to processors and tasks.

 Develop a design for the user interface.

 Choose basic strategy for implementing data

management.

 Identify global resources and the control mechanisms

required to access them.

 Design an appropriate control mechanism for the system,

including task management.

 Consider how boundary conditions should

Be handled.

 Review and consider trade-offs.

In actually the computer system design process is an exercise of

specifying “How” the system will work. It is an iterative process,

which is based on “What” the system will do.

Mainly, following five parts have been included in the system

design process:

i) Output Design: -

The starting point of the design process is the proper knowledge

of system requirements, which will normally be converted in terms

of output.

ii) Input Design: -

Once the output requirements have been finalized, the next step

is to find out what data need to be made available to the system

SUBMITTED BY:-DEEPSHIKHA VERMA 21


HOTEL BILLING SYSTEM

to produce the desired outputs. The basic documents in which

these data are available need to be identified. If necessary, these

documents may have to be revised or new documents may have

to be introduced.

iii) File Design: -

Once the input data is captured in the system, these may have to

be preserved either for a short or long period. These data will

generally be stored in files in a logical manner. The designer will

have to devise the techniques of storing and retrieving data from

these files.

iv) Procedure Design:

This step involves specification of how processing will be

performed in this, there are two aspects:

 Computer procedure.

 Non-computer procedure.

 The computer procedure will specify what Functions will

be carried out on computer, what will be different

programs and in what sequence the programs will be run.

The non-computer procedure will specify the manual

procedures for feeding input data, receiving outputs etc.

v) Control Design:

SUBMITTED BY:-DEEPSHIKHA VERMA 22


HOTEL BILLING SYSTEM

The control design indicates necessary procedures which will

ensure correctness of processing, accuracy of data, timely output

etc. This will ensure that the system is functioning as per plan.

Input Design

The design of input play very significant role in getting the correct

output. It covers all phases of input from creation of initial data

to actual entering the data to the system for processing. The

input design is the link that ties the information system into the

world of its users. Some feature of design may very depending on

whether the system is batch oriented or online.

The various objectives of input design which focus on:

 Controlling amount of input.

 Avoiding delay.

 Avoiding errors in data.

 Avoiding extra steps.

 Keeping the process simple.

Major Concerns Regarding Input:

We must consider on some important points regarding input, they

are: -

 What input is needed?

 How and where is the input created?

 How should the source documents be designed?

 What format should be used for the Input records?

SUBMITTED BY:-DEEPSHIKHA VERMA 23


HOTEL BILLING SYSTEM

 What medium should be used for recording the input?

Output Design

Presenting the data processed by a computer-based information

system in an attractive and usable form has become very essential.

Success and acceptance of a system to some extent depend on good

presentation. Therefore, system analysts must know fully how to

design output report in an attractive way. Many new output devices

are being introduced in the market because of recent development in

computer technology.

There are three main reasons why outputs from the computer are

required.

1. For communicating to the persons concerned.

2. For re-input to the computer for being connected with

other data and further processing.

3. For permanent storage.

SUBMITTED BY:-DEEPSHIKHA VERMA 24


HOTEL BILLING SYSTEM

DATA FLOW DIAGRAM


Introduction:-

When we begin to create any project then we consider about all

aspects of project right from the beginning that is needed to build

our project better. They guide us to move forward in right way and

help in dealing with the subject of the project. The data flow

diagram is one of most considerable aspects of a project among all

the section of the project. As we know that graphical description of

a system’s data and how the processes transform the data is known

as data flow diagram. In other’s word we can say that data flow

diagram is graphical representation of movement of data that shows

the transformation processes of data. Data flow diagram do not

supply detailed description of modules but it graphically describes

system‘s data and how the data interacts with the system.

When we construct data flow diagram we use some shapes

that provide us different information. these are:

1. ARROW: - An arrow identifies data flow-data in motion. It

behaves as a pipeline through which information flow.

2. CIRCLE: - In data flow diagram a circle represents process of

data that converts data into information.

3. OPEN ENDED BOXES: - An open ended boxes represents a

data store-data at rest or a temporary repository of data.

SUBMITTED BY:-DEEPSHIKHA VERMA 25


HOTEL BILLING SYSTEM

4. SQUARES:- A square defines a source or destination of

system’s data.

While designing a data flow diagram we follow some rule

.These rules helps us to get obvious and error free data flow

diagram. these rules are:-

1. Arrow used in data flow diagram should not cross each

other.

2. Squares, Circles and files must bear names.

3. Decomposed data flow must be balanced.

4. No two data flows, squares or circle can have the same

name.

5. Draw all data flow around the outside of the diagram.

6. Choose meaningful names for data flow, processes and

data stores. Use strong verbs followed by nouns.

7. Control information such as record counts, password and

validation requirement are not pertain to a data flow diagram.

So we see that data flow diagram perform

important role in describing work. It provides reference to user for

handling the project in organized state. So a trainer must be aware

about constructing data flow diagram.

SUBMITTED BY:-DEEPSHIKHA VERMA 26


HOTEL BILLING SYSTEM

DFD OF THE SYSTEM

0 - Level DFD (Data Flow Diagram)

Room Information The Menu Item information


The customer information of Hotel Samrat

Guest Information The Room


information Emp information
The Menu Item The customer information
of Guest information of
The Guest information of Guest
Hotel Windsor Hotel
Places an Order
The Emp information of
The Guest Hotel Windsor
report for hotel HOTEL 1.0
Administrator Restaurant Room
BILLING
bill Database
Guest bill report
Report module
SYSTEM
For Master Entries The Menu Item
Report
Guest Report
The customer information

Guest bill Report

2.0
Bill Report Restaurant Menu Item Report Database
ModuleThe customer information of Hotel Samrat

First Level
3.0DFD
Emp
module Database

4.0
Database
SUBMITTED BY:-DEEPSHIKHA VERMA Report
27
Module
HOTEL BILLING SYSTEM

Second level DFD for Room & Restaurant


Guest Information Room Information
Customer
Record
The guest information of The Room
Hotel Windsor information

Hotel
Billing
Store
System Room
Retrieval

The room report

Room Report

2nd level DFD for Emp & Guest


Guest Information Emp Information

The Guest information The emp information


of Hotel Windsor of Hotel Windsor

Store
Emp
Guest/emp Retrieval
Managemen Store
Retrieval Guest
t

The Guest
The Emp
report
report
for hotel

SUBMITTED BY:-DEEPSHIKHA VERMA 28


HOTEL BILLING SYSTEM

E-R Diagrams
Room
Room_Typ no
e Floor_n
o

Remark
Room s

Charge Guest_i Nam


d e
Guest
boo
Date
k
has

Bill_n pay mob Addres


o s
Guest_bill

Total
Restaurant date
Name
Emp_id Address

Dob
Total Rbill_i
has Employee
d
Doj
Restaurant_bill
Mob_no Basicion

has
Total_salary

Typ
Menu Item e

Name Charge

Menu_id

SUBMITTED BY:-DEEPSHIKHA VERMA 29


HOTEL BILLING SYSTEM

MODULES & DESCRIPTIONS

In this project, Development of Database System for the HOTEL

BILLING SYSTEM, we are going to implement the

requirement of a well design database which has data

integrity, optimum reduced redundancy, maintenance,

consistency & Data sharing. As all the programming is divided

into different modules and they will interact with each other to

maintain the data and information, module structure is

designed to maintain the logic for modification and

maintenance. Since program has to interact with the

database, it is based on user interface as front-end and

database tables as back-end. This project has several

modules which are as follows: -

 Guest

 Rooms

 Employee

 Guest_bill

 Restaurant_bill

 Menu_detail

SUBMITTED BY:-DEEPSHIKHA VERMA 30


HOTEL BILLING SYSTEM

Guest Module ( )

This module is one of the main modules of the project.

Through the user can maintain the database of all Guest information

and its bill_details.

Rooms Module ( )

This module is one of the main modules of the project.

Through the user can maintain the database of all rooms details and

its charges.

Emp Module ( )

In the appointment procedure of Restaurant we can use the

emp appointment form. Through the user can maintain the

database of all emp information.

Reports module ()

In this module shows the reports of the menu_item,

guest_bill, restaurant_bill and room details.

Exit Module ( )

Through this module user can stop the package where they

are doing their work and maintain all the information regarding

Hotel Windsor, Patna.

SUBMITTED BY:-DEEPSHIKHA VERMA 31


HOTEL BILLING SYSTEM

1. Admin_Login

Field Name Data Type Width Constraints


User_id Varchar2 10 Not null
Password Varchar2 10 Not null
2. Room_details

Field Name Data Type Width Constraints


User_id Varchar2 10 Not null
Password Varchar2 10 Not null
Field Name Data Type Width Constraints
Room_no Number 6 Primary key
Floor_no Varchar2 10 Not null
Room_type Varchar2 10 Not null
Room_charge Number 5,2 Not null
Remarks Varchar2 20 Not null

3. Guest_details

Field Name Data Type Width Constraints


Guest_id Varchar2 10 Primary key
Name Varchar2 20 Not null

SUBMITTED BY:-DEEPSHIKHA VERMA 32


HOTEL BILLING SYSTEM

Room_no Number 6 Foreign key


Guest_type Varchar2 12 Not null
Arr_date Date Not null
Dep_date Date Not null
Arr_time Varchar2 12 Not null
Dep_time Varchar2 12 Not null
Address Varchar2 40 Not null
Mob_no Number 10 Not null
Advance_pay Number 8,2 Not null
Purpose Varchar2 20 Not null

4. Guest_bill_details

Field Name Data Type Width Constraints


Bill_no Varchar2 10 Primary key
Bill_date Date Not null
Guest_id Varchar2 10 Foreign key
Name Varchar2 20 Not null
Room_no Number 6 Foreign key
Room_charge Number 5 Not null
No_of_days Number 5 Not null
Mis_bill Number 8,2 Not null
Tax Number 8,2 Not null
Total Number 8,2 Not null
Advance_pay Number 8,2 Not null
Balance Number 8,2 Not null

5. Menu details

Field Name Data Type Width Constraints


Menu_id Varchar2 10 Primary key
Menu_Name Varchar2 15 Not null
Menu_type Varchar2 10 Not null
Charge Number 8,2 Not null

6. Restaurant_bill_details

Field Name Data Type Width Constraints


Rbill_id Varchar2 10 Primary key
Rbill_date Date Not null

SUBMITTED BY:-DEEPSHIKHA VERMA 33


HOTEL BILLING SYSTEM

Menu_id Varchar2 10 Foreign key


Menu_name Varchar2 15 Not null
Charge Number 8,2 Not null
Tax Number 8,2 Not null
Total Number 8,2 Not null

7. Employee details
Field Name Data Type Width Constraints
Emp_id Varchar2 10 Primary key
Emp_name Varchar2 20 Not null
Dob Date Not null
Doj Date Not null
Address Varchar2 20 Not null
Mob_no Number 10 Not null
Basic_salary Number 8,2 Not null
TA Number 8,2 Not null
DA Number 8,2 Not null
HRA Number 8,2 Not null
Total Number 8,2 Not null

Input/Output To The Project


Input

SUBMITTED BY:-DEEPSHIKHA VERMA 34


HOTEL BILLING SYSTEM

The HOTEL BILLING SYSTEM is an automation system. In this

system user can find any information/Status related to Hotel

Windsor, patna.

The Operator can easily insert, update, and delete the entry for

various tables through different forms. Then the correspondence

result will be displayed.

There is highly security system in which only authenticated user can

logon to the system after going through user name and password

checking. This facility is introduced only for strict security. Hotel

Management has following inputs:

Master Information

 Room Details

 Guest Details

 Emp Details

 Menu Details

Transaction

 Restaurant_bill

 Guest_bill

Output

SUBMITTED BY:-DEEPSHIKHA VERMA 35


HOTEL BILLING SYSTEM

As described in input section there is no any formal input in HOTEL

BILLING SYSTEM, so as a result no formal output.

After some time result facility will be introduced as Output.

The output and the report for the HOTEL BILLING SYSTEM here will

be computerized Management system of the Hotel describes The

following report is generated under this project:

1. Guest Details

2. Bill Detail

3. Room Detail

4. Menu_item Detail

5. Facility of Room

6. Booked Room

7. Available Room

8. Report of Bill

SUBMITTED BY:-DEEPSHIKHA VERMA 36


HOTEL BILLING SYSTEM

CODING

SUBMITTED BY:-DEEPSHIKHA VERMA 37


HOTEL BILLING SYSTEM

Connection Coding

package connection;
import java.sql.*;

public class connect {


static Connection con=null;
public static Connection conn()
{
try
{
Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");

con=DriverManager.getConnection(“jdbc:odbc:hotel”,”billing”,”system
");
System.out.println("connection created");
}
catch(Exception e)
{}
return con;
}

Welcome Form

SUBMITTED BY:-DEEPSHIKHA VERMA 38


HOTEL BILLING SYSTEM

package hms;

public class welcome extends javax.swing.JFrame {

/** Creates new form welcome */


public welcome() {
initComponents();
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
btncontinue = new javax.swing.JButton();

SUBMITTED BY:-DEEPSHIKHA VERMA 39


HOTEL BILLING SYSTEM

btncancel = new javax.swing.JButton();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(255, 255, 255));

jLabel2.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel2.setText("To");

jLabel3.setFont(new java.awt.Font("Monotype Corsiva", 3,


48)); // NOI18N
jLabel3.setForeground(new java.awt.Color(0, 0, 204));
jLabel3.setText("Hotel Windsor ");

btncontinue.setFont(new java.awt.Font("Arial Black", 1, 14));


btncontinue.setText("Continue");
btncontinue.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncontinueActionPerformed(evt);
}
});

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14));


btncancel.setText("Cancel");
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});

SUBMITTED BY:-DEEPSHIKHA VERMA 40


HOTEL BILLING SYSTEM

jPanel2.setBackground(new java.awt.Color(255, 255, 255));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel1.setForeground(new java.awt.Color(227, 6, 6));
jLabel1.setText("Welcome");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(105, Short.MAX_VALUE)
.addComponent(jLabel1)
.addGap(90, 90, 90))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jLabel4.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel4.setText("By");

jLabel5.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel5.setForeground(new java.awt.Color(204, 0, 51));
jLabel5.setText("Ranjan kumar");

jPanel1Layout.setVerticalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 41


HOTEL BILLING SYSTEM

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(13, 13, 13)
.addComponent(jLabel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 43,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jLabel3)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jLabel4)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jLabel5)
.addGap(23, 23, 23)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncontinue)
.addComponent(btncancel))
.addGap(108, 108, 108))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());

SUBMITTED BY:-DEEPSHIKHA VERMA 42


HOTEL BILLING SYSTEM

getContentPane().setLayout(layout);
layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 399,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
pack();
}// </editor-fold>

private void
btncontinueActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for open login form
login sc=new login();
dispose();
sc.show();
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for cancel
dispose();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 43


HOTEL BILLING SYSTEM

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new welcome().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton btncancel;
private javax.swing.JButton btncontinue;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
// End of variables declaration

Security Form

SUBMITTED BY:-DEEPSHIKHA VERMA 44


HOTEL BILLING SYSTEM

package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class login extends javax.swing.JFrame {


String uname=null;
String pwd=null;
Connection con=null;
ResultSet rs=null;
PreparedStatement ps=null;

/** Creates new form login */


public login() {
initComponents();
}

private void initComponents() {

jFrame1 = new javax.swing.JFrame();


jFrame2 = new javax.swing.JFrame();
jFrame3 = new javax.swing.JFrame();
jFrame4 = new javax.swing.JFrame();

SUBMITTED BY:-DEEPSHIKHA VERMA 45


HOTEL BILLING SYSTEM

jFrame5 = new javax.swing.JFrame();


jFrame6 = new javax.swing.JFrame();
jPanel1 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
txtusr_id = new javax.swing.JTextField();
txtusr_pwd = new javax.swing.JPasswordField();
jLabel1 = new javax.swing.JLabel();
btnlogin = new javax.swing.JButton();
btncancel = new javax.swing.JButton();

javax.swing.GroupLayout jFrame1Layout = new


javax.swing.GroupLayout(jFrame1.getContentPane());
jFrame1.getContentPane().setLayout(jFrame1Layout);
jFrame1Layout.setHorizontalGroup(

jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame1Layout.setVerticalGroup(

jFrame1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 300, Short.MAX_VALUE)
);

javax.swing.GroupLayout jFrame2Layout = new


javax.swing.GroupLayout(jFrame2.getContentPane());
jFrame2.getContentPane().setLayout(jFrame2Layout);
jFrame2Layout.setHorizontalGroup(

jFrame2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGap(0, 400, Short.MAX_VALUE)
);
jFrame2Layout.setVerticalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 46


HOTEL BILLING SYSTEM

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(255, 255, 255));

jLabel2.setFont(new java.awt.Font("Arial Black", 1, 18)); //


NOI18N
jLabel2.setText("User id");

jLabel3.setFont(new java.awt.Font("Arial Black", 1, 18)); //


NOI18N
jLabel3.setText("Password");

txtusr_id.setFont(new java.awt.Font("Tahoma", 1, 14)); //


NOI18N

txtusr_pwd.setFont(new java.awt.Font("Tahoma", 1, 18)); //


NOI18N

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3,


48)); // NOI18N
jLabel1.setForeground(new java.awt.Color(255, 0, 51));
jLabel1.setText("Security Form");

btnlogin.setBackground(new java.awt.Color(102, 255, 51));


btnlogin.setFont(new java.awt.Font("Tahoma", 1, 18)); //
NOI18N
btnlogin.setText("Login");
btnlogin.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnloginActionPerformed(evt);
}
});

btncancel.setBackground(new java.awt.Color(255, 51, 102));

SUBMITTED BY:-DEEPSHIKHA VERMA 47


HOTEL BILLING SYSTEM

btncancel.setFont(new java.awt.Font("Arial", 1, 18)); // NOI18N


btncancel.setText("Cancel");
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});

.
addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(txtusr_id,
javax.swing.GroupLayout.DEFAULT_SIZE, 149, Short.MAX_VALUE)
.addComponent(txtusr_pwd)))

.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel1Layout.createSequentialGroup()
.addGap(31, 31, 31)
.addComponent(jLabel1)))
.addGap(26, 26, 26))
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addComponent(btnlogin,
javax.swing.GroupLayout.PREFERRED_SIZE, 94,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

SUBMITTED BY:-DEEPSHIKHA VERMA 48


HOTEL BILLING SYSTEM

.addComponent(btncancel)
.addContainerGap())))
);

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncancel)
.addComponent(btnlogin))
.addGap(101, 101, 101))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);

);
pack();
}// </editor-fold>

private void btnloginActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for login
uname=txtusr_id.getText();
pwd=txtusr_pwd.getText();
try
{
con=connection.connect.conn();
ps=con.prepareStatement("select * from login where uname=?
and password=?");
ps.setString(1,uname);
ps.setString(2,pwd);
rs=ps.executeQuery();
if(rs.next())
{
menu m=new menu();
dispose();
m.show();

SUBMITTED BY:-DEEPSHIKHA VERMA 49


HOTEL BILLING SYSTEM

}
else
{
JOptionPane.showMessageDialog(null,"invalid user name and
password");
}
}
catch(Exception e)
{}
}
private void btncancelActionPerformed(java.awt.event.ActionEvent
evt) {
// Coding for cancel
dispose();
}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new login().setVisible(true);
}
});
} // Variables declaration - do not modify
private javax.swing.JButton btncancel;
private javax.swing.JButton btnlogin;
private javax.swing.JFrame jFrame1;
private javax.swing.JFrame jFrame2;
private javax.swing.JFrame jFrame3;
private javax.swing.JFrame jFrame4;
private javax.swing.JFrame jFrame5;
private javax.swing.JFrame jFrame6;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JTextField txtusr_id;
private javax.swing.JPasswordField txtusr_pwd;
// End of variables declaration
}

SUBMITTED BY:-DEEPSHIKHA VERMA 50


HOTEL BILLING SYSTEM

Menu Form

Coding

package hms;

public class menu extends javax.swing.JFrame {

/** Creates new form menu */


public menu() {
initComponents();
}

private void initComponents() {

jMenuBar1 = new javax.swing.JMenuBar();


jMenu1 = new javax.swing.JMenu();
jMenuItem1 = new javax.swing.JMenuItem();

SUBMITTED BY:-DEEPSHIKHA VERMA 51


HOTEL BILLING SYSTEM

jMenuItem2 = new javax.swing.JMenuItem();


jMenuItem3 = new javax.swing.JMenuItem();
jMenuItem11 = new javax.swing.JMenuItem();
jMenu2 = new javax.swing.JMenu();
jMenuItem4 = new javax.swing.JMenuItem();
jMenuItem5 = new javax.swing.JMenuItem();
jMenuItem6 = new javax.swing.JMenuItem();
jMenu3 = new javax.swing.JMenu();
jMenuItem7 = new javax.swing.JMenuItem();
jMenuItem8 = new javax.swing.JMenuItem();
jMenu4 = new javax.swing.JMenu();
jMenuItem9 = new javax.swing.JMenuItem();
jMenuItem10 = new javax.swing.JMenuItem();
jMenu5 = new javax.swing.JMenu();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jMenu1.setText("MASTER");

jMenuItem1.setText("Employee");
jMenuItem1.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem1ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem1);

jMenuItem2.setText("Room_details");
jMenuItem2.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem2ActionPerformed(evt);
}
});

SUBMITTED BY:-DEEPSHIKHA VERMA 52


HOTEL BILLING SYSTEM

jMenu1.add(jMenuItem2);

jMenuItem11.setAccelerator(javax.swing.KeyStroke.getKeyStroke(jav
a.awt.event.KeyEvent.VK_F4, java.awt.event.InputEvent.ALT_MASK));
jMenuItem11.setText("Exit");
jMenuItem11.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem11ActionPerformed(evt);
}
});
jMenu1.add(jMenuItem11);

jMenuBar1.add(jMenu1);

jMenu2.setText("GUEST");

jMenuItem5.setText("guest_details");
jMenuItem5.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem5ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem5);

jMenuItem6.setText("menu_details");
jMenuItem6.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem6ActionPerformed(evt);
}
});
jMenu2.add(jMenuItem6);

jMenuBar1.add(jMenu2);

SUBMITTED BY:-DEEPSHIKHA VERMA 53


HOTEL BILLING SYSTEM

jMenu3.setText("BILL");

jMenuItem7.setText("guest_bill_details");
jMenuItem7.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem7ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem7);

jMenuItem8.setText("restaurent_bill_details");
jMenuItem8.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem8ActionPerformed(evt);
}
});
jMenu3.add(jMenuItem8);

jMenuBar1.add(jMenu3);

jMenu4.setText("REPORT");

jMenuItem9.setText("Restaurant_bill");
jMenuItem9.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
jMenuItem9ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem9);

jMenuItem10.setText("Guest_bill");
jMenuItem10.addActionListener(new
java.awt.event.ActionListener() {

SUBMITTED BY:-DEEPSHIKHA VERMA 54


HOTEL BILLING SYSTEM

public void actionPerformed(java.awt.event.ActionEvent evt) {


jMenuItem10ActionPerformed(evt);
}
});
jMenu4.add(jMenuItem10);

jMenuBar1.add(jMenu4);

jMenu5.setText("HELP");
jMenuBar1.add(jMenu5);

setJMenuBar(jMenuBar1);

pack();
}// </editor-fold>

private void
jMenuItem11ActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for exit
dispose();
}

private void
jMenuItem1ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open employee_details form
employee_details emp=new employee_details();
emp.show();
}

private void
jMenuItem2ActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for open room_details form
room_details rm=new room_details();
rm.show();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 55


HOTEL BILLING SYSTEM

private void
jMenuItem3ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open reception_details form
reception_details rd=new reception_details();
rd.show();
}

private void
jMenuItem4ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open registration form
registration rg=new registration();
rg.show();
}

private void
jMenuItem5ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_details form
guest_details gd=new guest_details();
gd.show();
}

private void
jMenuItem6ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open menu_details form
menu_details md=new menu_details();
md.show();
}

private void
jMenuItem7ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_bill_details form
guest_bill_details gbd=new guest_bill_details();
gbd.show();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 56


HOTEL BILLING SYSTEM

private void
jMenuItem8ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open restaurant_bill_details form
restaurent_bill_details rbd=new restaurent_bill_details();
rbd.show();
}

private void
jMenuItem9ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open restaurant_bill_report
Restaurant_bill res=new Restaurant_bill();
res.show();
}

private void
jMenuItem10ActionPerformed(java.awt.event.ActionEvent evt) {
// coding for open guest_bill_report
Guest_bill gb=new Guest_bill();
gb.show();
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new menu().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JMenu jMenu1;
private javax.swing.JMenu jMenu2;
private javax.swing.JMenu jMenu3;
private javax.swing.JMenu jMenu4;
private javax.swing.JMenu jMenu5;
private javax.swing.JMenuBar jMenuBar1;
private javax.swing.JMenuItem jMenuItem1;

SUBMITTED BY:-DEEPSHIKHA VERMA 57


HOTEL BILLING SYSTEM

private javax.swing.JMenuItem jMenuItem10;


private javax.swing.JMenuItem jMenuItem11;
private javax.swing.JMenuItem jMenuItem2;
private javax.swing.JMenuItem jMenuItem3;
private javax.swing.JMenuItem jMenuItem4;
private javax.swing.JMenuItem jMenuItem5;
private javax.swing.JMenuItem jMenuItem6;
private javax.swing.JMenuItem jMenuItem7;
private javax.swing.JMenuItem jMenuItem8;
private javax.swing.JMenuItem jMenuItem9;
// End of variables declaration

Employee Details Form

SUBMITTED BY:-DEEPSHIKHA VERMA 58


HOTEL BILLING SYSTEM

Coding

package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class employee_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String emp_id=null;

SUBMITTED BY:-DEEPSHIKHA VERMA 59


HOTEL BILLING SYSTEM

String emp_name=null;
String dob=null;
String doj=null;
String address=null;
String mob_no=null;
String basic_salary=null;
String ta=null;
String da=null;
String hra=null;
String tax=null;
String total=null;
String dd1=null;
String mm1=null;
String yy2=null;
String dd2=null;
String mm3=null;
String yy1=null;
int mm2=0;
String month=null;
String vsid="";
String vsid1="";
/** Creates new form employee_details */
public employee_details() {
initComponents();
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();

SUBMITTED BY:-DEEPSHIKHA VERMA 60


HOTEL BILLING SYSTEM

jLabel7 = new javax.swing.JLabel();


jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
txtemp_id = new javax.swing.JTextField();
txtemp_name = new javax.swing.JTextField();
txtmob = new javax.swing.JTextField();
txtbs = new javax.swing.JTextField();
txtta = new javax.swing.JTextField();
txtda = new javax.swing.JTextField();
txthra = new javax.swing.JTextField();
txttax = new javax.swing.JTextField();
txttotal = new javax.swing.JTextField();
cmbdd = new javax.swing.JComboBox();
cmbmm = new javax.swing.JComboBox();
cmbyy = new javax.swing.JComboBox();
cmbdd1 = new javax.swing.JComboBox();
cmbmm1 = new javax.swing.JComboBox();
cmbyy1 = new javax.swing.JComboBox();
jScrollPane1 = new javax.swing.JScrollPane();
txtadd = new javax.swing.JTextArea();
jPanel4 = new javax.swing.JPanel();
btnsave = new javax.swing.JButton();
btnsearch = new javax.swing.JButton();
btnupdate = new javax.swing.JButton();
btncancel = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btnclear = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);
jPanel1.setBackground(new java.awt.Color(0, 0, 255));

SUBMITTED BY:-DEEPSHIKHA VERMA 61


HOTEL BILLING SYSTEM

jPanel2.setBackground(new java.awt.Color(219, 154, 13));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 1, 36));


jLabel1.setForeground(new java.awt.Color(219, 19, 56));
jLabel1.setText("Employee Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(33, 33, 33)
.addComponent(jLabel1)
.addContainerGap(60, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(197, 244, 83));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("Employee id");

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("Employee Name");

SUBMITTED BY:-DEEPSHIKHA VERMA 62


HOTEL BILLING SYSTEM

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("DOB");

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("DOJ");

jLabel6.setFont(new java.awt.Font("Arial", 1, 14));


jLabel6.setText("Address");

jLabel7.setFont(new java.awt.Font("Arial", 1, 14));


jLabel7.setText("Mobile No");

jLabel8.setFont(new java.awt.Font("Arial", 1, 14));


jLabel8.setText("Basic Salary");

jLabel9.setFont(new java.awt.Font("Arial", 1, 14));


jLabel9.setText("TA");

jLabel10.setFont(new java.awt.Font("Arial", 1, 14));


jLabel10.setText("DA");

jLabel11.setFont(new java.awt.Font("Arial", 1, 14));


jLabel11.setText("HRA");

jLabel12.setFont(new java.awt.Font("Arial", 1, 14));


jLabel12.setText("TAX");

jLabel13.setFont(new java.awt.Font("Arial", 1, 14));


jLabel13.setText("Total");

txtta.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttaActionPerformed(evt);
}
});

txthra.addActionListener(new java.awt.event.ActionListener() {

SUBMITTED BY:-DEEPSHIKHA VERMA 63


HOTEL BILLING SYSTEM

public void actionPerformed(java.awt.event.ActionEvent evt) {


txthraActionPerformed(evt);
}
});

txttotal.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttotalActionPerformed(evt);
}
});

cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));

cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));

cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

cmbdd1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));

cmbmm1.setModel(new
javax.swing.DefaultComboBoxModel(new String[] { "MM", "Jan",

SUBMITTED BY:-DEEPSHIKHA VERMA 64


HOTEL BILLING SYSTEM

"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}));

cmbyy1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

txtadd.setColumns(20);
txtadd.setRows(5);
jScrollPane1.setViewportView(txtadd);

javax.swing.GroupLayout jPanel3Layout = new


javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8)
.addComponent(jLabel9)

SUBMITTED BY:-DEEPSHIKHA VERMA 65


HOTEL BILLING SYSTEM

.addComponent(jLabel11)
.addComponent(jLabel13))
.addGap(25, 25, 25)

jPanel4.setBackground(new java.awt.Color(54, 163, 204));

btnsave.setFont(new java.awt.Font("Arial Black", 1, 14));


btnsave.setText("Save");
btnsave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsaveActionPerformed(evt);
}
});

btnsearch.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnsearch.setText("Search");
btnsearch.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsearchActionPerformed(evt);
}
});

btnupdate.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnupdate.setText("Update");
btnupdate.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnupdateActionPerformed(evt);
}
});

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14));


btncancel.setText("Cancel");

SUBMITTED BY:-DEEPSHIKHA VERMA 66


HOTEL BILLING SYSTEM

btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});

btndelete.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btndelete.setText("Delete");
btndelete.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
btndeleteActionPerformed(evt);
}
});

btnclear.setFont(new java.awt.Font("Arial Black", 1, 14));


btnclear.setText("Clear");
btnclear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnclearActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel4Layout = new


javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(41, 41, 41)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)

SUBMITTED BY:-DEEPSHIKHA VERMA 67


HOTEL BILLING SYSTEM

.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnclear))
.addGap(18, 18, 18)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btndelete,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsearch))
.addGap(18, 18, 18)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btncancel,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnupdate))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnupdate)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

SUBMITTED BY:-DEEPSHIKHA VERMA 68


HOTEL BILLING SYSTEM

.addComponent(btncancel))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnsave)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btnclear))
.addGroup(jPanel4Layout.createSequentialGroup()
.addComponent(btnsearch)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btndelete)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

pack();
}// </editor-fold>

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for add
emp_id=txtemp_id.getText();
emp_name=txtemp_name.getText();

Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
dob=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
doj=dd1+"-"+mm1+"-"+yy1;
address=txtadd.getText();
mob_no=txtmob.getText();
basic_salary=txtbs.getText();

SUBMITTED BY:-DEEPSHIKHA VERMA 69


HOTEL BILLING SYSTEM

ta=txtta.getText();
da=txtda.getText();

hra=txthra.getText();
tax=txttax.getText();
total=txttotal.getText();

if(!emp_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into employee_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,emp_id);
ps.setString(2,emp_name);
ps.setString(3,dob);
ps.setString(4,doj);
ps.setString(5,address);
ps.setString(6,mob_no);
ps.setString(7,basic_salary);
ps.setString(8,ta);
ps.setString(9,da);
ps.setString(10,hra);
ps.setString(11,tax);
ps.setString(12,total);

ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}

SUBMITTED BY:-DEEPSHIKHA VERMA 70


HOTEL BILLING SYSTEM

else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for cancel
dispose();
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for clear
clear();
}

private void
btnupdateActionPerformed(java.awt.event.ActionEvent evt) {
// Coding for delete
emp_id=txtemp_id.getText();
emp_name=txtemp_name.getText();

Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
dob=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
doj=dd1+"-"+mm1+"-"+yy1;
address=txtadd.getText();
mob_no=txtmob.getText();

SUBMITTED BY:-DEEPSHIKHA VERMA 71


HOTEL BILLING SYSTEM

basic_salary=txtbs.getText();
ta=txtta.getText();
da=txtda.getText();
hra=txthra.getText();
tax=txttax.getText();
total=txttotal.getText();

try
{
con=connection.connect.conn();
ps=con.prepareStatement("update employee_details set
emp_id=?,emp_name=?,dob=?,doj=?,address=?,mob=?,bs=?,ta=?,da=?,
hra=?,tax=?,total=?");
ps.setString(1,emp_id);
ps.setString(2,emp_name);
ps.setString(3,dob);
ps.setString(4,doj);
ps.setString(5,address);
ps.setString(6,mob_no);
ps.setString(7,basic_salary);
ps.setString(8,ta);
ps.setString(9,da);
ps.setString(10,hra);
ps.setString(11,tax);
ps.setString(12,total);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"data has been edited");
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"sorry data has not been
edited");
}

SUBMITTED BY:-DEEPSHIKHA VERMA 72


HOTEL BILLING SYSTEM

private void btnsearchActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling emp_id here:
emp_id=txtemp_id.getText();
if(!emp_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("select * from employee_details
where emp_id=?");
ps.setString(1,emp_id);
rs=ps.executeQuery();
while(rs.next())
{
txtemp_id.setText(rs.getString(1));
txtemp_name.setText(rs.getString(2));
java.sql.Date dbSqlDate=null;
dbSqlDate=rs.getDate(3);
vsid= dbSqlDate.toString();

JOptionPane.showMessageDialog(null,"date="+dbSqlDate);
yy1=vsid.substring(0,4);
mm1=vsid.substring(5, 7);
dd1=vsid.substring(8);

JOptionPane.showMessageDialog(null,"yy="+yy1);
JOptionPane.showMessageDialog(null,"mm="+mm1);
JOptionPane.showMessageDialog(null,"dd="+dd1);
cmbdd.setSelectedItem(dd1);
mm2=mm1.compareTo("01");
if(mm2==0)
{
month="Jan";
cmbmm.setSelectedIndex(0);
JOptionPane.showMessageDialog(null,"mm="+month);

SUBMITTED BY:-DEEPSHIKHA VERMA 73


HOTEL BILLING SYSTEM

}
mm2=mm1.compareTo("02");
if(mm2==0)
{
month="Feb";
cmbmm.setSelectedIndex(1);
JOptionPane.showMessageDialog(null,"mm="+month);

mm2=mm1.compareTo("03");
if(mm2==0)
{
month="Mar";
cmbmm.setSelectedIndex(2);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("04");
if(mm2==0)
{
month="Apr";
cmbmm.setSelectedIndex(3);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("05");
if(mm2==0)
{
month="May";
cmbmm.setSelectedIndex(4);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("06");
if(mm2==0)
{
month="Jun";
cmbmm.setSelectedIndex(5);

SUBMITTED BY:-DEEPSHIKHA VERMA 74


HOTEL BILLING SYSTEM

JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("07");
if(mm2==0)
{
month="Jul";
cmbmm.setSelectedIndex(6);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("08");
if(mm2==0)
{
month="Aug";
cmbmm.setSelectedIndex(7);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("09");
if(mm2==0)
{
month="Sep";
cmbmm.setSelectedIndex(8);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("10");
if(mm2==0)
{
month="Oct";
cmbmm.setSelectedIndex(9);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm1.compareTo("11");
if(mm2==0)
{
month="Nov";
cmbmm.setSelectedIndex(10);
JOptionPane.showMessageDialog(null,"mm="+month);
}

SUBMITTED BY:-DEEPSHIKHA VERMA 75


HOTEL BILLING SYSTEM

mm2=mm1.compareTo("12");
if(mm2==0)
{
month="Dec";
cmbmm.setSelectedIndex(11);
JOptionPane.showMessageDialog(null,"mm="+month);
}

cmbyy.setSelectedItem(yy1);
java.sql.Date dbSqlDate1=null;
dbSqlDate1=rs.getDate(4);
vsid= dbSqlDate1.toString();

JOptionPane.showMessageDialog(null,"date="+dbSqlDate1);
yy2=vsid.substring(0,4);
mm3=vsid.substring(5,7);
dd2=vsid.substring(8);

JOptionPane.showMessageDialog(null,"yy="+yy2);
JOptionPane.showMessageDialog(null,"mm="+mm3);
JOptionPane.showMessageDialog(null,"dd="+dd2);
cmbdd1.setSelectedItem(dd2);
mm2=mm3.compareTo("01");
if(mm2==0)
{
month="Jan";
cmbmm1.setSelectedIndex(0);
JOptionPane.showMessageDialog(null,"mm="+month);

}
mm2=mm3.compareTo("02");
if(mm2==0)
{
month="Feb";
cmbmm1.setSelectedIndex(1);
JOptionPane.showMessageDialog(null,"mm="+month);

SUBMITTED BY:-DEEPSHIKHA VERMA 76


HOTEL BILLING SYSTEM

mm2=mm3.compareTo("03");
if(mm2==0)
{
month="Mar";
cmbmm1.setSelectedIndex(2);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("04");
if(mm2==0)
{
month="Apr";
cmbmm1.setSelectedIndex(3);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("05");
if(mm2==0)
{
month="May";
cmbmm1.setSelectedIndex(4);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("06");
if(mm2==0)
{
month="Jun";
cmbmm1.setSelectedIndex(5);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("07");
if(mm2==0)
{
month="Jul";
cmbmm1.setSelectedIndex(6);
JOptionPane.showMessageDialog(null,"mm="+month);

SUBMITTED BY:-DEEPSHIKHA VERMA 77


HOTEL BILLING SYSTEM

}
mm2=mm3.compareTo("08");
if(mm2==0)
{
month="Aug";
cmbmm1.setSelectedIndex(7);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("09");
if(mm2==0)
{
month="Sep";
cmbmm1.setSelectedIndex(8);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("10");
if(mm2==0)
{
month="Oct";
cmbmm1.setSelectedIndex(9);
JOptionPane.showMessageDialog(null,"mm="+month);
}
mm2=mm3.compareTo("11");
if(mm2==0)
{
month="Nov";
cmbmm1.setSelectedIndex(10);
JOptionPane.showMessageDialog(null,"mm="+month);
}

mm2=mm3.compareTo("12");
if(mm2==0)
{
month="Dec";
cmbmm1.setSelectedIndex(11);
JOptionPane.showMessageDialog(null,"mm="+month);
}

SUBMITTED BY:-DEEPSHIKHA VERMA 78


HOTEL BILLING SYSTEM

cmbyy1.setSelectedItem(yy2);
txtadd.setText(rs.getString(5));
txtmob.setText(rs.getString(6));
txtbs.setText(rs.getString(7));
txtta.setText(rs.getString(8));
txtda.setText(rs.getString(9));
txthra.setText(rs.getString(10));
txttax.setText(rs.getString(11));
txttotal.setText(rs.getString(12));

}
}
catch(Exception e)
{
JOptionPane.showMessageDialog(null,"Sorry!\n No match
found!");
}
}
else
{
JOptionPane.showMessageDialog(null,"please enter the employee
emp_id!!");
}
}

private void btndeleteActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
emp_id=txtemp_id.getText();
if(!emp_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)

SUBMITTED BY:-DEEPSHIKHA VERMA 79


HOTEL BILLING SYSTEM

{
int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO
DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from employee_details where
emp_id=?");
ps.setString(1,emp_id);
ps.executeUpdate();

JOptionPane.showMessageDialog(null, "DATA DELETED


SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}

}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else

SUBMITTED BY:-DEEPSHIKHA VERMA 80


HOTEL BILLING SYSTEM

JOptionPane.showMessageDialog(null,"Please enter the Employee


Code for Delete Record!!");
}

}
public void clear()
{
txtemp_id.setText("");
txtemp_name.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
cmbdd1.setSelectedIndex(0);
cmbmm1.setSelectedIndex(0);
cmbyy1.setSelectedIndex(0);
txtadd.setText("");
txtmob.setText("");
txtbs.setText("");
txtta.setText("");
txtda.setText("");
txthra.setText("");
txttax.setText("");
txttotal.setText("");

}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new employee_details().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton btncancel;
private javax.swing.JButton btnclear;

SUBMITTED BY:-DEEPSHIKHA VERMA 81


HOTEL BILLING SYSTEM

private javax.swing.JButton btndelete;


private javax.swing.JButton btnsave;
private javax.swing.JButton btnsearch;
private javax.swing.JButton btnupdate;
private javax.swing.JComboBox cmbdd;
private javax.swing.JComboBox cmbdd1;
private javax.swing.JComboBox cmbmm;
private javax.swing.JComboBox cmbmm1;
private javax.swing.JComboBox cmbyy;
private javax.swing.JComboBox cmbyy1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JTextArea txtadd;
private javax.swing.JTextField txtbs;
private javax.swing.JTextField txtda;
private javax.swing.JTextField txtemp_id;
private javax.swing.JTextField txtemp_name;
private javax.swing.JTextField txthra;
private javax.swing.JTextField txtmob;
private javax.swing.JTextField txtta;
private javax.swing.JTextField txttax;
private javax.swing.JTextField txttotal;
// End of variables declaration
}
Room Details Form

SUBMITTED BY:-DEEPSHIKHA VERMA 82


HOTEL BILLING SYSTEM

package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class room_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String room_no=null;
String floor_no=null;
String room_type=null;
String room_charge=null;
String remarks=null;

/** Creates new form room_details */


public room_details() {
initComponents();
}

private void initComponents() {

SUBMITTED BY:-DEEPSHIKHA VERMA 83


HOTEL BILLING SYSTEM

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
txtroom_no = new javax.swing.JTextField();
jLabel3 = new javax.swing.JLabel();
txtfloor_no = new javax.swing.JTextField();
jLabel4 = new javax.swing.JLabel();
txtroom_type = new javax.swing.JTextField();
jLabel5 = new javax.swing.JLabel();
txtroom_charge = new javax.swing.JTextField();
jLabel6 = new javax.swing.JLabel();
txtremarks = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
btnsave = new javax.swing.JButton();
btnsearch = new javax.swing.JButton();
btnupdate = new javax.swing.JButton();
btnclear = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btncancel = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(0, 0, 255));

jPanel2.setBackground(new java.awt.Color(218, 199, 162));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 2, 48));


jLabel1.setForeground(new java.awt.Color(227, 12, 12));
jLabel1.setText("Room Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);

SUBMITTED BY:-DEEPSHIKHA VERMA 84


HOTEL BILLING SYSTEM

jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel2Layout.createSequentialGroup()
.addContainerGap(49, Short.MAX_VALUE)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 252,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(71, 71, 71))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(224, 165, 47));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("Room No.");

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("Floor No.");

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("Room Type");

txtroom_type.addActionListener(new
java.awt.event.ActionListener() {

SUBMITTED BY:-DEEPSHIKHA VERMA 85


HOTEL BILLING SYSTEM

public void actionPerformed(java.awt.event.ActionEvent evt) {


txtroom_typeActionPerformed(evt);
}
});

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("Room Charge");

txtroom_charge.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtroom_chargeActionPerformed(evt);
}
});

jLabel6.setFont(new java.awt.Font("Arial", 1, 14));


jLabel6.setText("Remarks");

javax.swing.GroupLayout jPanel3Layout = new


javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(jLabel2)
.addComponent(jLabel4)
.addComponent(jLabel6))
.addGap(26, 26, 26)

SUBMITTED BY:-DEEPSHIKHA VERMA 86


HOTEL BILLING SYSTEM

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(txtremarks)
.addComponent(txtroom_charge)
.addComponent(txtroom_type)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtroom_no,
javax.swing.GroupLayout.PREFERRED_SIZE, 63,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addGap(29, 29, 29)
.addComponent(jLabel3)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(txtfloor_no,
javax.swing.GroupLayout.PREFERRED_SIZE, 64,
javax.swing.GroupLayout.PREFERRED_SIZE)))
.addContainerGap(11, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtroom_no,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel3)
.addComponent(txtfloor_no,
javax.swing.GroupLayout.PREFERRED_SIZE,

SUBMITTED BY:-DEEPSHIKHA VERMA 87


HOTEL BILLING SYSTEM

javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(txtroom_type,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel4))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel5)
.addComponent(txtroom_charge,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(txtremarks,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addComponent(jLabel6))
.addGap(64, 64, 64))
);

SUBMITTED BY:-DEEPSHIKHA VERMA 88


HOTEL BILLING SYSTEM

jPanel4.setBackground(new java.awt.Color(154, 193, 195));

btnsave.setFont(new java.awt.Font("Arial Black", 1, 14));


btnsave.setText("Save");
btnsave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsaveActionPerformed(evt);
}
});

btnsearch.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnsearch.setText("Search");
btnsearch.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsearchActionPerformed(evt);
}
});

btnupdate.setFont(new java.awt.Font("Arial Black", 1, 14));


btnupdate.setText("Update");

btnclear.setFont(new java.awt.Font("Arial Black", 1, 14));


btnclear.setText("Clear");
btnclear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnclearActionPerformed(evt);
}
});

btndelete.setFont(new java.awt.Font("Arial Black", 1, 14));


btndelete.setText("Delete");

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14));


btncancel.setText("Cancel");

SUBMITTED BY:-DEEPSHIKHA VERMA 89


HOTEL BILLING SYSTEM

btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btnclear)
.addComponent(btndelete)
.addComponent(btncancel))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
pack();
}// </editor-fold>

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for add
room_no=txtroom_no.getText();
floor_no=txtfloor_no.getText();
room_type=txtroom_type.getText();
room_charge=txtroom_charge.getText();
remarks=txtremarks.getText();
if(!room_no.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into room_details
values(?,?,?,?,?)");
ps.setString(1,room_no);
ps.setString(2,floor_no);

SUBMITTED BY:-DEEPSHIKHA VERMA 90


HOTEL BILLING SYSTEM

ps.setString(3,room_type);
ps.setString(4,room_charge);
ps.setString(5,remarks);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for cancel
dispose();
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// coding for clear
clear();
}

private void btnsearchActionPerformed(java.awt.event.ActionEvent


evt) {

SUBMITTED BY:-DEEPSHIKHA VERMA 91


HOTEL BILLING SYSTEM

// Coding for search


room_no=txtroom_no.getText();
if (!room_no.equals("")) {
try {
con = connection.connect.conn();
ps = con.prepareStatement("select * from room_details
where room_no=?");
ps.setString(1, room_no);
rs = ps.executeQuery();

while (rs.next()) {
txtroom_no.setText(rs.getString(1).trim());
txtfloor_no.setText(rs.getString(2).trim());
txtroom_type.setText(rs.getString(3).trim());
txtroom_charge.setText(rs.getString(4).trim());
txtremarks.setText(rs.getString(5).trim());

} catch (Exception e) {
e.printStackTrace();
}

} else {
JOptionPane.showMessageDialog(null, "Please Enter the
Guest_id!!");
}
}
public void clear()
{
txtroom_no.setText("");
txtfloor_no.setText("");
txtroom_type.setText("");
txtroom_charge.setText("");
txtremarks.setText("");
}
public static void main(String args[]) {

SUBMITTED BY:-DEEPSHIKHA VERMA 92


HOTEL BILLING SYSTEM

java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new room_details().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton btncancel;
private javax.swing.JButton btnclear;
private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;
private javax.swing.JButton btnsearch;
private javax.swing.JButton btnupdate;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JTextField txtfloor_no;
private javax.swing.JTextField txtremarks;
private javax.swing.JTextField txtroom_charge;
private javax.swing.JTextField txtroom_no;
private javax.swing.JTextField txtroom_type;
// End of variables declaration

Guest Details Form

SUBMITTED BY:-DEEPSHIKHA VERMA 93


HOTEL BILLING SYSTEM

Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class guest_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String guest_id=null;

SUBMITTED BY:-DEEPSHIKHA VERMA 94


HOTEL BILLING SYSTEM

String name=null;
String room_no=null;
String guest_type=null;
String arr_date=null;
String dep_date=null;
String arr_time=null;
String dep_time=null;
String address=null;
String mob_no=null;
String advance=null;
String purpose=null;

/** Creates new form guest_details */


public guest_details() {
initComponents();
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
txtguest_id = new javax.swing.JTextField();
txtname = new javax.swing.JTextField();

SUBMITTED BY:-DEEPSHIKHA VERMA 95


HOTEL BILLING SYSTEM

txtroom_no = new javax.swing.JTextField();


txtguest_type = new javax.swing.JTextField();
cmbdd = new javax.swing.JComboBox();
cmbmm = new javax.swing.JComboBox();
cmbyy = new javax.swing.JComboBox();
cmbdd1 = new javax.swing.JComboBox();
cmbmm1 = new javax.swing.JComboBox();
cmbyy1 = new javax.swing.JComboBox();
txtarr_time = new javax.swing.JTextField();
txtdep_time = new javax.swing.JTextField();
jScrollPane1 = new javax.swing.JScrollPane();
tarea_address = new javax.swing.JTextArea();
txtmob_no = new javax.swing.JTextField();
txtadvance_pay = new javax.swing.JTextField();
txtpurpose = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
btnsave = new javax.swing.JButton();
btnclear = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btncancel = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(0, 0, 255));

jPanel2.setBackground(new java.awt.Color(189, 166, 13));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel1.setForeground(new java.awt.Color(255, 0, 51));
jLabel1.setText("Guest Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 96


HOTEL BILLING SYSTEM

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(34, 34, 34)
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 280,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(68, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(255, 153, 0));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("Guest id");

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("Name");

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("Room No.");

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("Guest Type");

jLabel6.setFont(new java.awt.Font("Arial", 1, 14));


jLabel6.setText("Arrival Date");

SUBMITTED BY:-DEEPSHIKHA VERMA 97


HOTEL BILLING SYSTEM

jLabel7.setFont(new java.awt.Font("Arial", 1, 14));


jLabel7.setText("Depachure Time");

jLabel8.setFont(new java.awt.Font("Arial", 1, 14));


jLabel8.setText("Address");

jLabel9.setFont(new java.awt.Font("Arial", 1, 14));


jLabel9.setText("Mobile No");

jLabel10.setFont(new java.awt.Font("Arial", 1, 14));


jLabel10.setText("Advance Pay");

jLabel11.setFont(new java.awt.Font("Arial", 1, 14));


jLabel11.setText("Purpose");

jLabel12.setFont(new java.awt.Font("Arial", 1, 14));


jLabel12.setText("Depachure Date");

jLabel13.setFont(new java.awt.Font("Arial", 1, 14));


jLabel13.setText("Arrival Time");

cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));

cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));

cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",

SUBMITTED BY:-DEEPSHIKHA VERMA 98


HOTEL BILLING SYSTEM

"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",


"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

cmbdd1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));
cmbdd1.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
cmbdd1ActionPerformed(evt);
}
});

cmbmm1.setModel(new
javax.swing.DefaultComboBoxModel(new String[] { "MM", "Jan",
"Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"
}));

cmbyy1.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

txtarr_time.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtarr_timeActionPerformed(evt);
}
});

tarea_address.setColumns(20);

SUBMITTED BY:-DEEPSHIKHA VERMA 99


HOTEL BILLING SYSTEM

tarea_address.setRows(5);
jScrollPane1.setViewportView(tarea_address);

txtmob_no.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtmob_noActionPerformed(evt);
}
});

txtpurpose.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txtpurposeActionPerformed(evt);
}
});

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel12)
.addComponent(jLabel13)
.addComponent(jLabel8)
.addComponent(jLabel6)
.addComponent(jLabel2)
.addComponent(jLabel5)
.addComponent(jLabel4)
.addComponent(jLabel3))
.addGap(14, 14, 14)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(txtroom_no,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(txtname,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)

SUBMITTED BY:-DEEPSHIKHA VERMA 100


HOTEL BILLING SYSTEM

.addComponent(txtguest_id,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addComponent(txtguest_type,
javax.swing.GroupLayout.Alignment.TRAILING,
javax.swing.GroupLayout.DEFAULT_SIZE, 232, Short.MAX_VALUE)
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtarr_time,
javax.swing.GroupLayout.PREFERRED_SIZE, 57,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(jLabel7))
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(cmbdd, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbdd1, 0, 57,
Short.MAX_VALUE))
.addGap(38, 38, 38)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(cmbmm, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(cmbmm1, 0,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))

jPanel4.setBackground(new java.awt.Color(143, 241, 95));

SUBMITTED BY:-DEEPSHIKHA VERMA 101


HOTEL BILLING SYSTEM

btnsave.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnsave.setText("Save");
btnsave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsaveActionPerformed(evt);
}
});

btnclear.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnclear.setText("Clear");
btnclear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnclearActionPerformed(evt);
}
});

btndelete.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btndelete.setText("Delete");
btndelete.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
btndeleteActionPerformed(evt);
}
});

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btncancel.setText("Cancel");
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}

SUBMITTED BY:-DEEPSHIKHA VERMA 102


HOTEL BILLING SYSTEM

});

javax.swing.GroupLayout jPanel4Layout = new


javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(34, 34, 34)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnclear,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE, 110, Short.MAX_VALUE))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED, 80, Short.MAX_VALUE)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btncancel,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btndelete,
javax.swing.GroupLayout.DEFAULT_SIZE, 106, Short.MAX_VALUE))
.addGap(52, 52, 52))
);

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for save

SUBMITTED BY:-DEEPSHIKHA VERMA 103


HOTEL BILLING SYSTEM

guest_id=txtguest_id.getText();
name=txtname.getText();
room_no=txtroom_no.getText();
guest_type=txtguest_type.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
arr_date=dd+"-"+mm+"-"+yy;
Object dd1=cmbdd1.getSelectedItem();
Object mm1=cmbmm1.getSelectedItem();
Object yy1=cmbyy1.getSelectedItem();
dep_date=dd+"-"+mm+"-"+yy;
arr_time=txtarr_time.getText();
dep_time=txtarr_time.getText();
address=tarea_address.getText();
mob_no=txtmob_no.getText();
advance=txtadvance_pay.getText();
purpose=txtpurpose.getText();

if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into guest_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,guest_id);
ps.setString(2,name);
ps.setString(3,room_no);
ps.setString(4,guest_type);
ps.setString(5,arr_date);
ps.setString(6,dep_date);
ps.setString(7,arr_time);
ps.setString(8,dep_time);
ps.setString(9,address);
ps.setString(10,mob_no);
ps.setString(11,advance);

SUBMITTED BY:-DEEPSHIKHA VERMA 104


HOTEL BILLING SYSTEM

ps.setString(12,purpose);

ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for cancel
dispose();
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for clear
clear();
}

private void btndeleteActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for delete
guest_id=txtguest_id.getText();

SUBMITTED BY:-DEEPSHIKHA VERMA 105


HOTEL BILLING SYSTEM

if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)
{
int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO
DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from guest_details where
guest_id=?");
ps.setString(1,guest_id);
ps.executeUpdate();
JOptionPane.showMessageDialog(null, "DATA DELETED
SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}

}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");

SUBMITTED BY:-DEEPSHIKHA VERMA 106


HOTEL BILLING SYSTEM

}
}
else
{
JOptionPane.showMessageDialog(null,"Please enter the guestid for
Delete Record!!");
}
}
public void clear()
{
txtguest_id.setText("");
txtname.setText("");
txtroom_no.setText("");
txtguest_type.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
cmbdd1.setSelectedIndex(0);
cmbmm1.setSelectedIndex(0);
cmbyy1.setSelectedIndex(0);
txtarr_time.setText("");
txtdep_time.setText("");
tarea_address.setText("");
txtmob_no.setText("");
txtadvance_pay.setText("");
txtpurpose.setText("");

}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new guest_details().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btncancel;

SUBMITTED BY:-DEEPSHIKHA VERMA 107


HOTEL BILLING SYSTEM

private javax.swing.JButton btnclear;


private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;
private javax.swing.JComboBox cmbdd;
private javax.swing.JComboBox cmbdd1;
private javax.swing.JComboBox cmbmm;
private javax.swing.JComboBox cmbmm1;
private javax.swing.JComboBox cmbyy;
private javax.swing.JComboBox cmbyy1;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JTextField txtadvance_pay;
private javax.swing.JTextField txtarr_time;
private javax.swing.JTextField txtdep_time;
private javax.swing.JTextField txtguest_id;
private javax.swing.JTextField txtguest_type;
private javax.swing.JTextField txtmob_no;
private javax.swing.JTextField txtname;
private javax.swing.JTextField txtpurpose;
private javax.swing.JTextField txtroom_no;
// End of variables declaration
}
Menu Details

SUBMITTED BY:-DEEPSHIKHA VERMA 108


HOTEL BILLING SYSTEM

Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class menu_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String menu_id=null;
String menu_name=null;
String menu_type=null;
String charge=null;

/** Creates new form menu_details */


public menu_details() {
initComponents();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 109


HOTEL BILLING SYSTEM

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
txtmenu_id = new javax.swing.JTextField();
txtmenu_name = new javax.swing.JTextField();
txtmenu_type = new javax.swing.JTextField();
txtcharge = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
btnsave = new javax.swing.JButton();
btnclear = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btncancel = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(0, 0, 255));

jPanel2.setBackground(new java.awt.Color(148, 195, 9));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3, 48));


jLabel1.setForeground(new java.awt.Color(222, 9, 9));
jLabel1.setText("Menu Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 110


HOTEL BILLING SYSTEM

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(27, 27, 27)
.addComponent(jLabel1)
.addContainerGap(45, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(183, 236, 94));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("Menu id");

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("Menu Name");

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("Menu Type");

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("Charge");

javax.swing.GroupLayout jPanel3Layout = new


javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 111


HOTEL BILLING SYSTEM

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5))
.addGap(26, 26, 26)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)
.addComponent(txtcharge,
javax.swing.GroupLayout.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addComponent(txtmenu_id,
javax.swing.GroupLayout.DEFAULT_SIZE, 192, Short.MAX_VALUE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED))
.addComponent(txtmenu_name)
.addComponent(txtmenu_type))))
.addContainerGap(32, Short.MAX_VALUE))
);
jPanel3Layout.setVerticalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()

SUBMITTED BY:-DEEPSHIKHA VERMA 112


HOTEL BILLING SYSTEM

.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel2)
.addComponent(txtmenu_id,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(jLabel3)
.addComponent(txtmenu_name,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE))
.addGap(18, 18, 18)

pack();
}// </editor-fold>

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for save
menu_id=txtmenu_id.getText();
menu_name=txtmenu_name.getText();
menu_type=txtmenu_type.getText();
charge=txtcharge.getText();

if(!menu_id.equals(" "))
{
try
{
con=connection.connect.conn();

SUBMITTED BY:-DEEPSHIKHA VERMA 113


HOTEL BILLING SYSTEM

ps=con.prepareStatement("insert into menu_details


values(?,?,?,?)");
ps.setString(1,menu_id);
ps.setString(2,menu_name);
ps.setString(3,menu_type);
ps.setString(4,charge);

ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
dispose();
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
clear();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 114


HOTEL BILLING SYSTEM

private void btndeleteActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for delete
menu_id=txtmenu_id.getText();
if(!menu_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)
{
int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO
DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from menu_details where
menu_id=?");
ps.setString(1,menu_id);
ps.executeUpdate();

JOptionPane.showMessageDialog(null, "DATA DELETED


SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 115


HOTEL BILLING SYSTEM

}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else

{
JOptionPane.showMessageDialog(null,"Please enter the menuid for
Delete Record!!");
}

public void clear()


{
txtmenu_id.setText("");
txtmenu_name.setText("");
txtmenu_type.setText("");
txtcharge.setText("");

}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new menu_details().setVisible(true);
}
});
}

// Variables declaration - do not modify

SUBMITTED BY:-DEEPSHIKHA VERMA 116


HOTEL BILLING SYSTEM

private javax.swing.JButton btncancel;


private javax.swing.JButton btnclear;
private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JTextField txtcharge;
private javax.swing.JTextField txtmenu_id;
private javax.swing.JTextField txtmenu_name;
private javax.swing.JTextField txtmenu_type;
// End of variables declaration

Guest_bill Details

SUBMITTED BY:-DEEPSHIKHA VERMA 117


HOTEL BILLING SYSTEM

Coding
package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class guest_bill_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String guest_id=null;
String name=null;
String room_no=null;
String room_charge=null;
String bill_no=null;
String bill_date=null;

SUBMITTED BY:-DEEPSHIKHA VERMA 118


HOTEL BILLING SYSTEM

String miss_bill=null;
String no_of_days=null;
String total=null;
String tax=null;
String balance=null;
String advance_pay=null;
/** Creates new form guest_bill_details */
public guest_bill_details() {
initComponents();
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
jLabel9 = new javax.swing.JLabel();
jLabel10 = new javax.swing.JLabel();
jLabel11 = new javax.swing.JLabel();
jLabel12 = new javax.swing.JLabel();
jLabel13 = new javax.swing.JLabel();
txtguest_id = new javax.swing.JTextField();
txtname = new javax.swing.JTextField();
txtroom_no = new javax.swing.JTextField();
txtbill_no = new javax.swing.JTextField();
txtroom_charge = new javax.swing.JTextField();
cmbdd = new javax.swing.JComboBox();
cmbmm = new javax.swing.JComboBox();
cmbyy = new javax.swing.JComboBox();

SUBMITTED BY:-DEEPSHIKHA VERMA 119


HOTEL BILLING SYSTEM

txtmiss_bill = new javax.swing.JTextField();


txttotal = new javax.swing.JTextField();
txtbalance = new javax.swing.JTextField();
txtno_of_days = new javax.swing.JTextField();
txttax = new javax.swing.JTextField();
txtadvance_pay = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
btnclear = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btncancel = new javax.swing.JButton();
btnsave = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(0, 0, 255));

jPanel2.setBackground(new java.awt.Color(227, 184, 41));

jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3, 36));


jLabel1.setForeground(new java.awt.Color(204, 0, 51));
jLabel1.setText("Guest Bill Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addGap(52, 52, 52)
.addComponent(jLabel1)
.addContainerGap(69, Short.MAX_VALUE))
);
jPanel2Layout.setVerticalGroup(

SUBMITTED BY:-DEEPSHIKHA VERMA 120


HOTEL BILLING SYSTEM

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(137, 240, 54));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("Bill No");

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("Bill date");

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("Guest id");

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("Name");

jLabel6.setFont(new java.awt.Font("Arial", 1, 14));


jLabel6.setText("Room No");

jLabel7.setFont(new java.awt.Font("Arial", 1, 14));


jLabel7.setText("Room Charge");

jLabel8.setFont(new java.awt.Font("Arial", 1, 14));


jLabel8.setText("No of Days");

jLabel9.setFont(new java.awt.Font("Arial", 1, 14));


jLabel9.setText("Miss Bill");

jLabel10.setFont(new java.awt.Font("Arial", 1, 14));

SUBMITTED BY:-DEEPSHIKHA VERMA 121


HOTEL BILLING SYSTEM

jLabel10.setText("Tax");

jLabel11.setFont(new java.awt.Font("Arial", 1, 14));


jLabel11.setText("Total");

jLabel12.setFont(new java.awt.Font("Arial", 1, 14));


jLabel12.setText("Advance Pay");

jLabel13.setFont(new java.awt.Font("Arial", 1, 14));


jLabel13.setText("Balance");

cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));

cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));

cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

txttax.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
txttaxActionPerformed(evt);
}
});

SUBMITTED BY:-DEEPSHIKHA VERMA 122


HOTEL BILLING SYSTEM

javax.swing.GroupLayout jPanel3Layout = new


javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel4)
.addComponent(jLabel6)
.addComponent(jLabel5)
.addComponent(jLabel7)
.addComponent(jLabel3)
.addComponent(jLabel9)
.addComponent(jLabel11))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)
.addComponent(txtname,
javax.swing.GroupLayout.Alignment.LEADING)
.addComponent(txtguest_id,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE, 226, Short.MAX_VALUE))

SUBMITTED BY:-DEEPSHIKHA VERMA 123


HOTEL BILLING SYSTEM

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING)

.addGroup(javax.swing.GroupLayout.Alignment.LEADING,
jPanel3Layout.createSequentialGroup()
.addComponent(cmbdd,
javax.swing.GroupLayout.PREFERRED_SIZE, 44,
javax.swing.GroupLayout.PREFERRED_SIZE)

jPanel4.setBackground(new java.awt.Color(221, 125, 84));

btnclear.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnclear.setText("Clear");
btnclear.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnclearActionPerformed(evt);
}
});

btndelete.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btndelete.setText("Delete");
btndelete.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
btndeleteActionPerformed(evt);
}
});

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btncancel.setText("Cancel");
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {

SUBMITTED BY:-DEEPSHIKHA VERMA 124


HOTEL BILLING SYSTEM

btncancelActionPerformed(evt);
}
});

btnsave.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btnsave.setText("Save");
btnsave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsaveActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel4Layout = new


javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(64, 64, 64)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)
.addComponent(btnclear,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
.addGap(84, 84, 84)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(btncancel)
.addComponent(btndelete))
.addContainerGap(58, Short.MAX_VALUE))

SUBMITTED BY:-DEEPSHIKHA VERMA 125


HOTEL BILLING SYSTEM

);
jPanel4Layout.setVerticalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel4Layout.createSequentialGroup()
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btndelete)
.addComponent(btnsave))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btncancel)
.addComponent(btnclear))
.addContainerGap())
);

javax.swing.GroupLayout jPanel1Layout = new


javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING, false)

SUBMITTED BY:-DEEPSHIKHA VERMA 126


HOTEL BILLING SYSTEM

.addComponent(jPanel4,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel4,
javax.swing.GroupLayout.PREFERRED_SIZE,

SUBMITTED BY:-DEEPSHIKHA VERMA 127


HOTEL BILLING SYSTEM

javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);

pack();
}// </editor-fold>

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for save
guest_id=txtguest_id.getText();
name=txtname.getText();

SUBMITTED BY:-DEEPSHIKHA VERMA 128


HOTEL BILLING SYSTEM

room_no=txtroom_no.getText();
room_charge=txtroom_charge.getText();
bill_no=txtbill_no.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
bill_date=dd+"-"+mm+"-"+yy;
miss_bill=txtmiss_bill.getText();
no_of_days=txtno_of_days.getText();
total=txttotal.getText();
tax=txttax.getText();
balance=txtbalance.getText();
advance_pay=txtadvance_pay.getText();

if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into guest_bill_details
values(?,?,?,?,?,?,?,?,?,?,?,?)");
ps.setString(1,guest_id);
ps.setString(2,name);
ps.setString(3,room_no);
ps.setString(4,room_charge);
ps.setString(5,bill_no);
ps.setString(6,bill_date);
ps.setString(7,miss_bill);
ps.setString(8,no_of_days);
ps.setString(9,total);
ps.setString(10,tax);
ps.setString(11,balance);
ps.setString(12,advance_pay);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();

SUBMITTED BY:-DEEPSHIKHA VERMA 129


HOTEL BILLING SYSTEM

}
catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for cancel
dispose();
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for clear
clear();
}

private void btndeleteActionPerformed(java.awt.event.ActionEvent


evt) {
// Coding for delete
guest_id=txtguest_id.getText();
if(!guest_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)
{

SUBMITTED BY:-DEEPSHIKHA VERMA 130


HOTEL BILLING SYSTEM

int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO


DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from guest_details where
guest_id=?");
ps.setString(1,guest_id);
ps.executeUpdate();

JOptionPane.showMessageDialog(null, "DATA DELETED


SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}

}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else

SUBMITTED BY:-DEEPSHIKHA VERMA 131


HOTEL BILLING SYSTEM

JOptionPane.showMessageDialog(null,"Please enter the guestid for


Delete Record!!");
}
}

public void clear()


{
txtguest_id.setText("");
txtname.setText("");
txtroom_no.setText("");
txtroom_charge.setText("");
txtbill_no.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
txtmiss_bill.setText("");

txtno_of_days.setText("");
txttotal.setText("");
txttax.setText("");
txtbalance.setText("");
txtadvance_pay.setText("");

}
public static void main(String args[]) {
java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new guest_bill_details().setVisible(true);
}
});
}
// Variables declaration - do not modify
private javax.swing.JButton btncancel;
private javax.swing.JButton btnclear;
private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;

SUBMITTED BY:-DEEPSHIKHA VERMA 132


HOTEL BILLING SYSTEM

private javax.swing.JComboBox cmbdd;


private javax.swing.JComboBox cmbmm;
private javax.swing.JComboBox cmbyy;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel10;
private javax.swing.JLabel jLabel11;
private javax.swing.JLabel jLabel12;
private javax.swing.JLabel jLabel13;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;
private javax.swing.JLabel jLabel5;
private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JLabel jLabel9;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JTextField txtadvance_pay;
private javax.swing.JTextField txtbalance;
private javax.swing.JTextField txtbill_no;
private javax.swing.JTextField txtguest_id;
private javax.swing.JTextField txtmiss_bill;
private javax.swing.JTextField txtname;
private javax.swing.JTextField txtno_of_days;
private javax.swing.JTextField txtroom_charge;
private javax.swing.JTextField txtroom_no;
private javax.swing.JTextField txttax;
private javax.swing.JTextField txttotal;
// End of variables declaration

}
Restaurant_bill_details

SUBMITTED BY:-DEEPSHIKHA VERMA 133


HOTEL BILLING SYSTEM

package hms;
import java.sql.*;
import javax.swing.JOptionPane;

public class restaurent_bill_details extends javax.swing.JFrame {


Connection con=null;
PreparedStatement ps=null;
ResultSet rs=null;
String rbill_id=null;
String rbill_date=null;
String menu_id=null;
String menu_name=null;
String charge=null;
String tax=null;
String total=null;

SUBMITTED BY:-DEEPSHIKHA VERMA 134


HOTEL BILLING SYSTEM

public restaurent_bill_details() {
initComponents();
}

private void initComponents() {

jPanel1 = new javax.swing.JPanel();


jPanel2 = new javax.swing.JPanel();
jLabel1 = new javax.swing.JLabel();
jPanel3 = new javax.swing.JPanel();
jLabel2 = new javax.swing.JLabel();
jLabel3 = new javax.swing.JLabel();
jLabel4 = new javax.swing.JLabel();
jLabel5 = new javax.swing.JLabel();
jLabel6 = new javax.swing.JLabel();
jLabel7 = new javax.swing.JLabel();
jLabel8 = new javax.swing.JLabel();
txtrbill_id = new javax.swing.JTextField();
cmbdd = new javax.swing.JComboBox();
cmbmm = new javax.swing.JComboBox();
cmbyy = new javax.swing.JComboBox();
txtmenu_id = new javax.swing.JTextField();
txtmenu_name = new javax.swing.JTextField();
txtcharge = new javax.swing.JTextField();
txttax = new javax.swing.JTextField();
txttotal = new javax.swing.JTextField();
jPanel4 = new javax.swing.JPanel();
btnsave = new javax.swing.JButton();
btnclear = new javax.swing.JButton();
btndelete = new javax.swing.JButton();
btncancel = new javax.swing.JButton();

setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_C
LOSE);

jPanel1.setBackground(new java.awt.Color(0, 0, 255));

SUBMITTED BY:-DEEPSHIKHA VERMA 135


HOTEL BILLING SYSTEM

jPanel2.setBackground(new java.awt.Color(233, 178, 96));

jLabel1.setBackground(new java.awt.Color(233, 187, 93));


jLabel1.setFont(new java.awt.Font("Monotype Corsiva", 3, 36));
jLabel1.setForeground(new java.awt.Color(204, 0, 51));
jLabel1.setText("Restaurent Bill Details");

javax.swing.GroupLayout jPanel2Layout = new


javax.swing.GroupLayout(jPanel2);
jPanel2.setLayout(jPanel2Layout);
jPanel2Layout.setHorizontalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jLabel1,
javax.swing.GroupLayout.DEFAULT_SIZE, 353, Short.MAX_VALUE)
.addContainerGap())
);
jPanel2Layout.setVerticalGroup(

jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel2Layout.createSequentialGroup()
.addComponent(jLabel1,
javax.swing.GroupLayout.PREFERRED_SIZE, 66,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(8, Short.MAX_VALUE))
);

jPanel3.setBackground(new java.awt.Color(155, 232, 23));

jLabel2.setFont(new java.awt.Font("Arial", 1, 14));


jLabel2.setText("RBill id");

SUBMITTED BY:-DEEPSHIKHA VERMA 136


HOTEL BILLING SYSTEM

jLabel3.setFont(new java.awt.Font("Arial", 1, 14));


jLabel3.setText("RBill Date");

jLabel4.setFont(new java.awt.Font("Arial", 1, 14));


jLabel4.setText("Menu id");

jLabel5.setFont(new java.awt.Font("Arial", 1, 14));


jLabel5.setText("Menu Name");

jLabel6.setFont(new java.awt.Font("Arial", 1, 14));


jLabel6.setText("Charge");

jLabel7.setFont(new java.awt.Font("Arial", 1, 14));


jLabel7.setText("Tax");

jLabel8.setFont(new java.awt.Font("Arial", 1, 14));


jLabel8.setText("Total");

cmbdd.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "DD", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10",
"11", "12", "13", "14", "15", "16", "17", "18", "19", "20", "21", "22",
"23", "24", "25", "26", "27", "28", "29", "30", "31" }));

cmbmm.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "MM", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug",
"Sep", "Oct", "Nov", "Dec" }));

cmbyy.setModel(new javax.swing.DefaultComboBoxModel(new
String[] { "YYYY", "1970", "1971", "1972", "1973", "1974", "1975",
"1976", "1977", "1978", "1979", "1980", "1981", "1982", "1983",
"1984", "1985", "1986", "1987", "1988", "1989", "1990", "1991",
"1992", "1993", "1994", "1995", "1996", "1997", "1998", "1999",
"2000", "2001", "2002", "2003", "2004", "2005", "2006", "2007",
"2008", "2009", "2010", "2011", "2012", "2013", "2014", "2015",
"2016", "2017", "2018", "2019", "2020", "2021", "2022", "2023",
"2024", "2025", "2026", "2027", "2028", "2029", "2030", " " }));

SUBMITTED BY:-DEEPSHIKHA VERMA 137


HOTEL BILLING SYSTEM

javax.swing.GroupLayout jPanel3Layout = new


javax.swing.GroupLayout(jPanel3);
jPanel3.setLayout(jPanel3Layout);
jPanel3Layout.setHorizontalGroup(

jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel3Layout.createSequentialGroup()
.addGap(26, 26, 26)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(jLabel2)
.addComponent(jLabel3)
.addComponent(jLabel4)
.addComponent(jLabel5)
.addComponent(jLabel6)
.addComponent(jLabel7)
.addComponent(jLabel8))
.addGap(15, 15, 15)

.addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLay

jPanel4.setBackground(new java.awt.Color(221, 237, 122));

btnsave.setFont(new java.awt.Font("Arial Black", 1, 14));


btnsave.setText("Save");
btnsave.addActionListener(new java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btnsaveActionPerformed(evt);
}
});

btnclear.setFont(new java.awt.Font("Arial Black", 1, 14));


btnclear.setText("Clear");
btnclear.addActionListener(new java.awt.event.ActionListener() {

SUBMITTED BY:-DEEPSHIKHA VERMA 138


HOTEL BILLING SYSTEM

public void actionPerformed(java.awt.event.ActionEvent evt) {


btnclearActionPerformed(evt);
}
});

btndelete.setFont(new java.awt.Font("Arial Black", 1, 14)); //


NOI18N
btndelete.setText("Delete");
btndelete.addActionListener(new java.awt.event.ActionListener()
{
public void actionPerformed(java.awt.event.ActionEvent evt) {
btndeleteActionPerformed(evt);
}
});

btncancel.setFont(new java.awt.Font("Arial Black", 1, 14));


btncancel.setText("Cancel");
btncancel.addActionListener(new
java.awt.event.ActionListener() {
public void actionPerformed(java.awt.event.ActionEvent evt) {
btncancelActionPerformed(evt);
}
});

javax.swing.GroupLayout jPanel4Layout = new


javax.swing.GroupLayout(jPanel4);
jPanel4.setLayout(jPanel4Layout);
jPanel4Layout.setHorizontalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(34, 34, 34)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING, false)

SUBMITTED BY:-DEEPSHIKHA VERMA 139


HOTEL BILLING SYSTEM

.addComponent(btnsave,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(btnclear))
.addGap(123, 123, 123)

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addComponent(btncancel)
.addComponent(btndelete))
.addContainerGap(48, Short.MAX_VALUE))
);
jPanel4Layout.setVerticalGroup(

jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.LEADING)
.addGroup(jPanel4Layout.createSequentialGroup()
.addGap(35, 35, 35)
.addComponent(btncancel))
.addGroup(jPanel4Layout.createSequentialGroup()

.addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.BASELINE)
.addComponent(btnsave)
.addComponent(btndelete))

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RE
LATED)
.addComponent(btnclear)))
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

SUBMITTED BY:-DEEPSHIKHA VERMA 140


HOTEL BILLING SYSTEM

javax.swing.GroupLayout jPanel1Layout = new


javax.swing.GroupLayout(jPanel1);
jPanel1.setLayout(jPanel1Layout);
jPanel1Layout.setHorizontalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(javax.swing.GroupLayout.Alignment.TRAILING,
jPanel1Layout.createSequentialGroup()
.addContainerGap()

.addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLay
out.Alignment.TRAILING)
.addComponent(jPanel4,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel3,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
.addComponent(jPanel2,
javax.swing.GroupLayout.Alignment.LEADING,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
.addContainerGap())
);
jPanel1Layout.setVerticalGroup(

jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignm
ent.LEADING)
.addGroup(jPanel1Layout.createSequentialGroup()
.addContainerGap()
.addComponent(jPanel2,
javax.swing.GroupLayout.PREFERRED_SIZE, 74,
javax.swing.GroupLayout.PREFERRED_SIZE)

SUBMITTED BY:-DEEPSHIKHA VERMA 141


HOTEL BILLING SYSTEM

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel3,
javax.swing.GroupLayout.PREFERRED_SIZE, 237,
javax.swing.GroupLayout.PREFERRED_SIZE)

.addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UN
RELATED)
.addComponent(jPanel4,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
.addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE,
Short.MAX_VALUE))
);

javax.swing.GroupLayout layout = new


javax.swing.GroupLayout(getContentPane());
getContentPane().setLayout(layout);
layout.setHorizontalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)
);
layout.setVerticalGroup(

layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEA
DING)
.addComponent(jPanel1,
javax.swing.GroupLayout.PREFERRED_SIZE,
javax.swing.GroupLayout.DEFAULT_SIZE,
javax.swing.GroupLayout.PREFERRED_SIZE)

SUBMITTED BY:-DEEPSHIKHA VERMA 142


HOTEL BILLING SYSTEM

);

pack();
}// </editor-fold>

private void btnsaveActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
rbill_id=txtrbill_id.getText();
Object dd=cmbdd.getSelectedItem();
Object mm=cmbmm.getSelectedItem();
Object yy=cmbyy.getSelectedItem();
rbill_date=dd+"-"+mm+"-"+yy;
menu_id=txtmenu_id.getText();
menu_name=txtmenu_name.getText();
charge=txtcharge.getText();
tax=txttax.getText();
total=txttotal.getText();
if(!rbill_id.equals(""))
{
try
{
con=connection.connect.conn();
ps=con.prepareStatement("insert into restaurent_bill_details
values(?,?,?,?,?,?,?)");
ps.setString(1,rbill_id);
ps.setString(2,rbill_date);
ps.setString(3,menu_id);
ps.setString(4,menu_name);
ps.setString(5,charge);
ps.setString(6,tax);
ps.setString(7,total);
ps.executeUpdate();
JOptionPane.showMessageDialog(null,"Data has been
inserted successfully");
clear();
}

SUBMITTED BY:-DEEPSHIKHA VERMA 143


HOTEL BILLING SYSTEM

catch(Exception e)
{
e.printStackTrace();
}
}
else
{
JOptionPane.showMessageDialog(null,"Data has not been
inserted!!");
}
}

public void clear()


{
txtrbill_id.setText("");
cmbdd.setSelectedIndex(0);
cmbmm.setSelectedIndex(0);
cmbyy.setSelectedIndex(0);
txtmenu_id.setText("");
txtmenu_name.setText("");
txtcharge.setText("");
txttax.setText("");
txttotal.setText("");
}
private void btndeleteActionPerformed(java.awt.event.ActionEvent
evt) {
// Coding for delete
rbill_id=txtrbill_id.getText();
if(!rbill_id.equals(""))
{
try
{
con=connection.connect.conn();
int ok=3;
if(ok<=3)
{

SUBMITTED BY:-DEEPSHIKHA VERMA 144


HOTEL BILLING SYSTEM

int aa=JOptionPane.showConfirmDialog(null,"DO YOU WANT TO


DELETE RECORDS");
if(aa==JOptionPane.YES_OPTION)
{
ps=con.prepareStatement("delete from guest_details where
guest_id=?");
ps.setString(1,rbill_id);
ps.executeUpdate();

JOptionPane.showMessageDialog(null, "DATA DELETED


SUCCESSFULLY");
clear();
}
else
{
if(aa==JOptionPane.NO_OPTION)
JOptionPane.showMessageDialog(null," DATA NOT DELETED");
}
}
else
{
dispose();
}

}
catch(Exception e)
{
e.printStackTrace();
JOptionPane.showMessageDialog(null,"DATA HAS NOT BEEN
DELETED");
}
}
else

SUBMITTED BY:-DEEPSHIKHA VERMA 145


HOTEL BILLING SYSTEM

JOptionPane.showMessageDialog(null,"Please enter the rbillid for


Delete Record!!");
}
}

private void btnclearActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
clear();
}

private void btncancelActionPerformed(java.awt.event.ActionEvent


evt) {
// TODO add your handling code here:
dispose();
}

public static void main(String args[]) {


java.awt.EventQueue.invokeLater(new Runnable() {
public void run() {
new restaurent_bill_details().setVisible(true);
}
});
}

// Variables declaration - do not modify


private javax.swing.JButton btncancel;
private javax.swing.JButton btnclear;
private javax.swing.JButton btndelete;
private javax.swing.JButton btnsave;
private javax.swing.JComboBox cmbdd;
private javax.swing.JComboBox cmbmm;
private javax.swing.JComboBox cmbyy;
private javax.swing.JLabel jLabel1;
private javax.swing.JLabel jLabel2;
private javax.swing.JLabel jLabel3;
private javax.swing.JLabel jLabel4;

SUBMITTED BY:-DEEPSHIKHA VERMA 146


HOTEL BILLING SYSTEM

private javax.swing.JLabel jLabel5;


private javax.swing.JLabel jLabel6;
private javax.swing.JLabel jLabel7;
private javax.swing.JLabel jLabel8;
private javax.swing.JPanel jPanel1;
private javax.swing.JPanel jPanel2;
private javax.swing.JPanel jPanel3;
private javax.swing.JPanel jPanel4;
private javax.swing.JTextField txtcharge;
private javax.swing.JTextField txtmenu_id;
private javax.swing.JTextField txtmenu_name;
private javax.swing.JTextField txtrbill_id;
private javax.swing.JTextField txttax;
private javax.swing.JTextField txttotal;
// End of variables declaration

SUBMITTED BY:-DEEPSHIKHA VERMA 147


HOTEL BILLING SYSTEM

REPORTS

Guest_bill_Report

package hms;

import java.awt.*;

SUBMITTED BY:-DEEPSHIKHA VERMA 148


HOTEL BILLING SYSTEM

import java.awt.event.*;
import javax.swing.*;
import java.sql.*;
import java.awt.print.*;
public class Guest_bill extends JFrame implements ActionListener
{
Container cp;
PrinterJob pj;
PageFormat pf;
PrintPanel canvas;

JPanel p,t;
JLabel lblempid;
JComboBox cmbemp_id;
JButton btnShow,btnShowAll,btnPrint,btnPgSetup,btnClose;
JTable table;
Connection cn;
ResultSet rs,rst;
ResultSetMetaData rsmd;
Statement st,stt;
int rc,cc,rc1,cc1;
Object[][] cells;
String rdt,wCOND="",columnNames[];
public void connect()
{
try{

DriverManager.registerDriver(new
sun.jdbc.odbc.JdbcOdbcDriver());

cn=DriverManager.getConnection(“jdbc:odbc:hotel”,”billing”,”system")
;

st=cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultS
et.CONCUR_UPDATABLE);

SUBMITTED BY:-DEEPSHIKHA VERMA 149


HOTEL BILLING SYSTEM

rs=st.executeQuery("select * from guest_bill_details");


}catch(Exception e) { }

}
public void grand_total()
{
try
{
String query1="Select sum(gid) from guest_bill_detail where
gid=? group by gid";
st =
cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.
CONCUR_READ_ONLY);
rs = st.executeQuery(query1);
rc1 = 0;
while(rs.next())
rc1++;
rsmd=rs.getMetaData();
cc1=rsmd.getColumnCount();
}catch(Exception e) { }

}
public void openRecord()
{
try{
String query = "SELECT * FROM guest_bill_detail " + wCOND;
st =
cn.createStatement(ResultSet.TYPE_SCROLL_INSENSITIVE,ResultSet.
CONCUR_READ_ONLY);
rs = st.executeQuery(query);
rc = 0;
while(rs.next())
rc++;
rsmd=rs.getMetaData();
cc=rsmd.getColumnCount();
}catch(Exception e) { }
}

SUBMITTED BY:-DEEPSHIKHA VERMA 150


HOTEL BILLING SYSTEM

public void setemp_code()


{
String query = "SELECT gid FROM guest_bill_detail " ;
try{
stt = cn.createStatement
(ResultSet.TYPE_SCROLL_SENSITIVE,ResultSet.CONCUR_READ_ONLY
);
rst = stt.executeQuery(query);
while(rst.next())
cmbemp_id.addItem(rst.getString(1));
rst.close();
stt.close();
}catch(Exception e) { }
}
public void setData()
{
int i,j,k,l;
try
{
for(i=0;i<cc;i++)
columnNames[i]=rsmd.getColumnName(i+1);

i=0;
rs.first();
do{
for(j=0;j<cc;j++)
cells[i][j]=rs.getString(j+1);
i++;
}while(rs.next());

}catch (SQLException e){ }


}
public Guest_bill()
{
setBounds(10,10,780,560);
setTitle("Guest Bill Report ");

SUBMITTED BY:-DEEPSHIKHA VERMA 151


HOTEL BILLING SYSTEM

cp = getContentPane();
setDefaultCloseOperation(WindowConstants.HIDE_ON_CLOSE);
p=new JPanel();
p.setLayout(new GridLayout(0,7));
lblempid = new JLabel("Guest Id : ",SwingConstants.RIGHT);
cmbemp_id = new JComboBox();
btnShow = new JButton("Show"); btnShow.setMnemonic('S');
btnShowAll = new JButton("Show All");
btnShow.setMnemonic('A');
btnPrint = new JButton("Print"); btnPrint.setMnemonic('P');
btnPgSetup = new JButton("Page
setup");btnPgSetup.setMnemonic('G');
btnClose = new JButton("Close");
btnClose.setMnemonic('C');

cmbemp_id.setEditable(false);
btnShow.setActionCommand("Show");
btnShowAll.setActionCommand("Show All");
btnPrint.setActionCommand("Print");
btnPgSetup.setActionCommand("Page Setup");
btnClose.setActionCommand("Close");

btnShow.addActionListener((ActionListener) this);
btnShowAll.addActionListener(this);
btnPrint.addActionListener(this);
btnPgSetup.addActionListener(this);
btnClose.addActionListener(this);

btnShow.setForeground(Color.BLUE);
btnShowAll.setForeground(Color.BLUE);
btnPrint.setForeground(Color.BLUE);
btnPgSetup.setForeground(Color.BLUE);
btnClose.setForeground(Color.BLUE);
lblempid.setForeground(Color.BLUE);
cmbemp_id.setForeground(Color.BLUE);

p.add(lblempid);

SUBMITTED BY:-DEEPSHIKHA VERMA 152


HOTEL BILLING SYSTEM

p.add(cmbemp_id);
p.add(btnShow);
p.add(btnShowAll);
p.add(btnPrint);
p.add(btnPgSetup);
p.add(btnClose);
cp.add(p,"North");
connect();
openRecord();
setemp_code();
t=new JPanel();
canvas = new PrintPanel();
cp.add(canvas, "Center");

}
public void actionPerformed(ActionEvent e)
{
String cmd = e.getActionCommand();
if(cmd.equals("Show"))
{
wCOND = " WHERE gid='" + cmbemp_id.getSelectedItem()+"'";
showGridData();
}
if(cmd.equals("Show All"))
{
wCOND = "";
showGridData();
}
if (cmd.equals("Print"))
{
pj = PrinterJob.getPrinterJob();
if (pf == null)
pf = pj.defaultPage();
pj.setPrintable(canvas, pf);
if (pj.printDialog())
{ try
{ pj.print();

SUBMITTED BY:-DEEPSHIKHA VERMA 153


HOTEL BILLING SYSTEM

}
catch (PrinterException exception)
{ JOptionPane.showMessageDialog(this, exception);
}
}
}

if(cmd.equals("Page Setup"))
{
pj = PrinterJob.getPrinterJob();
if (pf == null)
pf = pj.defaultPage();
pf = pj.pageDialog(pf);
}

if(cmd.equals("Close")){
if (cn != null) {
try{
cn.close();
}catch(Exception zx) {}
}
setVisible(false);
//System.exit(0);
}
}
void showGridData()
{
openRecord();
if(rc==0)
JOptionPane.showMessageDialog(null,"Data not Found.","Guest
Bill Report",JOptionPane.INFORMATION_MESSAGE);
else
{
columnNames=new String[cc];
cells=new Object[rc][cc];
setData();
table = new JTable(cells, columnNames);

SUBMITTED BY:-DEEPSHIKHA VERMA 154


HOTEL BILLING SYSTEM

remove(t);
t=new JPanel();
t.setBorder(BorderFactory.createTitledBorder("Guest_bill_report"
));
t.setLayout(new BorderLayout());
t.add(new JScrollPane(table));
cp.add(t, "Center");
setVisible(true);
}
}
public static void main(String args[])
{
Guest_bill gb=new Guest_bill();
gb.show();
}
class PrintPanel extends JPanel implements Printable
{
@Override
public void paintComponent(Graphics g)
{ super.paintComponent(g);
}

public int print(Graphics g, PageFormat pf, int page) throws


PrinterException
{
if (page >= 1) return Printable.NO_SUCH_PAGE;
Graphics2D g2 = (Graphics2D)g;
g2.setPaint(Color.black);
g2.translate(pf.getImageableX(), pf.getImageableY());
g2.draw(new java.awt.geom.Rectangle2D.Double(0, 0,
pf.getImageableWidth(), pf.getImageableHeight()));
int r=2;
try{
rdt="";
for(int i=0;i<cc;i++)
rdt+=rsmd.getColumnName(1)+ " ";
g.drawString(rdt,10,4);

SUBMITTED BY:-DEEPSHIKHA VERMA 155


HOTEL BILLING SYSTEM

rs.beforeFirst();
while(rs.next())
{
rdt="";
for(int i=0;i<cc;i++)
rdt+=rs.getString(i+1)+ " ";
g.drawString(rdt,10,(++r)*20);
}
}catch (SQLException e){ }
return Printable.PAGE_EXISTS;
}
public PrintPanel(){}
}
}

SUBMITTED BY:-DEEPSHIKHA VERMA 156


HOTEL BILLING SYSTEM

TESTING

SUBMITTED BY:-DEEPSHIKHA VERMA 157


HOTEL BILLING SYSTEM

TESTING

Testing is a process of executing a program with the intent of finding

an error.

 A good test case is one that has high profitability of an as-yet-

undiscovered error.

 A successful test is one that uncovers an as-yet-undiscovered

error.

 Testing presents an interesting anomaly for the software

engineers. If testing is conducted successfully it will uncover

errors in the software. As a secondary benefit testing

demonstrates that software Functions appear to be working

according to specification. Data collected at the time of testing

is a good indication of software reliability and some indication

of software quality as whole.

 As far as proposed software is concerned different types of

testing have been performed such as

 Unit Testing

 Integration Testing

SUBMITTED BY:-DEEPSHIKHA VERMA 158


HOTEL BILLING SYSTEM

 Validation Testing

 Loop Testing

When the individual program modules were working properly, we

combined the module into a working system. This integration is

planned and coordinated so that when an error occurs, we have an

idea of what caused it. Integration is the process of verifying that the

components of the system work together. For testing, the entire

system was viewed as a hierarchy of modules. We began with the

highest level of design and worked down. The next modules to be

tested are those that call the previously tested modules. For example,

variables used for record sets and connections, which are frequently

called across forms from modules ex: function named connect me is

frequently called from modules by MDI form.

 Unit testing: - It is normally performed on individual module.

As each module of the proposed system has been developed,

the modules are being tested. At the times coding there are so

many errors inside the unit modules and it was removed while

testing that particular unit modules. Inside the unit modules,

when the unit modules does not match with our target it will be

placed into Black Box Testing ,while if there is only syntax

SUBMITTED BY:-DEEPSHIKHA VERMA 159


HOTEL BILLING SYSTEM

errors it is just removed and we can place that errors into

White-box errors.

 Integration Testing: - It is performed after unit testing.

Integration testing is a systematic technique for constructing

the program structure while conducting tests to uncover errors

associated with interfacing.

 Program Testing:-In system analysis the system was designed

according to the requirement of the system. The system deals

with a large number of states, complex logics and activities.

So some error might occur in the system. Error may be in software,

which is known as “Software error” I.e. the software doesn’t do what

the requirement says. So an exhaustive and thorough testing has been

conducted to a certain whether the system produces right results.

The guide and user both did testing at the several stages.

The actual output is compared with expected output. Action

buttons Save/Edit/ Find/Show/Print/Ok/ Exit Close are tested.

First each program module was tested as single program which

is also known as Module testing or Unit testing . in unit testing, asset

of data was given as input to the module and output data produces

were observed. In addition, logic and boundary conditions for input

and output data was also checked. The interface between this model

SUBMITTED BY:-DEEPSHIKHA VERMA 160


HOTEL BILLING SYSTEM

and others was also checked for correctness. While collecting the

input data for testing the program module it was kept in mind that

input data must be from the all classes, so the entire condition of the

program could be checked. In the testing, the role of the user is also

very important, since they understand the full range of data and

condition that might occur in the system. So a wide range of data was

collected from the user to test the program thoroughly.

To ensure comprehensive test coverage, the test cases have been

designed to include the following features:

‘Null data’ Cases have been covered

0‘Valid Data ‘ cases have been covered

1‘Boundary Data’ cases have been covered

2Processing logic checks have been covered.

 System Testing:- When the individual program modules were

working properly, we combined the module into a working

system. This integration is planned and coordinated so that

when an error occurs, we have an idea of what caused it.

Integration is the process of verifying that the components of

the system work together. For testing, the entire system was

viewed as a hierarchy of modules. We began with the highest

level of design and worked down. The next modules to be

SUBMITTED BY:-DEEPSHIKHA VERMA 161


HOTEL BILLING SYSTEM

tested are those that call the previously tested modules. For

example, variables used for record sets and connections, which

are frequently called across forms from modules ex: function

named connect me is frequently called from modules by MDI

form.

 Function Testing:-

Once we were sure that information is passed among modules

according to the design prescription we tested the system to

assure whether the function described the requirement

specification were actually performed by the integrated system.

 Acceptance Testing:-

When the function test was completed, we involved the user to

make sure that the system worked according to user’s

expectation. Thus the user did the final acceptance test.

 nstallation Testing :-

When acceptance test was completed, the acceptance system

was installed in the environment in which it would be used and

a final installation test was performed to make sure that the

system function as it should.

SUBMITTED BY:-DEEPSHIKHA VERMA 162


HOTEL BILLING SYSTEM

ERRORS WHILE TESTING THE SOFTWARE PACKAGE

During the development of this software package, I have tested it and

found a lot of errors during development. Errors, which are come as

follows with their solution -

When I press on this ok button .the related line the returned into

light yellow and cursor set on the particular place where list

separator are required. I followed the problem and debug it

successfully.

When I press on the debug command the related line turned into

yellow color. When I check minutely and found object is not open in

the form load area.

SUBMITTED BY:-DEEPSHIKHA VERMA 163


HOTEL BILLING SYSTEM

PERT CHART & GANTT CHART

PERT CHART:

Program Evaluation Review Technique, PERT can be both a cost

and a time management system. PERT is organized by events and

activities or tasks. PERT has several advantages over bar charts and is

likely to be used with more complex projects. One advantage of PERT

is that it is scheduling device that also shows graphically which tasks

must be completed before others are begun.

Also, by displaying the various task paths, PERT enables the

calculation of a critical path. Each path consists of combinations of

tasks, which must be completed.

PERT CHART
I/O DESIGN
START

INTEGRATION AND
TESTING

ANALYSIS

CODING
FINISH

WRITE
SUBMITTED BY:-DEEPSHIKHA VERMA 164
MANUAL
HOTEL BILLING SYSTEM

GANTT CHART (BAR CHART):

A Bar Chart is perhaps the simplest form of formal project

management. The bar chart is also known as Gantt Chart. It is used

almost exclusively for scheduling purposes and therefore controls

only the time of projects.

Gantt Charts are a project control technique that can be used

for several purposes, including scheduling, budgeting and resource

planning. A Gantt Chart is a Bar Chart, with each bar representing an

activity.

GANTT CHART

OCT 15,11 NOV 15,11 NOV 20,11 DEC 10,11 DEC 12,11

START

ANALYSIS

I /O DESIGN

CODING

WRITE MANUAL

SUBMITTED BY:-DEEPSHIKHA VERMA 165


HOTEL BILLING SYSTEM

LIMITATION OF THE PROJECT

There is always room for improvements and modifications in a

project. The application HOTEL BILLING SYSTEM may also suffer

from the following limitations.

 Knowledge of MS WINDOWS NT, MS WINDOWS XP, Oracle 10g

and Java is essential.

 Through training of using this system is required.

 Occasional long power failure may disturb the system.

 This project as any other project may suffer from mishandling

by the users in some cases.

SUBMITTED BY:-DEEPSHIKHA VERMA 166


HOTEL BILLING SYSTEM

FUTURE SCOPE OF THE PROJECT

The development of this software has been done keeping in mind the

future scope of this application. I find that it has good prospects in

the future also. I find it is getting solved the work of the HOTEL

WINDSOR,PATNA. After development of this software, I can say that

the complete work of Hotel would be under control and easier to

handle. Keeping in mind the needs of the Hotel, which may crop up in

the near future, I have tried and introduced certain features, which

may be required by the Hotel, and so at that time implementation can

be done without any problems. Right now I have developed this

software keeping in mind just of The Hotel Windsor, but this job can

be done countrywide. It will run successfully, it can be distributed to

other Hotels too.

Future Scope of this project regarding

 Modifiability: -This project may be modified in future because

the on going developing projects is developing with bottom-up

approach, it means it will develop using unit, and each unit will be

integrated then it will be become sub-module and after integration of

sub-module the main module will completed. So, it will easier task to

develop the project in future.

SUBMITTED BY:-DEEPSHIKHA VERMA 167


HOTEL BILLING SYSTEM

BIBLIOGRAPHY

1. PL/SQL PROGRAMMING BY IVAN BAYROSE

2. COMPLETE REFERENCEOF ORACLE 10g BY ORACLE PRESS

3. CORE-JAVA PROGRAMMING By BALAGURUSWAMI

4. JAVA HOW TO PROGRAM By DEITEL & DEITEL

5. OFFICE 2000 BY NELSON

6. SYSTEM ANALYSIS AND DESIGN BY AWARD

7. SOFTWARE ENGINEERING BY PRESSMANN

SUBMITTED BY:-DEEPSHIKHA VERMA 168

You might also like