SlideShare a Scribd company logo
1 of 12
import pymysql as db
conn=db.connect("127.0.0.1","root","pass@123","database1")
cur=conn.cursor()
def viewemployee(cur):
qry="select * from employee"
cur.execute(qry)
rs=cur.fetchall()
print("userNametuserPasstuserTypetfullNametphonetemailtstatusn------------
----------")
for rows in rs:
print("{}t{}t{}t{}t{}t{}t{}".format(*rows))
def viewprospect(cur):
qry="select * from prospect"
cur.execute(qry)
rs=cur.fetchall()
print("prospIdtprospNametprosPhonetprospAddresstinterestedModeltinterested
ColortdateOfVisitthotnessn----------------------")
for rows in rs:
print("{}t{}t{}t{}t{}t{}t{}t{}".format(*rows))
#Login
print("Enter username and password to login:")
userName=input("Enter username")
userPass=input("Enter Password")
cur=conn.cursor()
qry="select * from employee where userName=%s and userPass=%s"
cur.execute(qry,(userName,userPass))
result=cur.fetchall()
if result:
userType=input("Enter your user type")
cur=conn.cursor()
qry="select * from employee where userName=%s and userPass=%s and
userType=%s"
cur.execute(qry,(userName,userPass,userType))
res=cur.fetchall()
if res:
if userType=="admin":
val=int(input("Enter value 1 for Admin module and 2 for Monitor module"))
if val==1:
while(True):
print("Admin Module Access")
print("""************************ADMIN
MODULE*********************
1) Create User Account
a) Monitor b)Admin
2)View All User(Employees)
3) View All Prospects
4) Change Password
a) Self b)Others
5) Search Prospect
a)By Hotness b) By Prospect Id
6)Activate/Deactivate Account
7) Sign Out
""")
choice=int(input("Enter your Choice"))
if choice==1:
#User Account Creation
num=int(input("no of records:"))
for i in range(num):
userName=input("user name:")
userPass =input("Enter Password:")
userType =input("Type of user:")
fullName=input("Enter full name:")
phone =input("Enter phone number:")
email =input("Email Id ")
status =input("Enter status of employee(Activated or
Deactivated):")
qry="insert into employee values(%s,%s,%s,%s,%s,%s,%s)"
cur.execute(qry,(userName,userPass,userType,fullName,phone,email,status))
print("n")
conn.commit()
viewemployee(cur)
elif choice==2:
#view all employee
print("view users")
cur=conn.cursor()
qry="select * from employee"
cur.execute(qry,)
result=cur.fetchall()
for i in result:
print(i)
conn.commit()
elif choice==3:
#view all prospect
print("view prospect")
cur=conn.cursor()
qry="select * from prospect"
cur.execute(qry,)
res=cur.fetchall()
for i in res:
print(i)
conn.commit()
elif choice ==4:
#Change Password
print("Change Password")
userName=input("Enter Username")
userPass=input("Enter New Password ")
cur=conn.cursor()
qry="update employee set userPass=%s where userName=%s"
cur.execute(qry,(userPass,userName))
conn.commit()
viewemployee(cur)
elif choice==5:
#Search Prospect
print("Enter either by hotness or ProspectId")
value=input("Enter h for hotness or p for prospId")
if value=='h':
hotness=input("Enter hotness of customer")
cur=conn.cursor()
qry="select * from prospect where hotness=%s"
cur.execute(qry,(hotness))
res=cur.fetchall()
print(res)
conn.commit()
elif value =='p':
prospId=input("Enter prospect Id")
cur=conn.cursor()
qry="select * from prospect where prospId=%s"
cur.execute(qry,(prospId))
res=cur.fetchone()
print(res)
conn.commit()
else:
print("!!! Invalid Choice!!!")
elif choice==6:
#Status of Account
print("Activate or Deactivate Account")
userName=input("Enter User Name")
status=input("Change Status of Account as per your choice")
cur=conn.cursor()
qry="update employee set Status=%s where userName=%s"
cur.execeute(qry,(Status,userName))
conn.commit()
viewemployee(cur)
elif choice==7:
#Sign Out
print("You have sucessfully signed out")
break
else:
print("!!! Invalid Choice!!!")
elif val==2:
while(True):
print("Employee Module Access")
print("""*******************EMPLOYEE
MODULE*************************
Login
1)Add New Prospect
2)View All Prospeect
3)Update Prospect
a) -Phone b)-Model c)-Colour d)-Hotness
4)Search
a)By Hotness b) By Prospect Id
5)Change Own paasword
6)Sign Out
""")
choice=int(input("Enter Choice"))
if choice==1:
#Add New Prospect
num=int(input("enter no. of records you wanna enter"))
for i in range(num):
prospId=input("enter prospect id:")
prospName =input("Enter name:")
prospPhone =input("Enter phone number:")
prospAddress=input("Enter address:")
interestedModel =input("Enter interested model:")
interestedColor =input("Enter interested color")
dateOfVisit =input("Enter date of visit:")
hotness=input("enter hotness as 1) cold,2)warm,3)hot:")
qry="insert into prospect
values(%s,%s,%s,%s,%s,%s,%s,%S)"
cur.execute(qry,(prospId,prospName,prospPhone,prospAddress,interestedModel,inter
estedColor,dateOfVisit,hotness))
print("n")
conn.commit()
viewprospect(cur)
elif choice==2:
#View All Prospect
print("view prospect")
cur=conn.cursor()
qry="select * from prospect"
cur.execute(qry)
res=cur.fetchall()
for i in res:
print(i)
conn.commit()
elif choice==3:
#update prospect
print("update prospect")
prospId=input("Enter prospId")
prospPhone=input("Enter new phone number")
interestedModel=input("Enter model of car")
interestedColour=input("Enter colour of car")
hotness=input("Enter hotness of customer")
cur=conn.cursor()
qry="update prospect set
prospPhone=%s,interestedModel=%s,interestedColour=%s,hotness=%s where
prospId=%s"
cur.execute(qry,(prospPhone,interestedModel,interestedColour,hotness,prospId))
conn.commit()
elif choice==4:
#Search Prospect
print("Enter either by hotness or ProspectId")
value=input("Enter h for hotness or p for prospId")
if value=='h':
hotness=input("Enter hotness of customer")
cur=conn.cursor()
qry="select * from prospect where hotness=%s"
cur.execute(qry,(hotness))
res=cur.fetchall()
print(res)
conn.commit()
elif value =='p':
prospId=input("Enter prospect Id")
cur=conn.cursor()
qry="select * from prospect where prospId=%s"
cur.execute(qry,(prospId))
res=cur.fetchone()
print(res)
conn.commit()
else:
print("!!! Invalid Choice!!!")
elif choice==5:
#change password
print("Change Password")
userName=input("Enter Username")
userPass=input("Enter New Password ")
cur=conn.cursor()
qry="update employee set userPass=%s where userName=%s"
cur.execute(qry,(userPass,userName))
conn.commit()
viewemployee(cur)
elif choice==6:
#Sign Out
print("You Have Signed Out")
break
else:
print("!!!Invalid Choice!!!")
continue
else:
print("!!!Invalid Choice!!!")
elif userType=="employee":
while(True):
print("Employee Module Access")
print("""*******************EMPLOYEE
MODULE*************************
Login
1)Add New Prospect
2)View All Prospeect
3)Update Prospect
a) -Phone b)-Model c)-Colour d)-Hotness
4)Search
a)By Hotness b) By Prospect Id
5)Change Own paasword
6)Sign Out
""")
choice=int(input("Enter Choice"))
if choice==1:
#Add New Prospect
num=int(input("enter no. of records you wanna enter"))
for i in range(num):
prospId=input("enter prospect id:")
prospName =input("Enter name:")
prospPhone =input("Enter phone number:")
prospAddress=input("Enter address:")
interestedModel =input("Enter interested model:")
interestedColor =input("Enter interested color")
dateOfVisit =input("Enter date of visit:")
hotness=input("enter hotness as 1) cold,2)warm,3)hot:")
qry="insert into prospect
values(%s,%s,%s,%s,%s,%s,%s,%s)"
cur.execute(qry,(prospId,prospName,prospPhone,prospAddress,interestedModel,inter
estedColor,dateOfVisit,hotness))
print("n")
conn.commit()
viewprospect(cur)
elif choice==2:
#View All Prospect
print("view prospect")
cur=conn.cursor()
qry="select * from prospect"
cur.execute(qry,)
res=cur.fetchall()
for i in res:
print(i)
conn.commit()
elif choice==3:
#update prospect
print("update prospect")
prospId=input("Enter prospId")
prospPhone=input("Enter new phone number")
interestedModel=input("Enter model of car")
interestedColour=input("Enter colour of car")
hotness=input("Enter hotness of customer")
cur=conn.cursor()
qry="update prospect set
prospPhone=%s,interestedModel=%s,interestedColour=%s,hotness=%s where
prospId=%s"
cur.execute(qry,(prospPhone,interestedModel,interestedColour,hotness,prospId))
conn.commit()
elif choice==4:
#Search Prospect
print("Enter either by hotness or ProspectId")
value=input("Enter h for hotness or p for prospId")
if value=='h':
hotness=input("Enter hotness of customer")
cur=conn.cursor()
qry="select * from prospect where hotness=%s"
cur.execute(qry,(hotness))
res=cur.fetchall()
print(res)
conn.commit()
elif value=='p':
prospId=input("Enter prospect Id")
cur=conn.cursor()
qry="select * from prospect where prospId=%s"
cur.execute(qry,(prospId))
res=cur.fetchone()
print(res)
conn.commit()
else:
print("!!! Invalid Choice!!!")
elif choice==5:
#change password
print("Change Password")
userName=input("Enter Username")
userPass=input("Enter New Password ")
cur=conn.cursor()
qry="update employee set userPass=%s where userName=%s"
cur.execute(qry,(userPass,userName))
conn.commit()
viewemployee(cur)
elif choice==6:
#Sign Out
print("You Have Signed Out")
break
else:
print("!!!Invalid Choice!!!")
continue
else:
print("!!!Invalid Choice!!!")
else:
print("Invalid")
cur.close()
conn.commit()
conn.close()
OUTPUT
C:UserssauraPycharmProjectsuntitled1venvScriptspython.exe
C:/Users/saura/Downloads/prospect.py
Enter username and password to login:
Enter usernameneha
Enter Password1234
Enter your user typeadmin
Enter value 1 for Admin module and 2 for Monitor module1
Admin Module Access
************************ADMIN MODULE*********************
1) Create User Account
a) Monitor b)Admin
2)View All User(Employees)
3) View All Prospects
4) Change Password
a) Self b)Others
5) Search Prospect
a)By Hotness b) By Prospect Id
6)Activate/Deactivate Account
7) Sign Out
Enter your Choice2
view users
('chandu', '1234', 'employee', 'chandrakant gaikwad', '7484338384', 'chandu@gmail.com',
'activated')
('neha', '1234', 'admin', 'neha jagtap', '8817291712', 'neha@gmail.com', 'activated')
('praju', '1234', 'admin', 'prajakta raskar', '9898272223', 'praju@gmail.com', 'activated')
('rushi', '1234', 'employee', 'rushikesh meher', '8984743987', 'rushi@gmail.com', 'activated')
('saurab', '1234', 'admin', 'saurabh jha', '3434343434', 'saurabh@gmail.com', 'activated')
('shub', '1234', 'employee', 'shubham kadam', '7474747634', 'shubham@gmail.com', 'activated')
Admin Module Access
************************ADMIN MODULE*********************
1) Create User Account
a) Monitor b)Admin
2)View All User(Employees)
3) View All Prospects
4) Change Password
a) Self b)Others
5) Search Prospect
a)By Hotness b) By Prospect Id
6)Activate/Deactivate Account
7) Sign Out
Enter your Choice3
view prospect
(1, 'rajwardhan shelar', '3454545323', 'baramati', 'ciaz 2019', 'white', datetime.date(2014, 11, 18),
'warm')
(2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19),
'hot')
Admin Module Access
************************ADMIN MODULE*********************
1) Create User Account
a) Monitor b)Admin
2)View All User(Employees)
3) View All Prospects
4) Change Password
a) Self b)Others
5) Search Prospect
a)By Hotness b) By Prospect Id
6)Activate/Deactivate Account
7) Sign Out
Enter your Choice5
Enter either by hotness or ProspectId
Enter h for hotness or p for prospIdh
Enter hotness of customerhot
((2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19),
'hot'),)
Admin Module Access
************************ADMIN MODULE*********************
1) Create User Account
a) Monitor b)Admin
2)View All User(Employees)
3) View All Prospects
4) Change Password
a) Self b)Others
5) Search Prospect
a)By Hotness b) By Prospect Id
6)Activate/Deactivate Account
7) Sign Out
Enter Choice7
view prospect
(1, 'rajwardhan shelar', '3454545323', 'baramati', 'ciaz 2019', 'white', datetime.date(2014, 11, 18),
'warm')
(2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19),
'hot')
Employee Module Access
*******************EMPLOYEE MODULE*************************
Login
1)Add New Prospect
2)View All Prospeect
3)Update Prospect
a) -Phone b)-Model c)-Colour d)-Hotness
4)Search
a)By Hotness b) By Prospect Id
5)Change Own paasword
6)Sign Out
Enter Choice8
enter no. of records you wanna enter1
enter prospect id:5
Enter name:suraj
Enter phone number:876565689
Enter address:baramati
Enter interested model:maruti suzuki
Enter interested color
Enter date of visit:13/12/19
enter hotness as 1) cold,2)warm,3)hot:warm
prospId prospName prosPhone prospAddress interestedModel interestedColor
dateOfVisit hotness
----------------------
1 rajwardhan shelar 3454545323 baramati ciaz 2019 white 2014-11-18
warm
2 saurabh gade 9839228392 malegaon swift desire matte blue 2020-09-19
hot
5 suraj 876565689 baramati maruti suzuki 2013-12-19 warm
Employee Module Access
*******************EMPLOYEE MODULE*************************
Login
1)Add New Prospect
2)View All Prospeect
3)Update Prospect
a) -Phone b)-Model c)-Colour d)-Hotness
4)Search
a)By Hotness b) By Prospect Id
5)Change Own paasword
6)Sign Out
Enter Choice9
You Have Signed Out
Process finished with exit code 0

More Related Content

Similar to dbms project with output.docx

c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
Swarup Kumar Boro
 
school-management-by-shivkamal-singh.pdf
school-management-by-shivkamal-singh.pdfschool-management-by-shivkamal-singh.pdf
school-management-by-shivkamal-singh.pdf
ashishkum805
 

Similar to dbms project with output.docx (20)

pyspark_df.pdf
pyspark_df.pdfpyspark_df.pdf
pyspark_df.pdf
 
Railwaynew
RailwaynewRailwaynew
Railwaynew
 
Lab Question
Lab QuestionLab Question
Lab Question
 
9.C Programming
9.C Programming9.C Programming
9.C Programming
 
Railway reservation
Railway reservationRailway reservation
Railway reservation
 
c++ program for Railway reservation
c++ program for Railway reservationc++ program for Railway reservation
c++ program for Railway reservation
 
C++ manual Report Full
C++ manual Report FullC++ manual Report Full
C++ manual Report Full
 
Cpds lab
Cpds labCpds lab
Cpds lab
 
CBSE Class XI Programming in C++
CBSE Class XI Programming in C++CBSE Class XI Programming in C++
CBSE Class XI Programming in C++
 
7 functions
7  functions7  functions
7 functions
 
hotelmangt project code connecting python wih Mysql cbse 2022-23 project .docx
hotelmangt project code connecting python wih Mysql cbse 2022-23 project .docxhotelmangt project code connecting python wih Mysql cbse 2022-23 project .docx
hotelmangt project code connecting python wih Mysql cbse 2022-23 project .docx
 
C Programming
C ProgrammingC Programming
C Programming
 
school-management-by-shivkamal-singh.pdf
school-management-by-shivkamal-singh.pdfschool-management-by-shivkamal-singh.pdf
school-management-by-shivkamal-singh.pdf
 
Php functions
Php functionsPhp functions
Php functions
 
C programs Set 3
C programs Set 3C programs Set 3
C programs Set 3
 
C lab programs
C lab programsC lab programs
C lab programs
 
C lab programs
C lab programsC lab programs
C lab programs
 
sodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdfsodapdf-converted into ppt presentation(1).pdf
sodapdf-converted into ppt presentation(1).pdf
 
PROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdfPROJECT ON HOTEL MANAGEMENT.pdf
PROJECT ON HOTEL MANAGEMENT.pdf
 
VTU Data Structures Lab Manual
VTU Data Structures Lab ManualVTU Data Structures Lab Manual
VTU Data Structures Lab Manual
 

Recently uploaded

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
Muhammad Subhan
 

Recently uploaded (20)

State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
Oauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoftOauth 2.0 Introduction and Flows with MuleSoft
Oauth 2.0 Introduction and Flows with MuleSoft
 
Top 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development CompaniesTop 10 CodeIgniter Development Companies
Top 10 CodeIgniter Development Companies
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
ERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage IntacctERP Contender Series: Acumatica vs. Sage Intacct
ERP Contender Series: Acumatica vs. Sage Intacct
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Design Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptxDesign Guidelines for Passkeys 2024.pptx
Design Guidelines for Passkeys 2024.pptx
 
ADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptxADP Passwordless Journey Case Study.pptx
ADP Passwordless Journey Case Study.pptx
 
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
TrustArc Webinar - Unified Trust Center for Privacy, Security, Compliance, an...
 
2024 May Patch Tuesday
2024 May Patch Tuesday2024 May Patch Tuesday
2024 May Patch Tuesday
 
WebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM PerformanceWebAssembly is Key to Better LLM Performance
WebAssembly is Key to Better LLM Performance
 
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties ReimaginedEasier, Faster, and More Powerful – Notes Document Properties Reimagined
Easier, Faster, and More Powerful – Notes Document Properties Reimagined
 
Vector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptxVector Search @ sw2con for slideshare.pptx
Vector Search @ sw2con for slideshare.pptx
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
“Iamnobody89757” Understanding the Mysterious of Digital Identity.pdf
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Event-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream ProcessingEvent-Driven Architecture Masterclass: Challenges in Stream Processing
Event-Driven Architecture Masterclass: Challenges in Stream Processing
 

dbms project with output.docx

  • 1. import pymysql as db conn=db.connect("127.0.0.1","root","pass@123","database1") cur=conn.cursor() def viewemployee(cur): qry="select * from employee" cur.execute(qry) rs=cur.fetchall() print("userNametuserPasstuserTypetfullNametphonetemailtstatusn------------ ----------") for rows in rs: print("{}t{}t{}t{}t{}t{}t{}".format(*rows)) def viewprospect(cur): qry="select * from prospect" cur.execute(qry) rs=cur.fetchall() print("prospIdtprospNametprosPhonetprospAddresstinterestedModeltinterested ColortdateOfVisitthotnessn----------------------") for rows in rs: print("{}t{}t{}t{}t{}t{}t{}t{}".format(*rows)) #Login print("Enter username and password to login:") userName=input("Enter username") userPass=input("Enter Password") cur=conn.cursor() qry="select * from employee where userName=%s and userPass=%s" cur.execute(qry,(userName,userPass)) result=cur.fetchall() if result: userType=input("Enter your user type") cur=conn.cursor() qry="select * from employee where userName=%s and userPass=%s and userType=%s" cur.execute(qry,(userName,userPass,userType)) res=cur.fetchall() if res: if userType=="admin": val=int(input("Enter value 1 for Admin module and 2 for Monitor module")) if val==1: while(True): print("Admin Module Access")
  • 2. print("""************************ADMIN MODULE********************* 1) Create User Account a) Monitor b)Admin 2)View All User(Employees) 3) View All Prospects 4) Change Password a) Self b)Others 5) Search Prospect a)By Hotness b) By Prospect Id 6)Activate/Deactivate Account 7) Sign Out """) choice=int(input("Enter your Choice")) if choice==1: #User Account Creation num=int(input("no of records:")) for i in range(num): userName=input("user name:") userPass =input("Enter Password:") userType =input("Type of user:") fullName=input("Enter full name:") phone =input("Enter phone number:") email =input("Email Id ") status =input("Enter status of employee(Activated or Deactivated):") qry="insert into employee values(%s,%s,%s,%s,%s,%s,%s)" cur.execute(qry,(userName,userPass,userType,fullName,phone,email,status)) print("n") conn.commit() viewemployee(cur) elif choice==2: #view all employee print("view users") cur=conn.cursor() qry="select * from employee" cur.execute(qry,) result=cur.fetchall() for i in result: print(i) conn.commit() elif choice==3: #view all prospect print("view prospect") cur=conn.cursor() qry="select * from prospect"
  • 3. cur.execute(qry,) res=cur.fetchall() for i in res: print(i) conn.commit() elif choice ==4: #Change Password print("Change Password") userName=input("Enter Username") userPass=input("Enter New Password ") cur=conn.cursor() qry="update employee set userPass=%s where userName=%s" cur.execute(qry,(userPass,userName)) conn.commit() viewemployee(cur) elif choice==5: #Search Prospect print("Enter either by hotness or ProspectId") value=input("Enter h for hotness or p for prospId") if value=='h': hotness=input("Enter hotness of customer") cur=conn.cursor() qry="select * from prospect where hotness=%s" cur.execute(qry,(hotness)) res=cur.fetchall() print(res) conn.commit() elif value =='p': prospId=input("Enter prospect Id") cur=conn.cursor() qry="select * from prospect where prospId=%s" cur.execute(qry,(prospId)) res=cur.fetchone() print(res) conn.commit() else: print("!!! Invalid Choice!!!") elif choice==6: #Status of Account print("Activate or Deactivate Account") userName=input("Enter User Name") status=input("Change Status of Account as per your choice") cur=conn.cursor() qry="update employee set Status=%s where userName=%s" cur.execeute(qry,(Status,userName)) conn.commit() viewemployee(cur) elif choice==7:
  • 4. #Sign Out print("You have sucessfully signed out") break else: print("!!! Invalid Choice!!!") elif val==2: while(True): print("Employee Module Access") print("""*******************EMPLOYEE MODULE************************* Login 1)Add New Prospect 2)View All Prospeect 3)Update Prospect a) -Phone b)-Model c)-Colour d)-Hotness 4)Search a)By Hotness b) By Prospect Id 5)Change Own paasword 6)Sign Out """) choice=int(input("Enter Choice")) if choice==1: #Add New Prospect num=int(input("enter no. of records you wanna enter")) for i in range(num): prospId=input("enter prospect id:") prospName =input("Enter name:") prospPhone =input("Enter phone number:") prospAddress=input("Enter address:") interestedModel =input("Enter interested model:") interestedColor =input("Enter interested color") dateOfVisit =input("Enter date of visit:") hotness=input("enter hotness as 1) cold,2)warm,3)hot:") qry="insert into prospect values(%s,%s,%s,%s,%s,%s,%s,%S)" cur.execute(qry,(prospId,prospName,prospPhone,prospAddress,interestedModel,inter estedColor,dateOfVisit,hotness)) print("n") conn.commit() viewprospect(cur) elif choice==2: #View All Prospect print("view prospect") cur=conn.cursor() qry="select * from prospect"
  • 5. cur.execute(qry) res=cur.fetchall() for i in res: print(i) conn.commit() elif choice==3: #update prospect print("update prospect") prospId=input("Enter prospId") prospPhone=input("Enter new phone number") interestedModel=input("Enter model of car") interestedColour=input("Enter colour of car") hotness=input("Enter hotness of customer") cur=conn.cursor() qry="update prospect set prospPhone=%s,interestedModel=%s,interestedColour=%s,hotness=%s where prospId=%s" cur.execute(qry,(prospPhone,interestedModel,interestedColour,hotness,prospId)) conn.commit() elif choice==4: #Search Prospect print("Enter either by hotness or ProspectId") value=input("Enter h for hotness or p for prospId") if value=='h': hotness=input("Enter hotness of customer") cur=conn.cursor() qry="select * from prospect where hotness=%s" cur.execute(qry,(hotness)) res=cur.fetchall() print(res) conn.commit() elif value =='p': prospId=input("Enter prospect Id") cur=conn.cursor() qry="select * from prospect where prospId=%s" cur.execute(qry,(prospId)) res=cur.fetchone() print(res) conn.commit() else: print("!!! Invalid Choice!!!") elif choice==5: #change password print("Change Password") userName=input("Enter Username")
  • 6. userPass=input("Enter New Password ") cur=conn.cursor() qry="update employee set userPass=%s where userName=%s" cur.execute(qry,(userPass,userName)) conn.commit() viewemployee(cur) elif choice==6: #Sign Out print("You Have Signed Out") break else: print("!!!Invalid Choice!!!") continue else: print("!!!Invalid Choice!!!") elif userType=="employee": while(True): print("Employee Module Access") print("""*******************EMPLOYEE MODULE************************* Login 1)Add New Prospect 2)View All Prospeect 3)Update Prospect a) -Phone b)-Model c)-Colour d)-Hotness 4)Search a)By Hotness b) By Prospect Id 5)Change Own paasword 6)Sign Out """) choice=int(input("Enter Choice")) if choice==1: #Add New Prospect num=int(input("enter no. of records you wanna enter")) for i in range(num): prospId=input("enter prospect id:") prospName =input("Enter name:") prospPhone =input("Enter phone number:") prospAddress=input("Enter address:") interestedModel =input("Enter interested model:") interestedColor =input("Enter interested color") dateOfVisit =input("Enter date of visit:") hotness=input("enter hotness as 1) cold,2)warm,3)hot:") qry="insert into prospect values(%s,%s,%s,%s,%s,%s,%s,%s)"
  • 7. cur.execute(qry,(prospId,prospName,prospPhone,prospAddress,interestedModel,inter estedColor,dateOfVisit,hotness)) print("n") conn.commit() viewprospect(cur) elif choice==2: #View All Prospect print("view prospect") cur=conn.cursor() qry="select * from prospect" cur.execute(qry,) res=cur.fetchall() for i in res: print(i) conn.commit() elif choice==3: #update prospect print("update prospect") prospId=input("Enter prospId") prospPhone=input("Enter new phone number") interestedModel=input("Enter model of car") interestedColour=input("Enter colour of car") hotness=input("Enter hotness of customer") cur=conn.cursor() qry="update prospect set prospPhone=%s,interestedModel=%s,interestedColour=%s,hotness=%s where prospId=%s" cur.execute(qry,(prospPhone,interestedModel,interestedColour,hotness,prospId)) conn.commit() elif choice==4: #Search Prospect print("Enter either by hotness or ProspectId") value=input("Enter h for hotness or p for prospId") if value=='h': hotness=input("Enter hotness of customer") cur=conn.cursor() qry="select * from prospect where hotness=%s" cur.execute(qry,(hotness)) res=cur.fetchall() print(res) conn.commit() elif value=='p': prospId=input("Enter prospect Id") cur=conn.cursor() qry="select * from prospect where prospId=%s"
  • 8. cur.execute(qry,(prospId)) res=cur.fetchone() print(res) conn.commit() else: print("!!! Invalid Choice!!!") elif choice==5: #change password print("Change Password") userName=input("Enter Username") userPass=input("Enter New Password ") cur=conn.cursor() qry="update employee set userPass=%s where userName=%s" cur.execute(qry,(userPass,userName)) conn.commit() viewemployee(cur) elif choice==6: #Sign Out print("You Have Signed Out") break else: print("!!!Invalid Choice!!!") continue else: print("!!!Invalid Choice!!!") else: print("Invalid") cur.close() conn.commit() conn.close() OUTPUT C:UserssauraPycharmProjectsuntitled1venvScriptspython.exe C:/Users/saura/Downloads/prospect.py Enter username and password to login: Enter usernameneha Enter Password1234 Enter your user typeadmin Enter value 1 for Admin module and 2 for Monitor module1 Admin Module Access
  • 9. ************************ADMIN MODULE********************* 1) Create User Account a) Monitor b)Admin 2)View All User(Employees) 3) View All Prospects 4) Change Password a) Self b)Others 5) Search Prospect a)By Hotness b) By Prospect Id 6)Activate/Deactivate Account 7) Sign Out Enter your Choice2 view users ('chandu', '1234', 'employee', 'chandrakant gaikwad', '7484338384', 'chandu@gmail.com', 'activated') ('neha', '1234', 'admin', 'neha jagtap', '8817291712', 'neha@gmail.com', 'activated') ('praju', '1234', 'admin', 'prajakta raskar', '9898272223', 'praju@gmail.com', 'activated') ('rushi', '1234', 'employee', 'rushikesh meher', '8984743987', 'rushi@gmail.com', 'activated') ('saurab', '1234', 'admin', 'saurabh jha', '3434343434', 'saurabh@gmail.com', 'activated') ('shub', '1234', 'employee', 'shubham kadam', '7474747634', 'shubham@gmail.com', 'activated') Admin Module Access ************************ADMIN MODULE********************* 1) Create User Account a) Monitor b)Admin 2)View All User(Employees) 3) View All Prospects 4) Change Password a) Self b)Others 5) Search Prospect a)By Hotness b) By Prospect Id
  • 10. 6)Activate/Deactivate Account 7) Sign Out Enter your Choice3 view prospect (1, 'rajwardhan shelar', '3454545323', 'baramati', 'ciaz 2019', 'white', datetime.date(2014, 11, 18), 'warm') (2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19), 'hot') Admin Module Access ************************ADMIN MODULE********************* 1) Create User Account a) Monitor b)Admin 2)View All User(Employees) 3) View All Prospects 4) Change Password a) Self b)Others 5) Search Prospect a)By Hotness b) By Prospect Id 6)Activate/Deactivate Account 7) Sign Out Enter your Choice5 Enter either by hotness or ProspectId Enter h for hotness or p for prospIdh Enter hotness of customerhot ((2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19), 'hot'),) Admin Module Access ************************ADMIN MODULE********************* 1) Create User Account a) Monitor b)Admin
  • 11. 2)View All User(Employees) 3) View All Prospects 4) Change Password a) Self b)Others 5) Search Prospect a)By Hotness b) By Prospect Id 6)Activate/Deactivate Account 7) Sign Out Enter Choice7 view prospect (1, 'rajwardhan shelar', '3454545323', 'baramati', 'ciaz 2019', 'white', datetime.date(2014, 11, 18), 'warm') (2, 'saurabh gade', '9839228392', 'malegaon', 'swift desire', 'matte blue', datetime.date(2020, 9, 19), 'hot') Employee Module Access *******************EMPLOYEE MODULE************************* Login 1)Add New Prospect 2)View All Prospeect 3)Update Prospect a) -Phone b)-Model c)-Colour d)-Hotness 4)Search a)By Hotness b) By Prospect Id 5)Change Own paasword 6)Sign Out Enter Choice8 enter no. of records you wanna enter1 enter prospect id:5 Enter name:suraj Enter phone number:876565689
  • 12. Enter address:baramati Enter interested model:maruti suzuki Enter interested color Enter date of visit:13/12/19 enter hotness as 1) cold,2)warm,3)hot:warm prospId prospName prosPhone prospAddress interestedModel interestedColor dateOfVisit hotness ---------------------- 1 rajwardhan shelar 3454545323 baramati ciaz 2019 white 2014-11-18 warm 2 saurabh gade 9839228392 malegaon swift desire matte blue 2020-09-19 hot 5 suraj 876565689 baramati maruti suzuki 2013-12-19 warm Employee Module Access *******************EMPLOYEE MODULE************************* Login 1)Add New Prospect 2)View All Prospeect 3)Update Prospect a) -Phone b)-Model c)-Colour d)-Hotness 4)Search a)By Hotness b) By Prospect Id 5)Change Own paasword 6)Sign Out Enter Choice9 You Have Signed Out Process finished with exit code 0