Okjk
Okjk
[Document subtitle]
nia Public Sc
rde ho
ol
Ga
Hotel
Management
System
Index
S.no Content Page no.
1) Certificate 4
2) Acknowledgement 5
3) Introduction 6
4) Source Code 8
5) Output Window 11
6) Bibliography 14
CERTIFICATE
This is to certify that Ujjwal Pratap Singh of
class XII (Science) of Gardenia Public School
has done his/her project on <Project name > un-
der my supervision. He / She has taken interest
and has shown at most sincerity in completion of
this project. I certify this Project up to my expec-
tation & as per guidelines issued by CBSE, NEW
DELHI.
Internal Examiner
External Examiner
Acknowledgement
It is with pleasure that I acknowledge my sincere gratitude
to our teacher, Govind Singh Rathore who taught
and undertook the responsibility of teaching the subject
computer science. I have been greatly benefited from
his/her classes.
My sincere thanks goes to our Principal Mrs. Avneet Kaur
who has always been a source of encouragement and sup-
port and without whose inspiration, this project would not
have been a successful.
Finally, I would like to express my sincere appreciation for
all the other students for my batch their friendship & the
fine times that we all shared together.
Last but not least ,I would like to thank all those who had
helped directly or indirectly towards the completion of this
project.
Class – 12th B
Introduction
Hotel management project in python is a simple con-
sole application built without the use of graphics.
This project helps in managing the record of any Ho-
tel. In this project we tried to enter all details of any
person who checked in any hotel like name, mobile,
email, city and address etc. And tried to maintain all
the possibility which may help the user to enter more
record user requires.
Some of the features of the program are:
1) User can enter records of any Person at check in.
2) User can get all records of all client who visit any
hotel.
3) User can get record of any specific client who ever
visit any hotel.
4) User can check out any client.
5) User can check all entries of present client and
checked out client.
Source Code
from datetime import datetime
import mysql.connector
mydb=mysql.connector.connect(host="lo-
calhost",user="root",password="123456", database="ho-
tel")
def chkin():
mycursor=mydb.cursor()
y="y"
while y=="y":
nm=input("Enter name:")
adhaar=input("Enter Adhaar No.:")
now = datetime.now()
chkin= now
mycursor.execute("insert into
in_out(name,adhar,checkin_date,chkin_time,status) val-
ues('{}','{}','{}','{}',1)".format(nm,ad-
haar,chkin,chkin))
mydb.commit()
print(mycursor.rowcount,"Record Inserted")
y=input("Do you want to insert more data:")
main()
def chkind():
mycursor=mydb.cursor()
for i in myrecords:
print(i[1],'\t\t',i[3],'\t\t',i[5])
print("Total number of rows retrieved",mycur-
sor.rowcount)
main()
def chkoutd():
mycursor=mydb.cursor()
for i in myrecords:
print(i[1],'\t\t',i[4],'\t\t',i[6])
print("Total number of rows retrieved",mycur-
sor.rowcount)
main()
def chkout():
mycursor=mydb.cursor()
nm=input("Enter name:")
now = datetime.now()
chkout= now
mycursor.execute("update in_out set check-
out_date='{}',chkout_time='{}',status=0 where
name='{}'".format(chkout,chkout,nm))
mydb.commit()
print("Total number of rows affected",mycur-
sor.rowcount)
main()
def search():
mycursor=mydb.cursor()
nm=input("Enter name:")
mycursor.execute("select * from in_out where
name='{}'".format(nm))
myrecords=mycursor.fetchall()
for i in myrecords:
print(i[1],'\t',i[2],'\t',i[3],'\t',i[4],'\t',i[5],'\t
',i[6])
print("Total number of rows retrieved",mycur-
sor.rowcount)
main()
def full_search():
mycursor=mydb.cursor()
mycursor.execute("Select * from in_out")
myrecords=mycursor.fetchall()
for i in myrecords:
print(i[1],'\t',i[2],'\t',i[3],'\t',i[4],'\t',i[5],'\t
',i[6])
print("Total number of rows retrieved",mycur-
sor.rowcount)
main()
def main():
print("Main menu-Hotel Management System")
print("1. Check In: \t 2. Check Out:\n 3. All
Check In detail: \
\t 4. All Check Out detail: \n 5. Search any one \t 6.
Full record")
ch=int(input("Enter your Choice:"))
if ch==1:
chkin()
elif ch==2:
chkout()
elif ch==3:
chkind()
elif ch==4:
chkoutd()
elif ch==5:
search()
elif ch==6:
full_search()
else:
print("Enter correct choice")
main()
main()
Output:
Main menu:
Table used
Bibliography
Book Name
Preeti Arora
Website
http://python.mykvs.in/index.php
https://www.google.co.in/
THANK
YOU