0% found this document useful (0 votes)
7 views

Project

The document describes a program for managing school uniform distribution. The program allows students to view their order details and submit exchange requests. Administrators can insert, update, view student details, update delivery status, and view exchange requests.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Project

The document describes a program for managing school uniform distribution. The program allows students to view their order details and submit exchange requests. Administrators can insert, update, view student details, update delivery status, and view exchange requests.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 20

Anna Nagar

Uniform Distribution System

Gurucharan R
CONTENTS

1. Bonafide Certificate ~3
2. Acknowledgement ~4
3. Case Study ~5
4. Software Used ~6
5. Operating Instructions ~7
6. Code ~8
7. Table Description ~13
8. Output ~ 14
9. Scope For Improvement ~ 19
10. Bibliography ~ 20
CERTIFICATE

This is to certify that, Gurucharan R , student of Class XII A, Chennai


Public School, Anna Nagar, has completed the project titled Uniform
Distribution System during the academic year 2023-24 towards partial
fulfillment of credit for the AISSCE Practical Evaluation, under my
supervision.

_______________ _______________
Mrs. Shakunthala External Examiner
Computer Science
Teacher

_______________________

Mrs. Asha Nathan


Principal School Seal
Acknowledgement

I would like to thank our School Management and our Principal, Vice-Principal

and the coordinators who have made every single effort to provide a full-

fledged learning environment. I would like to thank our computer science

teacher Shakunthala Ma’am, who has been guiding us consistently by giving

ideas about different kinds of projects and also explaining various means of

developing the project which could culminate into a project report. I would like

to thank my parents who have been very supportive in all my endeavors

concerning the project.


CASE STUDY

The aim of this project is to manage the distribution of school uniforms to


students. The program aims to streamline the uniform distribution process,
keep track of uniform sizes, and provide an efficient way to ensure all students
receive the correct uniforms.

The program contains two portals (Admin and Student). A student can view
his/her order details in the Student portal using his/her roll number.
The student can also give an exchange request to the admin.

Admin should enter the password to gain access to student data through
Admin Portal. After that the admin can input, view, update student details,
update delivered status and view exchange requests.
Software
~ Python 3.8.6

~ MySQL

Functions Used

admin() - To log onto Admin portal

Student_info() - To log onto Student portal

insertinto() - To insert new records

updateinto() - To update existing records

view() - To view existing records

deliveryout() - To update delivery status to delivered

exchange() - To view the exchange requests


Operating Instructions

Run the program installationstdmgm.py to setup the database for the first
time.

Run the program mainstdmgm.py.

Student:

Log on to student portal.


Enter your roll number to fetch and display your order details.
Enter Yes if you want an exchange to your delivered uniform and mention the
reason for your exchange.

Admin:

Log on to admin portal.


Enter the password.
If verified, you can do various operation onto the student order details like
 Inserting new student details
 Updating existing student details
 Viewing existing student details
 Updating delivery status
 Viewing exchange requests
Code
installationstdmgm.py

import mysql.connector
db_connection = mysql.connector.connect(host="localhost",user="root",password="admin")
cursor = db_connection.cursor()
cursor.execute("create database stdmgm;")
cursor.execute("use stdmgm;")
cursor.execute("create table users (rollno int primary key, name varchar(30), std int, section char(1), email
varchar(30), shirtsize varchar(2), pantsize varchar(2), socksize int, delivered varchar(3));")
db_connection.commit()
cursor.execute("create table users_exchange (rollno int primary key, name varchar(30), std int, section
char(1), email varchar(30), reason varchar(50));")
print("Database and table created successfully.")
db_connection.commit()
cursor.close()
mainstdmgm.py

import mysql.connector
db_connection = mysql.connector.connect(host="localhost",user="root",password="admin",database="stdmgm")

def student_info():

studentroll = int(input("Enter your roll number : "))


cursor = db_connection.cursor()
query = "select * from users where rollno = %s"
user_data = (studentroll,)
cursor.execute(query, user_data)
user_data = cursor.fetchone()
if user_data :
print("\nShowing the order details for the roll no ",studentroll )
print("Roll number : ",user_data[0])
print("Name : ",user_data[1])
print("Standard : ",user_data[2])
print("Section : ",user_data[3])
print("Email : ",user_data[4])
print("Shirtsize : ",user_data[5])
print("Pantsize : ",user_data[6])
print("Socksize : ",user_data[7])
print("Delivery status : ",user_data[8])
studentexchange=str(input("\nDo you want to exchange your uniform (Y/N) :"))
if studentexchange == 'Y' and user_data[8]!='No':
reason=str(input("\nEnter the reason for your exchange request : "))
query = "insert into users_exchange values(%s,%s,%s,%s,%s,%s)"
user_data = (studentroll,user_data[1],user_data[2],user_data[3],user_data[4],reason)
cursor.execute(query, user_data)
print("\nExchange request sent to the admin.")
elif studentexchange == 'Y' and user_data[8] =='No':
print("\nYour uniform isn't delivered. Please ask the admin to change the details.")
else:
print("\nNo student data found with the roll number ",studentroll)
print("Try entering the roll number without spaces.")

def admin():
def insertinto():
cursor = db_connection.cursor()
rollno = int(input("Enter the rollno : "))
cursor.execute("select rollno from users where rollno = %s",(rollno,))
user_data = cursor.fetchone()

if user_data:
print("The order details for the roll number ",rollno," already exists. Use update option to update the details.")

else:
name = str(input("Enter the name : "))
std = int(input("Enter the standard : "))
section = str(input("Enter the section : "))
email = str(input("Enter the email : "))
shirtsize = str(input("Enter the shirt size (S / M / L / XL) : "))
pantsize = str(input("Enter the pant size (S / M / L / XL) : "))
socksize = int(input("Enter the socks size (6 / 8 / 10 / 12) : "))
delivered = "No"

insert_query = "insert into users (rollno, name, std, section, email, shirtsize, pantsize, socksize, delivered)
VALUES (%s,%s,%s,%s,%s,%s,%s,%s,%s)"
user_data = (rollno, name, std, section, email, shirtsize, pantsize, socksize, delivered)
cursor.execute(insert_query, user_data)
db_connection.commit()
cursor.close()

def updateinto():

cursor = db_connection.cursor()
rollno = int(input("Enter the rollno of the student whose details you want to update: "))
select_query = "select rollno, name, std, section, email, shirtsize, pantsize, socksize, delivered FROM users
WHERE rollno = %s"
cursor.execute(select_query, (rollno,))
user_data = cursor.fetchone()

if user_data:

print("Existing Student Data:")


print("Roll number : ",user_data[0])
print("Name : ",user_data[1])
print("Standard : ",user_data[2])
print("Section : ",user_data[3])
print("Email : ",user_data[4])
print("Shirtsize : ",user_data[5])
print("Pantsize : ",user_data[6])
print("Socksize : ",user_data[7])
print("Delivery status : ",user_data[8])

name = input("Enter the name : ")


std = input("Enter the standard : ")
section = input("Enter the section : ")
email = input("Enter the email : ")
shirtsize = input("Enter the shirt size : ")
pantsize = input("Enter the pant size : ")
socksize = input("Enter the socks size : ")
delivered = "No"

update_query = "update users set name = %s, std = %s, section = %s, email = %s, shirtsize = %s, pantsize
= %s, socksize = %s, delivered = %s where rollno = %s"
updated_user_data = (name, std, section, email, shirtsize, pantsize, socksize, delivered, rollno)
cursor.execute(update_query, updated_user_data)
db_connection.commit()
print("\nUser data updated successfully.")
else:
print("\nNo student details found with roll number",rollno)

db_connection.commit()
cursor.close()

def view():

cursor = db_connection.cursor()
rollno = input("Enter the rollno of the student you want to view: ")
select_query = "select * FROM users WHERE rollno = %s"
cursor.execute(select_query, (rollno,))
user_data = cursor.fetchone()
if user_data :

print("\nExisting Student Data:")


print("Roll number : ", user_data[0])
print("Name : ", user_data[1])
print("Standard : ", user_data[2])
print("Section : ", user_data[3])
print("Email : ", user_data[4])
print("Shirtsize : ", user_data[5])
print("Pantsize : ", user_data[6])
print("Socksize : ", user_data[7])
print("Delivery status : ", user_data[8])
else :
print("\nNo student data found with the roll number ", rollno)
print("Try entering the roll number without spaces.")
cursor.close()

def deliveryout():

cursor = db_connection.cursor()
rollno = int(input("Enter the roll number of the student who got their uniform delivered: "))
update_query = "update users set delivered = 'Yes' WHERE rollno = %s"
cursor.execute(update_query, (rollno,))
db_connection.commit()
cursor.close()
print("\nRecord updated successfully!")

def exchange():

cursor = db_connection.cursor()
print("Exchange requests : ")
select_query = "select * from users_exchange"
cursor.execute(select_query)
user_data = cursor.fetchall()

for i in user_data :
print("Roll number : ", i[0])
print("Reason : ", i[5])

while True:

passwd=str(input("Enter the password : "))


if passwd.strip() == 'admin1234' :
print("Successfully logged into admin account...")
while True:
print("-"*40)
print("1. Input New Student Details")
print("2. Update Existing Student Details")
print("3. View Existing Student Details")
print("4. Delivery")
print("5. Exchange requests ")
print("6. Exit")
option = int(input("Enter the corresponding number to your choice : "))
print("-"*40)

if option == 1:
insertinto()
elif option == 2:
updateinto()

elif option == 3:
view()

elif option == 4:
deliveryout()

elif option == 5:
exchange()

else:
break
break

else:
print("Wrong credentials ! Contact the Dev to reset the password.")
break

while True:

print()
print("-"*40)
userid=int(input("Enter '1' to log on to student portal \nEnter '2' to log on to admin portal \nTo exit enter '3'\n"))
print("-"*40)
if userid == 1:
student_info()
elif userid == 2:
admin()
elif userid == 3:
db_connection.close()
break
Table Description
Table: users

Table : users_exchange
Output
----------------------------------------
Enter '1' to log on to student portal
Enter '2' to log on to admin portal
To exit enter '3'
2
----------------------------------------
Enter the password : admin1234
Successfully logged into admin account...
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 1
----------------------------------------
Enter the rollno :1
Enter the name : Guru
Enter the standard : 12
Enter the section :A
Enter the email : [email protected]
Enter the shirt size (S / M / L / XL) : S
Enter the pant size (S / M / L / XL) : M
Enter the socks size (6 / 8 / 10 / 12) : 8
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 1
----------------------------------------
Enter the rollno :2
Enter the name : Charan
Enter the standard : 12
Enter the section :A
Enter the email : [email protected]
Enter the shirt size (S / M / L / XL) : M
Enter the pant size (S / M / L / XL) : M
Enter the socks size (6 / 8 / 10 / 12) : 10
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 2
----------------------------------------
Enter the rollno of the student whose details you want to update: 1
Existing Student Data:
Roll number : 1
Name : Guru
Standard : 12
Section : A
Email : [email protected]
Shirtsize : S
Pantsize : M
Socksize : 8
Delivery status : No

Enter the name : Guru


Enter the standard : 12
Enter the section : A
Enter the email : [email protected]
Enter the shirt size : L
Enter the pant size : M
Enter the socks size : 8

User data updated successfully.


----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 3
----------------------------------------
Enter the rollno of the student you want to view: 1

Existing Student Data:


Roll number : 1
Name : Guru
Standard : 12
Section : A
Email : [email protected]
Shirtsize : L
Pantsize : M
Socksize : 8
Delivery status : No
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 4
----------------------------------------
Enter the roll number of the student who got their uniform delivered: 2

Record updated successfully!


----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 6
----------------------------------------
Enter '1' to log on to student portal
Enter '2' to log on to admin portal
To exit enter '3'
1
----------------------------------------
Enter your roll number : 2

Showing the order details for the roll no 2


Roll number : 2
Name : Charan
Standard : 12
Section : A
Email : [email protected]
Shirtsize : M
Pantsize : M
Socksize : 10
Delivery status : Yes

Do you want to exchange your uniform (Y/N) :Y

Enter the reason for your exchange request : Pant given is very loose. Need L sized pant.

Exchange request sent to the admin.

----------------------------------------
Enter '1' to log on to student portal
Enter '2' to log on to admin portal
To exit enter '3'
1
----------------------------------------
Enter your roll number : 1

Showing the order details for the roll no 1


Roll number : 1
Name : Guru
Standard : 12
Section : A
Email : [email protected]
Shirtsize : L
Pantsize : M
Socksize : 8
Delivery status : No

Do you want to exchange your uniform (Y/N) :Y

Your uniform isn't delivered. Please ask the admin to change the details.

----------------------------------------
Enter '1' to log on to student portal
Enter '2' to log on to admin portal
To exit enter '3'
2
----------------------------------------
Enter the password : admin1234
Successfully logged into admin account...
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 3
----------------------------------------
Enter the rollno of the student you want to view: 1

Existing Student Data:


Roll number : 1
Name : Guru
Standard : 12
Section : A
Email : [email protected]
Shirtsize : L
Pantsize : M
Socksize : 8
Delivery status : No
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 5
----------------------------------------
Exchange requests :
Roll number : 2
Reason : Pant given is very loose. Need L sized pant.
----------------------------------------
1. Input New Student Details
2. Update Existing Student Details
3. View Existing Student Details
4. Delivery
5. Exchange requests
6. Exit
Enter the corresponding number to your choice : 6
----------------------------------------

----------------------------------------
Enter '1' to log on to student portal
Enter '2' to log on to admin portal
To exit enter '3'
3
----------------------------------------
Scope for improvement

 The student portal could have been improved with many more options.
 Student’s details could have been secure because any one can access
their details through their roll number.
 The admin can only update one record at a time which could have been
improved.
 Could have integrated the project with Tkinter Module.
Bibliography

 Programiz
https://www.programiz.com/python-programming/

 Stack exchange
https://cs.stackexchange.com/

 Computer Science with Python by Preeti Arora

You might also like