Final DBMS report

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 59

PLACEMENT MANAGEMENT SYSTEM

PROJECT REPORT

Submitted by

KHUSHI UPADHYAY [RA2211026010312]


NAMAN NANDA[RA2211026010316]

Under the Guidance of

Dr. SASI REKHA

Assistant Professor, Department of Computing Technologies

In partial satisfaction of the requirements for the degree of

BACHELOR OF TECHNOLOGY
in
COMPUTER SCIENCE ENGINEERING

SCHOOL OF COMPUTING

COLLEGE OF ENGINEERING AND TECHNOLOGY SRM


INSTITUTE OF SCIENCE AND TECHNOLOGY KATTANKULATHUR
- 603203
Mar 2024
ABSTRACT

The Placement Management System aims to streamline student information


management within the college, enhancing existing processes by introducing
automation and efficiency. By centralizing student details, the system alleviates the
burden of manual data handling, ultimately saving time and resources previously
dedicated to report generation and data collection. Accessible college-wide through
secure logins, the system's primary objective is to diminish manual intervention,
particularly in gathering individual student information. To address this challenge,
we propose the development of a user-friendly web-based platform, facilitating quick
identification of eligible students for recruitment drives. Additionally, it
comprehensively manages student records, placement training, and facilitates
coordination of various placement activities both within and outside the college. By
alleviating the workload of placement officers and faculty members, the system not
only enhances operational efficiency but also ensures the security of student
information. Through these initiatives, the Placement Management System endeavors
to optimize placement processes, fostering a more streamlined and secure
environment for student career advancement.

2
TABLE OF CONTENTS

S.No CONTENTS PAGE NO

3
1. Problem Statement

6
2. ER Diagram

16
3. Relational Tables and Schema

24
4. Complex queries based on the concepts of constraints,
sets, joins, views, Triggers and Cursors
31
5. identifying the dependencies, and applying
normalizations and anomalies
36
6. Code for the project

52
7. Result and Discussion

58
8. Online course certificate

3
1. PROBLEM STATEMENT

Manual Training and Placement which is done at various colleges is by human intervention due to
which there is a maximum chance of errors. The major problem is searching and updating of the
student data. Placement officers have to manage the student’s profile and their documents.
Placement Officer has to collect the information of various companies who comes for recruitment.
They have to arrange profiles of students according to various streams and notify them each time
according to company requirements. Placement officers submit the information of students and if
any changes or updates are required in the profile of any student, it has to be done manually. This
process is so difficult and tedious when the number of users increases. This is tedious and time
consuming. Chances of missing data are also possible. It is also difficult for collecting, managing,
and updating student data as the number of students increases. Placement Management System’
like many other placement management web sites, provides information on placement providers
and the placements and also keeps up to date information of all students. It is a platform where
students can view and assess their opportunities. The system will be having different types of
accounts for different types of users such as Admin, Student, HODs, and tutor. A profile for each
student is created with the necessary credentials for the portal. The system uses MySQL for
database management and will sort the data of the student based on eligibility criteria demanded by
the respective companies and a list of eligible candidates will be prepared and they can choose if
they are interested to attend that particular drive or test. Based on this a final data-set is created and
the interested candidates will be registered automatically by the system. This way it reduces the
work of college staff or faculty from the problems caused by human error and wastage of time
doing all processes manually.
Manual system in the colleges requires a lot of manpower and time. With this project we aim to
develop a web portal to solve this issue. The project is aimed at developing an application for the
placement department of the college. The system is an application which will be accessed and
effectively used throughout the organization with proper login enabled. It can also be used as an
application for the Placement Officers in the college to manage the student information about
placement thus reducing the manual work and consumes less paperwork. The system also provides
the facility of viewing the personal and academic information of the student. The system gets the
requested list of candidates for the companies who would like to recruit the people according to
their eligibility criteria.

4
1.1 Project Overview

Placement Management System manages student information in the college with regard to
placement. It improves existing system .It has the facility of maintaining the details of the student,
thereby reducing the manual work. It will save time and energy which are spending in making
reports and collecting data. Placement Management System can be accessed throughout the college
with proper login provided.

The main objective of the placement management system is to reduce manual work and time. It is
difficult and time-consuming to collect all the details from each student. To avoid this problem we
have planned to develop a web-based placement management system. Easy to find out the list of
eligible students attending the drives.It manages the details of student records, placement training,
different placements happening in and out of the college.  Saves the time of placement officer and
faculties.  Reduces the manual works.  This system makes student information more secure.

In colleges the records were stored in excel sheets hence sorting the data is always a problem. The
excel sheets are also less advanced. Hence sorting and searching problems arises. Updating Records
is another tedious task. Due to the above problems the updating was very difficult and ambiguous.
Data redundancy also occurs due to the duplication of files and records. The files were not stored in
a hierarchical format, hence searching the eligible students was the greatest problem . The
placement officer has to find out the eligible students by looking at the excel sheet. He/she has to
see the marks of every student and their eligibility. Another problem students face is that they are
not made aware of the Training and Placement activity held in their institutions, hence there might
have been a loss of opportunities. There is also a large communication gap between students and
the placement officers as it is difficult to maintain coordination between them. The existing system
is also inefficient as it could not take acknowledgment from the students attending a particular
drive. Hence lots of confusion at the last moment also arises. As all this is done manually, there is a
lot of workload on the placement officer. The existing method used for placement management is
not computerized [2]. All the records are main- trained manually. The departments or the
management carry out this job manually making it more complicated and tedious most of the time.
The best solution here is to computerize the current environment.

2.ER Diagram
5
2.1 Entity and Their Attributes
1.Recruiters (Employers):
Represents employer organizations recruiting for job positions.
Attributes: Company Name, Company ID (Primary Key), Contact Information (Multi-
valued), Company rank.

2.Job Seekers (Students):


Represents individuals seeking job opportunities.
Attributes: Student ID (Primary Key), Student DOB -> Age (Derived), Student Skills
(Multi-Valued), CGPA, Student Name (First Name and Last Name) -> Break down.

3.Departments:
Represents organizational units within academic institutions or companies.
Attributes: Department ID (Primary key), Head of Department Name (BreakDown),
Department Contact (Multivalues).

4.Jobs:
Represents available job positions.
Attributes: Job ID (Primary Key), Application number (Foreign Key), salary, Job titles
(Multivalued), Position, Job requirements (Multivalued), Status.

5.Resumes/CVs:
Represents documents containing educational and professional background.
Attributes: Student ID (Foreign Key), Resume ID (Primary Key), Projects, Education,
Experience.

6.Placement Offers:

6
Represents offers extended to students for job positions.
Attributes: Offer ID (Primary Key), Company ID (Foreign Key), Salary, Acceptance Status,
Start Date, Position.

7.Feedback (weak Entity):


Represents feedback provided by employers.
Attributes: Company ID (Foreign Key), Student ID (Foreign Key), Feedback Info.

8.Placement Records (weak):


Represents historical records of placements.
Attributes: Company ID (Foreign Key), Student ID (Foreign Key), Date.

9.Events:
Represents career-related events.
Attributes: Event ID (Primary Key), Company ID (Foreign Key), Event Name, Event
Location, Event Date.

10.Applications:
Represents submissions made by students for job positions.
Attributes: Application Number (Primary Key), Student ID (Foreign Key), Application
Date.

11.Roles:
Represents roles assigned to students within companies.
Attributes: Role ID (Primary Key), Student ID (Foreign Key), Company ID (Foreign Key)

7
2.2 Relationships in ER along with their cardinalities:

1. conducts (Company - Event): Many-to-Many

A company can conduct many events (career fairs, workshops, etc.).

An event can be conducted by many companies (joint events, industry fairs).

2. assigned (Company - Employee): Many-to-Many

A company can have many employees assigned to different departments or projects.

An employee can be assigned to work for many companies (contractors, consultants).

3. recruits (Employee - Student): Many-to-Many

An employee working in recruitment can recruit many students for various job openings.

A student can be recruited by many employees from different companies.

4. offers (Job - Position): One-to-One

A job opening typically offers a single specific position within a company (e.g., Software
Engineer).

A position is associated with only one job opening at a time.

5. maintains (Employee - Job, Employee - Placement Offers): Many-to-Many

There can be a many-to-many relationship between employees and jobs if employees


maintain ongoing responsibilities for multiple jobs (e.g., project managers).

Similarly, employees might be involved in maintaining details of multiple placement offers


for students.

6. has (Job has Roles, Company has Roles): Many-to-Many

A job opening can have many required roles (e.g., software engineer needs skills in Java
and Python).

A company might have various roles across different departments (e.g., marketing,
engineering).. This means that post can contain any number of likes and tags.

8
ER Diagram :

Figure 2.1 ER Diagram

9
3. Relational Tables and Schema

3.1 Schema Diagram

Figure 3.1 Schema Diagram

10
3.1.1 Schema
Entities :

1.Student Entity:
Student ID (Primary key), Date of Birth, Skills (Multi-Valued), CGPA, Name (First Name
and Last Name).

2.Employer Entity:
Company Name, Company ID (Primary Key), Contact Information (Multi-valued),
Company rank.

3.Placement Coordinator Entity:


Name, Contact Information, Department, Responsibilities
.
4.Job Entity:
Job ID (Primary Key), Application number (Foreign Key), salary, Job titles (Multi-valued),
Position, Job requirements (Multi-valued), Status.

5.Resume/CV Entity:
Student ID (Foreign Key), Resume ID (Primary Key), Projects, Education, Experience.

6.Placement Offer Entity:


Offer ID (Primary Key), Company ID (Foreign Key), Salary, Acceptance Status, Start
Date,Position.

7.Feedback Entity (Weak Entity):


Company ID (Foreign Key), Student ID (Foreign Key), Feedback Info.

8.Placement Record Entity (Weak Entity):


Company ID (Foreign Key), Student ID (Foreign Key), Date.

11
9.Events Entity:
Event ID (Primary Key), Company ID (Foreign Key), Event Name, Event Location, Event
Date.

10.Applications Entity:
Application Number (Primary Key), Student ID (Foreign Key), Application Date.

11.Roles Entity:
Role ID (Primary Key), Student ID (Foreign Key), Company ID (Foreign Key), Student
Role, Company Role.

3.2 Relational Table:

Student Table:

CREATE TABLE Student (


StudentID INT PRIMARY KEY,
DateOfBirth DATE,
Skills VARCHAR(255),
CGPA FLOAT,
FirstName VARCHAR(50),
LastName VARCHAR(50)
);

Employer Table:

CREATE TABLE Employer (


CompanyName VARCHAR(100),
CompanyID INT PRIMARY KEY,
ContactInformation VARCHAR(255),
CompanyRank VARCHAR(50)
);

12
PlacementCoordinator Table:

CREATE TABLE PlacementCoordinator (


Name VARCHAR(100),
ContactInformation VARCHAR(255),
Department VARCHAR(100),
Responsibilities VARCHAR(255)
);

Job Table:

CREATE TABLE Job (


JobID INT PRIMARY KEY,
ApplicationNumber INT,
Salary DECIMAL(10, 2),
JobTitles VARCHAR(255),
Position VARCHAR(100),
JobRequirements VARCHAR(255),
Status VARCHAR(50)
);

ResumeCV Table:

CREATE TABLE ResumeCV (


StudentID INT,
ResumeID INT PRIMARY KEY,
Projects TEXT,
Education TEXT,
Experience TEXT
);

PlacementOffer Table:

13
CREATE TABLE PlacementOffer (
OfferID INT PRIMARY KEY,
CompanyID INT,
Salary DECIMAL(10, 2),
AcceptanceStatus VARCHAR(50),
StartDate DATE,
Position VARCHAR(100)
);

Feedback Table:

CREATE TABLE Feedback (


CompanyID INT,
StudentID INT,
FeedbackInfo TEXT
);

PlacementRecord Table:

CREATE TABLE PlacementRecord (


CompanyID INT,
StudentID INT,
Date DATE
);

Events Table:

CREATE TABLE Events (


EventID INT PRIMARY KEY,
CompanyID INT,
EventName VARCHAR(100),
EventLocation VARCHAR(100),
EventDate DATE

14
);

Applications Table:

CREATE TABLE Applications (


ApplicationNumber INT PRIMARY KEY,
StudentID INT,
ApplicationDate DATE
);

Roles Table:

CREATE TABLE Roles (


RoleID INT PRIMARY KEY,
StudentID INT,
CompanyID INT,
StudentRole VARCHAR(100),
CompanyRole VARCHAR(100)
);

15
3.2 Relational Tables Structure and Content :

3.2.1 SKILLS

Figure3.2.1 Skills Table Structure And Content

3.2.2DEPARTMENT

Figure3.2.2 Department Table Structure And Content

16
3.2.3 DEPARTMENT CONTACT

Figure3.2.1 Department Contact Table Structure And Content

3.2.4 JOB

Figure3.2.4 Job Table Structure And Content

17
3.2.5.JOBTITLES

Figure3.2.5. Job_Titles Table Structure And Content

3.2.6.REQUIREMENTS

Figure3.2.6 Requirement Table Structure And Content


18
3.2.7.RESUME

Figure3.2.7 Resume Table Structure And Content

3.2.8.PLACEMENT_OFFERS

Figure3.2.8 Placement Offer Table

19
3.2.9.FEEDBACK

Figure3.2.9 Feedback Table

3.2.10.RECORDS

Figure3.2.10 Recoeds Table

20
3.2.11EVENT

Figure3.2.11 Event Table

3.2.12APPLICATION

Figure3.2.12 Application Table

21
3.2.13.ROLE

Figure3.2.13 Role Table

3.2.14.COMPANY

Figure3.2.14 Company Table

22
3.2.15.COMPANY_CONTACT

Figure3.2.15 Company_Contact Table Structure And Content

3.2.16.STUDENT

Figure3.2.16 Student Table Structure And Content

23
4.Complex Queries

4. 1.Nested Queries

SQL command
Retrieve students who applied for jobs offered by companies ranked higher than 5

Result

SQL command
Retrieve the names of students who have applied for jobs

Result

24
4.2.Correlated Quires

SQL command
Find all companies along with the count of placement offers they have made:

Result

4.3 Trigger

SQL command
calculate the number of companies a student has applied to and updates a column in the
students table accordingly

25
SQL command
Trigger to log changes made to the applications table

SQL command
Trigger to update a student's age when their date of birth is modified

26
4.4 Cursor

SQL command
cursor to find the number of events held by each company

4.5 INNER JOIN

SQL command
Get all events along with the corresponding company name:

Resultt

27
4.6 Left Join

SQL command
Retrieve all records of placement offers along with the corresponding student's name and the
company name. Include records without associated students or companies:

Result

4.7 Right Join

SQL command
Get all students along with the corresponding feedbacks. Include students without associated
feedbacks:

Result

28
4.8 Set Operation: UNION ALL

SQL command
Merge data from events and job titles with a common column 'event_id' and 'job_title_id':

Result

4.9 PL SQL

SQL command
retrieves the count of applications for each student and stores the result in a separate table

29
4.10 View

SQL command

Result

30
5 Identifying Functional Dependencies

Here are some functional dependencies for the project:

1. In the Student table:

- StudentID -> DateOfBirth, Skills, CGPA, FirstName, LastName

- FirstName, LastName -> StudentID

- DateOfBirth -> Age (Derived)

2. In the Employer table:

- CompanyID -> CompanyName, ContactInformation, CompanyRank

- CompanyName -> CompanyID

3. In the PlacementCoordinator table:

- Name -> ContactInformation, Department, Responsibilities

4. In the Job table:

- JobID -> ApplicationNumber, Salary, JobTitles, Position, JobRequirements, Status

- ApplicationNumber -> JobID

5. In the ResumeCV table:

- ResumeID -> StudentID, Projects, Education, Experience

- StudentID -> ResumeID

31
6. In the PlacementOffer table:

- OfferID -> CompanyID, Salary, AcceptanceStatus, StartDate, Position

- CompanyID -> OfferID

7. In the Feedback table:

- (CompanyID, StudentID) -> FeedbackInfo

8. In the PlacementRecord table:

- (CompanyID, StudentID) -> Date

9. In the Events table:

- EventID -> CompanyID, EventName, EventLocation, EventDate

- CompanyID -> EventID

10. In the Applications table:

- ApplicationNumber -> StudentID, ApplicationDate

- StudentID -> ApplicationNumber

11. In the Roles table:

- RoleID -> StudentID, CompanyID, StudentRole, CompanyRole

- (StudentID, CompanyID) -> RoleID

32
5.1 Normalization

4.12.1 1 NF

Event Table

Result

In the Event table, normalization has been applied by decomposing the event location
into separate attributes: event_place and event_pincode, along with event_city.

4.12.2 2NF

Result

To achieve second normal form (2NF) in the offer table, a separate company table is
created with the attributes cmp_id, cmp_name, and cmp_rank, where cmp_id acts as a
foreign key in the offer table.

4.12.3 3NF
33
Result

To ensure data consistency and reduce redundancy, the Student table has been
normalized to the third normal form (3NF). A separate Department table has been
created, containing unique department identifiers (dept_id) and corresponding
department names (dept_name).

4.12.4 4NF

Company Contact

Result

In 4th Normal Form (4NF), the multivalued attribute cmp_phone_number in the


company contact table is normalized by creating another table. This new table includes
cmp_id as the primary key and separate attributes for cmp_phone_number and
cmp_alternate_phone_number, ensuring atomicity and eliminating multivalued

34
dependencies.

5.2 Anomalies

1. Insertion Anomalies:

Functional Dependency Violation: If the jobs_applied table has a functional dependency between
app_number and job_id, inserting a new job application without a corresponding job ID could lead
to an inconsistency.

inserting a new record in the placement_offers table with a cmp_id that does not exist in the
companies table would lead to such an anomaly.

2.Deletion Anomalies:

deleting a record from the students table might result in the loss of information about the student's
past applications, skills, or roles.

deleting a record from the companies table without considering the related records in the
company_contact table could leave orphaned records.

3.Update Anomalies:

if a student's contact information is updated in the students table but not in the records table, the
data would become inconsistent.

35
6.Code for Project

import tkinter as tk
from tkinter import messagebox
import mysql.connector
from datetime import datetime

class PlacementManagementSystem:
def __init__(self, root):
self.root = root
self.root.title("Placement Management System")
self.root.geometry("300x200")

# Database connection
self.db_connection = mysql.connector.connect(host="localhost", user="root",
passwd="Noone@121003", auth_plugin='mysql_native_password', db="placement-management")
self.cursor = self.db_connection.cursor()

# Create main menu frame


self.main_menu_frame = tk.Frame(self.root)
self.main_menu_frame.pack()

self.student_login_button = tk.Button(self.main_menu_frame, text="Student Login",


command=self.student_login_page)
self.student_login_button.grid(row=0, column=0)

self.recruiter_login_button = tk.Button(self.main_menu_frame, text="Recruiter Login",


command=self.recruiter_login_page)
self.recruiter_login_button.grid(row=0, column=1)

def student_login_page(self):
# Clear main menu frame
self.main_menu_frame.destroy()

36
# Create student login frame
self.student_login_frame = tk.Frame(self.root)
self.student_login_frame.pack()

self.username_label = tk.Label(self.student_login_frame, text="Username:")


self.username_label.grid(row=0, column=0)
self.username_entry = tk.Entry(self.student_login_frame)
self.username_entry.grid(row=0, column=1)

self.password_label = tk.Label(self.student_login_frame, text="Password:")


self.password_label.grid(row=1, column=0)
self.password_entry = tk.Entry(self.student_login_frame, show="*")
self.password_entry.grid(row=1, column=1)

self.login_button = tk.Button(self.student_login_frame, text="Login",


command=self.student_login)
self.login_button.grid(row=2, columnspan=2)

def recruiter_login_page(self):
# Clear main menu frame
self.main_menu_frame.destroy()

# Create recruiter login frame


self.recruiter_login_frame = tk.Frame(self.root)
self.recruiter_login_frame.pack()

self.username_label = tk.Label(self.recruiter_login_frame, text="Username:")


self.username_label.grid(row=0, column=0)
self.username_entry = tk.Entry(self.recruiter_login_frame)
self.username_entry.grid(row=0, column=1)

self.password_label = tk.Label(self.recruiter_login_frame, text="Password:")

37
self.password_label.grid(row=1, column=0)
self.password_entry = tk.Entry(self.recruiter_login_frame, show="*")
self.password_entry.grid(row=1, column=1)

self.login_button = tk.Button(self.recruiter_login_frame, text="Login",


command=self.recruiter_login)
self.login_button.grid(row=2, columnspan=2)

def student_login(self):
username = self.username_entry.get()
password = self.password_entry.get()

query = "SELECT * FROM student_login WHERE username = %s AND password = %s"


self.cursor.execute(query, (username, password))
student = self.cursor.fetchone()

if student:
messagebox.showinfo("Success", "Student Login successful!")
self.show_student_dashboard()
else:
messagebox.showerror("Error", "Invalid student username or password")

def show_student_dashboard(self):
# Clear student login frame
self.student_login_frame.destroy()

# Create student dashboard frame


self.student_dashboard_frame = tk.Frame(self.root)
self.student_dashboard_frame.pack()

# Create buttons for various actions


self.profile_button = tk.Button(self.student_dashboard_frame, text="Profile",
command=self.show_student_profile)

38
self.profile_button.grid(row=0, column=0)

self.edit_profile_button = tk.Button(self.student_dashboard_frame, text="Edit Profile",


command=self.edit_student_profile)
self.edit_profile_button.grid(row=0, column=1)

self.view_all_job_offers_button = tk.Button(self.student_dashboard_frame, text="View All


Job Offers", command=self.view_all_job_offers)
self.view_all_job_offers_button.grid(row=1, column=0)

self.apply_job_button = tk.Button(self.student_dashboard_frame, text="Apply for Job",


command=self.apply_for_job_window)
self.apply_job_button.grid(row=1, column=1)

self.view_applied_companies_button = tk.Button(self.student_dashboard_frame, text="View


Applied Companies", command=self.view_applied_companies)
self.view_applied_companies_button.grid(row=2, column=1)

def edit_student_profile(self):
# Fetch student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)
student_username = self.cursor.fetchone()

if student_username:
# Fetch student's profile information from the database
query = "SELECT * FROM students WHERE student_id = %s"
self.cursor.execute(query, (student_username[0],))
student_profile = self.cursor.fetchone()

if student_profile:
# Create a new window for editing the profile
edit_window = tk.Toplevel(self.root)

39
edit_window.title("Edit Student Profile")

# Create labels and entry widgets for each profile field


labels = ["Student ID:", "CGPA:", "First Name:", "Last Name:", "Age:", "DOB:",
"Department ID:"]
entries = []
for i in range(len(labels)):
tk.Label(edit_window, text=labels[i]).grid(row=i, column=0)
entry = tk.Entry(edit_window)
entry.insert(0, student_profile[i]) # Populate entry with current profile information
entry.grid(row=i, column=1)
entries.append(entry)

# Update profile button


update_button = tk.Button(edit_window, text="Update Profile", command=lambda:
self.update_student_profile(entries))
update_button.grid(row=len(labels), columnspan=2)

else:
messagebox.showerror("Error", "Failed to fetch student profile")
else:
messagebox.showerror("Error", "Student username not found in the database")

def update_student_profile(self, entries):


# Get updated profile information from entry widgets
updated_profile = [entry.get() for entry in entries]

# Update student's profile in the database


query = "UPDATE students SET student_CGPA = %s, student_First_Name = %s,
student_Last_Name = %s, Student_age = %s, student_dob = %s, dep_id = %s WHERE student_id
= %s"
self.cursor.execute(query, (updated_profile[1], updated_profile[2], updated_profile[4],
updated_profile[3], updated_profile[5], updated_profile[6], updated_profile[0]))

40
self.db_connection.commit()

messagebox.showinfo("Success", "Profile updated successfully")


def show_student_profile(self):
# Fetch student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)
student_username = self.cursor.fetchone()

if student_username:
# Fetch student's profile information from the database
query = "SELECT * FROM students WHERE student_id = %s"
self.cursor.execute(query, (student_username[0],))
student_profile = self.cursor.fetchone()

if student_profile:
messagebox.showinfo("Student Profile", f"Student ID: {student_profile[0]}\n"
f"Student CGPA: {student_profile[1]}\n"
f"Student First Name: {student_profile[2]}\n"
f"Student Last Name: {student_profile[4]}\n"
f"Student Age: {student_profile[3]}\n"
f"Student DOB: {student_profile[5]}\n"
f"Department ID: {student_profile[6]}\n")
else:
messagebox.showerror("Error", "Failed to fetch student profile")
else:
messagebox.showerror("Error", "Student username not found in the database")

def recruiter_login(self):
username = self.username_entry.get()
password = self.password_entry.get()

41
# Check recruiter login credentials
query = "SELECT * FROM recruiter_login WHERE username = %s AND password = %s"
self.cursor.execute(query, (username, password))
recruiter = self.cursor.fetchone()

if recruiter:
self.recruiter_username = username # Store recruiter's username
messagebox.showinfo("Success", "Recruiter Login successful!")
self.show_recruiter_dashboard()
else:
messagebox.showerror("Error", "Invalid recruiter username or password")

def show_recruiter_dashboard(self):
# Clear recruiter login frame
self.recruiter_login_frame.destroy()

# Create recruiter dashboard frame


self.recruiter_dashboard_frame = tk.Frame(self.root)
self.recruiter_dashboard_frame.pack()

# Create buttons for various actions


self.company_profile_button = tk.Button(self.recruiter_dashboard_frame, text="View
Company Profile", command=self.show_company_profile)
self.company_profile_button.grid(row=0, column=0)

self.edit_company_profile_button = tk.Button(self.recruiter_dashboard_frame, text="Edit


Company Profile", command=self.edit_company_profile)
self.edit_company_profile_button.grid(row=0, column=1)

self.post_job_offer_button = tk.Button(self.recruiter_dashboard_frame, text="Post Job Offer",


command=self.post_job_offer)
self.post_job_offer_button.grid(row=0, column=2)

42
self.view_offers_button = tk.Button(self.recruiter_dashboard_frame, text="View Offers
Posted", command=self.view_recruiter_jobs)
self.view_offers_button.grid(row=0, column=3)

self.view_applied_students_button = tk.Button(self.recruiter_dashboard_frame, text="View


Applied Students", command=self.view_applied_students)
self.view_applied_students_button.grid(row=0, column=4)
# Add more buttons for other actions as needed

def show_company_profile(self):
# Fetch company details from the database
query = "SELECT * FROM company_contact"
self.cursor.execute(query)
company_profile = self.cursor.fetchone()

if company_profile:
messagebox.showinfo("Company Profile", f"Company Name: {company_profile[0]}\n"
f"Company Email: {company_profile[1]}\n"
f"Company Phone: {company_profile[2]}")
else:
messagebox.showerror("Error", "Company profile not found")

def edit_company_profile(self):
# Fetch recruiter's username from the database
query = "SELECT username FROM recruiter_login"
self.cursor.execute(query)
recruiter_username = self.cursor.fetchone()

if recruiter_username:
# Fetch company profile information from the database
query = "SELECT * FROM company_contact WHERE cmp_id = %s"
self.cursor.execute(query, (recruiter_username[0],))

43
company_profile = self.cursor.fetchone()

if company_profile:
# Create a new window for editing the company profile
edit_window = tk.Toplevel(self.root)
edit_window.title("Edit Company Profile")

# Create labels and entry widgets for each profile field


labels = ["Company Name:", "Company Email:", "Company Phone:"]
entries = []
for i in range(len(labels)):
tk.Label(edit_window, text=labels[i]).grid(row=i, column=0)
entry = tk.Entry(edit_window)
entry.insert(0, company_profile[i]) # Populate entry with current profile information
entry.grid(row=i, column=1)
entries.append(entry)

# Update profile button


update_button = tk.Button(edit_window, text="Update Profile", command=lambda:
self.update_company_profile(entries))
update_button.grid(row=len(labels), columnspan=2)

else:
messagebox.showerror("Error", "Failed to fetch company profile")
else:
messagebox.showerror("Error", "Recruiter username not found in the database")

def update_company_profile(self, entries):


# Get updated company details from entry widgets
updated_profile = [entry.get() for entry in entries]

# Update company profile in the database

44
query = "UPDATE company_contact SET cmp_mail_id = %s, cmp_phone_number = %s
WHERE cmp_id = %s"
self.cursor.execute(query, (updated_profile[1], updated_profile[2], updated_profile[0]))
self.db_connection.commit()

messagebox.showinfo("Success", "Company profile updated successfully")

def post_job_offer(self):
# Create a new window for posting job offers
post_window = tk.Toplevel(self.root)
post_window.title("Post Job Offer")

# Create labels and entry widgets for job offer details


labels = ["Company ID:", "Salary:", "Status:", "Start Date:", "Position:"]
entries = []
for i in range(len(labels)):
tk.Label(post_window, text=labels[i]).grid(row=i, column=0)
entry = tk.Entry(post_window)
entry.grid(row=i, column=1)
entries.append(entry)

# Submit button
submit_button = tk.Button(post_window, text="Submit", command=lambda:
self.submit_job_offer(entries))
submit_button.grid(row=len(labels), columnspan=2)

def submit_job_offer(self, entries):


# Get job offer details from entry widgets
company_id = entries[0].get()
salary = entries[1].get()
status = entries[2].get()
start_date = entries[3].get()
position = entries[4].get()

45
# Insert job offer into placement_offers table
query = "INSERT INTO placement_offers (cmp_id, offer_salary, offer_status,
offer_start_date, offer_position) VALUES (%s, %s, %s, %s, %s)"
self.cursor.execute(query, (company_id, salary, status, start_date, position))
self.db_connection.commit()

messagebox.showinfo("Success", "Job offer posted successfully")

# Inside __init__ method, create a button for posting job offers


self.post_job_offer_button = tk.Button(self.recruiter_dashboard_frame, text="Post Job Offer",
command=self.post_job_offer)
self.post_job_offer_button.grid(row=1, column=0)
def view_recruiter_jobs(self):
# Fetch recruiter's username (cmp_id) from the database
query = "SELECT username FROM recruiter_login"
self.cursor.execute(query)
recruiter_username = self.cursor.fetchone()

if recruiter_username:
# Fetch job offers posted by the recruiter from the database
query = "SELECT * FROM placement_offers WHERE cmp_id = %s"
self.cursor.execute(query, (recruiter_username[0],))
recruiter_jobs = self.cursor.fetchall()

if recruiter_jobs:
# Display job offers in a new window
jobs_window = tk.Toplevel(self.root)
jobs_window.title("Recruiter Jobs")

# Create a text widget to display job offers


jobs_text = tk.Text(jobs_window, height=20, width=80)
jobs_text.grid(row=0, column=0, padx=10, pady=10)

46
# Display job offers in the text widget
for job in recruiter_jobs:
jobs_text.insert(tk.END, f"Salary: {job[1]}\n")
jobs_text.insert(tk.END, f"Status: {job[2]}\n")
jobs_text.insert(tk.END, f"Start Date: {job[3]}\n")
jobs_text.insert(tk.END, f"Position: {job[4]}\n\n")

# Make text widget read-only


jobs_text.config(state=tk.DISABLED)
else:
messagebox.showinfo("Information", "No job offers posted by this recruiter")
else:
messagebox.showerror("Error", "Recruiter username not found in the database")

def view_all_job_offers(self):
# Fetch all job offers from the database
query = "SELECT * FROM placement_offers"
self.cursor.execute(query)
all_job_offers = self.cursor.fetchall()

if all_job_offers:
# Display job offers in a new window
job_offers_window = tk.Toplevel(self.root)
job_offers_window.title("All Job Offers")

# Create a text widget to display job offers


job_offers_text = tk.Text(job_offers_window, height=20, width=80)
job_offers_text.grid(row=0, column=0, padx=10, pady=10)

# Display job offers in the text widget


for job_offer in all_job_offers:

47
job_offers_text.insert(tk.END, f"Offer ID: {job_offer[0]}\n")
job_offers_text.insert(tk.END, f"Company Name: {job_offer[5]}\n")
job_offers_text.insert(tk.END, f"Salary: {job_offer[1]}\n")
job_offers_text.insert(tk.END, f"Status: {job_offer[2]}\n")
job_offers_text.insert(tk.END, f"Start Date: {job_offer[3]}\n")
job_offers_text.insert(tk.END, f"Position: {job_offer[4]}\n\n")

# Make text widget read-only


job_offers_text.config(state=tk.DISABLED)
else:
messagebox.showinfo("Information", "No job offers available")

def apply_for_job_window(self):
# Create a new window for applying for a job
apply_window = tk.Toplevel(self.root)
apply_window.title("Apply for Job")

# Label and Entry for entering offer ID


offer_id_label = tk.Label(apply_window, text="Enter Offer ID:")
offer_id_label.grid(row=0, column=0, padx=10, pady=10)
offer_id_entry = tk.Entry(apply_window)
offer_id_entry.grid(row=0, column=1, padx=10, pady=10)

# Button to submit application


apply_button = tk.Button(apply_window, text="Apply", command=lambda:
self.apply_for_job(offer_id_entry.get()))
apply_button.grid(row=1, columnspan=2, padx=10, pady=10)

def apply_for_job(self, offer_id):


# Get student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)

48
student_username = self.cursor.fetchone()

if student_username:
# Get the current date and time
current_date = datetime.now().strftime('%Y-%m-%d %H:%M:%S')

# Insert application into applications table


query = "INSERT INTO applications (app_date, student_id, offer_id) VALUES (%s, %s,
%s)"
self.cursor.execute(query, (current_date, student_username[0], offer_id))
self.db_connection.commit()

messagebox.showinfo("Success", "Job application submitted successfully")


else:
messagebox.showerror("Error", "Student username not found in the database")

def view_applied_companies(self):
# Get student's username from the database
query = "SELECT username FROM student_login"
self.cursor.execute(query)
student_username = self.cursor.fetchone()

if student_username:
# Fetch companies applied by the student
query = """
SELECT DISTINCT companies.cmp_name
FROM applications
JOIN placement_offers ON applications.offer_id = placement_offers.offer_id
JOIN companies ON placement_offers.cmp_id = companies.cmp_id
WHERE applications.student_id = %s
"""
self.cursor.execute(query, (student_username[0],))

49
applied_companies = self.cursor.fetchall()

if applied_companies:
company_names = [company[0] for company in applied_companies]
messagebox.showinfo("Applied Companies", "\n".join(company_names))
else:
messagebox.showinfo("Applied Companies", "You haven't applied to any companies
yet.")
else:
messagebox.showerror("Error", "Student username not found in the database")

def view_applied_students(self):

if self.recruiter_username:
# Fetch students who have applied for jobs posted by the recruiter
query = """
SELECT DISTINCT students.student_id, students.student_first_name,
students.student_last_name
FROM applications
JOIN students ON applications.student_id = students.student_id
JOIN placement_offers ON applications.offer_id = placement_offers.offer_id
WHERE placement_offers.cmp_id = %s
"""
self.cursor.execute(query, (self.recruiter_username,))
applied_students = self.cursor.fetchall()

if applied_students:
student_info = [f"{student[0]} - {student[1]} {student[2]}" for student in
applied_students]
messagebox.showinfo("Applied Students", "\n".join(student_info))
else:

50
messagebox.showinfo("Applied Students", "No students have applied for jobs posted by
you yet.")
else:
messagebox.showerror("Error", "Recruiter username not found. Please log in again.")
if __name__ == "__main__":
root = tk.Tk()
app = PlacementManagementSystem(root)
root.mainloop()

51
7.Result and Discussion

Figure 7.1 Login Page

The frontend features a homepage with distinct buttons for accessing the student and recruiter login
portals, providing streamlined access for respective users.

Figure 7.2 Details Page

Upon selection of either the student or recruiter login button, users are directed to a login page
prompting entry of username and password credentials.
52
Figure 7.3 User Dashboard Page

For student login, options encompass viewing the profile, editing it, applying for jobs, accessing all
job offers, and viewing applied companies.

Figure 7.4 Recruiter Dashboard Page

For recruiter login, options include editing the company profile, posting job offers, viewing posted
offers, and reviewing applied students.
53
Figure 7.5 Post Job Offer Page

To post a job offer, recruiters are required to input company ID along with details such as salary,
status, start date, and position.

Figure 7.6 Recruiter Job Page

Recruiter jobs are updated with changes to salary, start date, position, and status, ensuring accurate
representation of job offers.

54
Figure 7.7Successful Login pop up

Upon successful login, a pop-up message confirms the user's successful authentication, providing
immediate feedback to the user.

Figure 7.8 All Jobs Offered Page

The "All Jobs Offered" page displays a comprehensive list of job offers, including offer ID,
company name, salary, status, start date, and position, providing users with detailed information
about available employment opportunities.

55
Figure 7.9 Apply Page

To apply for a job, users are prompted to enter the offer ID corresponding to the desired position,
facilitating a streamlined application process.

Figure 7.10 User Details

The "User Details" page showcases essential student information, featuring fields such as student
ID, registration number, GPA, and department affiliation, providing comprehensive insights into
individual student profiles.
56
Figure 7.11 Entities and Views

57
8. Online course certificate

Reg No:RA2211026010312

Name:Khushi Upadhyay

58
Reg No:RA2211026010316

Name:Naman Nanda

59

You might also like