CD & DVD
MANAGEMENT
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("connected")
c1=[Link]()
[Link]('create table cd_details(year_of_release int, type_of_movie varchar(65) ,
movie_name varchar(65), language varchar(56))')
print("table created")
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("connected")
c1=[Link]()
[Link]('create table login_id( user_id int(11) primary key,passwd int(11),name
varchar(65))')
print("table created")
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("connected")
c1=[Link]()
[Link]('create table dvd_detail(dvd_model varchar(65),dvd_name
varchar(56),version int,range_of_amt int)')
print('created')
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("connected")
c1=[Link]()
[Link]('use dvd')
print("table created")
v_user_id=int(input("enter id:"))
v_passwd=int(input("enter password:"))
v_name=input("enter ur name")
V_SQL_INSERT="insert into login
values("+str(v_user_id)+","+str(v_passwd)+",'"+v_name+"')"
[Link](V_SQL_INSERT)
print("LOGIN DONE")
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("connected")
c1=[Link]()
[Link]('create table online(customer_name varchar(100),age int,mobile_number
int,cd_or_dvd varchar(65),rating int)')
print("table created")
import [Link] as sql
conn=[Link](host="localhost", user="root", passwd="manager",database="dvd")
if conn.is_connected():
print("HELLO")
c1=[Link]()
[Link]('use dvd')
c1=[Link]()
print("WELCOME TO SAINIK CD,DVD STORE")
print(' ')
print(' ')
from time import gmtime,strftime
a=strftime("%a,%d%b%y",gmtime())
print(a)
print(' ')
print(' ')
name=input("enter your name:")
n=[Link]()
print(' ')
print(' ')
print('OUR HEARTY WELCOMES TO',n)
print(' ')
print(' ')
print("[Link]")
print("[Link] create account")
print("[Link]")
print('')
print('')
choice=int(input("enter your choice:"))
print(' ')
print(' ')
if choice==1:
a=int(input("enter user_id:"))
[Link]("select passwd from login_id where user_id = "+str(a)+";")
data=[Link]()
data=data[0]
data=list(data)
data=data[0]
data=str(data)
print(' ')
print(' ')
b=int(input("enter passwd:"))
[Link]()
[Link]()
print(' ')
print('[Link] order')
print(' ')
print(' ')
print('[Link] details')
print(' ')
print(' ')
print('[Link] details')
print(' ')
print(' ')
print('[Link] oppurtunities')
print(' ')
print(' ')
choice2=int(input("enter your choice to see cd and dvd(5 or 6) and for online order(4):"))
if choice2==5:
v_year_of_release=int(input("enter the year:"))
v_language=input("enter ur language:")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
v_type_of_movie=input("type of movie u want:")
v_movie_name=input("enter movie name:")
print("details uploaded")
V_SQL_INSERT1="insert into cd_details
values("+str(v_year_of_release)+",'"+v_type_of_movie+"','"+v_movie_name+"','"+v_lang
uage+"')"
[Link](V_SQL_INSERT1)
print("movie added to your cart")
[Link]()
if choice2==6:
v_dvd_model=input("enter dvd model:")
v_dvd_name=input("enter dvd company:")
v_version=int(input("enter the version you need:"))
v_range_of_amt=int(input("the amt of product u expect:"))
if v_range_of_amt>=5000:
print("best products awaits you")
else:
print("we can provide the best if there is offers")
V_SQL_INSERT2="insert into dvd_detail
values('"+v_dvd_model+"','"+v_dvd_name+"',"+str(v_version)+","+str(v_range_of_amt)+
")"
[Link](V_SQL_INSERT2)
print("dvd added to your cart !!!")
[Link]()
if choice2==4:
v_customer_name=input("enter name:")
print("welcome",v_customer_name,"to our shop")
v_age=int(input("enter ur age:"))
v_mobile_number=int(input("enter ur phno:"))
v_cd_or_dvd=input("enter what you want(cd or dvd):")
if v_cd_or_dvd=="cd":
v_year_of_release=int(input("enter the year:"))
v_language=input("enter ur language:")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
print("[Link]")
v_type_of_movie=input("type of movie u want:")
v_movie_name=input("enter movie name:")
print("details uploaded")
V_SQL_INSERT1="insert into cd_details
values("+str(v_year_of_release)+",'"+v_type_of_movie+"','"+v_movie_name+"','"+v_lang
uage+"')"
[Link](V_SQL_INSERT1)
print("movie added to your cart")
[Link]()
elif v_cd_or_dvd=="dvd":
v_dvd_model=input("enter dvd model:")
v_dvd_name=input("enter dvd name:")
v_version=int(input("enter the version you need:"))
v_range_of_amt=int(input("the amt of product u expect:"))
if v_range_of_amt>=10000:
print("best products awaits you")
else:
print("we can provide the best if there is offers")
V_SQL_INSERT2="insert into dvd_detail
values('"+v_dvd_model+"','"+v_dvd_name+"',"+str(v_version)+","+str(v_range_of_amt)+
")"
[Link](V_SQL_INSERT2)
print("dvd added to your cart !!!")
[Link]()
else:
print("sorry we didn't get u")
v_rating=int(input("rate us if u like:"))
V_SQL_INSERT1="insert into online
values('"+v_customer_name+"',"+str(v_age)+","+str(v_mobile_number)+",'"+v_cd_or_dv
d+"',"+str(v_rating)+")"
[Link](V_SQL_INSERT1)
[Link]()
print("your order will accpected once u detail ur material")
if choice==2:
print('to create your account please enter your user id and password')
c1=[Link]()
#c1=[Link]("('create table login_id(user_id varchar(100) primary key,passwd
varchar(100),name varchar(100))')
v_user_id=int(input("choose your user id (in integer):"))
print('')
v_passwd=int(input("create your password (in integer):"))
print('')
v_name=input("your full name:")
print('')
c1=[Link]()
update="insert into login_id values("+ str(v_user_id) +","+ str(v_passwd) +",'"+ v_name
+"')"
[Link](update)
[Link]()
print("account created")
if choice==3:
print("THANK YOU",n)
print("VISIT AGAIN")
from time import gmtime,strftime
a=strftime("%a,%d%b%y",gmtime())
print(a)