Nothing Special   »   [go: up one dir, main page]

Employee Management System: L. N. Mishra College of Business Management

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

L. N.

Mishra College of Business


Management
An Autonomous College Under B.R.Ambedkar Bihar
University
Affiliated to UGC, Approved by AICTE & Department of
Higher Education, Govt. of Bihar

A
PROJECT REPORT
ON
EMPLOYEE MANAGEMENT
SYSTEM
Is
Submitted
to
L. N. Mishra College of Business Management
Under B.R.A Bihar University, Muzaffarpur
for
the Partial Fulfilment of the Requirement for the Degree of
Bachelor of Computer Application
Session:-2019-2022
Under the Guidance of:Asst. Prof. Submitted By:
Mr. Sandeep Kaushik Kashif Ali
L. N.Mishra College of Business Managenent,
Muzaffarpur
                                   

ACKNOWLEDGEMENT

I would like to express my special appreciate and thanks to my Guide Dr.Sandeep


Kaushik ,Dr.Radhe Shyam Soni, Praveen sir, Krishna Murari sir, L.N Mishra College of
Business Management, Department of IT, Muzaffarpur. Who has been a tremendous mentor
for me. I would like to thank him for encouraging my
career have been priceless. His vision has been imperative in guiding me throughout the
project. I would like to show my sincere gratitude to my Guide for his sustainable support
throughout my project work.

I feel extremely pleased to thank my colleague and member of the team of the project
Vineet Kumar Jha Sudhanshu Kumar Jha , Ravi Kesh Nirala, Md Shahbaz.

I would also like to thank my friends who supported me.

(Kashif Ali)
INDEX

 Analysis
 Introduction
 Purpose of system
 Benifits of system
 Tools, platform and language to be used
 Django
 MVT model
 HTML 
 CSS
 JAVA script
 Hardware required
 Feasibility study
 Requirement analysis
 Software life cycle adopted
 Screenshot of the project
 Python coding
 Snapeshot with DataBase
 Scope of future application
 DFD
 ER diagram
 Pert chart
 File structure
 Test case
 Conclusion
 Bibliography 
PROJECT MEMBER
SL.NO. NAME ROLL NO.

1. KASHIF ALI 195204

2. VINEET KUMAR 195206


SINGH

3. SUDHANSHU 195160
KUMAR JHA
4. RAVI KESH NIRALA 195179

5. MD SHAHBAZ 195112

     
EMPLOYEE 
MANAGEMENT
SYSTEM
 Introduction:-   
                                            
                                                                Every  organization, whether big or small,
has human resource challenges to overcome. every organization has different
employee management needs, therefore we design exclusive employee managements
systems that are adapted to your managerial requirements. This is designed
to assist in strategic planning, and will help you ensure that your organization is
equipped with the right level of human resources for your future goals.
Also, for those busy executive who are always on the go, our systems come with access
features, which will allow you to manage your workforce anytime,
at all times.  These systems will ultimately allow you to better manage resources.
One of the main features in employee management system is Employee List
And it’s salaries. Effective time tracking mechanism saves both time and money for the
organization.

 PURPOSE OF THE SYSTEM:-


                                                   As we know in any technical educational office, the
man

ager of office used to spare lot of time even after the normal office hours either 

at home or office for preparation of daily/weekly report and other necessary 

record. Now with the help of this system, the manager has the information on his 

finger tips and can easily prepare a record based on their requirements apart 

from daily/weekly report.  Finally,We can say that this system will not only auto-

mate the process but save the valuable time of the office manager, which can be 

well utilized by this  institute. This will be an additional advantage and manage-
ment of manpower based on their free time from his normal duty.

 BENEFITS OF THIS SYSTEM:-


                                           
 This system will reduce the complexcity of employee management.

 By using this system we can easily maintain all the records about” ON 

EMPLOYEES” or “OFF EMPLOYEES”.

 It will reduce searching time.

 It can be easily handled by the person who have elementary know

ledge of computer because it provides an user friendly environment.

 It’s hardware and software configuration is not very costly that


means 

The hardware and software requirement for this soft

ware/project are not very costly.

 TOOLS, PLATFORM AND LANGUAGES TO BE USED:-


In order to run this project following is the configuration which is

required for smooth running of the software.

            Software's Required

Front End  HTML,CSS,BOOTSTRAP


Back End  DJANGP,PYTHON
Operating System Windows X or Higher Version

DJANGO

1. Introduction
2. History
3. Popularity
4. Features of Django

1. INTRODUCTION
Django is a web application framework written in python programming language. It
is based on MVT(Model View Template) design pattern. The Django is very
demanding due to its rapid development feature. It takes less time to build application
after collecting client requirement.
This framework uses a famous tag line: The Web framework for perfectionists
with deadlines.
By using Django ,we can build web applications in very less time . Django is
designed in such a manner that it handles much of configure things automatically, so
we can focus on application development only.

2. HISTORY
Django was designed and developed by Lawrence journal world in 2003 and
publicly released under BSD license in July 2005. Currently, DSF(Django Software
Foundation) maintains its development and release cycle.

3.POPULARITY
Django is widely accepted and used by various well-known sites such as:
 Instagram
 Mozilla
 Disqus
 Pinterest
 Bitbucket
 The Washington Times

4.FEATURES OF DJANGO
o Rapid Development
Django was designed with the intention to make a framework which
takes less time to build web application. The project implementation
phase is a very time taken but Django creates it rapidly.

o Secure
Django takes security seriously and helps developers to avoid many
common security mistakes, such as SQL injection, cross-site scripting,
cross-site request forgery etc. Its user authentication system provides
a secure way to manage user accounts and passwords.

Scalable
Django is scalable in nature and has ability to quickly and flexibly
switch from small to larger scale application project.

o Fully loaded
Django includes various helping task modules and libraries which can
be used to handle common web development tasks. Django takes
care of user authentication, content administration, site maps, RSS
feeds etc.

o Versatile
Django is versatile in nature which allows it to build applications for
different-different domains. Now a days, companies are using Django
to build various types of applications like: content management
systems, social networks site or scientific computing platforms etc.

o Open Source

Django is an open source web application framework. It is publicly


available without cost. It can be downloaded with source code from the
public repository. Open source reduces the total cost of the application
development.

o Vast and Supported Community


Django is an one of the most popular web framework. It has widely
supportive community and channels to share and connect.

MVT (Model View Template)

The MVT is a software design pattern. It is a collection of three important


components Model View and Template . The Model helps to handle database. It is
a data access layer which handles the data.
The template is a presentation layer which handles User Interface part completely.
The view is used to execute the business logic and interact with a model to carry data
and renders a template.
Although Django follows MVC pattern but maintains its own conventions. So,
control is handled by the framework itself.
There is no separate controller and complete application is based on Model View
and Template. That’s why it is called MVT application.
See the following graph that shows the MVT based control flow.

Here, a user requests for a resource to the Django, Django works as a controller and
check to the available resource in URL.
If URL maps, a view is called that interact with model and template, it renders a
template.
Django responds back to the user and sends a template as a response.

DJANGO MODEL

In Django, a model is a class which is used to contain essential fields and methods. Each
model class maps to a single table in the database. Django Model is a subclass of
Django.db.models.Model and each field of the model class represents a database
field(column). Django provides us a database-abstraction API which allows us to create,
retrieve, update and delete a record from the mapped table. Model is defined in Models.py
file. This file can contain multiple models.
Let’s see an example here, we are creating a model LOGIN which has two fields username
and password.

From django.db import models


Class Login (models.Model):
Username=models. CharField(max_length=20)
Password=models .CharField(max_length=20)

The username and password fields are specified as class attributes and each attribute maps to
a database column.
Now register MODEL in admin.py by using :
Admin.site.register(class name)

DJANGO VIEW

A view is a place where we put our business logic of the application. The view is a python
function which is used to perform some business logic and return a response to the user. This
response can be HTML contents of a web page, or a redirect, or a 404 error.
All the view function are created inside the Views.py file of the Django app.

Example ofFrom django.shortcuts


LOGIN page: import render
From myapp.models import Login
Def Login(request):
If request==”POST”:
Username=request.POST.get(‘username’)
Password=request.POST.get(‘password’)
Login=Login(username=username,password=password)
Login.save()
Return render(request,’login.html’)

View calls when gets mapped with URL in urls.py


Example:
Path(‘login/’,views.login),

DJANGO TEMPLATES
Django provides a convenient way to generate dynamic HTML pages by using its
template system. A template consists of static parts of the desired HTML output as well as
some special syntax describing how dynamic content will be inserted. Place all HTML file
in templates.

HTML

The term HTML stands for Hypertext Markup Language . it is developed by Tim Berners
Lee. It is a language which is used for describing web pages. It’s not a programming
language . it’s a markup language. A markup language is basically a set of markup tags.
The markup tags describe how text should be displayed. HTML markup tags are usually
called HTML tags. HTML tags are the keywords surrounded by angular bracket <>.
HTML tags normally comes in pair like <body></body>. The first tag is called start tag or
opening tag and last tag is called closing tag or end tag. An HTML file is a text file that is
arrived with HTML tags. Extension of HTML file is .html or .htm. An HTML file can be
created by using a text editor like notepad. An HTML file is often called html document or
web page. An HTML file is always opened in web browser.
FEATURES OF HTML:-
1. It’s a global language.
2. It is supported by all web browser.
3. HTML is used to create static web page.
4. It is non case-sensitive.
5. It is error free language.

There are two types of tag in HTML:-


1) Self-closing tag:- closing tag is not important.
2) Container tag:- closing is important.

STEPS TO WRITE HTML CODE:-


1. Open text editor(Notepad++)
2. Write the code.
3. Save with .html or .htm
4. Right click on the save file and go for open with browser option.
5. Web page is ready to display.
STRUCTURE OF HTML CODE:-
<! DOCTYPE html>
<html>
<head>
<title> title of the page.</title>
</head>
<body>
<b> hello </b>
</body>
</html>
CSS

The term CSS stands for cascading style sheet. CSS defines how to display the HTML
elements. Styles are normally stored in stylesheets. CSS styles is used to add in HTML
code for better/ attractive presentation. CSS is designed for making web pages more
presentable. First version of CSS was introduced in 1996 most commonly known as CSS1.0 .
FEATURES OF CSS :-
a) Flexible
b) Code rendering
c) Accessibility
d) Consistency
e) Designing
f) Time saving
g) Easy maintenance
h) Compatibility

CSS STRUCTURE:-
<html>
<head>
<style type=”text/css”>
{
}
</style>
</head>
<body>
</body>
</html>
CSS IS CATEGORIZED IN 3 PARTS:-
1) INLINE CSS:- Inline styling is use to apply a unique style to a single HTML element
Inline styling uses a style attribute.
<h1 style=”color:red;”> this is red heading </h1>

2) INTERNAL CSS:- Internal styling is used to define a style for one HTML page .
Internal styling is defined in the head section of an HTML page within a style
element.
<html>
<head>
<style>
Body{background-color:yellow;}
H1{color:blue}
P{color:green}
</style>
</head>
<body>
<h1>this is heading </h1>
<p>this is paragraph</p>
</body>
</html>

3) EXTERNAL CSS:- An external styling is used to define the style for many pages.
With an external stylesheet we can change the look of an entire website by
changing one file. To use an external stylesheet can be written in any text editor . the
file should not contain any HTML tag. The stylesheet file must be saved with .css
extension.
<html>
<head>
<link rel=”stylesheet” href=”style.css”>
</head>
<body>
<h1> hello </h1>
<p> this is a paragraph </p>
</body>
</html>

Now open style.css file:-


Body{
Background-color:blue;
}
h1{color:blue;}
P{color:green;}

SELECTOR IN CSS:-
Selectors are nothing but the HTML tags on which styles are applied. Selectors
may be applied on <head> , <body> ,<table>

TYPES OF SELECTOR:-
1.UNIVERSAL SELECTOR:- The universal selector (*) selects all HTML
elements on the page.
Eg: *{
Text-align : center ;
Color: blue;
}

2.ID SELECTOR:- The id selector uses the id attribute of an HTML element to


select a specific element. The id of an element is unique within a page, so the id
selector is used to select one unique element! . To select an element with a
specific id , write a hash(#) character, followed by the id of element .An id name
cannot start with a number
Eg: #para1{
Text-align : center;
Color:red;
}
3.CLASS SELECTOR:-
The class selector selects HTML elements with a specific class attribute. To select
elements with a specific class, write a period(.) character, followed by the name of
class
Eg: .center{
Text-align: center;
Color: red;
}

JAVASCRIPT

Javascript is a light-weight object oriented programming language which is used by several


websites for scripting the webpages. It is an interpreted , full-fledged programming language
that enables dynamic interactivity on websites when applied to an HTML document. It was
introduced in the year 1995 for adding programs to the webpages in the Netscape Navigator
browser. Since then , it has been adopted by all other graphical web browsers. With javascript
, users can build modern web applications to interact directly without reloading the page
every time. The traditional website uses js to provide several forms of interactivity and
simplicity. Javascript file is saved with extension .js
FEATURES OF JAVASCRIPT:-
1. All popular web browsers support javascript as they provide built-in execution
environments.
2. Javascript follows the syntax and structure of the C programming language.
Thus , it is a structured programming language.
3. Javascript is a weakly typed language, where certain types are implicitly
cast(depending on the operation)
4. Javascript is an object-oriented programming language that uses prototypes
rather than using classes for inheritance.
5. It is a light-weighted and interpreted language.
6. It is a case-sensitive language.
7. Javascript is supportable in several operating systems including windows, macOS,
etc
8. It provides good control to the users over the web browsers.

APPLICATION OF JAVASCRIPT:-
o Client-side validation
o Dynamic drop-down menus,
o Displaying date and time
o Displaying pop-up windows and dialog boxes

Displaying clocks etc


Hardware Required:

Processor            I3 or above

RAM 8MB

SSD 256GB

 FEASIBILITY STUDY:-

The feasibility study of this project has revealed the project as

follows: -

ECONOMIC FEASIBILITY

The project has shown the economic feasibility by the study of

the fact that by using this software the increased number of the consumers can

be given service effectively and efficiently and can save a lot time and saving

time means saving money. The cost  and benefit analysis has shown that cost 

that  have incurred  in developing the project is less than the benefits that the

project is going to provide once it is developed, so this project has passed  the

feasibility test.

BEHAVIOURAL FEASIBILITY
The working staff members are also interested in this project, as

it will help them to do work with ease and efficiently without complexity, so

they supported the development of this project with full enthusiasm. This

shows the behavioral feasibility of the project.

TECHNICAL FEASIBILITY

Technical feasibility centers on the existing computer system

(Hardware, Software etc) and to what extent it supports the existing system. As

the existing system computer system is viable so there is no matter of technical

feasibility that is   the system is technically feasible.

TIME FEASIBILITY

It is the determination of whether a proposed project can be

implemented fully within stipulated time frame. The project was decided to be

done in three months and was thought to be feasible enough.

 REQUIREMENT ANALYSIS:-

The aim of requirement analysis is to understand the exact

requirement of the customer and to document and to document them

properly.  Requirement analysis involves obtaining a clear and thorough

understanding of the product to be developing with a view to remove all

ambiguities and inconsistencies from the initial customer perception the

problem.
The question arising during the requirement analysis phases is: -

 What is the problem?

 Why is it important to solve the problem?

 What are the possible solutions to the problem?

 What exactly are the data inputs and data outputs by system?

 What are the likely the complex cities that might arise while solving

the problem?

During requirement analysis there exist mainly two activities.

1. Requirement gathering

2. Analysis of gathered requirements.

Requirement gathering: - This involves interviewing the end user and

customers to collect all possible information regarding the software.

Analysis of gathered requirement: - The main purchase of analysis is to

collect information to clearly understand the exact requirement of customer

and resolve anomalies, conflicts and inconsistencies in the gathered

requirement.
SOFTWARE LIFE CYCLE ADOPTED:-
In order to develop the project “Employee Management” we have

adopted the iterative enhancement model. This model removes the shortcoming

of waterfall model. Since many facts of this system are already known. It is not a

new concept and hence no research is required. A working version can be easily

created and hence the system can start working. Rest of the functionalities can

be implemented in the next iteration and can be delivered later. As the

requirement analysis is also not required. It not being a new technology risk

involved is also less. So one need not perform detailed risk analysis. If

redevelopment staff is less than development can be started with less number of

people and in next increments others can be involved. As this model combines

the advantage of waterfall model and prototyping, clients are always aware of

the product being delivered and can always suggest changes and enhancements

and can get them implemented. As less amount of customer communication is

required one need not apply spiral model in which all types of analysis is done in

detail. As the deadline is affordable one need not to for Rapid Application

Development model. Iterative enhancement model is useful when less manpower

is available for software development and the release deadlines are specified. It is

best suited for in house product development, where it is ensured that the user

has something to start with. The complete product is divided into releases and

the developer delivers the product release by release.

Requirement Analysis
Coding
Testing
Maintenance
Design

                Delivery of first increment


Thus increments are developed till final product is not obtained.

 SCREENSHOT OF PROJECT:-

CMD pages:

Login page:
HOME PAGE: It is the front page where
all the buttons are presents, These are-
Department List: It is the front page of
department List where all the department list are
presents,
These are
Position List: It is the front page where Position list
are presents,
They are
Employee List: It is the front page where Employee
list are presents,
They are-
Admin Login page:
Django Administration page:
Work of administrator:
PYTHON CODE
Views.py
Views.py

from django.shortcuts import redirect, render


from django.http import HttpResponse
from employee_information.models import Department, Position,
Employees
from django.contrib.auth import authenticate, login, logout
from django.contrib.auth.decorators import login_required
from django.shortcuts import redirect
import json
employees = [

{
'code':1,
'name':"KASHIF ALI",
'contact':'09534798856',
'address':'Address only'
},{
'code':2,
'name':"NIKKI",
'contact':'6287121853',
'address':' Address2 only'
}

# Login
def login_user(request):
logout(request)
resp = {"status":'failed','msg':''}
username = ''
password = ''
if request.POST:
username = request.POST['username']
password = request.POST['password']

user = authenticate(username=username,
password=password)
if user is not None:
if user.is_active:
login(request, user)
resp['status']='success'
else:
resp['msg'] = "Incorrect username or password"
else:
resp['msg'] = "Incorrect username or password"
return
HttpResponse(json.dumps(resp),content_type='application/json')

#Logout
def logoutuser(request):
logout(request)
return redirect('/')

# Create your views here.


@login_required
def home(request):
context = {
'page_title':'Home',
'employees':employees,
'total_department':len(Department.objects.all()),
'total_position':len(Position.objects.all()),
'total_employee':len(Employees.objects.all()),
}
return render(request,
'employee_information/home.html',context)

def about(request):
context = {
'page_title':'About',
}
return render(request,
'employee_information/about.html',context)

# Departments
@login_required
def departments(request):
department_list = Department.objects.all()
context = {
'page_title':'Departments',
'departments':department_list,
}
return render(request,
'employee_information/departments.html',context)
@login_required
def manage_departments(request):
department = {}
if request.method == 'GET':
data = request.GET
id = ''
if 'id' in data:
id= data['id']
if id.isnumeric() and int(id) > 0:
department = Department.objects.filter(id=id).first()

context = {
'department' : department
}
return render(request,
'employee_information/manage_department.html',context)

@login_required
def save_department(request):
data = request.POST
resp = {'status':'failed'}
try:
if (data['id']).isnumeric() and int(data['id']) > 0 :
save_department = Department.objects.filter(id =
data['id']).update(name=data['name'], description =
data['description'],status = data['status'])
else:
save_department = Department(name=data['name'],
description = data['description'],status = data['status'])
save_department.save()
resp['status'] = 'success'
except:
resp['status'] = 'failed'
return HttpResponse(json.dumps(resp),
content_type="application/json")

@login_required
def delete_department(request):
data = request.POST
resp = {'status':''}
try:
Department.objects.filter(id = data['id']).delete()
resp['status'] = 'success'
except:
resp['status'] = 'failed'
return HttpResponse(json.dumps(resp),
content_type="application/json")

# Positions
@login_required
def positions(request):
position_list = Position.objects.all()
context = {
'page_title':'Positions',
'positions':position_list,
}
return render(request,
'employee_information/positions.html',context)
@login_required
def manage_positions(request):
position = {}
if request.method == 'GET':
data = request.GET
id = ''
if 'id' in data:
id= data['id']
if id.isnumeric() and int(id) > 0:
position = Position.objects.filter(id=id).first()

context = {
'position' : position
}
return render(request,
'employee_information/manage_position.html',context)

@login_required
def save_position(request):
data = request.POST
resp = {'status':'failed'}
try:
if (data['id']).isnumeric() and int(data['id']) > 0 :
save_position = Position.objects.filter(id =
data['id']).update(name=data['name'], description =
data['description'],status = data['status'])
else:
save_position = Position(name=data['name'], description =
data['description'],status = data['status'])
save_position.save()
resp['status'] = 'success'
except:
resp['status'] = 'failed'
return HttpResponse(json.dumps(resp),
content_type="application/json")

@login_required
def delete_position(request):
data = request.POST
resp = {'status':''}
try:
Position.objects.filter(id = data['id']).delete()
resp['status'] = 'success'
except:
resp['status'] = 'failed'
return HttpResponse(json.dumps(resp),
content_type="application/json")

@login_required
# Employees
def employees(request):
employee_list = Employees.objects.all()
context = {
'page_title':'Employees',
'employees':employee_list,
}
return render(request,
'employee_information/employees.html',context)
@login_required
def manage_employees(request):
employee = {}
departments = Department.objects.filter(status = 1).all()
positions = Position.objects.filter(status = 1).all()
if request.method == 'GET':
data = request.GET
id = ''
if 'id' in data:
id= data['id']
if id.isnumeric() and int(id) > 0:
employee = Employees.objects.filter(id=id).first()
context = {
'employee' : employee,
'departments' : departments,
'positions' : positions
}
return render(request,
'employee_information/manage_employee.html',context)

@login_required
def save_employee(request):
data = request.POST
resp = {'status':'failed'}
if (data['id']).isnumeric() and int(data['id']) > 0:
check = Employees.objects.exclude(id = data['id']).filter(code
= data['code'])
else:
check = Employees.objects.filter(code = data['code'])
if len(check) > 0:
resp['status'] = 'failed'
resp['msg'] = 'Code Already Exists'
else:
try:
dept =
Department.objects.filter(id=data['department_id']).first()
pos = Position.objects.filter(id=data['position_id']).first()
if (data['id']).isnumeric() and int(data['id']) > 0 :
save_employee = Employees.objects.filter(id =
data['id']).update(code=data['code'], firstname =
data['firstname'],middlename = data['middlename'],lastname =
data['lastname'],dob = data['dob'],gender = data['gender'],contact
= data['contact'],email = data['email'],address =
data['address'],department_id = dept,position_id = pos,date_hired
= data['date_hired'],salary = data['salary'],status = data['status'])
else:
save_employee = Employees(code=data['code'],
firstname = data['firstname'],middlename =
data['middlename'],lastname = data['lastname'],dob =
data['dob'],gender = data['gender'],contact = data['contact'],email
= data['email'],address = data['address'],department_id =
dept,position_id = pos,date_hired = data['date_hired'],salary =
data['salary'],status = data['status'])
save_employee.save()
resp['status'] = 'success'
except Exception:
resp['status'] = 'failed'
print(Exception)
print(json.dumps({"code":data['code'], "firstname" :
data['firstname'],"middlename" : data['middlename'],"lastname" :
data['lastname'],"dob" : data['dob'],"gender" :
data['gender'],"contact" : data['contact'],"email" :
data['email'],"address" : data['address'],"department_id" :
data['department_id'],"position_id" :
data['position_id'],"date_hired" : data['date_hired'],"salary" :
data['salary'],"status" : data['status']}))
return HttpResponse(json.dumps(resp),
content_type="application/json")

@login_required
def delete_employee(request):
data = request.POST
resp = {'status':''}
try:
Employees.objects.filter(id = data['id']).delete()
resp['status'] = 'success'
except:
resp['status'] = 'failed'
return HttpResponse(json.dumps(resp),
content_type="application/json")

@login_required
def view_employee(request):
employee = {}
departments = Department.objects.filter(status = 1).all()
positions = Position.objects.filter(status = 1).all()
if request.method == 'GET':
data = request.GET
id = ''
if 'id' in data:
id= data['id']
if id.isnumeric() and int(id) > 0:
employee = Employees.objects.filter(id=id).first()
context = {
'employee' : employee,
'departments' : departments,
'positions' : positions
}
return render(request,
'employee_information/view_employee.html',context)

Urls.py

from . import views


from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.urls import path
from django.views.generic.base import RedirectView

urlpatterns = [
path('redirect-admin',
RedirectView.as_view(url="/admin"),name="redirect-admin"),
path('', views.home, name="home-page"),
path('login', auth_views.LoginView.as_view(template_name =
'employee_information/login.html',redirect_authenticated_user=Tru
e), name="login"),
path('userlogin', views.login_user, name="login-user"),
path('logout', views.logoutuser, name="logout"),
path('about', views.about, name="about-page"),
path('departments', views.departments, name="department-
page"),
path('manage_departments', views.manage_departments,
name="manage_departments-page"),
path('save_department', views.save_department, name="save-
department-page"),
path('delete_department', views.delete_department,
name="delete-department"),
path('positions', views.positions, name="position-page"),
path('manage_positions', views.manage_positions,
name="manage_positions-page"),
path('save_position', views.save_position, name="save-position-
page"),
path('delete_position', views.delete_position, name="delete-
position"),
path('employees', views.employees, name="employee-page"),
path('manage_employees', views.manage_employees,
name="manage_employees-page"),
path('save_employee', views.save_employee, name="save-
employee-page"),
path('delete_employee', views.delete_employee, name="delete-
employee"),
path('view_employee', views.view_employee, name="view-
employee-page"),

Admin.py

from django.contrib import admin


from employee_information.models import Department, Position,
Employees

# Register your models here.


admin.site.register(Department)
admin.site.register(Position)
admin.site.register(Employees)
Models.py

from datetime import datetime


from django.db import models
from django.utils import timezone

# Create your models here.


class Department(models.Model):
name = models.TextField()
description = models.TextField()
status = models.IntegerField()
date_added = models.DateTimeField(default=timezone.now)
date_updated = models.DateTimeField(auto_now=True)

def __str__(self):
return self.name

class Position(models.Model):
name = models.TextField()
description = models.TextField()
status = models.IntegerField()
date_added = models.DateTimeField(default=timezone.now)
date_updated = models.DateTimeField(auto_now=True)

def __str__(self):
return self.name

Urls.py

"""ems URL Configuration

The `urlpatterns` list routes URLs to views. For more information


please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based views
1. Add an import: from other_app.views import Home
2. Add a URL to urlpatterns: path('', Home.as_view(),
name='home')
Including another URLconf
1. Import the include() function: from django.urls import include,
path
2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path, include

urlpatterns = [
path('admin/', admin.site.urls,name="admin-site"),
path('', include('employee_information.urls')),
]

Setting.py

“””
Django settings for ems project.

Generated by 'django-admin startproject' using Django 3.2.5.

For more information on this file, see


https://docs.djangoproject.com/en/3.2/topics/settings/

For the full list of settings and their values, see


https://docs.djangoproject.com/en/3.2/ref/settings/
"""

from pathlib import Path

# Build paths inside the project like this: BASE_DIR / 'subdir'.


BASE_DIR = Path(__file__).resolve().parent.parent

# Quick-start development settings - unsuitable for production


# See
https://docs.djangoproject.com/en/3.2/howto/deployment/checklist
/

# SECURITY WARNING: keep the secret key used in production


secret!
SECRET_KEY = 'django-insecure--
w(dug*va_megpa25w$gmv8o6+f8!fg_*m1^u$)z25pab0hicm'

# SECURITY WARNING: don't run with debug turned on in


production!
DEBUG = True

ALLOWED_HOSTS = []

# Application definition

INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'employee_information.apps.EmployeeInformationConfig',
'django.contrib.humanize',
]

MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]

ROOT_URLCONF = 'ems.urls'

TEMPLATES = [
{
'BACKEND':
'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]

WSGI_APPLICATION = 'ems.wsgi.application'

# Database
# https://docs.djangoproject.com/en/3.2/ref/settings/#databases

DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}

# Password validation
# https://docs.djangoproject.com/en/3.2/ref/settings/#auth-
password-validators

AUTH_PASSWORD_VALIDATORS = [
{
'NAME':
'django.contrib.auth.password_validation.UserAttributeSimilarityVali
dator',
},
{
'NAME':
'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME':
'django.contrib.auth.password_validation.CommonPasswordValidato
r',
},
{
'NAME':
'django.contrib.auth.password_validation.NumericPasswordValidator
',
},
]

# Internationalization
# https://docs.djangoproject.com/en/3.2/topics/i18n/

LANGUAGE_CODE = 'en-us'

TIME_ZONE = 'UTC'

USE_I18N = True

USE_L10N = True

USE_TZ = True

# Static files (CSS, JavaScript, Images)


# https://docs.djangoproject.com/en/3.2/howto/static-files/

STATIC_URL = '/static/'
STATICFILES_DIRS = (
# location of your application, should not be public web
accessible
'./static',
)

# Default primary key field type


# https://docs.djangoproject.com/en/3.2/ref/settings/#default-
auto-field

DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
LOGIN_REDIRECT_URL = '/'
LOGIN_URL = '/login'
 SCOPE OF FUTURE APPLICATION
This software can be able to support internetworking with the

little advancement in the coding. Then any user can upload the date to the

school website and can view the data and all reports online

from any part of the world. This can also be connected strongly with the

internet, even if management wants, parents can view their child’s record

through an attractive and graphic rich website. They can also make their

child’s fee online.

This software can also be equipped with strong backup

facilities to protect the important data and hence preventing any sort of

problem which might occur due to lost of data. 

 SNAPSHOT WITH DATABASE:-

Form1:-Department

class Department(models.Model):
name = models.TextField()

description = models.TextField()

status = models.IntegerField()

date_added = models.DateTimeField(default=timezone.now)

date_updated = models.DateTimeField(auto_now=True)

def __str__(self):

return self.name

FORM2:-Position
      

Code:-class Position(models.Model):
name = models.TextField()
description = models.TextField()
status = models.IntegerField()
date_added =
models.DateTimeField(default=timezone.now)
date_updated =
models.DateTimeField(auto_now=True)
def __str__(self):
return self.name

FORM3:-Employee
class Employees(models.Model):
code =
models.CharField(max_length=100,blank=True)
firstname = models.TextField()
middlename =
models.TextField(blank=True,null= True)
lastname = models.TextField()
gender = models.TextField(blank=True,null=
True)
dob = models.DateField(blank=True,null= True)
contact = models.TextField()
address = models.TextField()
email = models.TextField()
department_id = models.ForeignKey(Department,
on_delete=models.CASCADE)
position_id = models.ForeignKey(Position,
on_delete=models.CASCADE)
date_hired = models.DateField()
salary = models.FloatField(default=0)
status = models.IntegerField()
date_added =
models.DateTimeField(default=timezone.now)
date_updated =
models.DateTimeField(auto_now=True)

def __str__(self):
return self.firstname + ' ' +self.middlename + '
'+self.lastname + ' 'Unload Me
End Sub
DFD:-

DEPARTMENT GENERATE
LIST DEPARTMENT
REPORT

EMPLOYE
POSITION LIST E GENERATE
MANAGE POSITION REPORT
MENT
SYSTEM

GENERATE
EMPLOYEE LIST EMPLOYEE
REPORT
ER-Diagram

Name Name Descriptio


n
code
Has
Department
Gender
Employee

Birthday Has Position

Email

Name Descriptio
n
Has
Contact
us

User
name

Login
passwor
d

PERT-CHART: -
PERT: Project Evaluation and Review Technique is
Used for project scheduling.
FILE-STRUCTURE
Microsoft Windows [Version 10.0.22000.675]

(c) Microsoft Corporation. All rights reserved.

D:\static>tree

Folder PATH listing for volume New Volume

Volume serial number is 74A0-C6D9

D:.

└───employee_information

└───assets

├───bootstrap

│ ├───css

│ └───js

├───default

│ ├───css

│ └───js

└───material-admin

├───css

│ ├───demo

│ └───maps

│ ├───demo
│ └───demo_1

├───fonts

│ └───roboto

├───images

│ ├───dashboard

│ ├───faces

│ └───sidebar

├───js

├───scss

│ ├───demo

│ ├───shared

│ │ ├───components

│ │ │ └───plugin-overides

│ │ ├───mixins

│ │ └───sample-screens

│ └───vertical

└───vendors

├───chartjs

├───codemirror

├───css

├───flag-icon-css

│ ├───css

│ └───flags

│ ├───1x1
│ └───4x3

├───js

├───jvectormap

├───material-design-icons

│ └───iconfont

└───mdi

├───css

└───fonts
TEST CASE:-
Functional test case:-
s.no Test case result
1 Verify if a user will be able to login with a positive
valid username and valid password
2 Verify if a user cannot login with a valid negative
username and an invalid password
3 Verify the login page for both when the field is negative
blank and submit button is clicked
4 Verify the forgot password functionality positive
5 Verify the message for invalid login positive
6 Verify the remember me functionality positive
7 Verify if a user is able to login with a new positive
password only after he/she has changed the
password

NON- FUNCTIONAL test case:-


s.no Test case result
1 verify if a user cannot enter the characters negative
more than the specified range in each field
2 verify the login page by pressing back negative
button of the browser. It should not allow you to
enter into the system once you log out
3 verify the timeout functionality of the login positive
session
4 Verify if a user should not be allowed to log negative
in with different credentials from the same
browser at the same time
5 Verify if a user should be able to login with positive
the same credentials in different browsers at the
same time
6 Verify the login page against SQL injection negative
attack
7 Verify the implementation of SSL certificate positive
Conclusion:
While writing test cases for login or sign-up page write the test cases for all the fields. There
should be a combination of both positive and negative test cases. Try to cover the
performance, security, and functional scenarios.

The login page is the page with fewer controls, so even though it is looking simples. for
testing, it should not be considered as an easy task.

Also many a time it is the first impression of an application, so it should be perfect for user
interface and usability.
                 
BIBLIOGRAPHY

A.      Books:
1.      Fluent python: clear, concise , and effective programming , by Luciano
Ramalho
2.      Learn python 3 the Hard Way, by Zed  A. Shaw
3.      Head First Python: A Brain-Friendly Guide, by Paul Barry
4.      Python Tricks by Dan Bader
 
 
 
B.      Youtube:
1.      “code with harry”
2.      “Apni Kaksha(Aman Bhaiya)”
 
 
C.       Reference  Websites:
1.      www.javatpoint.com
2.      www.w3schools.com
3.      www.geeksforgeeks.org

You might also like