You are on page 1of 3

""

def Add_Record_ClientMaster():
L=[]
ParkingId=(input("Enter the Parking Sr No, you wish to park in: "))
L.append(client_name)
client_name=(input("Enter Your Name: "))
L.append(client_name)
vehicle_no=input("Enter your Vehicle's Number ")
L.append(vehicle_no)
contact=input("Enter your Contact Number :")
L.append(contact)
estimated_hours=int(input("Enter the Estimated time, your car will be parked
here for:"))
L.append(estimated_hours)
stud=(L)
sql="INSERT INTO
`client_master`(`client_name`,`vehicle_no`,`contact`,`estimated_hours`) values (%s,
%s,%s,%s)"
mycursor.execute(sql,stud)
mydb.commit()

sql="SELECT `Id`,`parkingName`, `noOfSlots`, `remainingSlots`, `fees` from


client_master"
mycursor.execute(sql)
res=mycursor.fetchall()
print("Sr No ||","Parking Name ||", "Total Slots ||", "Available Slots ||",
"Fees/ Hr")
for row in res:
print(" ",row[0]," ||", row[1]," ", " ||",row[2]," " ,"
||",row[3]," "," ||",row[4])

remainingSlots =
L.append(remainingSlots)
fees=int(input("Fees per Hour: "))
L.append(fees)
stud=(L)
sql="insert into parking_master
(username,password,parkingName,noOfslots,remainingSlots,fees) values (%s,%s,%s,%s,
%s,%s)"
mycursor.execute(sql,stud)
mydb.commit()

def View_Record_ParkingMaster():
print("Enter Admin Username")
print("1. Parking Number")
print("2. Parking Name")
print("3. Level No")
print("4. All")
ch=int(input("Enter the choice : "))
if ch==1:
s=int(input("Enter Parking no : "))
rl=(s,)
sql="select * from parking_master "
mycursor.execute(sql,rl)
elif ch==2:
s=input("Enter Parking Name : ")
rl=(s,)
sql="select * from parking_master where pnm1=%s"
mycursor.execute(sql,rl)
elif ch==3:
s=int(input("Enter Level of Parking : "))
rl=(s,)
sql="select * from parking_master where level1=%s"
mycursor.execute(sql,rl)
elif ch==5:
sql="select * from parking_master"
mycursor.execute(sql)
res=mycursor.fetchall()
print("Details about Parking are as follows : ")
print("(Parking Id,Parking Name,Level,FreeSpace(Y/N),Vehicle No,No of days
for parking,Payment)")
for x in res:
print(x)

def RecView():
print("Select the search criteria : ")
print("1. Parking Number")
print("2. Parking Name")
print("3. Level No")
print("4. All")
ch=int(input("Enter the choice : "))
if ch==1:
s=int(input("Enter Parking no : "))
rl=(s,)
sql="select * from question where pid1=%s"
mycursor.execute(sql,rl)
elif ch==2:
s=input("Enter Parking Name : ")
rl=(s,)
sql="select * from question where pnm1=%s"
mycursor.execute(sql,rl)
elif ch==3:
s=int(input("Enter Level of Parking : "))
rl=(s,)
sql="select * from question where level1=%s"
mycursor.execute(sql,rl)
elif ch==5:
sql="select * from question"
mycursor.execute(sql)
res=mycursor.fetchall()
print("Details about Parking are as follows : ")
print("(Parking Id,Parking Name,Level,FreeSpace(Y/N),Vehicle No,No of days
for parking,Payment)")
for x in res:
print(x)

def Vehicle_Detail():
L=[]
vid1=int(input("Enter Vehicle No : "))
L.append(vid1)
vnm1=input("Enter Vehicle Name/Model Name : ")
L.append(vnm1)
dateofpur1=input("Enter Date of purchase : ")
L.append(dateofpur1)
onwer_name=input("Enter Owner's name :")
L.append(onwer_name)
contact_number=input("Enter Contact number :")
L.append(contact_number)
email=input("Enter Email address :")
L.appen(email)
vdt=(L)
sql="insert into vehicle1 (vid1,vnm1,dateofpur1,owner_name,contact_number,)
values (%s,%s,%s)"
mycursor.execute(sql,vdt)
mydb.commit()

def Menu():
print("Enter 1 : To Add Parking Detail")
print("Enter 2 : To View Parking Detail ")
print("Enter 3 : To Add Vehicle Detail ")
print("Enter 4 : To Remove Vehicle Record")
print("Enter 5 : To see the details of Vehicle")
input_dt = int(input("Please Select An Above Option: "))
if(input_dt== 1):
Add_Record_ParkingMaster()
elif (input_dt==2):
RecView()
elif (input_dt==3):
Vehicle_Detail()
elif (input_dt==4):
remove()
elif (input_dt==5):
Vehicle_View()
else:
print("Enter correct choice. . . ")

def runAgain():
runAgn = input("\nwant To Run Again Y/n: ")
while(runAgn.lower() == 'y'):
if(platform.system() == "Windows"):
print(os.system('cls'))
else:
print(os.system('clear'))

You might also like