Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 42

HOTEL CONNISSEUR

A CONTEMPORARY HOTEL

DONE BY:
- Milan Mishra and Raed Siddiqui

CERTIFICATE
This is to certify that Raed Siddiqui
Of Chrysalis High, Kadugodi, Bangalore has successfully completed project
towards partial completion of the practical examination of AISSCE 2021-2022
as prescribed by CBSE.

Signature of Signature of
Internal Examiner External Examiner

PRINCIPAL

CONTENTS
1. Acknowledgement
2. Introduction
3. System Requirements
4. Modules and Packages
5. Coding
6. Screenshots
7. Limitations
8. Bibliography

ACKNOWLEDGEMENT
We are over helmed in all humbleness and gratefulness to acknowledge our
depth to all those who have helped us to put these ideas, well above the level of
simplicity and into something concrete.
We would like to express our deep and sincere gratitude to our principal, Lalitha
Ganapathy, and our computer science teacher Supriya NS, who gave us the
golden opportunity to work on this wonderful project based on Python and
MySQL.
We would also like to thank our parents and friends who have given their
continuous support and time to help us in the completion of the project on time.

\
INTRODUCTION
Who doesn’t want everything at the ease of just a few clicks without moving
from your comfort zone? That’s exactly what our hotel management code
offers. From booking rooms to ordering food to making necessary payments,
everything is included in this code.
This python code is specially designed to help the hotel staff by maintaining and
managing records of customers as well as rooms in the hotel. A customer can
book a room in advance or at the spot as well. This code also offers a record of
the check in and check out dates as well as past transactions made. In terms of
security the database has been encrypted so as to ensure no files have been
stolen/grieved/corrupted maintaining a friendly user interface environment.
Rooms such as diamond, platinum, gold and silver packages are also available
along with curated offers followed by reasonable prices. For room service a
specially curated menu has also been prepared. On check out after payment a
bill of all transactions, details etc will also be issued.
WHY WE CHOSE THIS IDEA?
Due to the crucial time going on many businesses are suffering. COVID 19 not
only has affected businesses but also shut some of them down due to
lockdowns. The one which has been affected the most are travel and hotel
sectors. Due to covid fear many people don’t opt for hotels even though all
safety covid protocols are being followed. Some do not even know the
availability of hotels due to misinformation on the internet. Many people when
going to hotels sometimes aren’t able to book rooms either due to pricing
problems or any other issue. Even when in the hotel the problems aren’t sorted
since some do not prefer going to the restaurants instead having it in their
leisure and comfort in their rooms.
Which is why we chose this idea as it gives a much easier way to handle such
issues as booking can be done through this code as well as allotment of rooms
depending on the availability. We don’t provide just rooms but also great offers
along with it depending on the type chosen with reasonable prices. This code
also offers an organised record of the past payments as well as other necessary
details required. This code is just to create an awareness that such hard issues
like room service, booking rooms and payments can be compressed into a
simple python code.
SYSTEM REQUIREMENTS
Software used to run the project:
1. Windows 7.0

2. .Pyscripter

3. Front end
 Tkinter
 Python

4. Back end
 Structured Query Language (SQL)

Hardware used to run the project:


1. 2Ghz Dual Core Processor
2. 2GB RAM
3. 250 GB HDD
4. Monitor with VGA of 1024x768 Screen Resolution
PYTHON
Python is an interpreted high level programming language. Its design
philosophy emphasizes code readability with its use of significant indentation. It
was invented by Guido Van Rossum in 1991as Python 0.9.0.
Its language constructs as well as its object oriented approach aim to help
programmers write clear, logical code for small as well as large scale projects.

FEATURES OF PYTHON
Easy to code
Python is a high-level programming language.

Integrated
 Directly runs the program from the source code.
 Internally, Python converts the source code into an intermediate form called
bytecodes which is then translated into the native language of the specific
computer to run it.

Platform Independent
Python programs can be developed and executed on multiple operating
system platforms.

Free and Open Source

Redistributable

High-level Language
In Python, no need to take care of low-level details such as managing the
memory used by the program.

Robust
Exceptional handling features.
Memory management techniques inbuilt.

Rich Library Support


The Python Standard Library is very vast.
Besides the standard library, there are various other high-quality libraries
such as the Python Imaging Library which is an amazingly simple image
manipulation library.

The above features of python helped us use this language to implement our idea.
DESIGNING
MODULES AND PACKAGES
 Login
 Booking rooms
 Room packages/pricing
 Room service
 Payment
 Record

LOGIN MODULE
Requires user name and password. A list of usernames and password has been
saved in sql if recognised will be allowed in the next page else it will give an
error.

BOOKING ROOMS MODULE


Provides necessary information and details to our customers while booking a
room. Check in and check out dates, address, phone number and name are the
necessary information to be given by the user toe ensure a well maintained
record. On completing the booking the customer receives his room number as
well as a customer id which is very important to avail room service.

ROOM PACKAGES/INFORMATION/PRICING MODULE


This feature allows the customer to explore through the specially curated offers
the hotel can provide along with all the information needed about the type of
package he/she is choosing. One can also view the pricings for all the packages
and select the package that best fits them as per their convenience.

ROOM SERVICE MODULE


This requires the customer id to access. On entering the customer id, it takes
you to a specially curated menu from which the customer can order as per their
desire. All the pricings will be added to the final payment as well as the bill.
PAYMENT MODULE
This feature provides 4 payment methods- credit/debit card, UPI, paytm as well
as cash. After the payment is successful the customer receives the bill of all the
expenditures done in the hotel.
RECORD MODULE
Provides an organised record of check in and check out dates, phone number,
total amount paid as well room chosen. The record can be updated as per the
administrator.
DATABASE-STRUCTURED
QUERY LANGUAGE(SQL)
MySQL is an open source relational database management system. A
relational database organizes data into one or more data tables in
which data types may be related to each other; these relations help
structure the data. SQL is a language programmers use to create,
modify and extract data from the relational database as well as control
user access to the database.MySQL was developed by San Jose in a
IBM research laboratory .
FEATURES OF SQL
 SECURITY
Its databases are secured and password protected ensuring safety and
security.
 CONNECTIVITY
Various APIs are developed to connect it with many programming
languages.
 PORTABILITY
Small enough in size to install and run on any type of Hardware and OS
like Linus, MS Windows or Mac, etc.
 QUERY LANGUAGE
It supports SQL ( Structured Query Language) to manage databases.
 ADDITIONAL FEATURES
1. Highly efficient
2. Platform Independent
3. Its quick ad reliable
4. It can support large databases with upto 5,000,000,000 rows,
200,000 tables and could contain about 40-50 million records.
5. Supports relational databases
6. Supports SQL cursors
7. Python programs are portable
SOURCE CODE
CREATING TABLES:

CREATE TABLE receipts (


Name VARCHAR(50),
PhoneNo BIGINT,
Checkin DATE,
Checkout BIGINT,
Room_charges BIGINT,
Restaurant_charges BIGINT,
);

CREATE TABLE records(


Name VARCHAR(50),
PhoneNo BIGINT,
Address VARCHAR(50),
Checkin DATE,
Checkout BIGINT,
Room_type VARCHAR(10),
Price BIGINT,
);

CREATE TABLE Room_type(


Package VARCHAR(10),
Price BIGINT,
);
PYTHON CODE:
import random
import datetime

# importing SQL to Python


import mysql.connector as sql
conn=sql.connect(host=’local host’, user=’root’, password=’123Milan@’,
database=’hc’)
c1=conn.cursor()

# Global List Declaration


conn.connect
name = []
phno = []
add = []
checkin = []
checkout = []
room = []
price = []
rc = []
p = []
roomno = []
custid = []
day = []

# Global Variable Declaration

i=0

# Home Function
def Home():

print("\t\t\t\t\t\t WELCOME TO HOTEL CONNISSEUR\n")


print("\t\t\t 1 Booking\n")
print("\t\t\t 2 Rooms Type\n")
print("\t\t\t 3 Room Service(Menu Card)\n")
print("\t\t\t 4 Payment\n")
print("\t\t\t 5 Record\n")
print("\t\t\t 0 Exit\n")

ch=int(input("->"))

if ch == 1:
print(" ")
Booking()

elif ch == 2:
print(" ")
Membership_Info()
elif ch == 3:
print(" ")
restaurant()

elif ch == 4:
print(" ")
Payment()

elif ch == 5:
print(" ")
Record()

else:
exit()

# Function used in booking

def date(c):

if c[2] >= 2019 and c[2] <= 2022:

if c[1] != 0 and c[1] <= 12:

if c[1] == 2 and c[0] != 0 and c[0] <= 31:

if c[2]%4 == 0 and c[0] <= 29:


pass
elif c[0]<29:
pass

else:
print("Invalid date\n")
name.pop(i)
phno.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()

# if month is odd & less than equal


# to 7th month
elif c[1] <= 7 and c[1]%2 != 0 and c[0] <= 31:
pass

# if month is even & less than equal to 7th


# month and not 2nd month
elif c[1] <= 7 and c[1]%2 == 0 and c[0] <= 30 and c[1] != 2:
pass

# if month is even & greater than equal


# to 8th month
elif c[1] >= 8 and c[1]%2 == 0 and c[0] <= 31:
pass
# if month is odd & greater than equal
# to 8th month
elif c[1]>=8 and c[1]%2!=0 and c[0]<=30:
pass

else:
print("Invalid date\n")
name.pop(i)
phno.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()

else:
print("Invalid date\n")
name.pop(i)
phno.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()

else:
print("Invalid date\n")
name.pop(i)
phno.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()

# Booking function
def Booking():

# used global keyword to


# use global variable 'i'
global i
print(" BOOKING ROOMS")
print(" ")

while 1:
n = str(input("Name: "))
p1 = str(input("Phone No.: "))
a = str(input("Address: "))

# checks if any field is not empty


if n!="" and p1!="" and a!="":
name.append(n)
add.append(a)
break

else:
print("\tName, Phone no. & Address cannot be
empty..!!")

cii=str(input("Check-In: "))
checkin.append(cii)
cii=cii.split('/')
ci=cii
ci[0]=int(ci[0])
ci[1]=int(ci[1])
ci[2]=int(ci[2])
date(ci)

coo=str(input("Check-Out: "))
checkout.append(coo)
coo=coo.split('/')
co=coo
co[0]=int(co[0])
co[1]=int(co[1])
co[2]=int(co[2])

# checks if check-out date falls after


# check-in date
if co[1]<ci[1] and co[2]<ci[2]:

print("\n\tErr..!!\n\tCheck-Out date must fall after Check-In\


n")
name.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()
elif co[1]==ci[1] and co[2]>=ci[2] and co[0]<=ci[0]:

print("\n\tErr..!!\n\tCheck-Out date must fall after Check-In\


n")
name.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()
else:
pass

date(co)
d1 = datetime.datetime(ci[2],ci[1],ci[0])
d2 = datetime.datetime(co[2],co[1],co[0])
d = (d2-d1).days
day.append(d)

print("----SELECT ROOM TYPE----")


print(" 1. Silver")
print(" 2. Gold")
print(" 3. Platinum")
print(" 4. Diamond")
print(("\t\tPress 0 for Room Prices"))
ch=int(input("->"))

# if-conditions to display alloted room


# type and it's price
if ch==0:
print(" 1. Silver - Rs. 20000")
print(" 2. Gold - Rs. 80000")
print(" 3. Platinum - Rs. 175000")
print(" 4. Diamond - Rs. 325000")
ch=int(input("->"))
if ch==1:
room.append('Silver')
print("Room Type- Silver")
price.append(20000)
print("Price- 20000")
elif ch==2:
room.append('Gold')
print("Room Type- Gold")
price.append(80000)
print("Price- 80000")
elif ch==3:
room.append('Platinum')
print("Room Type- Platinum")
price.append(175000)
print("Price- 175000")
elif ch==4:
room.append('Diamond')
print("Room Type- Diamond")
price.append(325000)
print("Price- 325000")
else:
print(" Wrong choice..!!")

# randomly generating room no. and customer


# id for customer
rn = random.randrange(40)+300
cid = random.randrange(40)+10

# checks if alloted room no. & customer


# id already not alloted
while rn in roomno or cid in custid:
rn = random.randrange(60)+300
cid = random.randrange(60)+10

rc.append(0)
p.append(0)

if p1 not in phno:
phno.append(p1)
elif p1 in phno:
for n in range(0,i):
if p1== phno[n]:
if p[n]==1:
phno.append(p1)
elif p1 in phno:
for n in range(0,i):
if p1== phno[n]:
if p[n]==0:
print("\tPhone no. already exists and
payment yet not done..!!")
name.pop(i)
add.pop(i)
checkin.pop(i)
checkout.pop(i)
Booking()
print("")
print("\t\t\t***ROOM BOOKED SUCCESSFULLY***\n")
print("Room No. - ",rn)
print("Customer Id - ",cid)
roomno.append(rn)
custid.append(cid)
i=i+1
n=int(input("0-BACK\n ->"))
if n==0:
Home()
else:
exit()

# ROOMS INFO
def Membership_Info():
print(" ------ MEMBERSHIP INFO ------")
print("")
print("SILVER")
print("---------------------------------------------------------------")
print("Room amenities include: 1 Double Bed, Television, Free WiFi,")
print("Double-Door Cupboard, 1 Coffee table with 2 sofa, Balcony and")
print("an attached washroom with hot/cold water. complimentary
breakfast on your first day.\n")
print("GOLD")
print("---------------------------------------------------------------")
print("Room amenities include: 2 Double Bed, Television, Telephone,
Free WiFi")
print("Double-Door Cupboard, 1 Coffee table with 2 sofa, Balcony and")
print("an attached washroom with hot/cold water + Window/Split
AC.20% off on dinner and complimentary desserts.\n")
print("PLATINUM")
print("---------------------------------------------------------------")
print("Room amenities include: 2 Double Bed + 1 Single Bed,
Television,")
print("Telephone, a Triple-Door Cupboard, 1 Coffee table with 2 sofa,
1")
print("Side table, Balcony with an Accent table with 2 Chair and an")
print("attached washroom with hot/cold water.40% off on lunch and
dinner buffet as well as a specially curated complimentary menu.\n")
print("DIAMOND")
print("---------------------------------------------------------------")
print("Room amenities include: 2 Double Bed + 2 Single Bed,
Television,")
print("Telephone, a Triple-Door Cupboard, 1 Coffee table with 2 sofa, ")
print("1 Side table, Balcony with an Accent table with 2 Chair and an")
print("attached washroom with hot/cold water + Window/Split AC. 50%
off on dinner and lunch as well as complimentry drinks and a specially curated
menu at your favourite restaurant.\n\n")
print()
n=int(input("0-BACK\n ->"))
if n==0:
Home()
else:
exit()

# RESTAURANT FUNCTION
def restaurant():
ph=int(input("Customer Id: "))
global i
f=0
r=0
for n in range(0,i):
if custid[n]==ph and p[n]==0:
f=1

print("-------------------------------------------------------------------------")
print(" Hotel
Connisseur")

print("-------------------------------------------------------------------------")
print(" Menu Card")

print("-------------------------------------------------------------------------")
print("\n BEVARAGES
26 Dal Fry................ 140.00")
print("---------------------------------- 27 Dal
Makhani............ 150.00")
print(" 1 Regular Tea............. 20.00 28 Dal
Tadka.............. 150.00")
print(" 2 Masala Tea.............. 25.00")
print(" 3 Coffee.................. 25.00 ROTI")
print(" 4 Cold Drink.............. 25.00
----------------------------------")
print(" 5 Bread Butter............ 30.00 29 Plain Roti..............
15.00")
print(" 6 Bread Jam............... 30.00 30 Butter
Roti............. 15.00")
print(" 7 Veg. Sandwich........... 50.00 31 Tandoori
Roti........... 20.00")
print(" 8 Veg. Toast Sandwich..... 50.00 32 Butter
Naan............. 20.00")
print(" 9 Cheese Toast Sandwich... 70.00")
print(" 10 Grilled Sandwich........ 70.00 RICE")
print("
----------------------------------")
print(" SOUPS
33 Plain Rice.............. 90.00")
print("---------------------------------- 34 Jeera
Rice.............. 90.00")
print(" 11 Tomato Soup............ 110.00 35 Veg
Pulao.............. 110.00")
print(" 12 Hot & Sour............. 110.00 36 Peas
Pulao............. 110.00")
print(" 13 Veg. Noodle Soup....... 110.00")
print(" 14 Sweet Corn............. 110.00 SOUTH INDIAN")
print(" 15 Veg. Munchow........... 110.00
----------------------------------")
print("
37 Plain Dosa............. 100.00")
print(" MAIN COURSE 38
Onion Dosa............. 110.00")
print("---------------------------------- 39 Masala
Dosa............ 130.00")
print(" 16 Shahi Paneer........... 110.00 40 Paneer
Dosa............ 130.00")
print(" 17 Kadai Paneer........... 110.00 41 Rice Idli..............
130.00")
print(" 18 Handi Paneer........... 120.00 42 Sambhar
Vada........... 140.00")
print(" 19 Palak Paneer........... 120.00")
print(" 20 Chilli Paneer.......... 140.00 ICE CREAM")
print(" 21 Matar Mushroom......... 140.00
----------------------------------")
print(" 22 Mix Veg................ 140.00 43 Vanilla.................
60.00")
print(" 23 Jeera Aloo............. 140.00 44
Strawberry.............. 60.00")
print(" 24 Malai Kofta............ 140.00 45
Pineapple............... 60.00")
print(" 25 Aloo Matar............. 140.00 46 Butter
Scotch........... 60.00")
print("Press 0 -to end ")
ch=1
while(ch!=0):

ch=int(input(" -> "))


# if-elif-conditions to assign item
# prices listed in menu card
if ch==1 or ch==31 or ch==32:
rs=20
r=r+rs
elif ch<=4 and ch>=2:
rs=25
r=r+rs
elif ch<=6 and ch>=5:
rs=30
r=r+rs
elif ch<=8 and ch>=7:
rs=50
r=r+rs
elif ch<=10 and ch>=9:
rs=70
r=r+rs
elif (ch<=17 and ch>=11) or ch==35 or ch==36 or
ch==38:
rs=110
r=r+rs
elif ch<=19 and ch>=18:
rs=120
r=r+rs
elif (ch<=26 and ch>=20) or ch==42:
rs=140
r=r+rs
elif ch<=28 and ch>=27:
rs=150
r=r+rs
elif ch<=30 and ch>=29:
rs=15
r=r+rs
elif ch==33 or ch==34:
rs=90
r=r+rs
elif ch==37:
rs=100
r=r+rs
elif ch<=41 and ch>=39:
rs=130
r=r+rs
elif ch<=46 and ch>=43:
rs=60
r=r+rs
elif ch==0:
pass
else:
print("Wrong Choice..!!")
print("Total Bill: ",r)

# updates restaurant charges and then


# appends in 'rc' list
r=r+rc.pop(n)
rc.append(r)
else:
pass
if f == 0:
print("Invalid Customer Id")
n=int(input("0-BACK\n ->"))
if n==0:
Home()
else:
exit()

# PAYMENT FUNCTION
def Payment():

ph=str(input("Phone Number: "))


global i
f=0

for n in range(0,i):
if ph==phno[n] :

# checks if payment is
# not already done
if p[n]==0:
f=1
print(" Payment")
print(" --------------------------------")
print(" MODE OF PAYMENT")
print(" 1- Credit/Debit Card")
print(" 2- Paytm/PhonePe")
print(" 3- Using UPI")
print(" 4- Cash")
x=int(input("-> "))
print("\n Amount: ",(price[n]*day[n])+rc[n])
print("\n Pay For Connisseur")
print(" (y/n)")
ch=str(input("->"))

if ch=='y' or ch=='Y':
print("\n\n --------------------------------")
print(" Hotel Connisseur")
print(" --------------------------------")
print(" Bill")
print(" --------------------------------")
print(" Name: ",name[n],"\t\n Phone No.:
",phno[n],"\t\n Address: ",add[n],"\t")
print("\n Check-In: ",checkin[n],"\t\n Check-
Out: ",checkout[n],"\t")
print("\n Room Type: ",room[n],"\t\n Room
Charges: ",price[n]*day[n],"\t")
print(" Restaurant Charges: \t",rc[n])
print(" --------------------------------")
print("\n Total Amount: ",(price[n]*day[n])
+rc[n],"\t")
print(" --------------------------------")
print(" Thank You")
print(" Hope you enjoyed your stay
:)")
print(" --------------------------------\n")
p.pop(n)
p.insert(n,1)

# pops room no. and customer id from list and


# later assigns zero at same position
roomno.pop(n)
custid.pop(n)
roomno.insert(n,0)
custid.insert(n,0)

else:

for j in range(n+1,i):
if ph==phno[j] :
if p[j]==0:
pass

else:
f=1
print("\n\tPayment has been
Made :)\n\n")
if f==0:
print("Invalid Customer Id")

n = int(input("0-BACK\n ->"))
if n == 0:
Home()
else:
exit()

# RECORD FUNCTION
def Record():

# checks if any record exists or not


if phno!=[]:
print(" *** HOTEL RECORD ***\n")
print("| Name | Phone No. | Address | Check-In | Check-
Out | Room Type | Price |")

print("----------------------------------------------------------------------------------------
------------------------------")

for n in range(0,i):
print("|",name[n],"\t |",phno[n],"\t|",add[n],"\t|",checkin[n],"\
t|",checkout[n],"\t|",room[n],"\t|",price[n])

print("----------------------------------------------------------------------------------------
------------------------------")

else:
print("No Records Found")
n = int(input("0-BACK\n ->"))
if n == 0:
Home()
else:
exit()

# Driver Code
Home()
OUTPUT AND
SCREENSHOTS
LIMITATIONS
1. Does not use an actual bank system for payments or
transactions.
2. Does not remove information for a deleted account.
BIBLIOGRAPHY
1. https://en.wikipedia.org/wiki/Python_(programming_language)
2. https://en.wikipedia.org/wiki/MySQL
3. https://www.youtube.com/watch?v=LAP9-vu-KgU&t=238s
4. https://www.youtube.com/watch?v=zbMHLJ0dY4w&t=589s
5. https://www.youtube.com/watch?v=WmGgxTpGs_8
6. Sumita Arora class 12 computer science textbook

You might also like