diff --git a/Data Records/Student.txt b/Data Records/Student.txt index 7e3a011..1420945 100644 --- a/Data Records/Student.txt +++ b/Data Records/Student.txt @@ -1,4 +1,3 @@ -2022-05-27|9:01pm|LIBIN SABU|4DM19IS027|9947789622|OUT|HOSTEL 2022-05-27|10:00PM|PRAJWAL|4DM19IS043|1234567890|OUT|MOODBIDRI 2022-05-27|10:01PM|PRAJWAL|4DM19IS045|1234567890|OUT|MOODBIDRI 2022-05-28|5:00|AKSHAY KUMAR|4DM19IS006|1234567890|OUT|MANGLORE diff --git a/Data Records/Vehicle.txt b/Data Records/Vehicle.txt index a5cc823..ff2ecc3 100644 --- a/Data Records/Vehicle.txt +++ b/Data Records/Vehicle.txt @@ -1,14 +1,10 @@ 2022-05-24|19:01:47|KL14A1000|OUT|SABU TV|896756551|BIKE|OUTSIDE 2022-05-24|19:01:47|KL14A7000|OUT|LIBIN SABU |896756551|BIKE|OUTSIDE -2022-05-26|19:15:07:PM|ERTYUIO|OUT|SUNNY |994763821|TRUCK|HOME +2022-05-26|19:15:07:PM|TN68K8900|OUT|SUNNY |994763821|TRUCK|HOME 2022-05-22|20:54:11|KL79G7900|OUT|AMAL PRASAD|7306557354|BIKE|MOODBIDRI 2022-05-30|14:35:24:PM|GA12H7890|IN|ADHITHYAN|9947789622|CAR|HOME -2022-05-31|22:10:40:PM|KL89H8900|OUT|ASEEL HK|1234567890|CAR|HOME -2022-05-31|22:12:26:PM|KL78Y789|IN|MELBIN B|34567890123|BIKE|TOUR -2022-06-01|00:04:35:AM|KL68H6789|OUT|AMAL PRASAD|7306557354|OUT|HOME -2022-06-01|00:06:03:AM|1234567|DFGHJ|AMAL|7306557354|ING|ZXVCBNM -2022-06-01|00:08:35:AM|KL67S67890|OUT|LIBIN SABU|8304939772|CAR|TO VISIT HOSTEL -2022-06-01|00:08:35:AM|KL67S67890|OUT|LIBIN SABU|80780775784|CAR|TO VISIT HOSTEL -2022-06-01|00:08:35:AM|KL67S67890|OUT|LIBIN SABU|7306557354|CAR|TO VISIT HOSTEL -2022-06-01|00:08:35:AM|KL67S67890|OUT|LIBIN SABU|80780775784|CAR|TO VISIT HOSTEL -2022-06-01|00:12:29:AM|TN56Y78900|OUT|PRAJWAL|7306557354|BIKE|HOME +2022-06-01|00:22:56:AM|ZXCVBNM,./|OUT|ASDFGHJKL;|7306557354|CVBNM,| BNM, +2022-06-01|00:22:56:AM|ZXCVBNM,./|OUT|ASDFGHJKL;|7306557354|CVBNM,| BNM, +2022-06-01|21:04:54 PM|KL17U6799|OUT|PRASAD KP|9947789622|CAR|HOME +2022-06-01|21:05:07 PM|KL17U6799|OUT|PRASAD KP|9947789622|CAR|HOME +2022-06-01|21:07:08 PM|KL78ID007|IN|SABU VV|45678901234|TRUCK|HOME diff --git a/gui.py b/gui.py index 234570a..8337225 100644 --- a/gui.py +++ b/gui.py @@ -2,7 +2,7 @@ - +from time import strftime from email.mime import image from operator import index from pathlib import Path @@ -57,12 +57,13 @@ def relative_to_assets(path: str) -> Path: # time-> -now = datetime.now() -time = now.strftime("%H:%M:%S:%p") -# vlTime.set(time)string = strftime('%H:%M:%S %p') -# vlTime.config(text = string) -# vlTime.after(1000, time) -vlTime.set(time) + +def time(): + string = strftime('%H:%M:%S %p') + + + vlTime.set(string) + vdate.after(1000, time) # method for Insertion of vhl rcd def insertData(): time=vlTime.get() @@ -90,15 +91,15 @@ def insertData(): VhlReader=open("Data Records/Vehicle.txt","a") VhlReader.write(str(date)+"|"+time+"|"+vehiclenum+"|"+Vinout+"|"+Vowner+"|"+Vlmob+"|"+vltyp+"|"+vreason+"\n") messagebox.showinfo("STATUS", "RECORD ADDED TO DATABASE") - client = Client('AC4fb3f859d841739f658840ac79a3e879', '6bbdad1b6761f73b391dae6b4c69f87f') - message = client.messages \ - .create( - body="Hi "+Vowner+" \nWelcome to Yenepoya Institute of Technology"+" \nYour entering Time :"+str(time)+"\nDate:"+str(date)+"\nVehicle Number:"+vehiclenum+"\nLiqiud-Loop Gate Security System", - from_='+19403505053', - to="+91"+Vlmob - ) + # client = Client('AC4fb3f859d841739f658840ac79a3e879', '6bbdad1b6761f73b391dae6b4c69f87f') + # message = client.messages \ + # .create( + # body="Hi "+Vowner+"Welcome to Yenepoya Institute of Technology"+" \nYour entering Time :"+str(time)+"\nDate:"+str(date)+"\nVehicle Number:"+vehiclenum+"\nLiqiud-Loop Gate Security System", + # from_='+19403505053', + # to="+91"+Vlmob + # ) - print(message.sid) + # print(message.sid) @@ -252,6 +253,7 @@ def update(): filereader2=open("Data Records/Vehicle.txt","w+") for i in lines: filereader2.write(i) + messagebox.showinfo("Sucess", "Successfully updated") u_name=up_name.set("") u_num=up_num.set("") u_mob=up_mob.set("") @@ -1093,7 +1095,7 @@ def student_update(): sup_usn=StringVar() sup_mob=StringVar() search_date.set("2022-05-27") - search_usn.set("4dm19is027") + search_usn.set("4dm19is045") def SearchTree(): Student_date=search_date.get() print(Student_date) @@ -1198,6 +1200,10 @@ def update(): filereader2=open("Data Records/Student.txt","w+") for i in lines: filereader2.write(i) + messagebox.showinfo("Status", "Record Updated") + sup_name.set("") + sup_usn.set("") + sup_mob.set("") filereader2.close() # -----------------Endend------------ @@ -1205,6 +1211,8 @@ def update(): # date of Student + vdate = Label(Supdate_section,text = "Date:",bg="#FFFFFF").place(x = 20,y = 70) + student_date = Entry(Supdate_section, bd=0, bg="#C4C4C4", @@ -1219,6 +1227,8 @@ def update(): ) # vhl number + vhlnum = Label(Supdate_section,text = "USN:",bg="#FFFFFF").place(x = 250,y = 70) + student_usn = Entry(Supdate_section, bd=0, bg="#C4C4C4", @@ -1246,6 +1256,8 @@ def update(): height=50.0 ) # vhl owner name + u_name = Label(Supdate_section,text = "Name:",bg="#FFFFFF").place(x = 20,y = 455) + update_nameS = Entry(Supdate_section, bd=0, bg="#C4C4C4", @@ -1259,6 +1271,8 @@ def update(): height=48.0 ) # Vehicle number + vhlnum = Label(Supdate_section,text = "USN:",bg="#FFFFFF").place(x = 247,y = 455) + student_usn2 = Entry(Supdate_section, bd=0, bg="#C4C4C4", @@ -1271,6 +1285,7 @@ def update(): width=182.0, height=48.0 ) + mob= Label(Supdate_section,text = "Mobile:",bg="#FFFFFF").place(x = 473,y = 455) student_mob= Entry(Supdate_section, bd=0, bg="#C4C4C4", @@ -1401,7 +1416,7 @@ def update(): statusbar.pack(side=BOTTOM, fill=X) # ended------------> window.resizable(False,False) - +time() # ------STUDENT SEARCH SECTION--------> photo = PhotoImage(file ="assets/barrier.png") window.iconphoto(False,photo) diff --git a/sample_p.py b/sample_p.py index e69de29..41b1b2a 100644 --- a/sample_p.py +++ b/sample_p.py @@ -0,0 +1,29 @@ +from tkinter import * + +from time import strftime + +root=Tk() +root.geometry("400x400") + +u_num=StringVar() +def time(): + string = strftime('%H:%M:%S %p') + # vhlnum.config(text = string) + u_num.set(string) + vhlnum.after(1000, time) + +vhlnum = Entry(root, + bd=0, + bg="#C4C4C4", + highlightthickness=0, + textvariable=u_num + + ) +vhlnum.place( + x=250.0, + y=100.0, + width=182.0, + height=48.0 + ) +time() +root.mainloop() \ No newline at end of file