My CS Project2
My CS Project2
Principal
ACKNOWLEDGMENT
It is with pleasure that I acknowledge my
sincere gratitude to our teacher,
MR.VINAY KUMAR SIR who taught and
undertook the responsibility of teaching
the subject computer science. I have
been greatly benefited from his classes.
I am especially indebted to our Principal
who has always been a source of
encouragement and support and
without whose inspiration this project
would not have been a successful I
would like to place on record heartfelt
thanks to him.
Finally, I would like to express my sincere
appreciation for all the other students
for my batch their friendship & the fine
time that we all shared together
HARDWARE
1. PC
2. MOBILE PHONE
SOFTWARE
• PYTHON (latest version)
• MYSQL
• PYTHON CONNECTOR
FLIGHT
The following are the main advantages:
• High Speed: It is the fast speed means of transport. ...
• Minimum Cost: ...
• Strategic Importance: ...
• Easy transport of costly and light goods: ...
• Free from physical barriers: ...
• Useful for Agriculture: ...
• Useful in natural calamities:
import mysql.connector
obj.commit()
obj.commit()
obj.commit()
def fooditems():
print("The available foods are:")
mycursor.execute("SELECT * FROM food_items")
x = mycursor.fetchall()
for i in x:
print("Food ID:", i[0])
print("Food Name:", i[1])
print("Price:", i[2])
def admin1():
print("************ WHAT'S YOUR TODAYS GOAL? ****************")
print("1. Update details")
print("2. Show details")
print("3. Job approval")
x = int(input("Select your choice: "))
while True:
if x == 1:
print("1. Classtype")
print("2. Food")
print("3. Luggage")
x1 = int(input("Enter your choice: "))
if x1 == 1:
classtype()
elif x1 == 2:
food()
elif x1 == 3:
luggage()
else:
print("Please enter a valid option")
admin1()
elif x == 2:
print("1. Classtype")
print("2. Food")
print("3. Luggage")
print("4. Records")
y = int(input("From which table: "))
if y == 1:
mycursor.execute("SELECT * FROM classtype")
else:
mycursor.execute("SELECT * FROM customer_details")
z = mycursor.fetchall()
for i in z:
print(i)
print("These above people have booked a ticket")
break
def admin():
while True:
sec = input("Enter the password: ")
if sec == "admin":
admin1()
else:
print("Your password is incorrect. Please try again")
def record():
cid = int(input("Enter your customer id: "))
mycursor.execute("SELECT * FROM customer_details WHERE cus_id={}".format(cid))
d = mycursor.fetchall()
if not d:
print("No customer details found for the provided ID.")
return
def ticketbooking():
cname = input("Enter your name: ")
cmob = int(input("Enter your mobile no: "))
if cmob == 0000000000:
print("Mobile number can't be null")
ticketbooking()
fid = int(input("Enter flight id: "))
fcl = input("Enter your class: ")
fname = input("Enter your flight name")
dept = input("Enter departure place: ")
dest = input("Enter destination: ")
fday = input("Enter flight day: ")
ftime = input("Enter flight time: ")
fprice = input("Enter ticket rate: ")
mycursor.execute("INSERT INTO customer_details (cust_name, cont_no, flight_id,
cus_name, classtype, "
"departure, destination, flight_day, flight_time, price,
date_of_booking) "
"VALUES ('{}',{},{},'{}','{}','{}','{}','{}','{}',{},curdate())"
.format(cname, cmob, fid, fname, fcl, dept, dest, fday, ftime,
fprice))
obj.commit()
def flightavailable():
print("The available flights are:")
mycursor.execute("SELECT * FROM flight_details")
x = mycursor.fetchall()
for i in x:
print("Flight ID:", i[0])
print("Flight Name:", i[1])
print("Departure:", i[2])
print("Destination:", i[3])
print("Takeoff Day:", i[4])
print("Takeoff Time:", i[5])
print("Business:", i[6])
print("Middle:", i[7])
print("Economic:", i[8])
def user():
while True:
print("May I help you?")
print("1. Flight details")
print("2. Food details")
print("3. Book ticket")
print("4. My details")
print("5. Exit")
x = int(input("Enter your choice: "))
if x == 1:
flightavailable()
elif x == 2:
fooditems()
elif x == 3:
ticketbooking()
elif x == 4:
record()
else:
print("Please choose a correct option")
user()
break
# Main Interface
def menu1():
print("Your designation?")
print("1. Admin")
print("2. User")
print("3. Exit")
x = int(input("Choose an option: "))
while True:
if x == 1:
admin()
elif x == 2:
user()
else:
print("Please choose a correct option")
menu1()
break
menu1()
#Code outputs
# output in mysql database
• www.google.com
• www.wikipedia.org