GOVT.
ITI COLLEGE PANDHURNA
Project work
2025-26
Computer Peripherals Shop
Management System
Student Name:-Mr. Ganesh Dhurve
Trade:-COPA
Batch:-“B”
Training Officer Name:-Mr. Deepak Kumar Bhanre Sir
Training Officer Sign. Student [Link].
Deepak Kumar Bhanre Sir [Link] Dhurve
CERTIFICATE
THE IS TO CERTIFICATE THAT GANESH DHURVE
STUDENT OF [Link] (INDUSTRIAL TRAINING
INSTITUTE ) PANDHURNA
TRADE:-COPA
(COMPUTER OPERATOR AND PROGAMMING
ASSISTANT)
BATCH:-B
HAS SUCCESSFULLY COMPLETED HIS PROJECT
TOPIC:-“COMPUTER PERIPHERALS SHOP
MANAGEMENT SYSTEM”
UNDER THE GUIDANCE OF
MR “DEEPAK KUMATR BHARNE SIR”
FOR ACADEMIC SESSION 2025-26
PYTHON CODE
import sqlite3
import tkinter as tk
from tkinter import ttk, messagebox
from datetime import datetime
# ================= DATABASE
=================
conn = [Link]("[Link]")
cursor = [Link]()
[Link]("""
CREATE TABLE IF NOT EXISTS products(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,category TEXT,
price REAL, quantity INTEGER)""")
[Link]("""CREATE TABLE IF NOT EXISTS
sales(sale_id INTEGER PRIMARY KEY
AUTOINCREMENT, product_name
TEXT,quantity INTEGER, total_price REAL,
sale_date TEXT)""")[Link]()
# ================= ADD PRODUCT
=================
def add_product_window():
win = [Link](root)
[Link]("Add Product")
[Link]("350x300")
[Link](win, text="Product
Name").pack(pady=5)
name = [Link](win)
[Link]()
[Link](win, text="Category").pack(pady=5)
category = [Link](win)
[Link]()
[Link](win, text="Price").pack(pady=5)
price = [Link](win)
[Link]()
[Link](win, text="Quantity").pack(pady=5)
qty = [Link](win)
[Link]()
def save():
try:
[Link](
"INSERT INTO
products(name,category,price,quantity)
VALUES(?,?,?,?)",
( [Link](), [Link](),
float([Link]()),
int([Link]())
)
)
[Link]()
[Link](
"Success",
"Product Added Successfully"
)
[Link]()
except:
[Link](
"Error",
"Enter Valid Data"
)
[Link](
win,
text="Save Product",
command=save
).pack(pady=15)
# ================= VIEW PRODUCTS
=================
def view_products_window():
win = [Link](root)
[Link]("View Products")
[Link]("750x400")
tree = [Link](
win,
columns=("ID", "Name", "Category",
"Price", "Quantity"),
show="headings"
)
[Link]("ID", text="ID")
[Link]("Name", text="Product Name")
[Link]("Category", text="Category")
[Link]("Price", text="Price")
[Link]("Quantity", text="Quantity")
[Link](fill="both", expand=True)
[Link]("SELECT * FROM products")
for row in [Link]():
[Link]("", [Link], values=row)
# ================= SEARCH PRODUCT
=================
def search_product_window():
win = [Link](root)
[Link]("Search Product")
[Link]("600x350")
[Link](win, text="Enter Product
Name").pack(pady=5)
keyword = [Link](win, width=30)
[Link]()
result_box = [Link](win, height=12)
result_box.pack(fill="both", expand=True,
pady=10)
def search():
result_box.delete("1.0", [Link])
[Link](
"SELECT * FROM products WHERE name
LIKE ?",
('%' + [Link]() + '%',)
)
rows = [Link]()
if rows:
for row in rows:
result_box.insert([Link], str(row) + "\
n")
else:
result_box.insert([Link], "Product Not
Found")
[Link](
win,
text="Search",
command=search
).pack()
# ================= SELL PRODUCT
=================
def sell_product_window():
win = [Link](root)
[Link]("Sell Product")
[Link]("350x250")
[Link](win, text="Product
ID").pack(pady=5)
pid = [Link](win)
[Link]()
[Link](win, text="Quantity
Sold").pack(pady=5)
qty = [Link](win)
[Link]()
def sell():
try:
[Link](
"SELECT name,price,quantity FROM
products WHERE id=?",
([Link](),)
)
product = [Link]()
if product:
name, price, stock = product
sold_qty = int([Link]())
if stock >= sold_qty:
total = price * sold_qty
new_stock = stock - sold_qty
[Link](
"UPDATE products SET quantity=?
WHERE id=?",
(new_stock, [Link]())
)
[Link]("""
INSERT INTO sales
(product_name,quantity,total_price,
sale_date)
VALUES(?,?,?,?)
""",
(
name,
sold_qty,
total,
[Link]().strftime(
"%Y-%m-%d %H:%M:%S"
)
))
[Link]()
[Link](
"Sale Completed",
f"Total Amount = ₹{total}"
)
[Link]()
else:
[Link](
"Error",
"Insufficient Stock"
)
else:
[Link](
"Error",
"Product Not Found"
)
except:
[Link](
"Error",
"Invalid Input"
)
[Link](
win,
text="Sell Product",
command=sell
).pack(pady=15)
# ================= DELETE PRODUCT
=================
def delete_product_window():
win = [Link](root)
[Link]("Delete Product")
[Link]("300x200")
[Link](
win,
text="Enter Product ID"
).pack(pady=10)
pid = [Link](win)
[Link]()
def delete_product():
[Link](
"SELECT * FROM products WHERE id=?",
([Link](),)
)
product = [Link]()
if product:
[Link](
"DELETE FROM products WHERE id=?",
([Link](),)
)
[Link]()
[Link](
"Success",
"Product Deleted Successfully"
)
[Link]()
else:
[Link](
"Error",
"Product Not Found"
)
[Link](
win,
text="Delete Product",
bg="red",
fg="white",
command=delete_product
).pack(pady=20)
# ================= SALES REPORT
=================
def sales_report_window():
win = [Link](root)
[Link]("Sales Report")
[Link]("850x450")
tree = [Link](
win,
columns=(
"SaleID",
"Product",
"Qty",
"Amount",
"Date"
),
show="headings"
)
[Link]("SaleID", text="Sale ID")
[Link]("Product", text="Product
Name")
[Link]("Qty", text="Quantity")
[Link]("Amount", text="Total
Amount")
[Link]("Date", text="Sale Date")
[Link](fill="both", expand=True)
[Link]("SELECT * FROM sales")
records = [Link]()
grand_total = 0
for row in records:
[Link]("", [Link], values=row)
grand_total += row[3]
[Link](
win,
text=f"Total Sales Amount = ₹
{grand_total:.2f}",
font=("Arial", 12, "bold")
).pack(pady=10)
# ================= MAIN WINDOW
=================
root = [Link]()
[Link]("Computer Peripherals Shop
Management")
[Link]("450x500")
title = [Link](
root,
text="COMPUTER PERIPHERALS SHOP
MANAGEMENT SYSTEM",
font=("Arial", 16, "bold")
)
[Link](pady=20)
[Link](
root,
text="Add Product",
width=25,
command=add_product_window
).pack(pady=5)
[Link](
root,
text="View Products",
width=25,
command=view_products_window
).pack(pady=5)
[Link](
root,
text="Search Product",
width=25,
command=search_product_window
).pack(pady=5)
[Link](
root,
text="Sell Product",
width=25,
command=sell_product_window
).pack(pady=5)
[Link](
root,
text="Delete Product",
width=25,
command=delete_product_window
).pack(pady=5)
[Link](
root,
text="Sales Report",
width=25,
command=sales_report_window
).pack(pady=5)
[Link](
root,
text="Exit",
width=25,
bg="red",
fg="white",
command=[Link]
).pack(pady=20)
[Link]()
[Link]()
OUTPUT
Project complete