Sei sulla pagina 1di 22

KENDRIYA VIDYALAYA

ANDREWS GANJ

PROJECT ON HOTEL
MANAGEMENT

PROJECT PREPARED BY:


Himanshu Maithani
Class - XII ‘A’
Roll No.-
Session: 2019-2020
Kendriya Vidyalaya Andrews Ganj School

TABLE OF CONTENTS

Certificate

Acknowledgement

Requirements

Header files and their purpose

General directions

Functions and their purpose

Modules used

Source code

Output

Limitations

Bibliography
Acknowledgement

I thank my Computer Science teacher Mrs.


Pooja mam for guidance and support and my
friends for their valuable inputs and advices
through the course of the project. I would also
like to thank my parents for encouraging me
during the course of this project. Finally I would
like to thank CBSE for giving me this
opportunity to undertake this project.
Certificate

This is to certify that Himanshu Maithani of


class XII, Kendriya Vidyalaya Andrews Ganj School,
New Delhi, Delhi has successfully completed his
project in Computer Science as prescribed by CBSE
in the year 2019-2020.

Date: 21/12/2019

Registration No. :

Signature of Internal Signature of External


Examiner Examiner

__________________ __________________
HEADER FILES AND THEIR
PURPOSE

A header file is generally used to define all of


the functions, variables and constants
contained in any function library that you might
want to use.
GENERAL DIRECTIONS
This project is a front end interactive programme
for the customers of a hotel .It is a very easy to
use programme with little functionality and it
uses Tkinter to make a GUI application.
It is directed for small hotels for keeping track of
the customers .Logging customers on the the
hotel server. Hand written records are hard to
make and keep so this has the potential to help
them.
FUNCTIONS AND THEIR
PURPOSE
1. Ttk - The ttk module provides access to the Tk
themed widget set
2. Tkraise - Raise this widget in the stacking
order.
3. Tkstringvar - StringVar, it's either an ASCII
string or a Unicode string, depending on the
contents.
4. Tkentry - The Entry widget is used to accept
single-line text strings from a user.
5. Get - Returns the entry's current text as a string.
6. Popupmsg - A pop-up is a graphical user
interface (GUI) display area, usually a small
window, which suddenly appears ("pops up") in
the foreground of the visual interface.
7. Geometry - Tkinter provides various universal
method one of them is geometry() method. This
method is used to set the dimensions of
the Tkinter window as well as it is used to set the
position of the main window on the users desktop.
8. Pack - The Pack geometry
manager packs widgets in rows or columns. We
can use options like fill, expand, and side to
control this geometry manager.
9. Button - Creation of Button using tk themed
widget (tkinter.ttk). This will give you the effects
of modern graphics.
10. Grid_rowconfigure - Configure row INDEX
of a grid.
11. Grid_columnconfigure - Configure column
INDEX of a grid.
MODULES USED
 Tkinter - Python offers multiple options for developing
GUI (Graphical User Interface). Out of all the GUI
methods, tkinter is most commonly used method.
 Sys - The sys module provides information about
constants, functions and methods of
the Python interpreter. Dir (system) gives a summary
of the available constants, functions and methods.
Another possibility is the help() function. Using
help(sys) provides valuable detail information.

CODING
#HOTEL MANAGEMENT SYSTEM USING GUI

'''
File name: Hotel Management System
GUI.py
Author: Himanshu Maithani
Date created: 21/12/2019
Date last modified: 21/12/2019
Python Version: 3.7
'''

"""Program for the most initial requirement at any hotel.


To log in to the server to use the services provided by the
hotel
like internet services , telephone etc
"""

"""Specified fonts for different use throughout the program


1. Headers
2. Messages
#.Information
"""

import tkinter as tk
from tkinter import ttk
import sys

LARGE_FONT=("Verdana",18)
SMALL_FONT=("Verdana",14)
SMALLER_FONT=("Verdana",10)

Details={'a':"a",'b':"b"}
#Update dictionary using insert method
#len(Details)

def insert(UsernameR,PasswordR,EmailR,PhoneR):
#print("Insert Works")
#Fields cannot be left empty by user.
if(len(UsernameR.get())==0 or len(PasswordR.get())==0
or len(EmailR.get())==0 or len(PhoneR.get())==0):
popupmsg("Fields cannot be Empty","Fill All
Fields","OK")
sys.exit(1)
else:
if UsernameR.get() not in Details:
Details[UsernameR.get()]=PasswordR.get() #Add to
dictionary with Username as Key and Password as value
print(Details)
ResetReg(UsernameR,EmailR,PhoneR,PasswordR)
#Clearing Out Fields

"""username and password of user for booking with empty


input boxes
using tkinter GUI and message at the end"""

def CheckCred(Username,Password):
#print("CheckCred Works")
if(len(Username.get())==0 or len(Password.get())==0):
popupmsg("Invalid Credentials","Invalid Login","Try
Again")

else:
if Username.get() in Details:
#print("Inside")
r=tk.Tk()
r.geometry('500x500')
r.wm_title("Successfully Logged In")
rlbl=tk.Label(r,text="Welcome to
Booking.com",font=LARGE_FONT)
rlbl.pack(pady=20,padx=20)
rlbl1=tk.Label(r,text="Username:
"+Username.get(),font=SMALL_FONT)
rlbl1.pack(pady=10,padx=10)

rlbl2=tk.Label(r,text=
"You have Successfully Logged in.\n Book
affordable and comfortable rooms. :)",
font=SMALLER_FONT)
rlbl2.pack(pady=10,padx=10)

r.mainloop()
else:
Reset(Username,Password)
popupmsg("Invalid Credentials","Invalid Login","Try
Again")

def popupmsg(msg,heading,buttonText):
popup=tk.Tk()
popup.geometry('300x150')
popup.wm_title(heading)
label=tk.Label(popup,text=msg,font=SMALLER_FONT)
label.pack(side="top",fill="x",pady=20,padx=20)

b1=ttk.Button(popup,text=buttonText,command=popup.de
stroy)
b1.pack()
popup.mainloop()

class GUI(tk.Tk):
def __init__(self,*args,**kwargs):

tk.Tk.__init__(self,*args,**kwargs)

tk.Tk.wm_title(self,"HMS HHAS Hotels")


container=tk.Frame(self)
container.pack(side="top",fill="both",expand=False)
container.grid_rowconfigure(0,weight=1)
container.grid_columnconfigure(0,weight=1) #0 is the
min size

self.frames={} #Creating an empty dictionary

for F in (StartPage,RegPage,SuccessRegPage):
frame=F(container,self)
self.frames[F]= frame
frame.grid(row=0,column=0,sticky="nsew")

self.show_frame(StartPage)

def show_frame(self,cont):
frame=self.frames[cont]
frame.tkraise()

class StartPage(tk.Frame): #Inheriting every frame we used

def __init__(self,parent,controller):
nameEnterV=tk.StringVar()
passEnterV=tk.StringVar()
tk.Frame.__init__(self,parent) #Parent Class is the GUI
class

Wel=tk.Label(self,text="Welcome To HHAS
Hotels",font=LARGE_FONT)
Wel.pack(pady=10,padx=10)

LIFB=tk.Label(self,text="Log In for
Booking",font=SMALL_FONT)
LIFB.pack(pady=10,padx=10)

Username=tk.Label(self,text="Username",font=("Verdana",
11))
Username.pack(pady=5,padx=5)
nameEnter=tk.Entry(self,bd=4,textvariable=nameEnterV)
nameEnter.pack()

Password=tk.Label(self,text="Password",font=("Verdana",1
1))
Password.pack(pady=5,padx=5)

passEnter=tk.Entry(self,show='*',bd=4,textvariable=passE
nterV)
passEnter.pack()

Loginbutton=ttk.Button(self,text="Log
in",command=lambda:CheckCred(nameEnter,passEnter))

Loginbutton.pack(pady=20,padx=25)

ResButton=ttk.Button(self,text="Reset",command=lambda
: Reset(nameEnter,passEnter))
ResButton.pack(pady=10,padx=10)

NU=tk.Label(self,text="New
User?",font=("Verdana",12))
NU.pack(pady=25,padx=15)

RH=ttk.Button(self,text="Register Here",
command=lambda:
controller.show_frame(RegPage))
RH.pack()

def Reset(Username,Password):
Username.delete(0,'end')
Password.delete(0,'end')

class RegPage(tk.Frame):
def __init__(self,parent,controller):
nameEnterV=tk.StringVar()
passEnterV=tk.StringVar()
tk.Frame.__init__(self,parent)

RHSB=ttk.Label(self,text="Register for Hotel Services


and Booking",font=LARGE_FONT)
RHSB.pack(pady=10,padx=10)

UsernameR=tk.Label(self,text="Username",font=("Verdana
",11))
UsernameR.pack(pady=5,padx=5)

nameEnter=tk.Entry(self,bd=4,textvariable=nameEnterV)
nameEnter.pack()

Email=tk.Label(self,text="EmailID",font=("Verdana",11))
Email.pack(pady=5,padx=5)
emailEnter=tk.Entry(self,bd=4)
emailEnter.pack()

Phone=tk.Label(self,text="Phone
Number",font=("Verdana",11))
Phone.pack(pady=5,padx=5)
phoneEnter=tk.Entry(self,bd=4)
phoneEnter.pack()

PasswordR=tk.Label(self,text="Password",font=("Verdana",
11))
PasswordR.pack(pady=5,padx=5)

passEnter=tk.Entry(self,show='*',bd=4,textvariable=passE
nterV)
passEnter.pack()

SU=ttk.Button(self,text="Sign Up
",command=lambda:
[insert(nameEnter,passEnter,emailEnter,phoneEnter),contr
oller.show_frame(SuccessRegPage)])
SU.pack(pady=15,padx=15)
ResetButton=ttk.Button(self,text="Reset",command=lamb
da:ResetReg(nameEnter,emailEnter,phoneEnter,passEnter))
ResetButton.pack(pady=15,padx=15)

AHA=tk.Label(self,text="Already have an
account?",font=SMALLER_FONT)
AHA.pack(pady=30,padx=10)

Loginbutton2=ttk.Button(self,text="Go to Login
Page",command=lambda:controller.show_frame(StartPage)
)
Loginbutton2.pack(pady=0,padx=25)

def ResetReg(Nentry,Eentry,Pentry,Passentry):
Nentry.delete(0,'end')
Eentry.delete(0,'end')
Pentry.delete(0,'end')
Passentry.delete(0,'end')

class SuccessRegPage(tk.Frame):
def __init__(self,parent,controller):
tk.Frame.__init__(self,parent)
label=ttk.Label(self,text="Succesfully
Registered",font=SMALL_FONT)
label.pack(pady=10,padx=10)

button4=ttk.Button(self,text="Go To Login Page",


command=lambda:
controller.show_frame(StartPage))
button4.pack()

app=GUI()
#Calling the class
app.geometry('600x600')
app.mainloop()
#Tkinter functionality
OUTPUT
LIMITATIONS
1. Cannot store data as there is no back end
program to store any data.
2. Minimum functionality as the main focus was
on Tkinter module in python.
3. It is not in an exe (Application) format and will
require python IDLE and Tkinter module
downloaded on the PC.

REQUIREMENTS
HARDWARE REQUIRED
 Compact Drive
 Processor : Pentium III
 Ram : 64 MB
 Hard disk: 20 GB.

SOFTWARE REQUIRED

 Operating system : Windows XP


 Python 3.7, for execution of program

www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com

BIBLIOGRAPHY
Computer Science with Python
By- Sumitra Arora
Sites like Stack Overflow
https://stackoverflow.com/
https://www.geeksforgeeks.org/

wweportal.com
www.cbseportal.com
fejjhhhdhiwww.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com
www.cbseportal.com

Potrebbero piacerti anche