-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
1058 lines (844 loc) · 53.1 KB
/
main.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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
from tkinter import *
from tkinter import ttk
from tkinter import messagebox
from tkinter import font
from turtle import bgcolor
from PIL import Image
from PIL import ImageTk
from tkcalendar import *
import smtplib
import sqlite3
import time
import datetime
from datetime import datetime
from datetime import timedelta
from datetime import date
# connecting with the Admin database
db = sqlite3.connect('admin.db')
# connecting with the Books database
dbstore = sqlite3.connect('StoreBooks.db')
# connecting with the Students database
dbstudents = sqlite3.connect('StudentsData.db')
# generating window frame using tkinter
root = Tk()
root.title("Library Management System")
root.iconbitmap('images/aa.ico')
root.geometry("900x500+50+100")
root.resizable(0, 0)
# main class
class main:
# start page functionality
def code(self):
self.fm=Frame(root,height=500,width=900,bg='white')
self.fm.place(x=0,y=0)
self.canvas=Canvas(self.fm,height=500,width=900,bg='#000000')
self.canvas.place(x=0,y=0)
# image in backdrop of login page
self.photo=PhotoImage(file=r"images/library-background.png")
self.canvas.create_image(0,0,image=self.photo,anchor=NW)
self.fm1=Frame(self.canvas,height=260,width=300,bg='#993333',bd=3,relief='sunken')
self.fm1.place(x=300,y=120)
self.b1=Label(self.fm1,text='User ID',bg='#993333',font=('Arial',12,'bold'),fg='#ffffff')
self.b1.place(x=20,y=42)
self.e1=Entry(self.fm1,width=22,font=('arial',9,'bold'),bd=4,relief='groove')
self.e1.place(x=100,y=40)
self.lb2=Label(self.fm1,text='Password',bg='#993333',font=('Arial',12,'bold'),fg='#ffffff')
self.lb2.place(x=20,y=102)
self.e2=Entry(self.fm1,width=22,show='*',font=('arial',9,'bold'),bd=4,relief='groove')
self.e2.place(x=100,y=100)
self.btn1=Button(self.fm1,text=' Login',fg='#000000',bg='#ffcc00',width=100,font=('Arial',11,'bold'),activebackground='#000000',activeforeground='#ffcc00',command=self.login,bd=3,relief='flat',cursor='hand2')
self.btn1.place(x=25,y=160)
self.logo = PhotoImage(file=r"images/bt1.png")
self.btn1.config(image=self.logo, compound=LEFT)
self.small_logo = self.logo.subsample(1, 1)
self.btn1.config(image=self.small_logo)
self.btn2=Button(self.fm1,text=' Clear',fg='#000000',bg='#ffcc00',width=100,font=('Arial',11,'bold'),activebackground='#000000',activeforeground='#ffcc00',bd=3,relief='flat',cursor='hand2',command=self.mainclear)
self.btn2.place(x=155,y=160)
self.log = PhotoImage(file=r"images/bt2.png")
self.btn2.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(1, 1)
self.btn2.config(image=self.small_log)
self.forgot=Label(self.fm1,text='Forgot Password?', bg='#993333', fg='#ffffff',activeforeground='#000000',font=('cursive',12,'bold'))
self.forgot.place(x=90,y=220)
self.forgot.bind("<Button>",self.mouseClick)
root.mainloop()
# clear login creadentials
def mainclear(self):
self.e1.delete(0,END)
self.e2.delete(0,END)
# forgot password functionality
def mouseClick(self,event):
self.rog=Tk()
self.rog.title("Change password")
self.rog.geometry("400x300+300+210")
self.rog.iconbitmap("images/afterlogin1.ico")
self.rog.resizable(0,0)
self.rog.configure(bg='#000000')
self.framerog=Frame(self.rog,width=160,height=30,bg="#d6ed17")
self.framerog.place(x=95,y=15)
self.label=Label(self.framerog,text="SET NEW PASSWORD",bg='#d6ed17',fg='#606060',font=("Calibri",12,'bold'))
self.label.place(x=5,y=4)
self.user=Label(self.rog,text='User ID',bg='#000',fg='white',font=("Times New Roman",11,'bold'))
self.user.place(x=40,y=95)
self.user = Label(self.rog, text='New Password',bg='#000', fg='white', font=("Times New Roman", 11, 'bold'))
self.user.place(x=40, y=170)
self.ef1 = Entry(self.rog, width=24, font=('Calibri', 8, 'bold'), bd=4, relief='groove')
self.ef1.place(x=170, y=95)
self.ef2 = Entry(self.rog, width=24, font=('Calibri', 8, 'bold'), bd=4, relief='groove')
self.ef2.place(x=170, y=170)
self.btn1 = Button(self.rog, text='SUBMIT', fg='#606060', bg='#d6ed17', width=8, font=('Calibri', 12, 'bold'),activebackground='#000000', activeforeground='#d6ed17',bd=3, relief='flat',cursor='hand2',command=self.chan_pas)
self.btn1.place(x=40, y=240)
# update or change password functionality
def chan_pas(self):
self.a=self.ef1.get()
self.b=self.ef2.get()
import sqlite3
conn=sqlite3.connect('admin.db')
# run SQL query
cursor=conn.cursor()
cursor.execute("SELECT * FROM UserLogin WHERE UserID='"+self.a+"'")
conn.commit()
self.data=cursor.fetchone()
if self.data!=None:
# run SQL query
cursor = conn.cursor()
cursor.execute("UPDATE UserLogin SET Password='" + self.b + "' WHERE UserID='" + self.a + "'")
conn.commit()
messagebox.showinfo("SUCCESSFUL","Your Password is changed")
self.rog.destroy()
else:
messagebox.showerror("ERROR", "UserID doesn't exist")
self.rog.destroy()
self.rog.mainloop()
# login functionality
def login(self):
# getting user inputs: User ID and Password
self.var1 = self.e1.get()
self.var2 = self.e2.get()
# run SQL query
cursor = db.cursor()
cursor.execute("SELECT * FROM UserLogin WHERE UserID='"+self.var1+"' and Password='"+self.var2+"'")
db.commit()
self.ab = cursor.fetchone()
# change GUI if SQL inputs matches record
if self.ab!=None:
self.under_fm=Frame(root,height=500,width=900,bg='#ffffff')
self.under_fm.place(x=0,y=0)
self.fm2=Frame(root,bg='#0039e6',height=80,width=900)
self.fm2.place(x=0,y=0)
self.lbb=Label(self.fm2,bg='#012727')
self.lbb.place(x=15,y=5)
self.ig=PhotoImage(file='images/library-logo.png')
self.lbb.config(image=self.ig)
self.lb3=Label(self.fm2,text='IIT Mandi LMS',fg='#ffe6e6',bg='#002699',font=('Arial',30,'bold'))
self.lb3.place(x=325,y=17)
# show user name
self.name=Label(root,text="Name : ",bg='#ffffff',fg="#000000",font=('Calibri',12,'bold'))
self.name.place(x=5,y=83)
self.name1=Label(root,text=self.ab[0],fg='#000000',bg='#ffffff',font=('Calibri',12,'bold'))
self.name1.place(x=60,y=83)
# show current date
self.today=date.today()
self.dat=Label(root,text='Date : ',bg='#ffffff',fg='#000000',font=('Calibri',12,'bold'))
self.dat.place(x=750,y=83)
self.dat2 = Label(root, text=self.today, bg='#ffffff', fg='#000000', font=('Calibri', 12, 'bold'))
self.dat2.place(x=800, y=83)
self.cur()
else:
messagebox.showerror('Library System', 'Your ID or Password is invalid!')
def cur(self):
self.fm3=Frame(root,bg='#ffffff',width=900,height=390)
self.fm3.place(x=0,y=110)
# show current time
def clock():
h = str(time.strftime("%H"))
m = str(time.strftime("%M"))
s = str(time.strftime("%S"))
if int(h) >=12 and int(m) >=0:
self.lb7_hr.config(text="PM")
self.lb1_hr.config(text=h)
self.lb3_hr.config(text=m)
self.lb5_hr.config(text=s)
self.lb1_hr.after(200, clock)
self.lb1_hr = Label(self.fm3, text='12', font=('times new roman', 20, 'bold'), bg='#641b4e', fg='white')
self.lb1_hr.place(x=607, y=0, width=60, height=30)
self.lb3_hr = Label(self.fm3, text='05', font=('times new roman', 20, 'bold'), bg='#641b4e', fg='white')
self.lb3_hr.place(x=677, y=0, width=60, height=30)
self.lb5_hr = Label(self.fm3, text='37', font=('times new roman', 20, 'bold'), bg='#641b4e', fg='white')
self.lb5_hr.place(x=747, y=0, width=60, height=30)
self.lb7_hr = Label(self.fm3, text='AM', font=('times new roman', 17, 'bold'), bg='#641b4e', fg='white')
self.lb7_hr.place(x=817, y=0, width=60, height=30)
clock()
self.canvas8 = Canvas(self.fm3, bg='#000000', width=400, height=300)
self.canvas8.place(x=475, y=40)
# show image on right side of dashboard
self.photo9=PhotoImage(file="images/afterlogin1.png")
self.canvas8.create_image(0,0,image=self.photo9,anchor=NW)
# show developer credits in footnote
self.develop=Label(self.fm3,text='Developed By - Group 1',bg='#ffffff',fg='#993333', font=('Candara',12,'bold'))
self.develop.place(x=732,y=350)
self.bt1=Button(self.fm3,text=' Add Books', bg='#993333', fg='#000000',font=('Candara',15,'bold'),width=170,height=0,bd=7,relief='flat',command=self.addbook,cursor='hand2',activebackground='#000000',activeforeground='#993333')
self.bt1.place(x=40,y=40)
self.logo = PhotoImage(file='images/bt1.png')
self.bt1.config(image=self.logo, compound=LEFT)
self.small_logo = self.logo.subsample(1,1)
self.bt1.config(image=self.small_logo)
self.bt2 = Button(self.fm3, text=' Issue Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0, bd=7,relief='flat',command=self.issuebook,cursor='hand2',activebackground='#000000',activeforeground='#993333')
self.bt2.place(x=250, y=40)
self.log = PhotoImage(file='images/bt2.png')
self.bt2.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(1, 1)
self.bt2.config(image=self.small_log)
self.bt3 = Button(self.fm3, text=' Edit Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0,bd=7,relief='flat',cursor='hand2',command=self.edit,activebackground='#000000',activeforeground='#993333')
self.bt3.place(x=40, y=120)
self.logb = PhotoImage(file='images/bt3.png')
self.bt3.config(image=self.logb, compound=LEFT)
self.small_logb = self.logb.subsample(1, 1)
self.bt3.config(image=self.small_logb)
self.bt4 = Button(self.fm3, text=' Return Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0,bd=7,relief='flat',cursor='hand2',command=self.returnbook,activebackground='#000000',activeforeground='#993333')
self.bt4.place(x=250, y=120)
self.log4 = PhotoImage(file='images/bt4.png')
self.bt4.config(image=self.log4, compound=LEFT)
self.small_log4 = self.log4.subsample(1, 1)
self.bt4.config(image=self.small_log4)
self.bt5 = Button(self.fm3, text=' Delete Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0,bd=7,relief='flat',cursor='hand2',command=self.delete,activebackground='#000000',activeforeground='#993333')
self.bt5.place(x=40, y=200)
self.log5 = PhotoImage(file='images/bt5.png')
self.bt5.config(image=self.log5, compound=LEFT)
self.small_log5 = self.log5.subsample(1, 1)
self.bt5.config(image=self.small_log5)
self.bt6 = Button(self.fm3, text=' Show Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0,bd=7, relief='flat',cursor='hand2',command=self.show,activebackground='#000000',activeforeground='#993333')
self.bt6.place(x=40, y=280)
self.log6 = PhotoImage(file='images/bt6.png')
self.bt6.config(image=self.log6, compound=LEFT)
self.small_log6 = self.log6.subsample(1, 1)
self.bt6.config(image=self.small_log6)
self.bt7 = Button(self.fm3, text=' Search Books', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0,bd=7, relief='flat',cursor='hand2',command=self.search,activebackground='#000000',activeforeground='#993333')
self.bt7.place(x=250, y=200)
self.log7 = PhotoImage(file='images/bt7.png')
self.bt7.config(image=self.log7, compound=LEFT)
self.small_log7 = self.log7.subsample(1, 1)
self.bt7.config(image=self.small_log7)
try:
self.bt8 = Button(self.fm3, text=' Log Out', bg='#993333', fg='#000000', font=('Candara', 15, 'bold'),width=170,height=0, bd=7, relief='flat',cursor='hand2',command=self.code,activebackground='#000000',activeforeground='#993333')
self.bt8.place(x=250, y=280)
self.log8 = PhotoImage(file='images/bt8.png')
self.bt8.config(image=self.log8, compound=LEFT)
self.small_log8 = self.log8.subsample(1, 1)
self.bt8.config(image=self.small_log8)
except:
self.bt9 = ttk.Button(self.fm3, text="Ram", bg='#a40000', font=('Candara', 15, 'bold'), width=150,height=0)
self.bt9.place(x=40, y=350)
self.log9 = PhotoImage(file='images/bt8.png')
self.bt9.config(image=self.log9, compound=LEFT)
self.small_log9 = self.log9.subsample(3, 3)
self.bt9.config(image=self.small_log9)
# add book functionality
def addbook(self):
# temp class
class temp(main):
def book(self):
self.fm=Frame(root,bg='#ffe8ec',width=900,height=390)
self.fm.place(x=0,y=110)
self.fm1=Frame(self.fm,bg='#ffe8ec',width=500,height=360,bd=5,relief='flat')
self.fm1.place(x=200,y=15)
self.backbt = Button(self.fm, width=60, bg='#ffe8ec', bd=0, relief='flat',command=self.cur,activeforeground='#000000',activebackground='#ffe8ec')
self.backbt.place(x=2, y=7)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2, 2)
self.backbt.config(image=self.small_log)
self.fll=Frame(self.fm1,width=150,height=40,bg='#ff6690')
self.fll.place(x=150,y=15)
self.ll=Label(self.fll,text='ADD BOOKS',fg='#fff',bg='#ff6690',font=('Canara',12,'bold'),width=15)
# self.ll.config(height=5)
self.ll.place(x=0,y=8)
self.lb=Label(self.fm1,text='ID',fg='#000000',bg='#ffe8ec',font=('times new roman',11,'bold'))
self.lb.place(x=70,y=90)
self.lb2 = Label(self.fm1, text='Title', fg='#000000', bg='#ffe8ec', font=('times new roman', 11, 'bold'))
self.lb2.place(x=70, y=130)
self.lb3 = Label(self.fm1, text='Author', fg='#000000', bg='#ffe8ec', font=('times new roman', 11, 'bold'))
self.lb3.place(x=70, y=170)
self.lb4= Label(self.fm1, text='Edition', fg='#000000', bg='#ffe8ec', font=('times new roman', 11, 'bold'))
self.lb4.place(x=70, y=210)
self.lb5 = Label(self.fm1, text='Price', fg='#000000', bg='#ffe8ec', font=('times new roman', 11, 'bold'))
self.lb5.place(x=70, y=250)
self.ee1=Entry(self.fm1,width=25,bd=4,relief='groove',font=('Calibri',11,'bold'))
self.ee1.place(x=180,y=88)
self.ee2=Entry(self.fm1,width=25,bd=4,relief='groove',font=('Calibri',11,'bold'))
self.ee2.place(x=180,y=130)
self.ee3=Entry(self.fm1,width=25,bd=4,relief='groove',font=('Calibri',11,'bold'))
self.ee3.place(x=180,y=170)
self.ee4=Entry(self.fm1,width=25,bd=4,relief='groove',font=('Calibri',11,'bold'))
self.ee4.place(x=180,y=210)
self.ee5=Entry(self.fm1,width=25,bd=4,relief='groove',font=('Calibri',11,'bold'))
self.ee5.place(x=180,y=250)
self.bt=Button(self.fm1,text='SUBMIT',width=8,fg='white',bg='#ff6690',font=('Canara',12,'bold'),bd=3,relief='flat',command=self.submit1,activebackground='#000000',activeforeground='#ff6690')
self.bt.place(x=70,y=300)
def submit1(self):
try:
self.id=self.ee1.get()
self.ttl=self.ee2.get()
self.aut=self.ee3.get()
self.edi=self.ee4.get()
self.pri=self.ee5.get()
if(self.id and self.ttl and self.aut and self.edi and self.pri):
# run SQL query
cursor=dbstore.cursor()
cursor.execute("INSERT INTO Books(BookID,Title,Author,Edition,Price) values(?,?,?,?,?)",(self.id,
self.ttl,self.aut,self.edi,self.pri))
dbstore.commit()
messagebox.showinfo("Success","Book has been added to the library succesfully")
self.clear()
else:
messagebox.showerror("Error", "Enter Valid Details")
except Exception as e:
messagebox.showerror("Error", "Enter Valid Details")
def clear(self):
self.ee1.delete(0,END)
self.ee2.delete(0,END)
self.ee3.delete(0,END)
self.ee4.delete(0,END)
self.ee5.delete(0,END)
obj=temp()
obj.book()
# issue book functionality
def issuebook(self):
class test(main):
max=0
n = 1
def issue(self):
self.f = Frame(root, bg='#ffe8ec', width=900, height=390)
self.f.place(x=0, y=110)
self.fmi=Canvas(self.f,bg='#ffe8ec',width=900,height=390,bd=0,relief='flat')
self.fmi.place(x=0,y=0)
self.fc=Frame(self.fmi,bg='#ffe8ec',width=338,height=230,bd=4,relief='flat')
self.fc.place(x=70,y=20)
self.ffbll=Frame(self.fc,bg='#00203f', bd=2,relief='flat', width=210,height=40)
self.ffbll.place(x=50,y=0)
self.lc=Label(self.ffbll,text='STUDENT INFORMATION',bg='#00203f',fg='#adefd1',font=('Arial',12,'bold'))
self.lc.place(x=0,y=6)
self.lb = Label(self.fc, text='ERP ID', bg='#ffe8ec', fg='#000000', font=('times new roman', 11, 'bold'))
self.lb.place(x=15, y=90)
self.em2 = Entry(self.fc, width=30, bd=5, relief='ridge', font=('Arial', 8, 'bold'))
self.em2.place(x=105, y=90)
self.bt = Button(self.fc, text='SUBMIT', width=8, bg='#00203f', fg='#adefd1', font=('Canara', 12, 'bold'),bd=5,relief='flat',command=self.check, activeforeground='#00203f',activebackground='#adefd1')
self.bt.place(x=15,y=160)
self.backbt = Button(self.fmi,width=60, bg='#ffe8ec',activebackground='#ffe8ec',bd=0, relief='flat',command=self.issueback)
self.backbt.place(x=5, y=5)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2, 2)
self.backbt.config(image=self.small_log)
def check(self):
self.b=self.em2.get()
# run SQL query
cursor=dbstudents.cursor()
cursor.execute("SELECT * FROM Students WHERE ERP='"+self.b+"'")
self.var=cursor.fetchone()
if self.var!=None:
self.fmii=Canvas(self.f,bg='#ffe8ec',width=338,height=90,bd=0,relief='flat')
self.fmii.place(x=70,y=255)
self.lb1=Label(self.fmii,text='Name :',fg='#000000',bg ='#ffe8ec',font=('Calibri',12,'bold'))
self.lb1.place(x=5,y=5)
self.lb2 = Label(self.fmii, text=self.var[1],fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb2.place(x=70, y=5)
self.lb3 = Label(self.fmii, text='Course :',fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb3.place(x=5, y=25)
self.lb4 = Label(self.fmii, text=self.var[2],fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb4.place(x=70, y=25)
self.lb5 = Label(self.fmii, text='Year :', fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb5.place(x=5, y=45)
self.lb6 = Label(self.fmii, text=self.var[3], fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb6.place(x=70, y=45)
self.lb7 = Label(self.fmii, text='Contact :', fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb7.place(x=5, y=65)
self.lb8 = Label(self.fmii, text=self.var[6],fg='#000000',bg ='#ffe8ec', font=('Calibri', 12, 'bold'))
self.lb8.place(x=70, y=65)
self.fr=Frame(self.fmi,bg='#ffe8ec',bd=5,relief='flat',width=338,height=250)
self.fr.place(x=420,y=20)
self.ff=Frame(self.fr,bg='#adefd1',bd=2,relief='flat',width=140,height=40)
self.ff.place(x=80,y=0)
self.lb=Label(self.ff,text='ISSUE BOOK',bg='#adefd1',fg='#00203f',font=('Arial',12,'bold'))
self.lb.place(x=13,y=5)
self.tt=Label(self.fr,text='BOOK ID',bg='#ffe8ec',fg='#00203f',font=('times new roman',11,'bold'))
self.tt.place(x=30,y=90)
self.e1 = Entry(self.fr, width=30, bd=5, relief='ridge', font=('Arial', 8, 'bold'))
self.e1.place(x=130, y=90)
self.bt1 = Button(self.fr, text='SUBMIT', width=8, bg='#adefd1', fg='#00203f', font=('Canara', 12,'bold'),bd=5,relief='flat',command=self.data,activeforeground='#adefd1',activebackground='#00203f')
self.bt1.place(x=15, y=160)
else:
messagebox.showwarning('Warning','This student is not registered !')
self.em2.delete(0,END)
def issueback(self):
try:
self.boot.destroy()
self.cur()
except Exception as e:
self.cur()
repeat=0
def data(self):
self.b=self.em2.get()
# run SQL query
cursor=dbstudents.cursor()
cursor.execute("SELECT * FROM Students WHERE ERP='"+self.b+"'")
self.var=cursor.fetchone()
self.flag=0
if(int(self.var[11])>=3):
try:
self.boot.destroy()
messagebox.showerror("Unable to process request","You exceed the limit of Books per student!")
self.flag=1
self.cur()
except Exception as e:
messagebox.showerror("Unable to process request","You exceed the limit of Books per student!")
self.flag=1
self.cur()
self.vva=self.e1.get()
# run SQL query
cursor=dbstore.cursor()
cursor.execute("SELECT * FROM Books WHERE BookID='"+self.vva+"'")
dbstore.commit()
self.value=cursor.fetchone()
if self.value!=None:
if(self.flag!=1):
self.boot=Tk()
self.boot.title("Issue Books")
self.boot.iconbitmap("images/afterlogin1.ico")
self.boot.configure(bg='#ffe8ec')
self.boot.geometry("370x450+880+30")
self.boot.resizable(0,0)
test.repeat=1
self.lb=Label(self.boot,text='Title:',bg='#ffe8ec',fg='#000000',font=('Calibri',12,'bold'))
self.lb.place(x=30,y=30)
self.lbn = Label(self.boot, text=self.value[1], bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lbn.place(x=120,y=30)
self.lb = Label(self.boot, text='Author:', bg='#ffe8ec', fg='#000000', font=('Calibri', 12,'bold'))
self.lb.place(x=30, y=60)
self.lbn = Label(self.boot, text=self.value[2], bg='#ffe8ec', fg='#000000', font=('Calibri', 12,'bold'))
self.lbn.place(x=120, y=60)
self.lb = Label(self.boot, text='Edition:', bg='#ffe8ec', fg='#000000', font=('Calibri', 12,'bold'))
self.lb.place(x=30, y=90)
self.lbn = Label(self.boot, text=self.value[3], bg='#ffe8ec', fg='#000000', font=('Calibri', 12,'bold'))
self.lbn.place(x=120, y=90)
self.label = Label(self.fr, text='ADD MORE BOOKS ', bg='#ffe8ec', fg='#000000', font=('times new romman', 11,'bold'))
self.label.place(x=15, y=220)
self.it1=Radiobutton(self.fr,text='YES',bg='#ffe8ec',variable='radio',value=1,command=self.yes)
self.it1.place(x=170,y=220)
self.it2 = Radiobutton(self.fr, text='NO',bg='#ffe8ec', variable='radio', value=2,command=self.no)
self.it2.place(x=240, y=220)
self.button1 = Button(self.boot, text='ISSUE', bg='#adefd1', fg='#00203f', width=10, height=0,font=('Canara', 11, 'bold'), activebackground='#00203f',activeforeground='#adefd1',command=self.issued)
self.button1.place(x=30, y=400)
self.btn = Button(self.boot, text='SEND MAIL', bg='#adefd1', fg='#00203f', width=10, height=0,font=('Canara', 11, 'bold'),activebackground='#00203f',activeforeground='#adefd1', command=self.mail)
self.btn.place(x=160, y=400)
self.x = date.today()
self.cal = Calendar(self.boot, selectmode="day", bg='#000000',year=2022,month=3,day=30)
self.cal.place(x=20,y=150)
btn1 = Button(self.boot, text="CONFIRM DATE",command=self.get_data, bg='#343148',font=('Canara', 11,'bold'),fg='#d7c49e',activebackground='#000000', activeforeground='#d7c49e', relief='flat')
btn1.place(x=90,y=350)
self.boot.mainloop()
else:
messagebox.showerror('Book Not Found','No such book exists!')
self.e1.delete(0,END)
def get_data(self):
self.datecon=self.cal.selection_get()
def yes(self):
self.n=self.n+1
self.bt1 = Button(self.fr, text='SUBMIT', width=8, bg='#adefd1', fg='#00203f', font=('Canara', 12,'bold'),bd=5,relief='flat',command=self.data,activeforeground='#adefd1',activebackground='#00203f',state=ACTIVE)
self.bt1.place(x=15, y=160)
self.e1.delete(0, END)
#self.e2.delete(0, END)
self.max=self.max-1
def no(self):
self.bt1 = Button(self.fr, text='SUBMIT', width=8, bg='#adefd1', fg='#00203f', font=('Canara', 12,'bold'),bd=5,relief='flat',command=self.data,activeforeground='#adefd1',activebackground='#00203f',state=DISABLED)
self.bt1.place(x=15, y=160)
def issued(self):
self.datecon=self.cal.selection_get()
self.ac=self.e1.get()
# run SQL query
cursor=dbstore.cursor()
cursor.execute("UPDATE Books SET Issue='Issued', ID='"+self.b+"' WHERE BookID='"+self.ac+"'")
dbstore.commit()
if self.n<=3:
# run SQL query
book=dbstudents.cursor()
self.erpid1=self.em2.get()
book.execute("SELECT * FROM Students WHERE ERP='"+self.erpid1+"'")
self.issuevar=book.fetchone()
self.sum=self.issuevar[11]+1
book.execute("UPDATE Students SET NoBook='"+str(self.sum)+"' WHERE ERP='"+self.b+"' ")
dbstudents.commit()
# run SQL query
comm=dbstudents.cursor()
comm.execute("UPDATE Students SET FromDate='"+str(self.x)+"', ToDate='"+str(self.datecon)+"' , SubmitDate='' WHERE ERP='"+self.b+"'")
dbstudents.commit()
messagebox.showinfo('Library Management System', 'YOUR BOOK HAS BEEN ISSUED')
self.boot.destroy()
self.e1.delete(0, END)
def mail(self):
self.erpid=self.em2.get()
# run SQL query
cursor=dbstudents.cursor()
cursor.execute("SELECT * FROM Students WHERE ERP='"+self.erpid+"'")
self.var=cursor.fetchone()
sender = "mb22007@students.iitmandi.ac.in"
reciever =self.var[5]
with open("pass.txt",'r') as file:
password=file.read()
message = """FROM: LIBRARY DEPARTMENT
TO : Library Issued Books Department
Subject: Hello Student! Your book has been Issued"""
try:
server = smtplib.SMTP_SSL("smtp.gmail.com", 465)
server.login(sender, password)
server.sendmail(sender, reciever, message)
print("ok")
messagebox.showinfo("Library System","Send mail Successfully !")
except Exception as e:
pass
obissue=test()
obissue.issue()
# edit book details functionality
def edit(self):
class editing(main):
def edbooks(self):
self.ffm=Frame(root,bg='#ffe8ec',width=900,height=390)
self.ffm.place(x=0,y=110)
self.fm1 = Frame(self.ffm, bg='#ffe8ec', width=500, height=200, bd=5, relief='flat')
self.fm1.place(x=150, y=30)
self.ed = Frame(self.fm1, bg='#1c1c1b', bd=0, relief='flat', width=160, height=35)
self.ed.place(x=170,y=0)
self.lab = Label(self.ed, text='EDIT BOOK DETAILS', bg='#1c1c1b', fg='#ce4a7e', font=('Calibri', 12,'bold'))
self.lab.place(x=9, y=5)
self.label3=Label(self.fm1,text='Book ID',bg='#ffe8ec',fg='#000000',font=('Times New Roman',11,'bold'))
self.label3.place(x=85,y=65)
self.entry=Entry(self.fm1,width=30,bd=4,relief='groove',font=('Calibri',8,'bold'))
self.entry.place(x=188,y=65)
self.button7 = Button(self.fm1, text='SEARCH', bg='#1c1c1b', fg='#ce4a7e', width=8,font=('Calibri', 12, 'bold'),command=self.searchedit ,relief='flat',activebackground='#ce4a7e',activeforeground='#1c1c1b')
self.button7.place(x=85,y=125)
self.backbt = Button(self.ffm, width=60, bg='#ffe8ec',activebackground='#ffe8ec',bd=0, relief='flat', command=self.cur)
self.backbt.place(x=0, y=0)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2, 2)
self.backbt.config(image=self.small_log)
def searchedit(self):
self.datas=self.entry.get()
# run SQL query
cursor=dbstore.cursor()
cursor.execute("SELECT * FROM Books WHERE BookID = '"+self.datas+"'")
dbstore.commit()
self.val=cursor.fetchone()
if self.val!=None:
self.edcat=Tk()
self.edcat.title("Library System")
self.edcat.geometry("300x360+600+230")
self.edcat.configure(bg='#ffe8ec')
self.edcat.iconbitmap("images/afterlogin1.ico")
self.fc=Frame(self.edcat,bg='#1c1c1b',width=90,height=30)
self.fc.place(x=80,y=10)
self.lab=Label(self.fc,bg='#1c1c1b',fg='#ce4a7e',text='EDIT BOOK',font=('Calibri',12,'bold'))
self.lab.place(x=3,y=3)
self.labid = Label(self.edcat, bg='#ffe8ec', fg='#000000', text='Book ID:', font=('Calibri', 12,'bold'))
self.labid.place(x=30, y=60)
self.labti = Label(self.edcat, bg='#ffe8ec', fg='#000000', text='Title:', font=('Calibri', 12, 'bold'))
self.labti.place(x=30, y=100)
self.labaut = Label(self.edcat, bg='#ffe8ec', fg='#000000', text='Author:', font=('Calibri', 12,'bold'))
self.labaut.place(x=30, y=140)
self.labed = Label(self.edcat, bg='#ffe8ec', fg='#000000', text='Edition:', font=('Calibri', 12,'bold'))
self.labed.place(x=30, y=180)
self.labpr = Label(self.edcat, bg='#ffe8ec', fg='#000000', text='Price:', font=('Calibri', 12,'bold'))
self.labpr.place(x=30, y=220)
self.en1=Entry(self.edcat,width=20,bd=4,relief='groove',font=('Times New Roman',9,'bold'))
self.en1.place(x=110,y=60)
self.en2 = Entry(self.edcat, width=20, bd=4, relief='groove',font=('Times New Roman',9,'bold'))
self.en2.place(x=110, y=100)
self.en3 = Entry(self.edcat, width=20, bd=4, relief='groove',font=('Times New Roman',9,'bold'))
self.en3.place(x=110, y=140)
self.en4 = Entry(self.edcat, width=20, bd=4, relief='groove',font=('Times New Roman',9,'bold'))
self.en4.place(x=110, y=180)
self.en5 = Entry(self.edcat, width=20, bd=4, relief='groove',font=('Times New Roman',9,'bold'))
self.en5.place(x=110, y=220)
self.butt = Button(self.edcat, text='SUBMIT', bg='#1c1c1b', fg='#ce4a7e', width=8,font=('Calibri', 12, 'bold'),command=self.savedit,relief='flat')
self.butt.place(x=30, y=273)
self.en1.insert(0, self.val[0])
self.en2.insert(0, self.val[1])
self.en3.insert(0, self.val[2])
self.en4.insert(0, self.val[3])
self.en5.insert(0, self.val[4])
self.edcat.mainloop()
else:
messagebox.showerror('Invalid Entry',"This Book doesn't exists!")
self.entry.delete(0,END)
def savedit(self):
self.id = self.en1.get()
self.ti = self.en2.get()
self.au = self.en3.get()
self.ed = self.en4.get()
self.pi = self.en5.get()
if(self.id and self.ti and self.au and self.ed and self.pi):
# run SQL query
cursor= dbstore.cursor()
cursor.execute("UPDATE Books SET BookID='"+self.id+"', Title='"+self.ti+"',Author='"+self.au+"',Edition='"+self.ed+"',Price='"+self.pi+"' WHERE BookID='"+self.datas+"'")
dbstore.commit()
messagebox.showinfo('Changes Saved','Data has been updated successfully!')
self.edcat.destroy()
self.entry.delete(0,END)
else:
messagebox.showerror('Error','Enter Valid Details')
self.entry.delete(0,END)
obj=editing()
obj.edbooks()
# return book functionality
def returnbook(self):
class retu(main):
def __init__(self):
self.frame=Frame(root,bd=0,relief='flat',bg='#ffe8ec',width=900,height=390)
self.frame.place(x=0,y=110)
self.f1 = Frame(self.frame, bg='#ffe8ec', width=500, height=200, bd=5, relief='flat')
self.f1.place(x=200, y=15)
self.ed = Frame(self.f1, bg='#641b4e', bd=0, relief='flat', width=130, height=35)
self.ed.place(x=170, y=0)
self.lac = Label(self.ed, text='RETURN BOOKS ', bg='#641b4e', fg='#fff', font=('Calibri', 12, 'bold'))
self.lac.place(x=10, y=5)
self.label8 = Label(self.f1, text='ERP ID', bg='#ffe8ec', fg='#000000', font=('Times New Roman', 11, 'bold'))
self.label8.place(x=85, y=65)
self.entry4 = Entry(self.f1, width=30, bd=4, relief='groove', font=('Calibri', 8, 'bold'))
self.entry4.place(x=188, y=65)
self.button9 = Button(self.f1, text='RETURN', bg='#641b4e', fg='#fff', width=8, height=0,
font=('Calibri', 12, 'bold'),command=self.retbook,activebackground="#000",activeforeground="#641b4e")
self.button9.place(x=85, y=120)
self.backbt = Button(self.frame, width=60, bg='#ffe8ec', activebackground='#ffe8ec',bd=0, relief='flat', command=self.cur)
self.backbt.place(x=0, y=0)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2,2)
self.backbt.config(image=self.small_log)
def retsucc(self):
self.entry4.delete(0,END)
# run SQL query
cursor1 = dbstudents.cursor()
cursor1.execute("UPDATE Students SET FromDate='',ToDate='',Charge='"+str(self.charge)+"' WHERE ERP='"+self.entry+"'")
dbstudents.commit()
messagebox.showinfo("Success","Charges Updated and Books Returned Succesfully")
self.tom.destroy()
def retbook(self):
self.charge=0
self.entry=self.entry4.get()
# run SQL query
cursor=dbstudents.cursor()
cursor.execute("SELECT * FROM Students WHERE ERP='"+self.entry+"'")
dbstudents.commit()
self.data=cursor.fetchone()
if self.data!=None:
if(int(self.data[11])>=1):
self.get_date = date.today()
# run SQL query
cursor = dbstudents.cursor()
cursor.execute("UPDATE Students SET NoBook = 0, SubmitDate='" + str(self.get_date) + "' WHERE ERP='" + self.entry + "'")
dbstudents.commit()
# run SQL query
cursor=dbstore.cursor()
cursor.execute("UPDATE Books SET Issue='', ID='' WHERE ID='"+self.entry+"'")
dbstore.commit()
from datetime import datetime
# run SQL query
cursor=dbstudents.cursor()
cursor.execute("SELECT * FROM Students WHERE ERP='"+self.entry+"'")
dbstudents.commit()
self.var=cursor.fetchone()
if self.var!=None:
self.a=self.var[8]
self.b=self.var[9]
formatStr='%Y-%m-%d'
delta1=datetime.strptime(self.a,formatStr)
delta2=datetime.strptime(self.b, formatStr)
delta=delta2-delta1
chm=delta.days
if chm<=0:
messagebox.showinfo("Success","Books returned successfully")
self.entry4.delete(0,END)
else:
self.tom=Tk()
self.tom.geometry("300x150+300+258")
self.tom.iconbitmap("images/afterlogin1.ico")
self.tom.title('Library System')
self.tom.resizable(0,0)
self.tom.configure(bg="#ffe8ec")
self.lb=Label(self.tom,text="Name of Student: ",bg="#ffe8ec",fg="#000000",font=('Calibri',11,'bold'))
self.lb.place(x=5,y=20)
self.lb2=Label(self.tom,text=self.var[1],bg="#ffe8ec",fg="#000000",font=('Calibri',11,'bold'))
self.lb2.place(x=130,y=20)
self.charge=(5*chm)+int(self.var[10])
self.lb3=Label(self.tom,text="Fine Charge: ",bg="#ffe8ec",fg="#000000",font=('Calibri',11,'bold'))
self.lb3.place(x=5,y=55)
self.lc2 = Label(self.tom, text=self.charge, bg="#ffe8ec", fg="#000000", font=('Calibri',11,'bold'))
self.lc2.place(x=130, y=55)
self.lc3 = Label(self.tom, text='Rs.', bg="#ffe8ec", fg="#000000",font=('Calibri', 11, 'bold'))
self.lc3.place(x=150, y=55)
self.tombtn = Button(self.tom,text='SUBMIT', background='#641b4e',foreground='white',font=('Calibri',12,'bold'),width=8,activebackground='#000000',activeforeground='#641b4e',relief='flat',command=self.retsucc)
self.tombtn.place(x=5,y=90)
self.tom.mainloop()
# run SQL query
cursor1 = dbstudents.cursor()
cursor1.execute("UPDATE Students SET FromDate='',ToDate='',Charge='"+str(self.charge)+"' WHERE ERP='"+self.entry+"'")
dbstudents.commit()
else:
messagebox.showwarning("No Books Found","This student does not have any book issued!")
self.entry4.delete(0,END)
else:
messagebox.showerror("Invalid ERP ID","This student doesn't exist!")
self.entry4.delete(0,END)
object=retu()
# delete book record functionality
def delete(self):
class dele(main):
def deletebooks(self):
self.ff = Frame(root, bg='#ffe8ec', width=900, height=390)
self.ff.place(x=0, y=110)
self.f1 = Frame(self.ff, bg='#ffe8ec', width=500, height=200, bd=5, relief='flat')
self.f1.place(x=200, y=15)
self.ed = Frame(self.f1, bg='#7ea310', bd=0, relief='flat', width=120, height=30)
self.ed.place(x=150, y=0)
self.lac = Label(self.ed, text='DELETE BOOKS ', bg='#7ea310', fg='#213502', font=('Calibri', 12,'bold'))
self.lac.place(x=7, y=3)
self.label8 = Label(self.f1, text='Book ID', bg='#ffe8ec', fg='#000000', font=('times new roman', 11, 'bold'))
self.label8.place(x=85, y=65)
self.entry4 = Entry(self.f1, width=30, bd=4, relief='groove', font=('Calibri', 8, 'bold'))
self.entry4.place(x=188, y=65)
self.button9 = Button(self.f1, text='DELETE', bg='#7ea310', fg='#213502', width=8,font=('Calibri', 12, 'bold'),command=self.deldata,relief='flat',activebackground='#000000',activeforeground='#7ea310')
self.button9.place(x=85, y=120)
self.backbt = Button(self.ff,width=60, bg='#ffe8ec',activebackground='#ffe8ec',bd=0, relief='flat', command=self.cur)
self.backbt.place(x=0, y=0)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2,2)
self.backbt.config(image=self.small_log)
def deldata(self):
self.a=self.entry4.get()
# run SQL query
cursor=dbstore.cursor()
cursorv=dbstore.cursor()
cursorv.execute("SELECT * FROM BOOKS WHERE BookID='"+self.a+"'")
dbstore.commit()
self.validation=cursorv.fetchone()
if(self.validation!=None):
# run SQL query
cursor.execute("DELETE FROM Books WHERE BookID='"+self.a+"'")
dbstore.commit()
messagebox.showinfo('Succesful','The book is successfully removed from the store!')
self.entry4.delete(0,END)
else:
messagebox.showerror('Invalid Operation','This book does not exist!')
self.entry4.delete(0,END)
occ=dele()
occ.deletebooks()
def search(self):
class demt(main):
def delmdata(self):
self.fc = Frame(root, bg='#ffe8ec', width=900, height=390)
self.fc.place(x=0, y=110)
self.fc1 = Frame(self.fc, bg='#ffe8ec', width=500, height=200, bd=5, relief='flat')
self.fc1.place(x=200, y=15)
self.edm = Frame(self.fc1, bg='#b76e79', bd=0, relief='flat', width=130, height=35)
self.edm.place(x=140, y=0)
self.lac = Label(self.edm, text='SEARCH BOOKS ', bg='#b76e79', fg='#fff', font=('Calibri', 12, 'bold'))
self.lac.place(x=8, y=5)
self.label8 = Label(self.fc1, text='Book ID', bg='#ffe8ec', fg='#000000', font=('Times New Roman', 11, 'bold'))
self.label8.place(x=85, y=65)
self.entryl= Entry(self.fc1, width=30, bd=4, relief='groove', font=('Calibri', 8, 'bold'))
self.entryl.place(x=188, y=65)
self.butto = Button(self.fc1, text='SEARCH', bg='#b76e79', fg='#fff', width=8,font=('Calibri', 12, 'bold'),command=self.srch,relief='flat',activebackground='#000000',activeforeground='#b76e79')
self.butto.place(x=85, y=120)
self.backbt = Button(self.fc,width=60, bg='#ffe8ec',activebackground='#ffe8ec',bd=0, relief='flat', command=self.cur)
self.backbt.place(x=0, y=0)
self.log = PhotoImage(file='images/backbtn1.png')
self.backbt.config(image=self.log, compound=LEFT)
self.small_log = self.log.subsample(2, 2)
self.backbt.config(image=self.small_log)
def srch(self):
self.emp=self.entryl.get()
# run SQL query
cursor=dbstore.cursor()
cursor.execute("SELECT * FROM Books WHERE BookID='"+self.emp+"'")
dbstore.commit()
self.srval=cursor.fetchone()
if self.srval!=None:
self.top=Tk()
self.top.title("Library System")
self.top.iconbitmap("images/afterlogin1.ico")
self.top.geometry("400x200+335+250")
self.top.resizable(0, 0)
self.top.configure(bg='#ffe8ec')
self.frm=Frame(self.top,bg='#b76e79',width=100,height=35)
self.frm.place(x=100,y=10)
self.mnlb=Label(self.frm,bg='#b76e79',fg='#fff',text="AVAILABLE",font=('Calibri',12,'bold'))
self.mnlb.place(x=9,y=5)
self.lb1 = Label(self.top, text='Title: ', bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lb1.place(x=85,y=70)
self.lb2=Label(self.top,text=self.srval[1],bg='#ffe8ec', fg='#000000',font=('Calibri',12,'bold'))
self.lb2.place(x=165,y=70)
self.lb3 = Label(self.top, text='Author: ', bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lb3.place(x=85, y=110)
self.lb4 = Label(self.top, text=self.srval[2], bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lb4.place(x=165, y=110)
self.lb5 = Label(self.top, text='Edition: ',bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lb5.place(x=85, y=150)
self.lb6 = Label(self.top, text=self.srval[3], bg='#ffe8ec', fg='#000000', font=('Calibri', 12, 'bold'))
self.lb6.place(x=165, y=150)
self.entryl.delete(0,END)
else:
messagebox.showwarning('Invalid Data','This book does not exists!')
self.entryl.delete(0,END)
object=demt()
object.delmdata()
# show books functionality
def show(self):