-
Notifications
You must be signed in to change notification settings - Fork 0
/
pembayaran.py
91 lines (73 loc) · 3.77 KB
/
pembayaran.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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
from tkinter import *
from PIL import ImageTk, Image
import os
import csv
os.chdir(os.path.dirname(__file__))
selectedSeats = [(1,3)]
backgroundColor = "#B28A60"
root6 = Tk(className = "Pembelian Tiket Bioskop") #Toplevel()
root6.geometry("400x900+200+0")
root6.configure(bg=backgroundColor)
root6.resizable(False,False)
Label(root6, fg = '#F0F0F0', bg = backgroundColor, text = 'Kami baru tersedia pembayaran melalui Gopay.', font = ('Microsoft YaHei UI Light', 11, 'bold')).place(anchor='center', relx=0.5, rely= 0.02)
Label(root6, fg = '#F0F0F0', bg = backgroundColor,text = 'Mohon maaf atas ketidanyamanannya.', font= ('Microsoft YaHei UI Light', 11, 'bold')).place(anchor= 'center', relx= 0.5, rely =0.05)
pmImage = Image.open("pembayaran.png")
resized_pmImage = pmImage.resize((350,700), Image.ANTIALIAS)
newpmImage = ImageTk.PhotoImage(resized_pmImage)
pmImg = Label(root6, image = newpmImage)
pmImg.place(rely=0.46 , relx = 0.06, anchor='w')
lstPm = [{
'image': 'ms1.png',
'fn':'BLACK ADAM',
'date':'23 Oktober 2022, 10.00-12.05'
}, {
'image': 'ms2.png',
'fn': '6/45',
'date':'23 Oktober 2022, 12.05-14.00'
}, {
'image': 'ms3.png',
'fn': 'INANG',
'date':'23 Oktober 2022, 14.00-16.00'
}, {
'image': 'ms4.png',
'fn': 'Miracle in Cell No. 7',
'date':'23 Oktober 2022, 16.00-18.25'
}, {
'image': 'ms5.png',
'fn': 'Kalian Pantas Mati',
'date':'23 Oktober 2022, 18.25-20.15'
}]
msImage = Image.open(lstPm[0]['image'])
resized_msImage = msImage.resize((75,111), Image.ANTIALIAS)
newmsImage = ImageTk.PhotoImage(resized_msImage)
msImg = Label(root6, image = newmsImage)
msImg.place(rely=0.192, relx = 0.11, anchor='w')
Label(root6, text = lstPm[0]['fn'], bg = 'white', font = ('Microsoft YaHei UI Light', 12,'bold') ).place(rely = 0.146, relx=0.32, anchor= 'w')
Label(root6, text = str(len(selectedSeats)) + ' Tiket', bg = 'white', font = ('Microsoft YaHei UI Light', 9) ).place(rely = 0.155, relx=0.377, anchor= 'n')
Label(root6, text = 'X Rp25.000', bg = 'white', font = ('Microsoft YaHei UI Light', 10, 'bold') ).place(rely = 0.153, relx=0.54, anchor= 'n')
Label(root6, text = lstPm[0]['date'], bg = 'white', font = ('Microsoft YaHei UI Light', 12,'bold') ).place(rely = 0.310, relx=0.50, anchor= 'n')
seats = ''
for items in selectedSeats:
seats += f'{chr(65+items[1])}' + str(items[0]+1) + ','
if seats[-1] == ',':
seats = seats[:-1] + '.'
total = 25*len(selectedSeats) + 1
Label(root6, text = seats, bg = 'white', font = ('Microsoft YaHei UI Light', 12,'bold')).place(rely = 0.390, relx=0.5, anchor= 'center')
Label(root6, text = 'Rp' +str(total-1)+'.000', bg = 'white', font = ('Microsoft YaHei UI Light', 10)).place(rely = 0.490, relx=0.797, anchor= 'center')
Label(root6, text = 'Rp1.000', bg = 'white', font = ('Microsoft YaHei UI Light', 10)).place(rely = 0.530, relx=0.81, anchor= 'center')
Label(root6, text = 'Rp'+str(total)+'.000', bg = 'white', font = ('Microsoft YaHei UI Light', 12, 'bold')).place(rely = 0.586, relx=0.767, anchor= 'center')
def on_enter(e):
numPh = numPhone.get()
if len(numPh) == 0 or numPh == 'Masukkan Nomor Handphone':
numPhone.delete(0, 'end')
def on_leave(e):
numPh = numPhone.get()
if numPh == '':
numPhone.insert(0, 'Masukkan Nomor Handphone')
numPhone = Entry(root6, width = 30, fg='black', border =0, bg='#EAFFEA', font = ('Microsoft YaHei UI Light', 11, 'bold'))
numPhone.place(rely = 0.70, relx=0.5, anchor= 'center')
numPhone.insert(0, 'Masukkan Nomor Handphone')
numPhone.bind('<FocusIn>', on_enter)
numPhone.bind('<FocusOut>', on_leave)
pmButton = Button(root6, width=35,height=2,pady=7, text = 'Bayar sekarang', bg= '#058689', fg= '#F0F0F0', border = 0, font = ('Microsoft YaHei UI Light', 11, 'bold')).place(rely=0.823, relx=0.503, anchor='center')
root6.mainloop()