-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHotelManagment.py
161 lines (160 loc) · 5.52 KB
/
HotelManagment.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
import sys
from datetime import date
name=[]
phno=[]
days=[]
roomtype=[]
checkindate=[]
def home():
name="sreekar"
print('\t Welcome to Hotel MG \n')
print('1. Booking \n')
print('2. Checkout \n')
print('3. Restaurant \n')
print('4. All Customer details \n')
print('6. Exit \n')
ch=int(input(":"))
if ch==1:
checkin()
elif ch==2:
checkout()
elif ch==3:
restaurant()
elif ch==4:
custinfo()
else:
sys.exit()
def checkin():
print('Booking Room \n')
n=input('Name : ')
num=input('Mobile Number : ')
day=input("Enter the number of days ur gonna stay : ")
name.append(n)
phno.append(num)
days.append(day)
todaydate=date.today()
checkindate.append(str(todaydate))
print('Select the room : ')
print('1. Double bedroom with AC')
print('2. Double bedroom without AC')
print('3. Single bedroom without AC')
print('4. Single bedroom with AC')
fwrite=open("hotelcheckindata.txt","a")
fwrite.write("Name: "+n)
fwrite.write("\t")
fwrite.write("Phone No: "+num)
fwrite.write("\t")
fwrite.write("No of days "+day)
fwrite.write("\t")
ch1=int(input(':'))
if ch1==1:
roomtype.append('Double bedroom with AC')
fwrite.write("Room Type: "+"Double bedroom with AC")
fwrite.write("\t")
print(' \n Room Booked successfully \n Enjoy Your Stay ')
elif ch1==2:
roomtype.append('Double bedroom without AC')
fwrite.write("Room Type: "+'Double bedroom without AC')
fwrite.write("\t")
print(' \n Room Booked successfully \n Enjoy Your Stay ')
elif ch1==3:
roomtype.append('Single bedroom without AC')
fwrite.write("Room Type: "+"Single bedroom without AC")
fwrite.write("\t")
print(' \n Room Booked successfully \n Enjoy Your Stay ')
elif ch1==4:
roomtype.append('Single bedroom with AC')
fwrite.write("Room Type: "+"Single bedroom with AC")
fwrite.write("\t")
print(' \n Room Booked successfully \n Enjoy Your Stay ')
else:
print('ERROR Please retry')
checkin()
fwrite.write("Check in Date: "+str(todaydate))
fwrite.write("\n")
fwrite.close()
home()
def checkout():
n1=input('Enter the name ')
if n1 in name:
print('You have been checkedout prociding to payment page: ')
payment(n1)
else:
print('Please give an valid name')
checkout()
def custinfo():
print('Customer Name')
print("| Name | Phone No | Days | Room Type |")
for i in range(len(name)):
print( name[i],'\t',phno[i],'\t',days[i],'\t\t',roomtype[i])
home()
def restaurant():
rs=0
n=input('Enter the name ')
if n in name:
print('\t\tFood Menu \n')
print('1. Tea \t RS30 \n')
print('2. Coffee \t RS35 \n')
print('3. Masala Dosa \t RS50 \n')
print('4. Plain Dosa \t RS40 \n')
print('5. Chicken Biriyani \t RS120 \n')
print('6. Mutton Biriyani \t RS180 \n')
print('7. Full Meals \t RS100 \n')
print('8. Jeera Rice \t RS60 \n')
print('Enter 0 to go to main page \n')
while True:
ch=int(input('Enter ur choise: '))
if ch==1:
print('Tea added to ur order \n')
rs=rs+30
elif ch==2:
print('COffe added to your order \n')
rs=rs+30
elif ch==3:
print('Masala Dosa added to your order \n')
rs=rs+50
elif ch==4:
print('Plain Dosa added to your order \n')
rs=rs+40
elif ch==5:
print('Chicken Biriyrni added to your order \n')
rs=rs+120
elif ch==6:
print('Mutton Biriyani added to your order \n')
rs=rs+180
elif ch==7:
print('Full Meals added to your order \n')
rs=rs+100
elif ch==8:
print('Jeera Rice added to your order \n')
rs=rs+60
else:
print('Total amount is ',rs)
home()
else:
print('Invalid Name \n')
restaurant()
def payment(n1):
bill=0
for i in range(len(name)):
if name[i]==n1:
print('Computing ur bill.......')
if roomtype[i]== 'Double bedroom with AC':
bill=bill+int(days[i])*15000
elif roomtype[i]=='Double bedroom without AC':
bill=bill+int(days[i])*1000
elif roomtype[i]=='Single bedroom without AC':
bill=bill+int(days[i])*500
elif roomtype[i]=='Single bedroom with AC':
bill=bill+int(days[i])*700
print('The amount to be paid is ',bill)
print('{} Has Been Successfully CheckedOut \n'.format(n1))
print(' \t Thankyou \n \t Visit Again')
for i in range(len(name)):
if name[i]==n1:
name.pop(i)
phno.pop(i)
days.pop(i)
roomtype.pop(i)
home()
home()