Skip to content

Add files via upload #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitattributes

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# Python 12th Project
Travel Agency with login and registration, with an option to select budget.
Use the main.py file to execute the program.
Read the SQL Readme to create the SQL Tables
Binary file added SQL README.docx
Binary file not shown.
31 changes: 17 additions & 14 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def package_choice():
choice = input(("Do you have a budget for the Travel? (y/n): "))
if choice == 'y' or choice == 'Y':
budget = int(input("Enter your budget (INR): "))
print("Packages in your budget are: ")
print("Packages in your budget are: \n Package name \t Price \t Package Description")
sql=("SELECT * FROM package_info WHERE package_price < %s")
mycursor.execute(sql,(budget,))
record = mycursor.fetchall()
Expand All @@ -21,8 +21,8 @@ def package_choice():
sql1 = ("INSERT INTO package_choice VALUES(%s,%s)")
values1 = (username,package_choice)
mycursor.execute(sql1,values1)
print("Package Chosen: ",package_choice)
print("Thank you for booking the package:",package_choice, ". We Hope to see you soon!")

elif choice == 'n' or choice == 'N':
print("Available Packages are: ")
mycursor.execute("SELECT * FROM package_info")
Expand All @@ -33,19 +33,21 @@ def package_choice():
sql1 = ("INSERT INTO package_choice VALUES(%s,%s)")
values1 = (username,package_choice)
mycursor.execute(sql1,values1)
print("Package Chosen: ",package_choice)

print("Thank you for booking the package:",package_choice, ". We Hope to see you soon!")
else:
print('Wrong Choice')


mycursor = mydb.cursor()
print("Welcome to Rocket Travel Agency!")
print("1. Login (already existing user)")
print("2. Register(new user)")
print("2. Register (new user)")
choice = int(input("Select your choice: "))
if choice == 1:
username = input('Enter your Username: ')
password = input('Enter password: ')
user_found = 0
mycursor.execute("SELECT user_name FROM user_info")
record = mycursor.fetchall()
for x in record:
Expand All @@ -56,14 +58,15 @@ def package_choice():
for a in record1:
for b in a:
if b == password:
print("Welcome")
package_choice()
break
else
break
else:
print('Wrong Username, try again')
break
user_found = 1
if user_found == 1:
print("Welcome ",username, "!")
package_choice()
else:
break
elif user_found==0:
print("Wrong Password/Username, Please try again.")
break


elif choice == 2:
Expand Down