Skip to content

Commit 5f0b275

Browse files
committed
Bug Fixes and Some New Features
1 parent 2afbedc commit 5f0b275

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed

AddBook.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,17 @@
22
import tkinter
33
from database import LMS
44
from tkinter.messagebox import showerror, showwarning, showinfo
5+
from tkcalendar import DateEntry
56

67
db = LMS("db/lms.db")
78

89
class AddBook(customtkinter.CTk):
910
def __init__(self):
1011
super().__init__()
1112
self.title("Library Management System")
12-
self.minsize(500,390)
13-
self.maxsize(500,390)
14-
self.geometry('500x390')
13+
self.minsize(500,400)
14+
self.maxsize(500,400)
15+
self.geometry('500x400')
1516

1617
heading_frame = customtkinter.CTkFrame(master=self,corner_radius=10)
1718
heading_frame.pack(padx=10,pady=10, ipadx=20, ipady=5,fill="x",anchor="n")
@@ -58,8 +59,11 @@ def __init__(self):
5859
purchase_dt_lbel = customtkinter.CTkLabel(master=main_frame,text="Purchased Date",)
5960
purchase_dt_lbel.grid(column=1,row=5,padx=5, pady=5)
6061

61-
self.purchase_dt_inp = customtkinter.CTkEntry(master=main_frame,width=200)
62-
self.purchase_dt_inp.grid(column=2,row=5,padx=5, pady=5)
62+
self.purch_dt_var = customtkinter.StringVar(self)
63+
self.purchase_dt = DateEntry(main_frame, width=10,borderwidth=2, year=2022, textvariable=self.purch_dt_var)
64+
self.purchase_dt.grid(column=2,row=5,padx=5, pady=5)
65+
#self.purchase_dt_inp = customtkinter.CTkEntry(master=main_frame,width=200)
66+
#self.purchase_dt_inp.grid(column=2,row=5,padx=5, pady=5)
6367

6468
add_new_book_btn = customtkinter.CTkButton(master=main_frame,text="Add Book", font=customtkinter.CTkFont(family="Verdana",size=16, weight="bold"),command=self.save_new_book)
6569
add_new_book_btn.grid(column=2,row=6,padx=10,pady=5,ipadx=10,ipady=10)
@@ -70,7 +74,7 @@ def save_new_book(self):
7074
book_author = self.book_author_input.get()
7175
book_edition = self.book_edition_input.get()
7276
book_price = self.book_price_input.get()
73-
purchase_dt = self.purchase_dt_inp.get()
77+
purchase_dt = self.purch_dt_var.get()
7478
if book_id != "" and book_nme != "" and book_author != "" and book_edition != "" and book_price != "" and purchase_dt != "":
7579
data = (
7680
book_id,

BookReport.py

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ class BookReport(customtkinter.CTk):
1111
def __init__(self):
1212
super().__init__()
1313
self.title("Library Management System")
14-
self.minsize(400,250)
15-
self.maxsize(400,250)
16-
self.geometry('400x250')
14+
self.minsize(400,300)
15+
self.maxsize(400,300)
16+
self.geometry('400x300')
1717

1818
heading_frame = customtkinter.CTkFrame(master=self,corner_radius=10)
1919
heading_frame.pack(padx=10,pady=10, ipadx=20, ipady=5,fill="x",anchor="n")
@@ -33,6 +33,9 @@ def __init__(self):
3333
export_all_book_btn = customtkinter.CTkButton(master=main_frame,text="Export All Book",command=self.export_all_book)
3434
export_all_book_btn.pack(padx=10,pady=10)
3535

36+
export_fine_btn = customtkinter.CTkButton(master=main_frame,text="Export Fine Details",command=self.export_fine_detail)
37+
export_fine_btn.pack(padx=10,pady=10)
38+
3639
def export_available_book(self):
3740
dbt = db.all_available_book()
3841
data = pd.read_sql_query(dbt[0],dbt[1])
@@ -62,4 +65,6 @@ def export_all_book(self):
6265
showinfo(title="Success",message="Exported successfully")
6366
except:
6467
showerror(title="Error", message="Location not selected...")
65-
68+
69+
def export_fine_detail(self):
70+
pass

__pycache__/AddBook.cpython-39.pyc

78 Bytes
Binary file not shown.
220 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)