-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelper_func_1.py
29 lines (24 loc) · 1.04 KB
/
helper_func_1.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
from re import L
from helper_func import *
from db_queries import *
import tkinter as tk
from tkinter import messagebox
def checkin_clicked(window, fare, pic_path):
new_pic_path = pic_path.replace('/', '\\')
fare = float(fare)
number_plate_str = getNumberPlateSting(new_pic_path)
res = addVehicleCheckin(vehicle_num=number_plate_str, fare=fare)
if(res == True):
messagebox.showinfo(
'SUCCESS!!!', 'Vehicle Info added To DB')
def checkout_clicked(window, pic_path):
new_pic_path = pic_path.replace('/', '\\')
number_plate_str = getNumberPlateSting(pic_path)
res = addVehicleCheckout(vehicle_num=number_plate_str)
ans = getCheckoutdetails(vehicle_num=number_plate_str)
text_str = 'Number= '+str(ans[0])+'\n'+'Check-In Time= ' + str(ans[1])+'\n'+'Check-Out Time= '+str(ans[2])+'\n'+'Base Fare= '+str(ans[3])+'\n'+'Collectible Fare= ' + \
str(ans[4])+'\n'+'Durationin hrs = '+str(ans[5])+'\n'
if(res == True):
messagebox.showinfo(
'Charges Calculated!!', text_str)
# pass