12thCOMPUTER (1)
12thCOMPUTER (1)
A PROJECT REPORT ON
MOVIE TICKETS DATABASE
Principal Project
Guide
Internal Examiner:
External Examiner:
ACKNOWLEDGEMENT
c
h
a
l
l
e
n
g
i
n
g
e
n
o
u
g
h
t
o
t
e
a
c
h
y
o
u
i
m
p
o
r
t
a
n
t
c
o
n
c
e
p
t
s
s
u
c
h
a
s
v
a
r
i
a
b
l
e
s
,
o
p
e
r
a
t
o
r
s
,
c
o
n
d
i
t
i
o
n
a
l
s
t
a
t
e
m
e
n
t
s
,
a
n
d
f
u
n
c
t
i
o
n
s
.
INTRODUCTION TO MYSQL
HARDWARE:
PC
KEYBOARD
MOUSE
SOFTWARE:
OPERATING SYSTEM: WINDOWS, MACOS, OR
LINUX (MOST VERSIONS SUPPORT PYTHON
AND MYSQL).
RAM: AT LEAST 512 MB (RECOMMENDED 1
GB OR MORE).
CODING
import mysql.connector
db=mysql.connector.connect(
host="localhost",
user="laksh",
passwd="124421",
database="ticket",
auth_plugin='mysql_native_password'
)
if db.is_connected():
print("Success")
ticketcursor=db.cursor()
#Admin Things
def makeadmin():
ticketcursor.execute(tablecreate)
adminreg()
def adminreg():
aname = input()
print("\nPassword:")
apasswd = input()
db.commit()
""")
result=ticketcursor.fetchone()
if result is None:
db.commit()
else:
#User Things
def UserReg(): #Runs first time and then runs if user creates an new
account
global username
name=input()
age=int(input())
print("\n Password: ")
password=input()
phone=int(input())
email=input()
db.commit()
username=name
MENU()
def UserLogin():
global username
if result:
print("Login successful!")
ticketcursor.execute(UserL, (username,))
db.commit()
else:
UserLogin()
def UserDataBase():
;""")
result=ticketcursor.fetchone()
if result is None:
UserReg()
else:
print("Please Login")
UserLogin()
def UserAnother():
global username
UserLogOut()
print("1. Login")
print("2. Register")
if uc == 1:
UserLogin()
MENU()
elif uc == 2:
UserReg()
else:
UserAnother()
def UserLogOut():
ticketcursor.execute(UserL, (username,))
# User HISTORY!!!
def UserPayment():
);""")
db.commit()
db.commit()
print("Payment confirmed!")
def buyMovie(movie_number):
global username
''')
if seat_name == 1:
seat_cost = 100
elif seat_name == 2:
seat_cost = 150
elif seat_name == 3:
seat_cost = 200
else:
return
number_of_seats = int(input())
confirm_payment = input()
if confirm_payment == "yes":
result = ticketcursor.fetchone()
if result:
username=result[0]
print("Payment successful!")
MENU()
else:
print("Payment cancelled.")
Mlist()
#ADMIN AREA!!! :d
def adminarea():
result = ticketcursor.fetchone()
if result:
adminmenu()
else:
MENU()
def adminmenu():
print("Admin Menu:")
if choice == 1:
show_databases()
elif choice == 2:
delete_UserPayment()
elif choice == 3:
delete_useraccount()
elif choice == 4:
MENU()
else:
adminmenu()
def show_databases():
ticketcursor.execute("SHOW TABLES")
tables = ticketcursor.fetchall()
print("Databases:", tables)
adminmenu()
def delete_UserPayment():
db.commit()
adminmenu()
def delete_useraccount():
db.commit()
print("User account deleted successfully!")
adminmenu()
def exit():
UserLogOut()
print("")
2. Admin Area
3. Movie List
4. Log Out
5. Exit ''')
print("Enter an choice:")
c = int(input())
if c == 1:
UserAnother()
elif c == 2:
adminarea()
elif c == 3:
print("")
Mlist()
elif c == 4:
UserLogOut()
elif c == 5:
exit()
else:
UserAnother()
# movie List!!! :)
def Mlist():
print("""
1. Movie 1
Timing:
Cinema:
Buy
2. Movie 2
Timing:
Cinema:
Buy
3. Movie 3
Timing:
Cinema:
Buy
4. Movie 4
Timing:
Cinema:
Buy
5. Movie 5
Timing:
Cinema:
Buy
6. Movie 6
Timing:
Cinema:
Buy
""")
movieoption = input()
if movieoption == '1':
print("")
buyMovie(1)
print("")
buyMovie(2)
print("")
buyMovie(3)
print("")
buyMovie(4)
elif movieoption == '5':
print("")
buyMovie(5)
print("")
buyMovie(6)
MENU()
else:
Mlist()
print("")
print("")
MENU()
OUTPUT
Admin Registering
Admin Powers
User Payment
CONCLUSION
BIBLIOGRAPHY
1. WWW.SCRIBD.COM
2. WWW.WIKIPEDIA.COM
3. WWW.GOOGLE.COM
4. CLASS 11 & 12 NCERT BOOK BY SUMITA
ARORA