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

Class 12 Computer Science Sample Project

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views

Class 12 Computer Science Sample Project

Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

PROJECT IN COMPUTER SCIENCE

By

XXXX X.

RegNo:

La Chatelaine Junior College


Chennai-600087
EVENT MANAGEMENT
SYSTEM
TABLE OF CONTENTS

Project Description
Source code
Output
Bibliography
Project Description
The project Event Management System uses Python as front end and
MySql as backend. It aims to maintain the details of an Event manager in a
systematic way.
Event details are stored in Mysql table for easy retrieval and access.
The following functionalities are included in the project:
 Adding Event Details
 Display Event Details
 Search Event Details
 Update Event Details
 Delete Event Details
 Datewise Report(Event Calender)

SOURCE CODE
import mysql.connector as ms
mycon = ms.connect(host='localhost',user="root",password="password",database="eventdb")
mycursor = mycon.cursor()

def Display():
global mycon,mycursor
try:
inpstrquery="select * from event"
mycursor.execute(inpstrquery)
results = mycursor.fetchall()
print("*********************************************************************************")
print('%5s'%"EVENTNO",'%15s'%'EVENT
NAME','%10s'%'DATE','%12s'%'ADDRESS','%10s'%'PHONENO')
print("*********************************************************************************")
count=0
for row in results:
print('%5s' % row[0],'%20s'%row[1],'%8s'%row[2],'%8s'%row[3],'%10s'%row[4])

print("*************** TOTAL RECORD : ",mycursor.rowcount,"******************************")


except:
print("error")

def insertevent():
global mycon,mycursor
print("*******************ADD NEW EVENT**************************")
eno = int(input("Enter event number :"))
en = input("Enter event name :")
edate=input("Enter event date:(yyyy-mm-dd)")
Addr = input("Enter Address: ")
ph = int(input("Enter phonenumber :"))
inpstrQuery="insert into event values({},'{}','{}','{}',{})".format(eno,en,edate,Addr,ph)
mycursor.execute(inpstrQuery)
mycon.commit()
print("\nRECORD ADDED SUCCESSFULLY!")

def searchevent():
global mycon,mycursor
print("*******************SEARCH EVENT FORM **************************")
en = int(input("Enter event number to search :"))
inpstrQuery="select * from event where eventno={}".format(en)
mycursor.execute(inpstrQuery)
results = mycursor.fetchall()
if mycursor.rowcount<=0:
print("\n SORRY! NO MATCHING DETAILS AVAILABLE!")
else:

print("*********************************************************************************")
print('%5s'%"EVENTNO",'%15s'%'EVENT
NAME','%10s'%'DATE','%12s'%'ADDRESS','%10s'%'PHONENO')
print("*********************************************************************************")
for row in results:
print('%5s' % row[0],'%20s'%row[1],'%8s'%row[2],'%8s'%row[3],'%10s'%row[4])
print("-"*50)

def updateevent():
global mycon,mycursor
print("*******************UPDATE EVENT FORM **************************")
en = int(input("Enter event number to update :"))
inpstrquery="select * from event where eventno={}".format(en)
mycursor.execute(inpstrquery)
results = mycursor.fetchall()
if mycursor.rowcount<=0:
print("SORRY! NO MATCHING DETAILS AVAILABLE")
else:
print("*********************************************************************************")
print('%5s'%"EVENTNO",'%15s'%'EVENT
NAME','%10s'%'DATE','%12s'%'ADDRESS','%10s'%'PHONENO')
print("*********************************************************************************")
for row in results:
print('%5s' % row[0],'%20s'%row[1],'%8s'%row[2],'%8s'%row[3],'%10s'%row[4])
print("-"*50)
ans = input("Are you sure to update ? (y/n)")
if ans=="y" or ans=="Y":
d = input("Enter new Address to update (enter old value if not to update) :")
s = int(input("Enter new Phoneno to update (enter old value if not to update) :"))
inpstrquery="update event set address='{}',phoneno={} where eventno={}".format(d,s,en)
mycursor.execute(inpstrquery)
mycon.commit()
print("\nRECORD UPDATED")

def deleteevent():
global mycon,mycursor

print("*******************DELET EVENT FORM **************************")


en = int(input("Enter event number to delete :"))
inpstrQuery="select * from event where eventno={}".format(en)
mycursor.execute(inpstrQuery)
results = mycursor.fetchall()
if mycursor.rowcount<=0:
print("\## SORRY! NO MATCHING DETAILS AVAILABLE ##")
else:

print("********************************************************************************")

print('%5s'%"EventNO",'%15s'%'EventNAME','%10s'%'Date','%12s'%'Address','%10s'%'phonen
o')
print("********************************************************************************")
for row in results:
print('%5s' % row[0],'%20s'%row[1],'%8s'%row[2],'%8s'%row[3],'%10s'%row[4])
print("-"*50)

ans = input("Are you sure to delete ? (y/n)")


if ans=="y" or ans=="Y":
inpstrquery="delete from event where eventno={}".format(en)
mycursor.execute(inpstrquery)
mycon.commit()
print("\n RECORD DELETED")

def generateReport():

global mycon,mycursor
print("*******************EVENT CALENDER**************************")
edate = input("Enter event date to print the schedule(yyyy-mm-dd):")
query="select * from event where eventdate='{}'".format(edate)
print(query)
mycursor.execute(query)
results = mycursor.fetchall()
if mycursor.rowcount<=0:
print("\n THERE ARE NO EVENTS SCHEDULED FOR THIS DAY ")
else:
print("*********************************************************************************")
print('%5s'%"EVENTNO",'%15s'%'EVENT
NAME','%10s'%'DATE','%12s'%'ADDRESS','%10s'%'PHONENO')
print("*********************************************************************************")
count=0
for row in results:
print('%5s' % row[0],'%20s'%row[1],'%8s'%row[2],'%8s'%row[3],'%10s'%row[4])

print("*************** TOTAL RECORD : ",mycursor.rowcount,"**********")

print("-"*50)

while True:
print("*******************EVENT MANAGEMENT SYSTEM **************************")
print("1. SHOW EVENT LIST ")
print("2. ADD NEW EVENT")
print("3. SEARCH EVENT ")
print("4. UPDATE EVENT ")
print("5. DELETE EVENT ")
print("6. GENERATE DATE SCHEDULE ")
print("7. EXIT")
print("********************************************* **************************")
ans = int(input("Enter your choice :"))
if ans==1:
Display()
elif ans==2:
insertevent()
elif ans==3:
searchevent()
elif ans==4:
updateevent()
elif ans==5:
deleteevent()
elif ans==6:
generateReport()
elif ans==7:
mycon.close()
break
else:
print("\nInvalidChoice!!")

OUTPUT
BIBLIOGRAPHY

 Computer Science with Python –


Sumitha Arora
Preethi Arora

You might also like