Cs Project
Cs Project
ARNOLD’S SCHOOL
LALARAM NAGAR
St. Arnold’s Seva Sadan Campus, 7/1, Boundary Road, Indore – 452 001
PROJECT
Session : 2024-2025
SUBMITTED BY : GUIDED BY :
[1]
CERTIFICATE
This is to certify that RASHI MODI of class XII A of St. Arnold’s School
Principal
Fr. Muthu Selvam SVD
[2]
ACKNOWLEGEMENT
Mrs. SHWETA MUNDRA as well as our principal Fr. Muthu Selvam SVD
doing a lot of research and I came to know about so many new things I am
RASHI MODI
CLASS XII A
[3]
TEAM MATES:
1) Rashi Modi
2) Jincy Chacko
3) Rishika Sharma
[4]
Hardware & software requirements:
#Software Specifications:
Operating System :- Windows 11
Platform :- Python IDLE 3.13 64-bit
Database :- MySQL
Language :- Python
#Hardware Specifications:
Processor :- Intel i7 12th generation
[5]
Ram :- 16 GB
[6]
INDEX:
INTRODUCTION
[7]
The traditional bookstores that once stood as cultural hubs are
now Undergoing a metamorphosis in the face of technological
advancements. The need for an efficient and seamless Book
Store Management System becomes increasingly evident. This
project aims not just to streamline the operations of bookstores
but to usher them into a new era of digital competence and
customer satisfaction.
[9]
3.2)E- Commerce Integration: The project aims to
integrate an e-commerce platform seamlessly with
the existing bookstore infrastructure, allowing
customers to browse, purchase, and receive their
favorite books with the click of a button.
SOURCE CODE
import mysql.connector
DB=mysql.connector.connect(host="localhost",
user="root",
password="2277",
database="book_store")
C=DB.cursor()
#ADMIN FUNCTIONS
def ADD():
Book=input("Enter Book Name: ")
Genre=input("Enter Genre:")
Quantity=int(input("Enter quantity of books:"))
Author=input("Enter author name:")
Publication=input("Enter publication house:")
Price=int(input("Enter the price of book:"))
C.execute("INSERT INTO available_books
values('{}','{}',{},'{}','{}',
{})".format(Book,Genre,Quantity,Author,Publication
,Price))
[12]
DB.commit()
print("""*********SUCCESSFULLY
ADDED*********""")
n=int(input(""" Do You Want To Continue: Yes: 1 ,
NO: 2 : """ ))
if n==1:
ADD()
if n==2:
Staff()
def NewStaff():
Fname=input("Enter Fullname:")
Gender=input("Enter Gender (M/F):")
Age=int(input(" Enter Age:"))
Phno=input("Enter Staff phone no.:")
Address=input("Enter Address:")
C.execute("INSERT INTO staff_details
values('{}','{}',{},
{},'{}')".format(Fname,Gender,Age,Phno,Address))
DB.commit()
print("""*********STAFF IS SUCCESSFULLY
ADDED*********""")
n=int(input("""Do You Want To Continue: Yes: 1 ,
NO: 2 : """ ))
if n==1:
NewStaff()
if n==2:
Staff()
def RemoveStaff():
[13]
Sname=input("Enter Staff Name to Remove: ")
C.execute("DELETE FROM staff_details WHERE
FName=('{}') ".format(Sname))
DB.commit()
print("Above Employee is promoted to
Customer")
n=int(input("""Do You Want To Continue: Yes: 1 ,
NO: 2 : """ ))
if n==1:
RemoveStaff()
if n==2:
Staff()
def StaffDetail():
spl_statement= "SELECT * from staff_details"
C.execute(spl_statement)
output =C.fetchall()
for x in output:
print("************************************")
print("Name of Employee:", x[0])
print("Gender of Employee:", x[1])
print("Age of Employee:", x[2])
print("Phone No of Employee", x[3])
print("Address of Employee:", x[4])
print("************************************")
n=int(input(""" Do You Want To Continue: Yes:
1 , NO: 2 : """ ))
if n==1:
StaffDetail()
if n==2:
[14]
Staff()
def SellRec():
C.execute("SELECT* from sell_rec")
for u in C:
print("*********************************************"
)
print("Buyer's Name: ",u[0])
print("Buyer's Mobile Number: ",u[1])
print("Book Purchased: ",u[2])
print("Quantity Brought: ",u[3])
print("Price of Book: ",u[4])
print("**********************************************
")
n=int(input("""Do You Want To Continue: Yes: 1 ,
NO: 2: """ ))
if n==1:
SellRec()
if n==2:
Staff()
def DelRec():
Del=input("Are you sure(Y/N):").upper()
if Del=="Y":
C.execute("DELETE from sell_rec")
DB.commit()
n=int(input("""Do You Want To Continue: Yes:
1 , NO: 2 : """ ))
if n==1:
[15]
DelRec()
if n==2:
Staff()
def TotalIncome():
C.execute("SELECT sum(price) from sell_rec")
for x in C:
print("Total Sell Till Date", x)
n=int(input("""Do You Want To Continue: Yes: 1,
NO: 2 : """ ))
if n==1:
TotalIncome()
if n==2:
Staff()
def AvailablefS():
C.execute("SELECT* from available_books order
by book")
for v in C:
print("**********************************************
******")
print("Book Name: ",v[0])
print("Book Genre: ",v[1])
print("Book Available: ",v[2])
print("Book Author: ",v[3])
print("Publication House: ",v[4])
print("Book Price: ", v[5])
print("**********************************************
******")
[16]
n=int(input("""Do You Want To Continue: Yes: 1,
NO: 2 : """ ))
if n==1:
AvailablefS()
if n==2:
Staff()
#********************BUYER
FUNCTION********************
def AvailablefU():
C.execute("SELECT* from available_books order
by book")
for v in C:
print("**********************************************
******")
print("Book Name: ",v[0])
print("Book Genre: ",v[1])
print("Book Available: ",v[2])
print("Book Author: ",v[3])
print("Publication House: ",v[4])
print("Book Price: ", v[5])
print("**********************************************
******")
n=int(input("""Do You Want To Continue: Yes: 1,
NO: 2 : """ ))
if n==1:
AvailablefU()
if n==2:
Buyer()
[17]
def StaffDetailfU():
spl_statement= "SELECT* from staff_details"
C.execute(spl_statement)
output =C.fetchall()
for x in output:
print("************************************")
print("Name of Employee:", x[0])
print("Gender of Employee:", x[1])
print("Age of Employee:", x[2])
print("Phone No of Employee", x[3])
print("Address of Employee:", x[4])
print("************************************")
n=int(input("""Do You Want To Continue: Yes: 1 ,
NO: 2 : """ ))
if n==1:
StaffDetailfU()
if n==2:
Buyer()
def Purchase():
print("AVAILABLE BOOKS...")
C.execute("SELECT* from available_books ")
books= C.fetchall()
for i in books:
print("**********************************************
******")
print("Book Name: ",i[0])
print("Book Genre: ",i[1])
print("Book Available: ",i[2])
[18]
print("Book Author: ",i[3])
print("Publication House: ",i[4])
print("Book Price: ", i[5])
print("**********************************************
******")
Cusname=input("Enter customer name:")
Phno=input("Enter phone number:")
Book=input("Enter Book Name:")
Price=int(input("Enter the price:"))
Quantity=int(input("Enter quantity:"))
C.execute("SELECT quantity from
available_books where book='"+Book+"'")
k=C.fetchone()
if max(k)<Quantity:
print(Quantity,"Books are not available!!!!")
else:
C.execute("SELECT book from
available_books where book='"+Book+"'")
log=C.fetchone()
if log is not None:
C.execute("INSERT INTO Sell_rec
values('"+Cusname+"','"+(Phno)+"','"+Book+"','"+
(Quantity)+"','"+(Price)+"')")
C.execute("UPDATE Available_Books set
quantity=quantity-'"+(Quantity)+"' where
book='"+Book+"'")
DB.commit()
print("""*********BOOK HAS BEEN
SOLD*********""")
else:
[19]
print("BOOK IS NOT AVAILABLE!!!!!!!")
n=int(input("""Do You Want To Continue:
Yes: 1 , NO: 2 : """ ))
if n==1:
Purchase()
if n==2:
Buyer()
def UsingName():
Sbook=input("Enter Book to search:")
C.execute("SELECT book from available_books
where book ='"+Sbook+"'")
t=C.fetchone()
if t != None:
print("""*********BOOK IS IN
STOCK*********""")
else:
print("BOOK IS OUT OF STOCK!!!!!!!")
n=int(input("""Do You Want To Continue: Yes:
1 , NO: 2 : """ ))
if n==1:
UsingName()
if n==2:
Buyer()
def UsingGenre():
Sgenre=input("Enter genre to search:")
C.execute("SELECT genre from available_books
where genre= '"+Sgenre+"'")
poll=C.fetchall()
[20]
if poll is not None:
print("""*********BOOK IS IN
STOCK*********""")
C.execute("SELECT * from available_books where
genre='"+Sgenre+"'")
for y in C:
print("*******************************************")
print("Book Name: ",y[0])
print("Book Genre: ",y[1])
print("Quantity Available: ",y[2])
print("Book Author", y[3])
print("Book Publication: ",y[4])
print("Book Price: ", y[5])
print("*******************************************")
else:
print("BOOKS OF SUCH GENRE ARE NOT
AVAILABLE!!!!!!!!!")
n=int(input("""Do You Want To Continue: Yes:
1 , NO: 2 : """ ))
if n==1:
UsingGenre()
if n==2:
Buyer()
def UsingAuthor():
Sauthor=input("Enter Book's Author to search:")
C.execute("SELECT book from available_books
where Author ='"+Sauthor+"'")
t=C.fetchone()
[21]
if t != None:
print("""*********BOOK IS IN
STOCK*********""")
else:
print("BOOK IS OUT OF STOCK!!!!!!!")
n=int(input("""Do You Want To Continue: Yes:
1 , NO: 2 : """ ))
if n==1:
UsingGenre()
if n==2:
Buyer()
def Staff():
print("""1. Add Books
2. Staff Details
3. Sell Record
4. Total Income after the Latest Reset
5. See Available Book
6. Exit""")
n=int(input("Enter Your Choice: "))
if n==1:
ADD()
if n==2:
print("""1. New staff entry
2. Remove staff
3. Existing staff details""")
ch=int(input("Enter your choice: "))
if ch==1:
NewStaff()
[22]
if ch==2:
RemoveStaff()
if ch==3:
StaffDetail()
if n==3:
print("""1:Sell history details
2:Reset Sell history""")
ty=int(input("Enter your choice:"))
if ty==1:
SellRec()
if ty==2:
DelRec()
if n==4:
TotalIncome()
if n==5:
AvailablefS()
if n==6:
return
def Buyer():
print("""1.Purchase Books
2.Search Books
3.Available Books
4.Staff Details
5. Exit""")
r=int(input("Enter Your Choice: "))
[23]
if r==1:
Purchase()
if r==2:
print("""1.Search by name
2.Search by genre
3.Search by author""")
l=int(input("Search by What : "))
if l==1:
UsingName()
if l==2:
UsingGenre()
if l==3:
UsingAuthor()
if r==3:
AvailablefU()
if r==4:
StaffDetail()
#MAIN PROGRAM
print("************************Welcome To Book
Store************************")
while 1:
a=int(input("""Enter as Employee: 1 , Enter as
User: 2 , Exit : 3 , Enter : """ ))
if a==1:
Staff()
if a==2:
[24]
print('''''****************BOOK
SHOP*********************
1. Signup
2. Login''')
s=int(input("Enter Your Choice: "))
#Sign-Up
if s==1:
User_name=input("ENTER USERNAME: ")
Password=input("ENTER PASSWORD: ")
C.execute("INSERT INTO signup
values('"+User_name+"','"+Password+"')")
DB.commit()
print("Sign Up Completed")
#Log in
else:
User2= input("Enter Your Username: ")
C.execute("SELECT user_name from Signup
where user_name='"+User2+"'")
b=C.fetchone()
Password=input("Enter Your Password: ")
C.execute("SELECT password from signup
where password='"+Password+"'")
a2=C.fetchone()
if a2 is not None:
print("*********************Login
Success********************")
Buyer()
if a==3:
break
[25]
DATABASE TABLES
1) Tables under database book_store :
[26]
2) Table available_books with all entries :
[27]
5)Table sell_rec with all entries :
OUTPUT
*******ADMIN*******
1)Home Screen :
2)Add Books :
3)Staff Details :
[28]
3.1)Add Staff Details:
3.2)Remove Staff :
[29]
4)Sell Record :
4.1)Sell History Details :
[30]
5)Total Income :
6)Available Books :
[31]
*******BUYER*******
1)Buyer(User) Menu :
2)Sign Up :
[32]
3)Login :
4)Purchasing Book :
5)Search Books:
5.1)Search By Name:
[33]
5.2)Search By Genre :
5.3)Search By Author :
6)Available Books :
[34]
7)Staff Details :
[35]
8)Exit :
[36]
BIBL IOGRAPHY
Computer Science class XII with Sumita
Arora
Computer Science class XII with Preeti Arora
www.wikipedia.org
www.stackoverflow.com
www.google.com
[37]