Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 56

VIDEO LIBRARY

MANAGEMENT SYSTEM

Computer Science Project

Name: Rishika Verma

Class: XII

Section: B
ACKNOWLEDGEMENT

I warmly acknowledge the continuous encouragement and


timely suggestions offered by our dear Principal. I extend
my hearty thanks for giving me the opportunity to make
use of the facilities available in the campus to carry out the
project successfully.

I am highly indebted to Ms. Anjula Sharma for the


constant supervision, providing, necessary information and
supporting in completing the project. I would like to
express my gratitude towards them for their kind
cooperation and encouragement.

Finally, I extend my gratefulness to one and all who are


directly or indirectly involved in the successful completion
of this project work.
TABLE OF CONTENTS

Sl. no Topic Page no.


1 I. System Specifications at a Glance 1
2 II. Requirement Analysis 3
3 III. System Specifications 4
4 IV. Overview of Python 4
5 V. Modules 8
6 VI. Table Designs and Structures 9
7 VII. Procedure/Function Description 9
8 VIII. Program Source Code 10
9 IX. Output Screens 36
10 X. Future Enhancements 52
11 XI. Bibliography 52
I. SYSTEM SPECIFICATION AT A GLANCE
AIM
The objective of our program is to computerize the video library management
system. This project is a software for the admin person in the library. Front end
is developed using Python 3.7.7 software and back end is with MySQL 8.0.
Thus, the entire project is based on Python-MySQL connectivity. The various
modules included are,
1. Adding a CD
2. Searching for a CD with name
3. Display all available CDs
4. Display all CDs of a language
5. Display details of all CDs
6. CD issue
7. CD return
8. Deleting a CD
9. Registering a customer
10.Display all customers
11.Deleting a customer
12.Modifying a customer
13.Modifying CD
14.Exit

Adding a CD
In this module, software provides the interface to enter the details of a new CD. This
includes cd number, name, language and availability.

Searching for a CD with name


Module search for a CD using name and lists the details using tree view widget in
Python’s tkinter module.

Display all available CDs


Module lists all CDs that are available in the library.

Display all CDs of a language


Module lists all CDs of a language in the library.

Display details of all CDs


Module lists all CDs in the library.

CD Issue
This module allows to issue a CD to a customer by entering the CD number and the

1
customer id. After issuing the availability field of cd table is updated with ‘no’ and this
also updates customer table fields cd number and token. Token 1 denotes customer is
having a cd with him and token 0 denotes customer don’t have a cd with him at present.
CD Return
This module allows to return a cd back to the library. This also updates cd and customer
table.

Modify details of a CD
This module allows to update the details of a cd. It’s possible only if the cd is available
in the library.

Deleting a CD
This asks the administrator to enter the cd number to delete and removes the cd from the
database. It’s possible only if the cd is available.

Registering a customer
This module allows to register a customer by adding details like customer id, name,
telephone and address. The fields cd number and token will be inserted as 0.

Display all customers


Module lists all customers registered in the library.

Deleting a customer
This asks the administrator to enter the customer id to delete and removes the customer
from the database. It’s possible only if the customer is having any cd with him.

Modifying a customer
This module allows to update the details of a customer.

Exit
This module allows the administrator to come out from the software whenever he is
moving out of his seat. So that unauthorized people cannot handle the things.

2
II. REQUIREMENT ANALYSIS

HARDWARE REQUIREMENTS

 Processor : Intel® CoreTM i3 CPU

 CPU speed : 2.67 GHz

 RAM : 4GB

 Hard disk memory : 80GB

 Cache : 512 KB

 Monitor

 Keyboard

SOFTWARE REQUIREMENTS

 Operating System : Microsoft Windows 10

 Software : Python 3.8.5 and MySQL Server 8.0.21

3
III. SYSTEM SPECIFICATIONS
DATA DESIGN
MySQL Database: lib
Table: cd

Table: cdcust

IV. PYTHON OVERVIEW


The Python programming language is an object-oriented language, which
means that it can model real-world entities. It is also dynamically-typed because
it carries out type-checking at runtime. It does so to make sure that the type of
construct matches what we expect it to be. The distinctive feature of Python is
that it is an interpreted language. The Python IDLE (Integrated Development
Environment) executes instructions one line at a time.
What makes Python so powerful?
Python provides the PyPI (Python Package Index). It is a repository of third-
party Python modules and you can install it using a program called pip.

Python History
The Python programming language was conceived in the late 1980s and was
named after the “BBC TV show Monty Python’s Flying Circus”. Guido van
Rossum started implementing Python at CWI in the Netherlands in December of
1989.

4
Python Constructs
i. Functions
A function in Python is a collection of statements grouped under a name. You
can use it whenever you want to execute all those statements at a time. You can
call it wherever you want and as many times as you want in a program. A
function may return a value.

ii. Classes
Python is an object-oriented language. It supports classes and objects. A class is
an abstract data type. In other words, it is a blueprint for an object of a certain
kind. It holds no values. An object is a real-world entity and an instance of a
class.

iii. Modules
A Python module is a collection of related classes and functions. We have
modules for mathematical calculations, string manipulations, web programming,
and many more. User can define his/her own modules, apart from built-in
modules.

iv. Packages
Python package is a collection of related modules. You can either import a
package or create your own.

v. List
A list is a collection of values. Declared in the CSV (Comma-Separated Values)
format and delimit using square brackets:
arity = [1,2,3]
A list may also contain elements of different types, and the indexing begins at 0.
You can also slice lists; slicing is a way of retrieving some values from it.

vi. Tuple
A tuple is like a list, but it is immutable (you cannot change its values).
pizza = (‘base’, ‘sauce’, ‘cheese’, ‘mushroom’)
vii. Dictionary
A dictionary is a collection of key-value pairs. Declare it using curly braces, and
commas to separate key-value pairs. Also, separate values from keys using a
colon (:).

5
student = {‘Name’: ‘Abc’, ‘Age’: 21}
viii. Comments and Docstrings
Declare comments using an octothorpe (#). However, Python does support
multiline comments using docstring. Also, docstrings are documentation strings
that help explain the code.
#This is a comment
“““
This is a docstring
”””
Python has a lot of other constructs. These include control structures, functions,
exceptions, etc.

Features of Python
The Python programming language is one of the richest languages.

i. Easy
Python is very easy to learn and understand; using this Python tutorial, any
beginner can understand the basics of Python.

ii. Interpreted
It is interpreted (executed) line by line. This makes it easy to test and debug.

iii. Object-Oriented
The Python programming language supports classes and objects. We discussed
these above.

iv. Free and Open Source


The language and its source code are available to the public for free; there is no
need to buy a costly license.

v. Portable
Since it is open-source, you can run Python on Windows, Mac, Linux or any
other platform. Your programs will work without needing to the changed for
every machine.

vi. GUI Programming


You can use it to develop a GUI (Graphical User Interface). One way to do this
is through Tkinter.

vii. Large Library


Python provides you with a large standard library. You can use it to implement a
variety of functions without needing to reinvent the wheel every time. Just pick
the code you need and continue. This lets you focus on other important tasks.

6
Interface Python with SQL
The Python programming language has powerful features for database
programming. Python supports various databases like MySQL, Oracle,
PostgreSQL, etc. Python also supports Data Definition Language (DDL), Data
Manipulation Language (DML) and Data Query Statements. For database
programming, Python DB-API is a widely used module that provides a database
application programming interface. It’s a standard for database interfaces.
Python Database API supports wide range of database servers like MySQL,
Oracle, PostgreSQL, etc.
Python-MySQL Connectivity
While designing real-life applications, certain situations arise pertaining to
storing some important and necessary information by the user. Usually, the data
inputted by the user along with the generated output is displayed but not stored
because all program execution takes place inside the RAM which is a temporary
memory and as soon as we close the form, its contents (form input and generated
output) get erased. They cannot be retrieved since they are not saved on a hard
disk (or any secondary storage device). Thus, when the application is executed
the second time, it requires a new set of inputs from the user. This limitation can
be overcome by sending output generated and saving the input fetched from the
user in a database created at the back-end of the application. The input is fetched
from the user using Python Interface. This is termed as the Front-End Interface
(Python) of the application. An application usually stores a lot of data in the
form of a database which is not directly accessible to the user. This database is
used by the application to give suitable response to the user. This database is
called Back-End Database (MySQL).
MySQL-CONNECTOR
So, we are integrating MySQL with Python interface for executing any database
applications. To establish connectivity between Python and MySQL, we have to
install MySQL-connector using pip command on the command prompt;
MySQL-connector is an interface for connecting to MySQL database server
from Python. It implements the Python Database API.
Python-MySQL Database Access
MySQL-connector is the Python interface to work with MySQL databases. It
must be imported in Python to work with any MySQL databases. All the SQL
commands are implemented through Python Interface.

7
V. MODULES
Modules in our project along with their associated functions are as follows:
Module Name Purpose Functions
mysql.connnector To establish connection connect( )
between Python and cursor( )
MySQL commit( )
execute( )
fetchone( )
fetchall( )
close( )
tkinter to create the GUI Tk( )
title( )
geometry( )
configure( )
Label( )
place( )
Entry( )
mainloop( )
Button( )
get( )
pack()
Frame( )
Scrollbar( )
destroy( )
Tkinter’s To create intractable showerror( )
tkmessagebox message boxes showinfo( )
User defined Deals with the SQL add ( )
functions based operations display1 ( ), display2 ( )
display3 ( ), search ( )
issue ( ), cdreturn ( )
delete ( ), modifycd ( )
register ( ), display4 ( )
remove ( ), modifyc ( )
stop ( ), menu( )
closingframes( )
valnum( )
valname( )

8
VI. TABLE DESIGN AND STRUCTURE
Table: cd
Sno. Field Name Type/Constraints Purpose
1 cdno int PRIMARY KEY It stores cd number
2 cname char(20) It stores cd name
3 language char(25) It stores cd language
4 avail char(6) It stores the availability os a cd
Table: cdcust
Sno. Field Name Type/Constraints Purpose
1 cusid int PRIMARY KEY It stores customer id
2 cname char(25) It stores customer name
3 tele int It stores telephone number of customer
4 address char(10) It stores address of customer
5 cdno char(30) Stores cd number issued to customer
6 token char(5) Denotes whether customer is having a
cd or not
VII. PROCEDURE/FUNCTION DESCRIPTION
S.No Function Purpose
1 add ( ) For adding a new cd
2 display1 ( ) To display all CD details
3 display2 ( ) To display all available cds
4 display3 ( ) To display all cds of a language
5 search ( ) To search for a CD with name
6 issue ( ) To issue a CD to customer
7 cdreturn ( ) To return CD
8 delete ( ) To delete a CD
9 modifycd ( ) To modify details of a CD
10 register ( ) To register a customer
11 logout ( ) To exit from project
12 menu( ) To display home screen
13 closingframes( ) For closing all frames that’s kept open
14 valname( ) For validating character data with alphabets and space
15 valnum( ) For validating numerical data
16 display4 ( ) To display all customer details
17 remove ( ) To remove a customer
18 modifyc ( ) To modify details of a customer
19 stop ( ) To exit from project

9
VIII. SOURCE CODE
#main program with menu
import os
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
import mysql.connector

#Function for closing all opened frames if not done


def closingframes():
try:
if D.winfo_exists():
D.destroy()
except:
pass

def valnum(S):
for i in S:
if i.isdigit() == True:
pass
else:
return -1
return 0

def valname(S):
for i in S:
if i.isalpha() == True or i == ' ':
pass
else:
return -1
return 0

#Function to add a CD
def add():
global D
closingframes()

con=mysql.connector.connect(host='localhost', database='lib', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

D = Frame(mainwin,'', width=440, height=400, bg='white')

10
D.place(x=320, y=160)

tt = Label(D, text="Adding A CD", bg='white', fg='black', font='forte 20 bold')


tt.place(x=5, y=0)

cdn = Label(D, text = "CD Number", bg='white', fg ="blue" , font = 'Times 18' )
cdn.place(x=10, y=40)
Tcdn = Entry(D, width=30)
Tcdn.place(x=200, y = 50)

cdname = Label(D, text = "CD Name", bg='white', fg ="blue" , font = 'Times 18' )
cdname.place(x=10, y=70)
Tcdname = Entry(D, width=30)
Tcdname.place(x=200, y = 80)

lan = Label(D, text = "Language", bg='white', fg ="blue" , font = 'Times 18' )


lan.place(x=10, y=100)
Tlan = Entry(D, width=30)
Tlan.place(x=200, y = 110)

cv2 = Canvas(D,width=205, height=150, bg='black', highlightthickness=0)


m2 = PhotoImage(file='p2.gif')
cv2.create_image(0,0, anchor=NW, image=m2)
cv2.place(x=120, y=230)

def addp():
if Tcdn.get()=='' or Tcdname.get()=='' or Tlan.get()=='':
messagebox.showerror("Error","Enter data completely")
else:
w1 = valnum(Tcdn.get())
w2 = valname(Tcdname.get())
w3 = valname(Tlan.get())

if w1 == -1:
messagebox.showerror("Error","Wrong CD number")
elif w2 == -1:
messagebox.showerror("Error","Wrong CD name")
elif w3 == -1:
messagebox.showerror("Error","Wrong Language")
else:
cur.execute('select * from CD')
f=0
res = cur.fetchall()
for i in res:
if int(i[0]) == int(Tcdn.get()):
f=1
break
if f == 1:
messagebox.showerror("Error","This CD number already exists")
else:

11
stmt = "insert into CD (cdno,cdname,language,avail) values(%s,%s,%s,%s)"
val = (int(Tcdn.get()), Tcdname.get(),Tlan.get(), 'yes')

cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","CD added successfully")
con.close()
D.destroy()

But2 = Button(D, text = "Submit", command=addp, bg='black',fg ="white" , font = 'forte 14',
relief=FLAT )
But2.place(x=180, y=150)
mainwin.mainloop()

#Function to display all CD details


def display1():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400, bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database='lib', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

cur.execute("select * from CD")

L2 = Label(D, text = "DISPLAY ALL CD DETAILS", anchor=W, bg='white', fg ="black" ,


font = 'forte 20')
L2.pack()

t1 = ttk.Treeview(D)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","avail")
t1.column("cdno", width=60, minwidth=60,anchor=CENTER)
t1.column("cdname", width=170, minwidth=170,anchor=CENTER)
t1.column("language", width=120, minwidth=120,anchor=CENTER)
t1.column("avail", width=80, minwidth=80,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)

12
t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("avail", text="Available", anchor=CENTER)

i=0
for row in cur:
t1.insert('',i, values=(row[0],row[1],row[2],row[3]))
i = i+1

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def treeclose():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose, bg='black',fg ="white" , font = 'forte 18',
relief=FLAT )
tb1.pack()

#Function to display all available cds


def display2():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400, bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

cur.execute("select * from CD where avail='yes'")

L2 = Label(D, text = "DISPLAY ALL AVAILABLE CDS", anchor=W, bg='white', fg


="black" , font = 'forte 20')
L2.pack()

t1 = ttk.Treeview(D)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))

13
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","avail")
t1.column("cdno", width=80, minwidth=80,anchor=CENTER)
t1.column("cdname", width=125, minwidth=125,anchor=CENTER)
t1.column("language", width=120, minwidth=120,anchor=CENTER)
t1.column("avail", width=100, minwidth=100,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)


t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("avail", text="Available", anchor=CENTER)

i=0
for row in cur:
t1.insert('',i, values=(row[0],row[1],row[2],row[3]))
i = i+1

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def treeclose2():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose2, bg='black',fg ="white" , font = 'forte


18', relief=FLAT )
tb1.pack()

#Function to display all cds of a language


def display3():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400, bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

L2 = Label(D, text = "DISPLAY CD BASED ON LANGUAGE", bg='white', fg ="black" ,


font = 'forte 20')

14
L2.pack()

Lan = Label(D, text = "Enter Language to Search", bg='white', fg ="red" , font = 'Times 10' )
Lan.pack()
TLan = Entry(D, width=40)
TLan.pack()

def searchp():
if TLan.get() == '':
messagebox.showerror("Error","Enter language to search")
else:
e1 = valname(TLan.get())
if e1 == -1:
messagebox.showerror("Error","Wrong language")
else:
s="select * from CD where language=%s"
v=(TLan.get(),)
cur.execute(s,v)

for i in t1.get_children():
t1.delete(i)

i=0
for row in cur:
t1.insert('',i, values=(row[0],row[1],row[2],row[3]))
i = i+1

B1 = Button(D, text = "Search", command=searchp, bg='black',fg ="white" , font = 'forte 14',


relief=FLAT )
B1.pack()

t1 = ttk.Treeview(D)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","available")
t1.column("cdno", width=80, minwidth=80,anchor=CENTER)
t1.column("cdname", width=100, minwidth=100,anchor=CENTER)
t1.column("language", width=100, minwidth=100,anchor=CENTER)
t1.column("available", width=80, minwidth=80,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)


t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("available", text="Available", anchor=CENTER)

vsb=ttk.Scrollbar(D,orient='vertical')

15
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def treeclose3():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose3, bg='black',fg ="white" , font = 'forte


18', relief=FLAT )
tb1.pack()

#Function to search for a CD with name


def search():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400, bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

L2 = Label(D, text = "DISPLAY DETAILS OF A CD", bg='white', fg ="blue" , font = 'Times


20')
L2.pack()

Lcdname = Label(D, text = "Enter CD Name to Search", bg='white', fg ="red" , font = 'Times
10' )
Lcdname.pack()
Tcdname = Entry(D, width=40)
Tcdname.pack()

def searchp():
if Tcdname.get() == '':
messagebox.showerror("Error","Enter CD Name")
else:
e1 = valname(Tcdname.get())
if e1 == -1:
messagebox.showerror("Error","Wrong CD Name")
else:
s="select * from CD where cdname=%s"
v=(Tcdname.get(),)

16
cur.execute(s,v)

for i in t1.get_children():
t1.delete(i)

i=0
for row in cur:
t1.insert('',i, text='', values=(row[0],row[1],row[2],row[3]))
i = i+1

B1 = Button(D, text = "Search", command=searchp, bg='black',fg ="white" , font = 'Times


14', relief=FLAT )
B1.pack()

t1 = ttk.Treeview(D)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","available")
t1.column("cdno", width=60, minwidth=60,anchor=CENTER)
t1.column("cdname", width=150, minwidth=150,anchor=CENTER)
t1.column("language", width=100, minwidth=100,anchor=CENTER)
t1.column("available", width=120, minwidth=120,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)


t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("available", text="Available", anchor=CENTER)

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def treeclose():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose, bg='black',fg ="white" , font = 'Times


18', relief=FLAT )
tb1.pack()

#Function to issue a CD to customer


def issue():
global D
closingframes()

17
D = Frame(mainwin,'', width=750, height=400,bg='white')
D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

cur.execute("use jean")
cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

L2 = Label(D, text = "ISSUING A CD", bg='white', fg ="blue" , font = 'Times 20')


L2.pack()

Lcdid = Label(D, text = "Enter CD NO. to be isuued", bg='white', fg ="red" , font = 'Times
10' )
Lcdid.pack()
Tcdid = Entry(D, width=40)
Tcdid.pack()

Lcid = Label(D, text = "Enter Customer ID for isuue", bg='white', fg ="red" , font = 'Times
10' )
Lcid.pack()
Tcid = Entry(D, width=40)
Tcid.pack()

def issp():
if Tcid.get() == '' or Tcdid.get() == '':
messagebox.showerror("Error","Enter CD NO. / customer id")
else:
e1 = valnum(Tcdid.get())
e2 = valnum(Tcid.get())

if e1 == -1:
messagebox.showerror("Error","Wrong CD ID")
elif e2 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
s1="select * from CD where cdno=%s"
v1=(Tcdid.get(),)
cur.execute(s1,v1)

for i in t1.get_children():
t1.delete(i)

18
i=0
for row in cur:
t1.insert('',i, values=(row[0],row[1],row[2],row[3]))
i = i+1

B1 = Button(D, text = "Submit", command=issp, bg='black',fg ="white" , font = 'Times 14',


relief=FLAT )
B1.pack()

t1 = ttk.Treeview(D, height=7)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","avail")
t1.column("cdno", width=80, minwidth=80,anchor=CENTER)
t1.column("cdname", width=130, minwidth=130,anchor=CENTER)
t1.column("language", width=100, minwidth=100,anchor=CENTER)
t1.column("avail", width=150, minwidth=150,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)


t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("avail", text="Availability", anchor=CENTER)

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def issp2():
w2 = valnum(Tcdid.get())
w3 = valnum(Tcid.get())

if w2 == -1:
messagebox.showerror("Error","Wrong CD ID")
elif w3 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
s2="select * from cdcust"
cur.execute(s2)
r2 = cur.fetchall()

ss1 = "select * from CD"


cur.execute(ss1)
r = cur.fetchall()

19
#Checking whether cd is found and is available to issue
found = 0
av = 0
for i in r:
if int(i[0]) == int(Tcdid.get()):
found = 1
if i[3]=='yes':
av = 1
break

if found == 0:
messagebox.showerror("Error","CD not found")
elif av == 0:
messagebox.showerror("Error","CD is not available to issue")
else:
#Checking whether customer is found and has already taken CD or not
#token = 1 says this customer has already taken a CD
#A customer can take only one CD at a time
fou = 0
a=0
for i in r2:
if int(i[0]) == int(Tcid.get()):
fou = 1
if int(i[5]) == 0:
stmt1 = "update cdcust set cdno=%s, token=%s where cusid=%s"
val1 = (Tcdid.get(), 1, Tcid.get())
cur.execute(stmt1, val1)
cur.execute('commit')

stmt = "update CD set avail=%s where cdno=%s"


val = ('no',Tcdid.get())
cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","CD issued successfully")
else:
messagebox.showerror("Error","This customer is already having a CD. So
cannot issue new CD")
break
if fou == 0:
messagebox.showerror("Error","Customer not found")
con.close()
D.destroy()

def treeclose4():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose4, bg='black',fg ="white" , font = 'Times


18', relief=FLAT )

20
tb1.pack()

tb2 = Button(D, text = " Issue ", command=issp2, bg='red', fg='white', font='Times 18',
relief=FLAT)
tb2.pack()

#Function to return CD
def cdreturn():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400,bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

cur.execute("use lib ")


cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

L2 = Label(D, text = "RETURNING A CD", bg='white', fg ="blue" , font = 'Times 20')


L2.pack()

Lcdid = Label(D, text = "Enter CD NO. to be returned", bg='white', fg ="red" , font = 'Times
10' )
Lcdid.pack()
Tcdid = Entry(D, width=40)
Tcdid.pack()

Lcid = Label(D, text = "Enter Customer ID for return", bg='white', fg ="red" , font = 'Times
10' )
Lcid.pack()
Tcid = Entry(D, width=40)
Tcid.pack()

def retp():
if Tcdid.get() == '' or Tcid.get() == '':
messagebox.showerror("Error","Enter CD ID / Customer ID")
else:
e1 = valnum(Tcdid.get())
e2 = valnum(Tcid.get())
if e1 == -1:
messagebox.showerror("Error","Wrong CD ID")

21
elif e2 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
s1="select * from CD where cdno=%s"
v1=(Tcdid.get(),)
cur.execute(s1,v1)

for i in t1.get_children():
t1.delete(i)

i=0
for row in cur:
t1.insert('',i, values=(row[0],row[1],row[2],row[3]))
i = i+1

B1 = Button(D, text = "Submit", command=retp, bg='black',fg ="white" , font = 'Times 14',


relief=FLAT )
B1.pack()

t1 = ttk.Treeview(D, height=7)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cdno","cdname","language","avail")
t1.column("cdno", width=80, minwidth=80,anchor=CENTER)
t1.column("cdname", width=130, minwidth=130,anchor=CENTER)
t1.column("language", width=100, minwidth=100,anchor=CENTER)
t1.column("avail", width=150, minwidth=150,anchor=CENTER)

t1.heading("cdno", text="CD NO.", anchor=CENTER)


t1.heading("cdname", text="CD Name", anchor=CENTER)
t1.heading("language", text="Language", anchor=CENTER)
t1.heading("avail", text="Availability", anchor=CENTER)

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def retp2():
if Tcdid.get() == '' or Tcid.get() == '':
messagebox.showerror("Error","Enter CD ID / Customer ID")
else:
e1 = valnum(Tcdid.get())
e2 = valnum(Tcid.get())
if e1 == -1:

22
messagebox.showerror("Error","Wrong CD ID")
elif e2 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
s2="select * from cdcust"
cur.execute(s2)
r2 = cur.fetchall()

ss1 = "select * from CD"


cur.execute(ss1)
r = cur.fetchall()

#Checking whether CD is found and is issued to any customer or not


found = 0 #Assuming CD is not found
av = 0 #Assuming CD is not available
for i in r:
if int(i[0]) == int(Tcdid.get()):
found = 1
if i[3]=='no':
av = 1
break
if found == 0:
messagebox.showerror("Error","CD not found")
elif av == 0:
messagebox.showerror("Error","This CD is not issued to anyone")
else:
#Checking whether customer is found and has taken any CD to return
fou = 0 #Assuming customer is not found
a = 0 #Assuming customer has not taken any CD to return
for i in r2:
if int(i[0]) == int(Tcid.get()):
fou = 1
if int(i[5]) == 1:
if int(i[4]) == int(Tcdid.get()):
stmt1 = "update cdcust set cdno=%s, token=%s where cusid=%s"
val1 = (0, 0, Tcid.get())
cur.execute(stmt1, val1)
cur.execute('commit')

stmt = "update CD set avail=%s where cdno=%s"


val = ('yes',Tcdid.get())
cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","CD returned successfully")
else:
messagebox.showerror('Error','This customer has not taken the CD with
this ID')
else:
messagebox.showinfo("","This customer has not taken any CD to return")
break

23
if fou == 0:
messagebox.showerror("Error","Customer ID not found")
con.close()
D.destroy()

def treeclose4():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose4, bg='black',fg ="white" , font = 'Times


18', relief=FLAT )
tb1.pack()

tb2 = Button(D, text = "Return", command=retp2, bg='red', fg='white', font='Times 18',


relief=FLAT)
tb2.pack()

#Function to delete a CD
def delete():
global D
closingframes()

D = Frame(mainwin,'', width=720, height=200, bg='white')


D.place(x=320, y=160)

L7 = Label(D, text = "Deleting a CD", bg='white', fg ="blue" , font = 'Times 18' )


L7.place(x=180, y=20)

Lcdno = Label(D, text = "Enter CD No. to be Deleted", bg='white', fg ="red" , font = 'Times
18' )
Lcdno.place(x=20, y=60)
Tcdno = Entry(D, width=20)
Tcdno.place(x=320, y = 68)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password=’123456')


cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists CD(cdno int primary key, cdname char(20), language
char(25), avail char(6))")
cur.execute("commit")

def delp():
if Tcdno.get() == '':
messagebox.showerror("Error","Enter CD No. to delete")
else:
w6 = valnum(Tcdno.get())
if w6 == -1:
messagebox.showerror("Error","Wrong CD No.")
else:

24
s1 = "select * from CD"
cur.execute(s1)
rows = cur.fetchall()

found = 0 #Assuming CD is not found


a = 1 #Assuming CD is available
for i in rows:
if int(i[0]) == int(Tcdno.get()):
found = 1
if i[3] == 'no':
a=0
break

if found == 0:
messagebox.showerror("Error","CD not found")
elif a == 0:
messagebox.showerror("Error","CD not available to delete")
else:
s = "delete from CD where cdno=%s"
v=(Tcdno.get(),)
cur.execute(s,v)
cur.execute("commit")
messagebox.showinfo("","CD successfully deleted")

con.close()
D.destroy()

Bb2 = Button(D, text = "Delete CD", command=delp, bg='black',fg ="white" , font = 'Times 18',
relief=FLAT )
Bb2.place(x=200, y=130)

#Function to modify details of a CD


def modifycd():
global D
closingframes()

D = Frame(mainwin,'', width=720, height=280, bg='white')


D.place(x=320, y=160)

tt = Label(D, text = " Modifying CD Details", bg='white', fg='blue', font='Times


18')
tt.place(x=0, y=0)

Lcdno = Label(D, text = "Enter CD No. to be modified", bg='white', fg ="red" , font = 'Times
16' )
Lcdno.place(x=10, y=60)
Tcdno = Entry(D, width=15)
Tcdno.place(x=260, y = 68)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')

25
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists books(bookid int primary key, bname char(20), author
char(15), publisher char(15), lang char(15), avail char(6))")
cur.execute("commit")

def modb1():
if con.is_connected():
if Tcdno.get() == '':
messagebox.showerror("Error","Enter CD No.")
else:
w6 = valnum(Tcdno.get())
if w6 == -1:
messagebox.showerror("Error","Wrong CD No.")
else:
cur.execute("use jean")
s1 = "select * from CD"
cur.execute(s1)
rows = cur.fetchall()

#Checking whether CD is found and is available or not


#We can modify only the details of available CD
found = 0 #Assuming CD is not found
a = 0 #Assuming CD is not available
for i in rows:
if int(i[0]) == int(Tcdno.get()):
found = 1
if i[3] == 'yes':
a=1
break
if found == 0:
messagebox.showerror("Error","CD not found")
elif a == 0:
messagebox.showerror("Error","CD is not available")
else:
cdn= Label(D, text = "CD Name", bg='white', fg ="red" , font = 'Times 18' )
cdn.place(x=20, y=90)
Tcdn = Entry(D, width=30)
Tcdn.place(x=180, y = 100)

lan = Label(D, text = "Language", bg='white', fg ="red" , font = 'Times 18' )


lan.place(x=20, y=120)
Tlan = Entry(D, width=30)
Tlan.place(x=180, y = 130)

def modb2():
if Tcdn.get() == '' or Tlan.get() == '':
messagebox.showerror("Error","ENTER FULL DATA")
else:
w2 = valname(Tcdn.get())

26
w3 = valname(Tlan.get())

if w2 == -1:
messagebox.showerror("Error","Wrong CD Name")
elif w3 == -1:
messagebox.showerror("Error","Wrong Language")
else:
stmt = "update CD set cdname=%s, language=%s where cdno=%s"
val = (Tcdn.get(),Tlan.get(), int(Tcdno.get()))

cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","CD details updated successfully")
con.close()
D.destroy()

But4 = Button(D, text = "Modify", command=modb2, bg='black',fg ="white" , font


= 'Times 14', relief=FLAT )
But4.place(x=240, y=220)

But2 = Button(D, text = "Submit", command=modb1, bg='black',fg ="white" , font = 'Times 14',
relief=FLAT )
But2.place(x=370, y=60)

#Function to register a customer


def register():
global D
closingframes()

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


cur=con.cursor(buffered=True)
if con.is_connected():
cur.execute("use lib ")
cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

D = Frame(mainwin,'', width=720, height=280, bg='white')


D.place(x=320, y=160)

tt = Label(D, text = " Registering A Customer", bg='white', fg='blue', font='forte


18')
tt.place(x=0, y=0)

cid = Label(D, text = "Customer ID", bg='white', fg ="red" , font = 'Times 18' )
cid.place(x=10, y=40)
Tcid = Entry(D, width=30)
Tcid.place(x=220, y = 50)

cn = Label(D, text = "Customer Name", bg='white', fg ="red" , font = 'Times 18' )

27
cn.place(x=10, y=70)
Tcn = Entry(D, width=30)
Tcn.place(x=220, y = 80)

tel = Label(D, text = "Telephone", bg='white', fg ="red" , font = 'Times 18' )


tel.place(x=10, y=100)
Ttel = Entry(D, width=30)
Ttel.place(x=220, y = 110)

cadd = Label(D, text = "Address", bg='white', fg ="red" , font = 'Times 18' )


cadd.place(x=10, y=130)
Tadd = Entry(D, width=30)
Tadd.place(x=220, y = 140)

def regp():
if Tcid.get() == '' or Tcn.get() == '' or Ttel.get() == '' or Tadd.get() == '':
messagebox.showerror("Error","Enter all data")
else:
w1 = valnum(Tcid.get())
w2 = valname(Tcn.get())
w3 = valnum(Ttel.get())

if w1 == -1:
messagebox.showerror("Error","Wrong Customer id")
elif w2 == -1:
messagebox.showerror("Error","Wrong Customer Name")
elif w3 == -1:
messagebox.showerror("Error","Wrong Telephone number")
else:
#Checking whether customer id already exists or not
cur.execute('select * from cdcust')
res = cur.fetchall()
f=0
for i in res:
if int(i[0]) == int(Tcid.get()):
f=1
break
if f == 1:
messagebox.showerror("Error","This Customer id already exists")
else:
stmt = "insert into cdcust (cusid,cname,tele,address, cdno, token) values(%s,%s,%s,
%s,%s,%s)"
val = (int(Tcid.get()), Tcn.get(),Ttel.get(), Tadd.get(), 0, 0)

cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","Customer registered successfully")
con.close()
D.destroy()

28
But2 = Button(D, text = "Submit", command=regp, bg='black',fg ="white" , font = 'Times 14',
relief=FLAT )
But2.place(x=180, y=220)

#Function to display all customer details


def display4():
global D
closingframes()

D = Frame(mainwin,'', width=750, height=400, bg='white')


D.place(x=320, y=160)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


if con.is_connected():
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

cur.execute("select * from cdcust")

L2 = Label(D, text = "DISPLAY ALL CUSTOMER DETAILS", bg='white', fg ="blue" , font


= 'Times 20')
L2.pack()

t1 = ttk.Treeview(D)
t1['show']='headings'
s=ttk.Style(D)
s.theme_use("clam")
s.configure('.',font=('Times Roman', 8))
s.configure('Treeview.Heading', foreground='blue', font=('Times Roman', 8, 'bold'))

t1['columns'] = ("cusid","cname","tele","address","cdno","token")
t1.column("cusid", width=50, minwidth=50,anchor=CENTER)
t1.column("cname", width=100, minwidth=100,anchor=CENTER)
t1.column("tele", width=70, minwidth=70,anchor=CENTER)
t1.column("address", width=100, minwidth=100,anchor=CENTER)
t1.column("cdno", width=60, minwidth=60,anchor=CENTER)
t1.column("token", width=70, minwidth=70,anchor=CENTER)

t1.heading("cusid", text="Cust.ID", anchor=CENTER)


t1.heading("cname", text="Customer Name", anchor=CENTER)
t1.heading("tele", text="Telephone", anchor=CENTER)
t1.heading("address", text="Address", anchor=CENTER)
t1.heading("cdno", text="CD taken", anchor=CENTER)
t1.heading("token", text="Taken CD", anchor=CENTER)

i=0
s=''

29
for row in cur:
if int(row[5])==0:
s='No'
else:
s='Yes'
t1.insert('',i, text='', values=(row[0],row[1],row[2],row[3],row[4],s))
i = i+1

vsb=ttk.Scrollbar(D,orient='vertical')
vsb.configure(command=t1.yview)
t1.configure(yscrollcommand=vsb.set)
vsb.pack(fill=Y, side=RIGHT)
t1.pack()

def treeclose():
con.close()
D.destroy()

tb1 = Button(D, text = "Close", command=treeclose, bg='black',fg ="white" , font = 'Times


18', relief=FLAT )
tb1.pack()

#Function to remove a customer


def remove():
global D
closingframes()

D = Frame(mainwin,'', width=720, height=200, bg='white')


D.place(x=320, y=160)

L7 = Label(D, text = "Deleting a Customer", bg='white', fg ="blue" , font = 'forte 20' )


L7.place(x=130, y=20)

Lcid = Label(D, text = "Enter Customer ID to be Deleted",bg='white', fg ="red" , font = 'Times


18' )
Lcid.place(x=10, y=60)
Tcid = Entry(D, width=10)
Tcid.place(x=344, y = 68)

con=mysql.connector.connect(host='localhost', database=' lib ', user='root', password='123456')


cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

def delp():
if Tcid.get() == '':
messagebox.showerror("Error","Enter Customer ID")
else:

30
w6 = valnum(Tcid.get())
if w6 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
s1 = "select * from cdcust"
cur.execute(s1)
rows = cur.fetchall()

#Checking whether customer id is found and has taken any CD.


#Cannot delete customer if any CD is issued to he/she
found = 0 #Assuming customer is not found
a = 0 #Assuming customer has not taken any CD
for i in rows:
if int(i[0]) == int(Tcid.get()):
found = 1
if int(i[5]) == 1:
a=1
break
if found == 0:
messagebox.showerror("Error","Customer not found")
elif a == 1:
messagebox.showerror("Error","Customer is having a CD at present. So cannot
delete")
else:
s = "delete from cdcust where cusid=%s"
v=(Tcid.get(),)
cur.execute(s,v)
cur.execute("commit")
messagebox.showinfo("","Customer successfully deleted")

con.close()
D.destroy()

Bb2 = Button(D, text = "Delete Customer", command=delp, bg='black',fg ="white" , font =


'Times 18', relief=FLAT )
Bb2.place(x=180, y=130)

#Function to modify details of a customer


def modifyc():
global D
closingframes()

D = Frame(mainwin,'', width=720, height=320, bg='white')


D.place(x=320, y=160)

tt = Label(D, text = " Modifying Customer Details", bg='white', fg='blue', font='Times


18')
tt.place(x=0, y=0)

31
Lcid = Label(D, text = "Enter Customer ID to be modified", bg='white', fg ="red" , font = 'Times
18' )
Lcid.place(x=10, y=60)
Tcid = Entry(D, width=10)
Tcid.place(x=360, y = 68)

def modp1():
con=mysql.connector.connect(host='localhost', database=' lib ', user='root',
password='123456')
cur=con.cursor(buffered=True)
cur.execute("use lib ")
cur.execute("create table if not exists cdcust(cusid int primary key, cname char(20), tele
char(10), address char(25), cdno int, token int)")
cur.execute("commit")

if con.is_connected():
if Tcid.get() == '':
messagebox.showerror("Error","Enter Customer ID")
else:
w6 = valnum(Tcid.get())
if w6 == -1:
messagebox.showerror("Error","Wrong Customer ID")
else:
cur.execute("use jean")
s1 = "select * from cdcust"
cur.execute(s1)
rows = cur.fetchall()

#Checking whether customer is found and is having any CD


found = 0 #Assuming customer is not found
a = 0 #Assuming that the customer is not having any CD at present
for i in rows:
if int(i[0]) == int(Tcid.get()):
found = 1
if int(i[5]) == 1:
a=1
break
if found == 0:
messagebox.showerror("Error","Customer not found")
elif a == 1:
messagebox.showerror("Error","Cannot modify details of customer who is already
having a CD")
else:
cn = Label(D, text = "Customer Name", bg='white', fg ="red" , font = 'Times 18' )
cn.place(x=60, y=140)
Tcn = Entry(D, width=30)
Tcn.place(x=260, y = 150)

tel = Label(D, text = "Telephone", bg='white', fg ="red" , font = 'Times 18' )


tel.place(x=60, y=170)

32
Ttel = Entry(D, width=30)
Ttel.place(x=260, y = 180)

cadd = Label(D, text = "Address", bg='white', fg ="red" , font = 'Times 18' )


cadd.place(x=60, y=200)
Tadd = Entry(D, width=30)
Tadd.place(x=260, y = 210)

def modp2():
if Tcn.get() == '' or Ttel.get() == '' or Tadd.get() == '':
messagebox.showerror("Error","Enter full data")
else:
w2 = valname(Tcn.get())
w3 = valnum(Ttel.get())

if w2 == -1:
messagebox.showerror("Error","Wrong Customer Name")
elif w3 == -1:
messagebox.showerror("Error","Wrong Telephone number")
else:
stmt = "update cdcust set cname=%s, tele=%s, address=%s where cusid=
%s"
val = (Tcn.get(),Ttel.get(), Tadd.get(),int(Tcid.get()))

cur.execute(stmt,val)
cur.execute("commit")
messagebox.showinfo("","Customer details updated successfully")
con.close()
D.destroy()

But4 = Button(D, text = "Modify", command=modp2, bg='black',fg ="white" , font


= 'Times 14', relief=FLAT )
But4.place(x=200, y=270)

But2 = Button(D, text = "Submit", command=modp1, bg='black',fg ="white" , font = 'Times 14',
relief=FLAT )
But2.place(x=200, y=100)

#Function to exit from project


def stop():
os._exit(0)

#Function to display home screen


def menu():
global mainwin
mainwin = Tk()
mainwin.title("Video Management System")
mainwin.geometry("800x580+250+60")
mainwin.configure(background='white')
mainwin.resizable(False,False)

33
L1 = Label(mainwin, text = "VIDEO LIBRARY MANAGEMENT SYSTEM", bg='white', fg
="purple" , font = 'Times 30')
L1.place(x=5, y=5)

F = Frame(mainwin, width=25)
F.place(x=10,y=60)

B1 = Button(F, text = "ADDING A CD", anchor=W, width=30, command=add, bg='purple',fg


="white" , font = 'Times 14', relief=RAISED)
B1.pack()

B2 = Button(F, text = "SEARCH FOR A CD WITH NAME",anchor=W, width=30,


command=search, bg='purple', fg ="white" , font = 'Times 14', relief=RAISED )
B2.pack()

B3 = Button(F, text = "DISPLAY ALL AVAILABLE CDs", anchor=W, width=30,


command=display2, bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B3.pack()

B4 = Button(F, text = "DISPLAY CDs OF A LANGUAGE", anchor=W, width=30,


command=display3, bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B4.pack()

B5 = Button(F, text = "CD ISSUE", anchor=W, width=30, command=issue, bg='purple',fg


="white" , font = 'Times 14', relief=RAISED )
B5.pack()

B6 = Button(F, text = "CD RETURN", anchor=W, width=30, command = cdreturn,


bg='purple',fg ="white" , font = 'Times 14' , relief=RAISED )
B6.pack()

B7 = Button(F, text = "DISPLAY ALL CDs", anchor=W, width=30, command=display1,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B7.pack()

B8 = Button(F, text = "DELETING A CD", anchor=W, width=30, command=delete,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B8.pack()

B9 = Button(F, text = "REGISTER CUSTOMER", anchor=W, width=30, command=register,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B9.pack()

B10 = Button(F, text = "DISPLAY ALL CUSTOMERS", anchor=W, width=30,


command=display4, bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B10.pack()

B11 = Button(F, text = "DELETE A CUSTOMER", anchor=W, width=30, command=remove,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )

34
B11.pack()

B12 = Button(F, text = "MODIFY CUSTOMER", anchor=W, width=30, command=modifyc,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B12.pack()

B13 = Button(F, text = "MODIFY CD", anchor=W, width=30, command=modifycd,


bg='purple',fg ="white" , font = 'Times 14', relief=RAISED )
B13.pack()

B14 = Button(F, text = "EXIT", anchor=W, width=30, command=stop, bg='purple',fg ="white" ,


font = 'Times 14', relief=RAISED )
B14.pack()

cv1 = Canvas(mainwin,width=440, height=100, bg='black', highlightthickness=0)


m1 = PhotoImage(file='p1.gif')
cv1.create_image(0,0, anchor=NW, image=m1)
cv1.place(x=320, y=60)

mainwin.mainloop()

menu()

35
IX. OUTPUT SCREENS
Home screen

Adding a CD

36
37
38
39
Displaying all cds

Displaying all cds of a language

40
Registering a customer

41
Displaying all customers

42
Issuing a CD
Screen after pressing submit button

Screen after pressing issue button

43
Displaying all cds

Displaying all available cds

44
Displaying all customers

Modifying a cd

45
Displaying all cds

46
Deleting a cd

47
Displaying all cds

Modifying a customer

48
Displaying all customers

49
Returning a cd

50
Displaying all cds

Displaying all customers

51
X. FUTURE ENHANCEMETS
 Aesthetic changes
 Can include login screen
 Can also include more features

XI. BIBLIOGRAPHY

 www.stackoverflow.com
 Computer Science with Python by Sumita Arora
 www.effbot.com
 www.w3schools.com/python
 www.learnpython.com
 www.programiz.com/python-programming

52

You might also like