-
Notifications
You must be signed in to change notification settings - Fork 0
/
bus_ticket.py
60 lines (44 loc) · 2.33 KB
/
bus_ticket.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
from tkinter import *
from tkinter import messagebox
from datetime import date
import random
import sqlite3
root = Tk()
root.state('zoomed')
bus_logo = PhotoImage(file=".\\images\\Bus_for_project.png")
Label(root, image=bus_logo).grid(row=0, column=5, columnspan=15, padx=600)
Label(root, text="Online Bus Booking System", bg="Light Blue",
fg="Red", font="Arial 20").grid(row=1, column=5, columnspan=15)
Label(root, text="Bus Ticket", bg="Light Green",
font="Arial 10").grid(row=2, column=5, pady=15, columnspan=15, padx=100)
con = sqlite3.Connection("Bus_database")
cur = con.cursor()
a = cur.execute(
"select b.Passenger_name, b.Gender, b.No_of_passenger, b.Phone, b.Age, Fare, Name, b.Date,b.Booking_ref,b.Boarding_station,b.Journey_date from Operator_details as o,Booking_history as b, Bus_details bus, Running_details as r,Route_details as t where b.B_Id=r.B_Id and bus.Op_Id=o.Op_Id and bus.B_Id=b.B_Id and bus.R_Id=t.R_Id")
f = a.fetchall()
for i in f:
Label(root, text="Passengers:").grid(row=4, column=10)
Label(root, text=i[0]).grid(row=4, column=11)
Label(root, text="Gender:").grid(row=4, column=14)
Label(root, text=i[1]).grid(row=4, column=15)
Label(root, text="No of Seats:").grid(row=5, column=10)
Label(root, text=i[2]).grid(row=5, column=11)
Label(root, text="Phone:").grid(row=5, column=14)
Label(root, text=i[3]).grid(row=5, column=15)
Label(root, text="Age:").grid(row=6, column=10)
Label(root, text=i[4]).grid(row=6, column=11)
Label(root, text="Fare Rs:").grid(row=6, column=14)
Label(root, text=int(i[2])*int(i[5])).grid(row=6, column=15)
Label(root, text="Booking Ref:").grid(row=7, column=10)
Label(root, text=i[8]).grid(row=7, column=11)
Label(root, text="Bus Detail:").grid(row=7, column=14)
Label(root, text=i[6]).grid(row=7, column=15)
Label(root, text="Travel On:").grid(row=8, column=10)
Label(root, text=i[10]).grid(row=8, column=11)
Label(root, text="Booked On:").grid(row=8, column=14)
Label(root, text=i[7]).grid(row=8, column=15)
Label(root, text="No of Seats:").grid(row=9, column=10)
Label(root, text=i[2]).grid(row=9, column=11)
Label(root, text="Boarding Point:").grid(row=9, column=14)
Label(root, text=i[9]).grid(row=9, column=15)
root.mainloop()