Skip to content

Commit 5f2428a

Browse files
Merge pull request avinashkranjan#2772 from Avdhesh-Varshney/complaint
[GSSoC'23] Complaint Management Program ✔️
2 parents fd2d8fe + 2cd5a1a commit 5f2428a

File tree

6 files changed

+142
-0
lines changed

6 files changed

+142
-0
lines changed

Complaint-Management/README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<h1 align="center">COMPLAINT MANAGEMENT SYSTEM</h1>
2+
3+
_______________________________________________________________________
4+
5+
## What is it
6+
7+
- This is a simple python program.
8+
- Use this program to add the complaints records.
9+
- This program also showcase the data of complaints which are in pending.
10+
- Save data using **mysql** language.
11+
12+
<br>
13+
14+
## TechStack
15+
16+
use python 3 and above to use this **COMPLAINT MANAGEMENT SYSTEM** program.
17+
18+
<br>
19+
20+
## Modules Used:
21+
22+
- sqlite3
23+
- tkinter
24+
- db
25+
26+
<br>
27+
28+
## Screenshot 📸
29+
30+
![image](https://github.com/avinashkranjan/Amazing-Python-Scripts/assets/114330097/c5586ff4-bdf9-43fd-a9cb-d6b0ab3fd06a)
31+
32+
<br>
33+
34+
![image](https://github.com/avinashkranjan/Amazing-Python-Scripts/assets/114330097/a40ba02f-fede-4915-a52b-7086c70be5d9)
35+
36+
<br>
37+
38+
## Created By 👦
39+
40+
[Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
41+
42+
<br>
43+
44+
### Happy Coding !

Complaint-Management/db.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import sqlite3
2+
3+
class DBConnect:
4+
def __init__(self):
5+
self._db = sqlite3.connect('information.db')
6+
self._db.row_factory = sqlite3.Row
7+
self._db.execute('create table if not exists Comp(ID integer primary key autoincrement, Name varchar(255), Gender varchar(255), Comment text)')
8+
self._db.commit()
9+
def Add(self, name, gender, comment):
10+
self._db.execute('insert into Comp (Name, Gender, Comment) values (?,?,?)',(name,gender,comment))
11+
self._db.commit()
12+
return 'Your complaint has been submitted.'
13+
def ListRequest(self):
14+
cursor = self._db.execute('select * from Comp')
15+
return cursor
16+

Complaint-Management/information.db

16 KB
Binary file not shown.

Complaint-Management/listComp.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
from tkinter import *
2+
from tkinter.ttk import *
3+
from db import DBConnect
4+
import sqlite3
5+
6+
class ListComp:
7+
def __init__(self):
8+
self._dbconnect = DBConnect()
9+
self._dbconnect.row_factory = sqlite3.Row
10+
self._root = Tk()
11+
self._root.title('List of Complaints')
12+
tv = Treeview(self._root)
13+
tv.pack()
14+
tv.heading('#0', text='ID')
15+
tv.configure(column=('#Name', '#Gender', '#Comment'))
16+
tv.heading('#Name', text='Name')
17+
tv.heading('#Gender', text='Gender')
18+
tv.heading('#Comment', text='Comment')
19+
cursor = self._dbconnect.ListRequest()
20+
for row in cursor:
21+
tv.insert('', 'end', '#{}'.format(row['ID']),text=row['ID'])
22+
tv.set('#{}'.format(row['ID']),'#Name',row['Name'])
23+
tv.set('#{}'.format(row['ID']),'#Gender',row['Gender'])
24+
tv.set('#{}'.format(row['ID']),'#Comment',row['Comment'])
25+

Complaint-Management/main.py

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
from tkinter import *
2+
from tkinter.ttk import *
3+
from tkinter.messagebox import *
4+
from db import DBConnect
5+
from listComp import ListComp
6+
7+
#Config
8+
conn = DBConnect()
9+
root = Tk()
10+
root.geometry('600x285')
11+
root.title('Complaint Management')
12+
root.configure(background='#AEB6BF')
13+
14+
#Style
15+
style = Style()
16+
style.theme_use('classic')
17+
for elem in ['TLabel', 'TButton', 'TRadioutton']:
18+
style.configure(elem, background='#AEB6BF')
19+
20+
#Gridx1353
21+
labels = ['Full Name:', 'Gender:', 'Comment:']
22+
for i in range(3):
23+
Label(root, text=labels[i]).grid(row=i, column=0, padx=10, pady=10)
24+
25+
BuList = Button(root, text='List Comp.')
26+
BuList.grid(row=4, column=1)
27+
BuSubmit = Button(root, text='Submit Now')
28+
BuSubmit.grid(row=4, column=2)
29+
30+
#Entries
31+
fullname = Entry(root, width=40, font=('Arial', 14))
32+
fullname.grid(row=0, column=1, columnspan=2)
33+
SpanGender = StringVar()
34+
35+
Radiobutton(root, text='Male', value='male', variable=SpanGender).grid(row=1, column=1)
36+
Radiobutton(root, text='Female', value='female', variable=SpanGender).grid(row=1, column=2)
37+
38+
comment = Text(root, width=35, height=5, font=('Arial', 14))
39+
comment.grid(row=2, column=1, columnspan=2, padx=10, pady=10)
40+
41+
#brought to you by code-projects.org
42+
def SaveData():
43+
msg = conn.Add(fullname.get(), SpanGender.get(), comment.get(1.0, 'end'))
44+
fullname.delete(0, 'end')
45+
comment.delete(1.0, 'end')
46+
showinfo(title='Add Info', message=msg)
47+
48+
def ShowList():
49+
listrequest = ListComp()
50+
51+
BuSubmit.config(command=SaveData)
52+
BuList.config(command=ShowList)
53+
54+
root.mainloop()
55+

SCRIPTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,5 +127,7 @@
127127
| 112\. | Open Websites By Speaking | This python script can allow user to open any website just by speaking. | [Take Me](./Websites_Automation) | [Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
128128
| 112\. | Advisor App | This python script allows user to give so many advices and motivation quote lines. | [Take Me](./Advisor_App) | [Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
129129
| 113\. | Fake News Detection | The Fake News Detection is Python based ML script which allows you to check if your news article is Real or Fake. | [Take me](https://github.com/Parul1606/Amazing-Python-Scripts/tree/testing/Fake-News-Detection) | [Parul Pandey](https://github.com/Parul1606)
130+
| 114\. | Complaint Management Application | This python program will give the facility to add the complaints and list the pending complaints using mysql database. | [Take me](./Complaint-Management) | [Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
130131
| 114\. | All Convertors | This python program provides all types of convertors to the user with best user interface and experience. | [Take me](./All-Convertors) | [Avdhesh Varshney](https://github.com/Avdhesh-Varshney)
131132

133+

0 commit comments

Comments
 (0)