Python Code
Python Code
importos
import platform
importmysql.connector
import pandas as pd
importdatetime
mydb = mysql.connector.connect(user='root', password='12345',
host='localhost',
database='air')
mycursor=mydb.cursor()
defregistercust():
L=[]
name=input("enter name:")
L.append(name)
addr=input("enter address:")
L.append(addr)
jr_date=input("enter date of journey:")
L.append(jr_date)
source=input("enter source:")
L.append(source)
destination=input("enter destination:")
L.append(destination)
cust=(L)
sql="insert into
pdata(custname,addr,jrdate,source,destination)values(%s,%s,%s,%s,
%s)"
mycursor.execute(sql,cust)
mydb.commit()
defclasstypeview():
print("Do you want to see class type available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
ifch==1:
sql="select * from classtype"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
defticketprice():
print ("We have the following rooms for you:-")
print ("1. type First class---->rs 6000 PN\-")
print ("2. type Business class---->rs 4000 PN\-")
print ("3. type Economy class---->rs 2000 PN\-")
x=int(input("Enter Your Choice Please->"))
n=int(input("No of passenger:"))
if(x==1):
print ("you have opted First class")
s=6000*n
elif (x==2):
print ("you have opted Business class")
s=4000*n
elif (x==3):
print ("you have opted Economy class")
s=2000*n
else:
print ("please choose a class type")
print ("your room rent is =",s,"\n")
defmenuview():
print("Do you want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
ifch==1:
sql="select * from food"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
deforderitem():
global s
print("Do yoy want to see menu available : Enter 1 for yes :")
ch=int(input("enter your choice:"))
ifch==1:
sql="select * from food"
mycursor.execute(sql)
rows=mycursor.fetchall()
for x in rows:
print(x)
defMenuset():
print(“AIR TICKET RESERVATION”)
print("enter 1: To enter customer data")
print("enter 2 : To view class")
print("enter 3 : for ticketamount")
print("enter 4 : for viewing food menu")
print("enter 5 : for food bill")
print("enter 6 :for lugage bill")
print("enter 7 : for complete amount")
print("enter 8 : for exit")
'''try:
#userinput=int(input("pleaseselect an above option:"))
exceptValueError:
exit("\n hi thats not a number")'''