File 1

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

1.

INTRODUCTION

1.1 Introduction of the system:


1.1.1 Project title
College management system
1.1.2 Category
Desktop application
1.1.3 Overview

About management of college information like attendance, achievement,


salary etc. It helps super admin means principal to monitor all possible staff
and department.
1.2 Background:

1.2.1 Introduction of the Company


Not applicable
1.2.2 Brief note on existing system
This software helps to monitor the activities of departments, staff to know the
information and can get easily data of person in college. There will be
attendance, salary that are all will be collected in this software. Our main
intention is of helping principle to reduce work.
1.3 Objectives of the system:
This software helps principal to get information easily. Not only principal and also
those sub admins are in college like head of departments, library, office.
1.4 Scope of the system:

The scope or limitation of this college management system is only those who are in
campus they can access. teachers, principle only able to access this software. The
database of this software is inside the campus to new member have to take permission
of a particular college staff.

1.5 Structure of the system:


1.5.1 Analysis
It is used to store the basic details of the staff members like staff member
name, date of birth, email-id, contact number, gender etc.

1
1.5.2 Module description
The module description specifies the different modules of software. This
application contains following modules:
1.5.2.1 General Module

1.5.2.1.1 Login module:

This module allows the admin or administrator to provide to


open the software with username and password.
1.5.2.1.2 Forgot Password:

In this user can change their password if they have forgot their
login password.

1.5.2.2 Admin Module

1.5.2.2.1 Staff management module:


This module has the information of the staff and also has some
sub modules.

1.5.2.2.1.1 Registration module:

This module gives to registration of new staff and


provides password and user name. This module contains
following sub modules:
1.5.2.2.1.1.1 Approve
This module helps the admin to approve
permission to the staff to access the information.
1.5.2.2.1.1.2 View
This module helps to view the registered staff
details.
1.5.2.2.1.1.3 Delete
This module helps the admin to delete all the
details of particular staff.
1.5.2.2.1.2 Admission:
This module will be the admission related activates of staff
and it has the sub modules.
1.5.2.2.1.2.1 Update:
This module gives the update of the staff and
some of the changes that had been mistaken.

2
1.5.2.2.1.2.2 View
This module helps to view the information about
particular staff.
1.5.2.2.1.2.3 Delete:
This module will delete the particular record of
staff details
1.5.2.2.1.3 Salary Payment module:
This module will be the salary related activates of staff
and it has the sub modules.
1.5.2.2.1.3.1 Calculate
This module will calculate the amount of salary to be
given to the staff based on his attendance.
1.5.2.2.1.3.1 Save
This module simply saves the salary payment
details of the staff.
1.5.2.2.1.4 Staff Attendance:
This module is used to manage the attendance record of
the staffs.
1.5.2.2.2 Report module:
This module provides academic report of the staffs. It contains
following sub modules.
1.5.2.2.2.1 Staff salary report module:
This module provides report of the staff salary.
1.5.2.2.2.2 Staff attendance report module:
This module provides report of the attendance of staff.
1.5.2.2.2.3 Staff achievement report module:
This module provides report of the achievement of staff.
1.5.2.3 Staff Module
1.5.2.3.1 Registration module:
This module gives to registration of new staff and provides
password and user name.

3
1.5.2.3.2 Admission module:
This module helps the staff to fill the admission related
activates of staff.
1.5.2.3.3 Achievement module:
This module helps the staff to add his achievements of other
activities. It has following sub modules:
 Add
 Update
1.5.2.3.4 Staff attendance:
This module helps the staff to add his attendance details.
1.5.2.3.5 View staff salary:
This module helps the staff to view his monthly salary details.

4
1.6 System architecture:

USER

GUI

Menu Command Console Textbox Button Radio Button

COLLEGE MANAGEMENT SYSTEM

General Staff management Report Registration Admission

Achievement Attendance View salary report

Packages
PYTHON Functions

Connections
XAMPP

DS

RDBMS MYSQL

Operating system

Processing modules

Fig 1.1 System Architecture

5
1.7 End user:
An end user is staff of the college who makes use of the services produced by the
system.
1.8 Software/Hardware need for the development:
It refers to a set of computer activities dedicated to a process of creating, designing,
deploying supporting software.
Front end: Python 3.10 64-bit (TK-inter)
Back end: XAMPP
1.9 Software/Hardware need for the implementation:
 Operating system: Windows, Linux and Mac

 Latest generation processor

 4 GB of RAM

 HDD: 100 GB and Above

 Mouse, Keyboard, Laptop or Computer.

6
2. SOFTWARE REQUIREMENT SPECIFICATION

2.1 Introduction
A software requirements specification (SRS) is a document that describes what the
software will do how it will be expected to perform. A software requirement
specification is a description of software system to be developed. It has to bridge
communication gap between developer and user. It describes functional and non-
functional requirement and may include a set of cases that describes user interaction
that the software must provide.
A typical SRS includes:
 A Purpose
 An overall description
The purpose of this document is to provide overall description of the event with
functionalities and their dependencies with each other and their requirement.
 An SRS forms the basis of an organization’s entire project, sets out the framework
that all the development teams will follow. It provides critical information to all the
teams, including development, operations, quality assurance (QA) and maintenance,
ensuring the teams are in agreement.
 Using the SRS helps an enterprise confirm that the requirements are fulfilled and
helps business leaders make decisions about the lifecycle of their product, such as
when to retire a feature.
 In addition, writing an SRS can help developers reduce the time effort
necessary to meet their goals as well as save money on the cost of
development.
 Boundaries of software products are defined by set of requirements. The
software development designs, implements, tests and deliver this requirement
to user. A requirement is automatic unit of software product.
 SRS document provides a reference for validation of the final product. A high-
quality SRS is a prerequisite to high quality software. In future one can refer
the following SRS to extend the same software by referring this SRS document
other developers can develop and extend this software to network level. It
specifies basic requirement constraints and interface for the proposed system.

7
2.2 Overall Description

This section describes the function of the project and their aim. It also includes the
constraints and the requirements of the project.
2.2.1 Product Perspective

Product Perspective is an essentially the relationship of the product to other


products defining whether the product is independent or is a part of longer
product function. This project is mainly designed to stop the manual process
done by the staff management.
2.2.1.1 System interfaces
This application runs in latest version Windows Linux and Mac.

2.2.1.2 User interfaces

The graphical user interface makes application more interactive which


includes buttons and labels for selecting options and perform
operations. This application GUI provides menus, toolbars, buttons,
panes, containers, grids allowing for easy control by a keyboard and a
mouse.

2.2.1.3 Hardware interfaces


To run this app the basic system requirements are as follows:
Hard Disk- 10 GB, 4 GB RAM and Input Device such as
Keyboard, Mouse etc.

2.2.1.4 Software interfaces

 This application allows to DML, DDL, DCL query with


MySQL server.

 This product uses Python and it operates on Windows 7 and


other higher versions.

2.2.1.5 Communication interfaces


This application allows to interface with LAN, WAN, MAN.

2.2.1.6 Interfaces with Server


This application allows to interface with SQL Server, XAMPP,
Apache tomcat.

8
2.2.2 Product Functions

The main function of the project is to college management application is


managed by an administrator. Admin can manage the entire detail of staffs.
Complete detail of staffs can be store and retrieved. Admin can add, remove
or view all the details of staff based on requirement.
2.2.3 User characteristics

User should have basic computer knowledge and know about the
functionalities of the application and user should be able to read or
understand English. It specifies the End Users minimum characteristics or
knowledge required use the application. The user/ admin should have basic
knowledge about the computer. They must have basic idea about the college
management. Admin is the super user and control over the entire event.

2.2.4 General constraints

This product is developed python language. It operates on Windows 7 and


higher versions and it needs to have 4 GB RAM and 10 GB Hard Disk.

2.2.5 Assumptions and Dependencies

The basic assumption is made about end users that they should be computer
literate, should know the usage of computer system and should know English
and user should have basic knowledge about college management.

2.3 Special Requirements


Not applicable

2.4 Functional Requirements

Functional requirements in an SRS document indicate what a software system must


do and how it must function; they are product features that focus on user needs.
2.4.1 General Module
2.4.1.1 Login
In this user can login to the system using username and password.
Input: Username, password
Process: Check for username, password

Output: If username, password is valid, user will login to the system.

9
2.4.1.2 Forgot Password

In this user can change their password if they have forgot their login
password.

Input: Security Key

Process: When user enters security key, if the security key is valid, then
the user will be asked to enter the new password where the user can
change their password.

Output: Password will be changed.

2.4.2 Admin Module


2.4.2.1 Staff management module
2.4.2.1.1 Registration
2.4.2.1.1.1 Approve
Input:
Input the basic information like staff name,
staff id, and status
Process:
Admin reads the details of staff and if the details
are correct then it will load the respective page.
Output:
If the information is valid displays ‘Success’
message else displays error message.
2.4.2.1.1.2 View
Input:
Input the staff id and name of the staff which has
to be displayed.
Process:
Admin reads the details of staff and if the details
are correct then it will load the respective page.
Output:
If the information is valid displays all the details
of staff.
2.4.2.1.1.3 Delete
Input:
Input the staff id and name of the staff which
has to be deleted.

10
Process:
Check for the staff record in the database
which has to be deleted.
Output:
The specified record is deleted from the
database.
2.4.2.1.2 Admission
: 2.4.2.1.2.1 Update
Input:
Input the staff id and name of the staff which
has to be updated.
Process:
Check for the staff record in the database
which has to be updated.

Output:
The specified staff record is updated.

2.4.2.1.2.2 View
Input:
Input the staff id and name of the staff which
has to be displayed.

Process:
Check for the staff record in the database
which has to be displayed.
Output:
The specified staff record is displayed.

2.4.2.1.2.3 Delete
Input:
Input the staff id and name of the staff which
has to be deleted.
Process:
Check for the staff record in the database
which has to be deleted.
Output:
The specified record is deleted from the
database.

2.4.2.1.3 Salary Payment Module


2.4.2.1.3.1 Calculate
Input:
Inputs the staff id and name whose salary
report be calculated.

11
Process:
Checks for specified staff attendance in the
database and calculates salary amount
according to it.
Output:
Specified staff salary amount is generated.
2.4.2.1.3.2 Save
Input:
Inputs the staff id and name whose salary
report to be saved.
Process:
Checks for specified staff details in the
database which has to be saved.
Output:
Specified staff salary amount is generated.

2.4.2.1.4 Attendance Module


Input:
Inputs both students and staff’s daily attendance to
store to the database.
Process:
Takes the attendance details which must be stored to
the database.
Output:
Attendance information of staffs and students are
stored to the database.
2.4.2.2 Report Module
2.4.2.2.1 Staff Salary Report
Input:
Inputs the staff id and name whose salary report to be
generated.
Process:
Checks for specified staff salary report in the database.
Output:
Specified staff salary report is generated.

2.4.4.2 Staff Achievement Report


Input:
Inputs the staff id and name whose achievement report
to be generated.
Process:
Checks for specified staff achievement report in the
database.

12
Output:
Specified staff achievement report is generated.

2.4.2.2.3 Staff Attendance Report


Input:
Inputs the staff id and name whose attendance report to
be generated.
Process:
Checks for specified staff attendance report in the
database
Output:
Specified staff attendance report is generated.

2.4.3 Staff Module

2.4.3.1 Registration
In this new user will register to the system using user credentials.
Input:
Username, password.
Process:
Check username, password against different validation. If
both username and password are valid, user will be
registered and a security key will be generated.
Output:
If both username and password are valid user will be
registered and a security key will be generated and displayed
to the user.
2.4.3.2 Admission
Input:
Input the basic information like staff name, staff id. degree,
college, university, marks obtained.
Process:
Stores the information of the staff to the database.
Output:
Displays ‘Admission successful’ message else displays 'Staff
record already exist’ message.

13
2.4.3.3 Achievements
2.4.3.3.1 Add
Input:
Input the staff id and name whose achievements details
to be added to the database.
Process:
Stores the staff achievements details to the database.
Output:
Staff achievement record will be added to the
database:
2.4.3.3.2 Update
Input:
Input the staff id and name whose achievements
details to be updated.
Process:
Checks for the staff achievement record in the data
base which has to be updated.
Output:
The specified staff achievements details is updated in
the database.
2.4.3.4 Staff attendance
Input:
Input the staff id and name whose attendance details to be
added.
Process:
If staff ID is valid then staff attendance details is added to
database.
Output:
If the staff ID is valid display ‘Staff attendance is added
successfully’ else display error message.
2.4.3.5 View salary report
Input:
Input the staff id and name of the staff whose salary report
has to be displayed.
Process:

14
If the name and password are correct then it will load
respective page.
Output:
If the information is valid displays staff salary report else
displays error message.
2.5 Design Constraints
2.5.1 Hardware Constraints

The development of this application requires a computer system with 4 GB


RAM and 100 GB Hard Disk.
2.5.2 Software Constraints

This application development requires Python language and Windows 7 or


other higher version of Operating system.
2.5.3 Fault Tolerance

Fault tolerance software is a software designed around the concept of fault


tolerance. In essence, they must be able to continue working to a level of
satisfaction in the presence of occurrence of exception. It is a property that
enables a system to continue operating properly in any event of the failure of
some of its components. The validation for input data and user level
management by proper authentication and authorization will add this solution
to be fault tolerance.
2.5.4 Security
If user gives invalid input, the system displays the appropriate error message.
This project provides security of data and only the authorized user can access
the data. User is authorized using user-id and password.
2.5.5 Standard Compliance
The software has Graphical user Interface (GUI) to ease of the user. Mouse
and Keyboard interaction as per the standard software system. The software
is design in such a way that it meets the existing standard.
2.6 System Attributes
2.6.1 Availability
This application is made available as Stand-Alone Application and it contains
number of buttons for different operations.
2.6.2 Reliability

15
This application system must be highly reliable and it should generate all the
outputs in the selected order.

2.6.3 Maintainability
This application will be developed in such a way that it can be modified.
2.6.4 Scalability

Not applicable
2.7 Other requirements
Not applicable

16
3. SYSTEM DESIGN

3.1 Introduction

 System design is the process of defining the architecture, module interfaces and
data for a system to satisfy specified requirements.
 The purpose of the design phase is to plan the solution of the problem specified by
the requirement documents.
 This is the first step that moving from problem domain to the solution domain.
 The design of the system is essentially a blueprint or a plan for a solution for the
system.

3.2 Assumptions and Constraints


An assumption is a condition you think to be true and a constraint is fixed limitations
of project development.

 All the functional requirement collected from client are sufficient for the project
life-cycle.
 All the Non-functional and Specific requirement specified in SRS well enough for
the development of system.
 Time constraint.
3.3 Functional decomposition

Functional decomposition is the process of taking a complex process and


breaking it down into its smaller, simpler parts. Using functional decomposition large
or complex functionalities are more easily understood. It is mainly used during project
analysis phase, so each phase can be viewed as software. So this has modular with
some sub modules.

17
3.3.1 System Software Architecture

College Management System

General Admin Staff

Login Staff management Registration

Forgot Password Registration Admission

Approve
Achievement
View
Add
Delete
Update

Admission

Attendance
Update

View View salary report

Delete

Salary payment

Calculate

Save

Staff Attendance

Report

Staff salary report

Staff achievement report

Staff attendance report

Fig 3.1 System Software Architecture

18
3.3.2 System technical architecture

Presentation Tier Application Tier Database


Management
Tier

Desktop
Internet Xampp MySQL
Database

Fig 3.2

3.3.3 System hardware architecture


3.4 Description of Programs

3.4.1 Context Flow Diagram (CFD)

Monitor In CFD entire system is considered as a single process. Context


Computer
flow diagram shows input and outputs of the system. It shows Mass all the
external entities that interact with the system and how the data flows
Storage
between the external entities and system.

Hard copy Primary Staff


input
device device
Staff achievement
Staff attendance
Login Successful

View salary report

Fig 3.3
Achievement
Login Details

registration
Attendance

details

College management System


19
Staff salary, Achievement,
Registration, Admission,
Login to the system

Attendance reports
Report generation
Request for login

Staff management

Salary payment,
Attendance
Admin

Fig 3.4

3.4.2 Data Flow Diagrams (DFDs – Level 0, Level 1)

Data Flow Diagram (DFD)


Data flow diagram shows the flow of data through system. Data
flow diagrams also called the data flow graphs. It views a system as a
function that transforms the inputs into desired outputs. It aims to
capture the transformation that taken place within a system to the input
data so that eventually the output data is produced.
Symbols Name Description

Process It performs transformation of data


from one state to another.

Source /Sink It represents the external entity that


may be either source or Sink

Flow of data It represent the flow of data from


source to destination

Data Source/Data It is the place where data is stored.


storage 20
Table 3.1 Data Flow Diagram

3.4.2.1 DFD LEVEL-0

Login
Staff
management

Forgot Report
password

USER
Registration
View salary
report

Admission
Attendance
Achievement

Fig 3.5

3.4.2.2 DFD LEVEL-1

General module

21
Invalid
Display Error
Data
message Login

Compare
Username, Password Validated
username,
Admin/Staff Validation
password and
User Type data user Type

Valid Data
Display Home
page

Fig 3.6

Admin module

Staff Report
management

Admin

Staff module

22
Achievement
Attendance

Staff

3.5 Description of components


3.5.1 General Module
3.5.1.1 Login:

Display error
message

Invalid

Load
Valid
Input name and respective
Admin/Staff Validation page
password

REG table
Display
successful
message

Input:
User type, Username, Password.
Process definition:

23
If the name and password are correct then it will load
respective page.
Output:
If the information is valid displays ‘Login successful’
else displays error message.

3.5.1.2 Forgot password:

Display error
message

Invalid

Input Username, Valid Send


Admin/Staff Email, New Validation OTP
password

Vali
d
REG table

Display Store to
successful database
message

Input:
Username, Email, New password, re-type password.
Process definition:

24
If he / she forgot password it will ask email id and
username that is used in registration time. If it is correct
email id then we can generate new password and re-type
password.
Output:
If the information is valid displays ‘Password
successfully changed’ else displays error message.

3.5.2 Admin Module


3.5.2.1 Staff management
3.5.2.1.1 Registration
3.5.2.1.1.1 Approve

Display error
message

Invalid

Valid Approve
Select the the staff
Admin details of Validation
details
staff

REG table

Display
successful
message

25
Input:
Status
Process definition:
Admin reads the details of staff and if the details are
correct then it will load the respective page.
Output:
If the information is valid displays ‘Success’ message
else displays error message.

3.5.2.1.1.2 View

Click on
Select Staff view
Admin details button

REG table

View the details


of staff

Input:
Staff ID
Process definition:
Admin reads the details of staff and if the details are
correct then it will load the respective page.
. Output:
If the information is valid displays all the details of staff.

3.5.2.1.1.3 Delete

REG
Display error table
message

Invalid

Valid Delete
Input details from
Admin of staff Validation database

REG table
Display “staff
record is
deleted” 26
message
Input:
Staff ID.
Process definition:
If the staff ID is valid then staff information is deleted
and from database.
Output:
If the staff ID is valid displays ‘staff record is deleted’
else display error message

3.5.2.1.2 Admission
3.5.2.1.2.1 Update

Invalid
Show message “Staff
record does not exist” REG table

Input staff ID Validation


Admin

Valid input

Admission
Update
details

Show message “Staff record Store to


is updated database

27
Input:
Staff ID.
Process definition:
If the staff ID is valid then staff information is updated
and stored to database.
Output:
If the staff ID is valid displays ‘staff record is updated’
else display error message.

3.5.2.1.2.2 View

Click
Select Staff on view
Admin
details button

REG table

View the
details of
staff

Input:
Staff ID
Process definition:
Admin reads the details of staff and if the details are
correct then it will load the respective page.
. Output:

28
If the information is valid displays all the details of staff.

3.5.2.1.2.3 Delete

Show message Admission


“Staff record
doesn’t exist”

Invalid
Delete
Valid from
Admin Validation database
Input details
of staff

REG table

Display staff
record is
deleted
message

Input:
Username and password
Process definition:
If the staff ID is valid then staff information is deleted
and from database.
Output:
If the staff ID is valid displays ‘staff record is deleted’
else display error message

3.5.2.1.3 Salary Payment


3.5.2.1.3.1 Calculate

Attendance

Calculate
Select the Click salary based
Admin Calculate
details of on
staff Button attendance
29
Store to
database

Input:
Staff ID
Process definition:
Admin reads the details of staff and then clicks on
Calculate button to calculate salary based on attendance
stored in database.
Output:
If the information is valid then stores staff salary to the
database.

3.5.2.1.3.2 Save

Saves the
Click on amount of
Admin Select the Save salary
details of Button calculated
staff

Salary

Store to
database

Input:

30
Staff ID
Process definition:
Admin reads the details of staff and then clicks on save
button which saves the amount of salary to database.
Output:
If the information is valid then stores staff salary to the
database.

3.5.2.1.4 Staff attendance


Invalid
Show message “Staff ID
does not exist”
REG table

Input staff ID Validation


Admin

Valid input

Attendance

Show message “Attendance Store to


details added successfully” database

Input:
Staff ID.
Process definition:
If the staff ID is valid then staff attendance is added to
database.
Output:
If the staff ID is valid displays ‘staff attendance is added
successfully’ message else display error message.
3.5.2.2 Report
3.5.2.2.1 Staff salary report

31
Invalid
Show message “Staff
record does not exist” REG table

Input staff ID Validation


Admin

Valid input
Salary

Selects from
database

Show message “Staff salary


report generated”

Input:
Staff ID.
Process Definition:
If staff ID is valid then staff salary report is displayed
from database.
Output:
If the id is valid displays ‘Staff salary report is
generated’ else display error message.

3.5.2.2.2 Staff Achievement report

32
Invalid
Show message “Staff REG table
record does not exist”

Input staff ID Validation


Admin

Valid
input
Achievement

Show message “Achievement Selects from


report is generated” database

Input:
Staff ID.
Process Definition:
If staff ID is valid then staff achievement report is
displayed from database.
Output:
If the id is valid displays ‘Staff achievement report is
generated’ else display error message.

3.5.2.2.3 Staff Attendance report

Invalid
Show message “Staff
record does not exist”
REG table

Input staff ID Validation


Admin

Valid input

Attendance

Show message “Attendance Selects from


report is generated” database

Input:
Staff ID.

33
Process Definition:
If staff ID is valid then staff attendance report is
displayed from database.
Output:
If the id is valid displays ‘Staff attendance report is
generated’ else display error message.

3.5.3 Staff Module


3.5.3.1 Registration

Display error
message

Invalid

Valid Store to
Input user Validation database
Staff
details

REG table
Display
successful
message

Input:
Username, Password, Phone, Email.
Process Definition:
User information if it is correct then information is stored
into database.
Output:
If the information is valid displays ‘Registration
successful message’ else display error message.
Interface with other functional components:
It is an independent module.
Resource Allocation:
REG table
User interface:
It includes buttons and labels for selecting option and
perform operation.

3.5.3.2 Admission

34
Show
message
“Staff ID
already exist”
Invalid

Valid Store to
Input user Validation database
Staff
details

REG table

Display
successful
message

Input:
Staff name, Staff ID, DOB, DOJ, phone.
Process Definition:
If input information is valid then staff record is added to
the database.
Output:
If the staff information is valid displays ‘Admission
successful message’ else display error message.

35
3.5.3.3 Achievement Module:
3.5.3.3.1 Add

Invalid
Show message “Staff
record does not exist” REG table

Input staff ID Validation


Staff

Valid input

Achievement
Input
achievement
details

Show message “Staff Store to


achievement is added” database

Input:
Staff ID.
Process Definition:
If Staff Id is valid then achievement details is stored to
database.
Output:
If the staff ID is valid display ‘Staff achievement is added’
else display error message.

36
3.5.3.3.2 Update:

Invalid REG table


Show message “Staff
record does not exist”

Input staff ID Validation


Staff

Valid input

Achievement
Update
details

Show message “Staff record Store to


is updated” database

Input:
Staff ID.
Process definition:
If the staff ID is valid then staff information is updated and
stored to database.
Output:
If the staff ID is valid displays ‘staff record is updated’ else
display error message.

37
3.5.3.4 Attendance Module

Invalid
Show message “Staff ID
does not exist” REG table

Input staff ID Validation


Staff

Valid input

Attendance

Show message “Attendance Store to


details added successfully” database

Input:
Staff ID.
Process Definition:
If Staff Id is valid then staff attendance details is added to
database.
Output:
If the staff ID is valid display ‘Staff attendance is added
successfully’ else display error message.

38
3.5.3.5 View salary report

View
staff
Admin Input Staff salary
details report

Salary

Show
successful
message

Input:
Staff ID
Process definition:
If the name and password are correct then it will load
respective page.
Output:
If the information is valid displays staff salary report else
displays error message.

39
4. DATABASE DESIGN

4.1 Introduction

Database is a collection of related data. Relational database stores data in a table


or relations. The data stored in a relation are arranged in records. Each record consists of
set of attributes. Fields can be referred to characteristics of records. This document
describes the table that is used to design software, its attributes, data types, constraints
and relationship among those tables.

The design process consists of the following steps:


• Determine the purpose of your database.
• Find and organize the information required.
• Divide the information into tables.
• Turn information items into columns.
• Specify primary keys.
• Set up the table relationships.
• Refine your design.
• Apply the normalization rules.

4.2 Purpose and scope

Purpose
 Avoid Redundant Data
The table in the database should be constructed following standards and with
utmost dedication. It should have different fields and minimize redundant data.
The table should always have a Primary Key that would be a unique id.

 Faultless Information
The database should follow the standards and conventions and provide
meaningful information useful to the organization(Constraint).

 Data Integrity
Integrity assists in guaranteeing that the values are valid and faultless. Data
Integrity is set to tables, relationships, etc.

 Modify
The database developed should be worked upon with the conventions and
standards, so that it can be easily modified whenever the need arise.

40
Scope
• Normalization of Database.
• Imposing Integrity Constraint.
• Establishing the Relation between the tables.
• Accessing the data from multiple tables. (Usage of join and sub query….)

4.3 Database Identification

The identification of database by unique name given to the various database


objects. The identifier is the name of database object. The following are the various
database objects.

• Tables

• Columns

• Views

• Sequences

• Indexes

• Stored Procedures

4.4 Schema information

The database schema is its structure described in a formal language supported by


the database management system (DBMS). The term "schema" refers to the organization
of data as a blueprint of how the database is constructed (divided into database tables in
the case of relational databases)

In a relational database, the schema defines the tables, fields, relationships, views,
indexes, packages, procedures, function s, queues, triggers, types, sequences,
materialized views.

41
Fig 4.1 Schema

4.5 Table Definition

• Register Table

Column Name Data Type Size Constraint Description

Username Varchar 50 Not null Name of the


user
Password Varchar 50 Not null Password of
staff
Phone_number Integer 10 Not null User phone
number
Email Varchar 50 Not null (primary Email of the
key) user

• Admin login Table

42
Column Name Data Type Size Constraint Description

User name Varchar 50 Not null Name of the


user
Password Varchar 20 Not null Password of
Admin

• Admission Table

Column Name Data Type Size Constraint Description

Staff ID Int 50 Not null(primary ID number of


key) staff
Staff name Varchar 50 Not null Name of staff

Date of join Date 20 Not null Joining date


of staff
Date of Birth Date 20 Not null Birth date of
staff
Email Varchar 50 Not null (foreign Email of the
key) user
Gender Varchar 50 Not null Gender of
staff
Designation Varchar 50 Not null Staff
department

• Staff Achievement Table

Column Name Data Type Size Constraint Description

Staff ID Int 50 Not null(foreign ID number of


Column Name Data Type Size key)
Constraint staff
Description
Text Varchar 50 Not null Written text of staff
Staff ID Int 50 Not null(foreign ID number of
Doc Varchar 50 Not null
key) Document
staff of
Paid date Date 20 Not null staff
Date of
payment salary
• Paid
Stafftime
Salary Tabletime 50 Not null Time of
payment salary
Paid Varchar 50 43 Not null Salary is paid

Not paid Varchar 50 Not null Salary is not


paid
• Staff Attendance Table

Column Name Data Type Size Constraint Description

Staff ID Int 50 Not null(foreign ID number of


key) staff
Date of attend Date 20 Not null Current Date of
Staff Attend
Attend Varchar 50 Not null Staff attend

Time of attend time 50 Not null Time of attend

4.6 Physical design

The physical design is where you translate schemas into actual database
structures.
• Entity to Table
• Tuples to rows
• Attribute to Column
• Primary Key and Alternate Key to Unique Index
• Domain into Constraints

4.7 Data Dictionary


A data dictionary is a file or a set of files that includes a database's metadata. The
data dictionary hold records about other objects in the database, such as data ownership,
data relationships to other objects, and other data.

44
The data dictionary, in general, includes information about the following:

• Name of the data item

• Aliases

• Description/purpose

• Related data items

• Range of values

• Data structure definition

4.8 ER Diagram

ER-modeling is a data modeling method used in software engineering to produce


a conceptual data model of an information system. Diagrams created using this ER-
modeling method are called Entity-Relationship Diagrams or ER diagrams or ERDs.

45
Symbols Conversion

Entity

Weak entity

Relation

Identity Relation

Attribute

Derived Attribute

Cardinality ratio 1:N from


E 1 R E E1:E2 in R.
R

Table 4.7 Symbols of ER-Diagram

User name
Password

Phone number

Registration
Email

46
Date of join

Gender 1
Staff ID
1
Admission has
Staff name 1

Components of an ER Diagrams Designation


Email 1
has

1. Entity many
Staff ID
An entity
has can be a real-world object, either animate or inanimate, that can be
merely identifiable.
Achievement
1
An entity is denoted as a rectangle in an ER diagram. For example, in a
school database, many
students, teachers, classes, and courses offered can be treated as
Time ofentities. All these entities have some attributes or properties thatImage
give them their
attend identity. Text

Attendance
Entity Set
An entity set is a collection of related types of entities.

Attend generate
Strong Entity
Staff ID An entity with uniquely identified by its attribute.
Date of many
attend

Salary
No of
Weak Entity Status days

In a relational database, a week entity is an entityPaid


thatdate
cannot be uniquely
Staff id
identified by its attributes alone.

Fig 4.3 ER-Diagram

2. Attributes
Entities are denoted utilizing their
properties, known as attributes. All attributes have values. For example, a student
entity may have name, class, and age as attributes.
There exists a domain or range of values that can be assigned to attributes.
For example, a student's name cannot be a numeric value. It has to be alphabetic. A
student's age cannot be negative, etc.

There are four types of Attributes:

47
1. Key attribute
2. Composite attribute
3. Single-valued attribute
4. Multi-valued attribute
5. Derived attribute

1. Key attribute: Key is an attribute or collection of attributes that uniquely


identifies an entity among the entity set. For example, the roll number of a
student makes him identifiable among students.

2. Composite attribute: An attribute that is a combination of other attributes is


called a composite attribute. For example, In student entity, the student address
is a composite attribute as an address is composed of other
characteristics such as pin code, state, country.

3. Single-valued attribute: Single-valued attribute contain a single value. For


example, Social, Security, Number.

4. Multi-valued Attribute: If an attribute can have more than one value, it is


known as a multi-valued attribute. Multi-valued attributes are depicted by the
double ellipse. For example, a person can have more than one phone number,
email-address, etc.

48
5. Derived attribute: Derived attributes are the attribute that does not exist in
the physical database, but their values are derived from other attributes present
in the database. For example, age can be derived from date_of_birth. In the ER
diagram, Derived attributes are depicted by the dashed ellipse.

3. Relationships
The association among entities is known as relationship. Relationships are
represented by the diamond-shaped box. For example, an employee works at a
department, a student enrolls in a course. Here, Works at and Enrolls are called
relationships.

Degree of a relationship set


The number of participating entities in a relationship describes the degree of
the relationship. The three most common relationships in E-R models are:
1. Unary (degree1)
2. Binary (degree2)
3. Ternary (degree3)
4.

1. Unary relationship: This is also called recursive relationships. It is a


relationship between the instances of one entity type. For example, one person is
married to only one person.

49
2. Binary relationship: It is a relationship between the instances of two entity
types. For example, the Teacher teaches the subject.

3.

Ternary relationship: It is a relationship amongst instances of three entity


types. In fig, the relationships "may have" provide the association of three
entities, i.e., TEACHER, STUDENT, and SUBJECT. All three entities are
many-to-many participants. There may be one or many participants in a ternary
relationship.

Cardinality Ratio

Cardinality describes the number of entities in one entity set, which can be
associated with the number of entities of other sets via relationship set.

Types of Cardinalities

1. One to One: One entity from entity set A can be contained with at most one entity
of entity set B and vice versa. Let us assume that each student has only one student ID,
and each student ID is assigned to only one person. So, the relationship will be one to
one.

50
2. One to many: When a single instance of an entity is associated with more than one
instances of another entity then it is called one to many relationships. For example, a
client can place many orders; a order cannot be placed by many customers.

3. Many to One: More than one entity from entity set A can be associated with at
most one entity of entity set B, however an entity from entity set B can be associated
with more than one entity from entity set A. For example - many students can study in a
single college, but a student cannot study in many colleges at the same time.

4. Many to Many: One entity from A can be associated with more than one entity
from B and vice-versa. For example, the student can be assigned to many
projects, and a project can be assigned to many students.

51
Identifying relationship
An identifying relationship is a relationship between two entities in which an
instance of a child entity is identified through its association with a parent entity,
which means the child entity is dependent on the parent entity for its identity and
cannot exits without it.

Participation Contraints

The participation constraint specifies the number of instance of an entity can


participate in a relationship set.

Total participation – Each entity is involved in the relatioship. Total


participation is represented by double lines.
Partial participation – Not all entities are involved in the relatioship. Partial
participation is represented by single lines.

4.9 Database Administration

4.9.1 DBMS System information

A database is an organized collection of structured information, or data typically


stored electronically in a computer system. A data base is usually controlled by a
database management system (DBMS).

4.9.2. DBMS configuration

Steps for configure apache and Mysql in XAMPP

52
1. In phpmyadmin, click the Users tab at the top.
2. Find the row that has User root and Host 127.0.0.1.
3. Click Edit Privileges.
4. Click Change password.
5. Enter the password twice (write it down somewhere if you're not sure you can
remember it)
6. Click the Go button

4.9.3. Support software required

Mysql Required XAMPP


Software Requirements
The following operating systems are officially supported:
• Windows 7 (64-bit, Professional level or higher)
• Mac OS X 10.6.1+
• Ubuntu 9.10 (64bit)
• Ubuntu 8.04 (32bit/64bit)

4.9.4. Hardware (Storage) requirements

The minimum hardware requirements are:


• Hard Disk:1 GB Required 500GB(Recommended)
• CPU: Intel Core or Xeon 3GHz (or Dual Core 2GHz) or equal AMD CPU
• Cores: Single (Dual/Quad Core is recommended)
• RAM: 4 GB (6 GB recommended)
• Graphic Accelerators: nVidia or ATI with support of OpenGL 1.5 or higher
• Display Resolution: 1280×1024 is recommended, 1024×768 is minimum.

4.9.5. Backup and recover

Recovery is the process of restoring a database to the correct state in the event
of a failure

Database backup is a way to protect and restore a database. It is performed


through database replication and can be done for a database or a database server.

Using phpMyAdmin to Back Up or Restore MySQL

If you’re running phpMyAdmin backing up and restoring your MySQL database


is simple.

53
The export function is used as a backup, and the import function is used to restore.

Step 1: Create a MySQL Database Backup

1. Open phpMyAdmin. On the directory tree on the left, click the database
you want to back up.
This should open the directory structure in the right-hand window.
You’ll also notice that, in the directory tree on the left, all the assets under
the main database are highlighted.

2. Click Export on the menu across the top of the display.

You’ll see a section called “Export Method.” Use Quick to save a


copy of the whole database. Choose Custom to select individual tables or
other special options.

Leave the Format field set to SQL, unless you have a good reason to
change it.

3. Click Go. If you select Quick, your web browser will download a copy of
the database into your specified downloads folder. You can copy that to a
safe location.

Step 2: Clear the Old Database Information

It’s important to clear out old data before restoring a backup. If


there’s any old data, it isn’t overwritten when you restore. This can create
duplicate tables, causing errors and conflicts.

1. Open phpMyAdmin, on the navigation pane on the left, choose the


database you want to restore.

2. Click the check all box near the bottom. Then, use the drop-down menu
labeled With selected to select Drop.

3. The tool should prompt you to confirm that you want to go forward. Click
yes.

This will get rid of all the existing data, clearing the way for your restoration.

Step 3: Restore Your Backed up MySQL Database


In phpMyAdmin, the Import tool is used to restore a database.

1. On the menu across the top, click Import.

54
2. The first section is labeled File to import. A couple of lines down, there’s
a line that starts with “Browse your computer,” with a button labeled
Choose File. Click that button.

3. Use the dialog box to navigate to the location where you’ve saved the
export file that you want to restore. Leave all the options set to default. (If
you created your backup with different options, you can select those here.)

4. Click Go.

5. DETAILED DESIGN
5.1 Introduction
During detailed design, the internal logic of each module specified in system design
is decided. During this phase further details of the modules are decided. Design of each of
the modules usually specified in a high-level description language which is independent of
the language in which software eventually be implemented.

5.2 Structure of software package

College Management System

General Admin Staff

Login Staff management Registration

Forgot Password
55 Registration Admission

Approve
Achievement
Add
Delete
Update
Admission
Attendance
Update

View View salary report

Delete

Salary payment

Calculate

Save

Staff Attendance

Report

Staff salary report

Staff achievement report

Staff attendance report

5.3 Module decomposition of software

Structure chart:
Structure chart is a top-down modular design, consist of squares representing
different models in a system and lines. Structure chart shows how program has been
partitioned into manageable modules hierarchy and organization of those modules
and communicational interface.

56
Table 5.1 Symbols of Structured chart

Flow chart:
Flow chart is a graphical representation of solution to the given problems. A
Flowchart is pictorial representation of an algorithm, workflow or process. The
diagrammatic representation illustrates a solution model to given problem. It uses the
following symbol.

57
In-page
Table 5.2 Symbols
of Flow chart
Off- page

5.3.1 General
module Delay
5.3.1.1
Login
5.3.1.1.1 Input
User name, password
5.3.1.1.2 Procedural details
Structure chart:

LOGIN

DISPLAY PAGE
VALIDATION
INPUT DETAILS

58
READ MESSAGE
USER_ID
AND
PASSWORD

Algorithm:
Step 1: start
Step 2: input username and password
Step 3: Validation
Step 5: IF Email exits
Load to home page
Display respective page
ELSE
Display error message
GOTO step 2
END IF
Step 5: stop

Flow chart:

Start

Input user name and password

Validation Register
table

59
Display error input
message False valid?
?

True

Load home
page

Display successful message

Stop

5.3.1.1.3 File I/O interfaces


Login table
5.3.1.1.4 Outputs
Navigate to admin page
5.3.1.1.5 Implementation aspects
Edit text, button

5.3.1.2 Forgot password


5.3.1.2.1 Input
User name, email-id, new password, Confirm password, OTP code
5.3.1.2.2 Procedural details
Structured chart:

FORGOT PASSWORD

VALIDATION
INPUT
DETAILS

60

DISPLAY ERROR LOAD TO LOGIN


READ USER_ID MESSAGE PAGE
CONFIRM_PASSWORD
OTP_CODE

Algorithm:
Step 1: start
Step 2: input username, new password, confirm password
Step 3: IF Email id is valid THEN
Send OTP
ELSE
Display error message
End IF
Step 4: IF OTP is valid THEN
Password is changed
ELSE
Display error message
End IF
Step 5: stop

Flow chart:
Start

Input username, New password and


Confirm password

Validation

Display error If
message input
False
61 is
valid?
True
False
Display error If OTP
message is valid?

True

Store to
Register table
database

Display Password is
changed

Stop

5.3.1.2.3 File I/O interfaces


Registration table
5.3.1.2.4 Outputs
New password is created
5.3.1.2.5 Implementation aspects
Edit text, button

5.3.2 Admin Module


5.3.2.1 Staff management
5.3.2.1.1 Registration
5.3.2.1.1.1 Approve
5.3.2.1.1.1.1 Input
Status
5.3.2.1.1.1.2 Procedural details

Structured chart:

APPROVE

62
VALIDATION DISPLAY
INPUT SUCCESSFUL
DETAILS MESSAGE
DISPLAY DATA IS
READ DEATAILS ERROR APPROVED
TO BE APPROVED MESSAGE

Algorithm:
Step 1: start
Step 2: read staff details
Step 3: check the validation of the input
Step 4: IF valid THEN
Approve the staff details
and display “success” message
ELSE
Display error message
Step 5: stop

Flow chart:

Start

Select the details of staff

False
If Display error message
valid?

True
63

Approve the staff details Registration


Display successful message

Stop

5.3.2.1.1.1.3 File I/O interfaces


Registration table
5.3.2.1.1.1.4 Outputs
If the email id is valid displays ‘client is approved’ message
5.3.2.1.1.1.5 Implementation aspects
Edit text, button.

5.3.2.1.1.2 View
5.3.2.1.1.2.1 Input
User name, password

5.3.2.1.1.2.2 Procedural details


Structured chart:

VIEW

VIEW STAFF FROM


INPUT DETAILS REGISTRATION
COMMAND TABLE

64
Algorithm:
Step 1: start
Step 2: select staff details
Step 3: Click view button
Step 4: View details of staff on the registration table
Step 5: Stop

Flow chart:

Start

Select the details of staff

Click view button

View details of staff


Registration table

Stop

5.3.2.1.1.2.3 File I/O interfaces


Registration table
5.3.2.1.1.2.4 Outputs
Views only client details in entry box
5.3.2.1.1.2.5 Implementation aspects
Button.

5.3.2.1.1.3 Delete
5.3.2.1.1.3.1 Input
Staff ID
5.3.2.1.1.3.2 Procedural details

Structured chart:

65
DELETE

CONFIRMATION DELETE FROM


INPUT STAFF DATABASE
DETAILS

If you want to
delete

Yes No

Flow chart:

Start

Input staff details

Display Error Registration table


message

66
No
Is
confirm?
Yes

Delete from database


Registration table

Display Successful
message

Stop

5.3.2.1.1.3.3 File I/O interfaces


Registration table
5.3.2.1.1.3.4 Outputs
If the staff id is valid displays ‘Client record deleted’ message
else display error message.
5.3.2.1.1.3.5 Implementation aspects
Button.

5.3.2.1.2 Admission
5.3.2.1.2.1 Update
5.3.2.1.2.1.1 Input
Staff name, Staff ID, DOB, DOJ, phone.
5.3.2.1.2.1.2 Procedural details

Structured chart:

STAFF MANAGEMENT

UPDATE STORE TO
INPUT STAFF DETAILS OF DATABASE
DETAILS STAFF

67
Flow chart:
Start

Input staff details

False
If
Display error message
valid?

True

Update staff details Admission


table

Display successful message

Stop

5.3.2.1.2.1.3 File I/O interfaces


Admission table
5.3.2.1.2.1.4 Outputs
If the staff id is valid displays ‘Staff record is updated’
message else display error message.
5.3.2.1.2.1.5 Implementation aspects
Button.

5.3.2.1.2.2 View
5.3.2.1.2.3.1 Input
User name, password, confirm password, email-id, phone
number, status
5.3.2.1.2.3.2 Procedural details

68
Structured chart:

VIEW

VIEW STAFF FROM


INPUT DETAILS REGISTRATION
COMMAND TABLE

Algorithm:
Step 1: start
Step 2: select staff details
Step 3: Click view button
Step 4: View details of staff on the registration table
Step 5: Stop

Flow chart:
Start

Select the details of


staff

Click view button

Registration table View details of staff

Stop
69
5.3.2.1.2.3.3 File I/O interfaces
Registration table
5.3.2.1.2.3.4 Outputs
Views only client details in entry box
5.3.2.1.2.3.5 Implementation aspects
Button.

5.3.2.1.2.3 Delete
5.3.2.1.2.2.1 Input
Staff id.
5.3.2.1.2.2.2 Procedural details
Structured chart:

STAFF MANAGEMENT

DELETE THE DELETE FROM


INPUT STAFF PARTICULAR DATABASE
DETAILS STAFF RECORD

Flow chart:

Start

Input Staff details

False
If
Display error message
valid?

True

Delete particular staff details Admission


table
70

Display successful message


Stop

5.3.2.1.2.2.3 File I/O interfaces


Admission table
5.3.2.1.2.2.4 Outputs
If the staff id is valid displays ‘Staff record deleted’
message else display error message.
5.3.2.1.2.2.5 Implementation aspects
Button.

5.3.2.1.3 Salary Payment


5.3.2.1.3.1 Calculate
5.3.2.1.3.1.1 Input
Button clicks
5.3.2.1.3.1.2 Procedural details
Structured chart:

SALARY PAYMENT

CALCULATE STORE TO
INPUT STAFF AMOUNT OF DATABASE
DETAILS SALARY BASED
ON ATTENDANCE

Flow chart:

71
Start

Select details of staff

Click Calculate button

Attendance table Calculate salary based on attendance

Salary table Store to database

Stop

5.3.2.1.3.1.3 File I/O interfaces


Registration table
5.3.2.1.3.1.4 Outputs
Views only client details in entry box
5.3.2.1.3.1.5 Implementation aspects
Button.

5.3.2.1.3.2 Save
5.3.2.1.3.2.1 Input
Button clicks
5.3.2.1.3.2.2 Procedural details
Structured chart:

SALARY PAYMENT

SAVES THE SHOW


INPUT STAFF AMOUNT OF SUCCESSFUL
DETAILS SALARY MESSAGE
CALCULATED

72
Flow chart:

Start

Select the details of staff

Click on Save button

Saves the amount of salary


calculated

Salary table Store to database

Stop

5.3.2.1.3.2.3 File I/O interfaces


Registration table
5.3.2.1.3.2.4 Outputs
Views only client details in entry box
5.3.2.1.3.2.5 Implementation aspects
Button.

5.3.2.1.4 Staff attendance


5.3.2.1.4.1 Input
Button clicks
5.3.2.1.4.2 Procedural details
Structured chart:

ATTENDANCE

VALIDATION SHOW
INPUT STAFF SUCCESSFUL
DETAILS MESSAGE

Store to Error
73 message
database
Staff id Time Date Attend
Flow chart:
Start

Input staff details

Display error message Validation


False
True

Add attendance
Attendance table details

Show successful message

Stop

5.3.2.1.4.3 File I/O interfaces


Attendance table
5.3.2.1.4.4 Outputs
If the staff id is valid displays ‘Staff attendance details is added
successfully’ message else display error message.
5.3.2.1.4.5 Implementation aspects
Button

5.3.2.2 Report
5.3.2.2.1 Staff salary report
5.3.2.2.1.1 Input
Staff id
5.3.2.2.1.2 Procedural details

74
Structured chart:

STAFF SALARY REPORT

RETRIEVE STAFF SHOW SALARY


INPUT SALARY DETAILS REPORT
DETAILS

Flow chart:
Start

Input staff ID

Retrieve staff salary details


Salary table

Show salary report

Stop

5.3.2.2.1.3 File I/O interfaces


Staff salary table
5.3.2.2.1.4 Outputs
If the staff id is valid displays ‘Staff salary report generated’
message else display error message.
5.3.2.2.1.5 Implementation aspects
Button.

5.3.2.2.2 Staff achievement report


5.3.2.2.2.1 Input
Staff id
5.3.2.2.2.2 Procedural details
Structured chart:

75
ACHIEVEMENT

DISPLAY
VALIDATION DETAILS
INPUT DETAILS

DISPLAY ERROR LOAD


READ MESSAGE DETAILS
STAFF_ID

Flow chart:
Start

Input user name and password

Validation Achievement
table

76
If
Display error input
message False valid?
True

Display successful message

Stop

5.3.2.2.2.3 File I/O interfaces


Staff achievement table
5.3.2.2.2.4 Outputs
If the staff id is valid displays ‘Staff achievement report is
generated’ message else display error message.
5.3.2.2.2.5 Implementation aspects
Button.

5.3.2.2.3 Staff attendance report


5.3.2.2.3.1 Input
Staff id.
5.3.2.2.3.2 Procedural details
Structured chart:

STAFF ATTENDANCE REPORT

DISPLAY STAFF DISPLAY FROM


INPUT DETAILS ATTENDANCE DATABASE

77
Flow chart:

Start

Input staff ID

Display attendance report


Attendance table

Show successful message

Stop

5.3.2.2.3.3 File I/O interfaces


Staff attendance table
5.3.2.2.3.4 Outputs
If the staff id is valid displays ‘Staff attendance report is
generated’ message else display error message.
5.3.2.2.3.5 Implementation aspects
Button.

5.3.3 Staff Module


5.3.3.1 Registration
5.3.3.1.1 Input
User name, password, phone number, e-mail
5.3.3.1.2 Procedural details
Structured chart:

REGISTRATION

VALIDATION
INPUT
DETAILS

78 ERROR
DISPLAY LOAD
READ MESSAGE RESPECTIVE
USER_ID PAGE
Algorithm:
Step 1: start
Step 2: input username, password, confirm password, email.
Step 3: IF input
Load respective page
ELSE
Display error message
END IF
Step 4: stop

Flow chart:

Start

Input staff details of registration

Validation

Display error If valid?


message
False
79
True

Store to
Display successful message

Stop

5.3.3.1.3 File I/O interfaces:


Registration table
5.3.3.1.4 Outputs:
Navigate to admin page
5.3.3.1.5 Implementation aspects:
Edit text, button.

5.3.3.2 Admission
5.3.3.2.1 Input
Button clicks
5.3.3.2.2 Procedural details
Structured chart:

ADMISSION

Validation Display successful


Input details message

Display Update
Read details Error data to
messages Database
80
Flow chart:

Start

Input staff details of admission

Validation

Display error If
message valid?
False
True

Store to Admission table


database

Display successful message

Stop

5.3.3.2.3 File I/O interfaces


Admission table
5.3.3.2.4 Outputs
If the staff id is displays ‘Staff admission is successful’
message else display error message.
5.3.3.2.5 Implementation aspects
Edit text, button, list box.

5.3.3.3 Staff achievement


5.3.3.3.1 Add
5.3.3.3.1.1 Input
Button clicks
5.3.3.3.1.2 Procedural details

81
Structured chart:

ACHIEVEMENT

ADD ACHIEVEMENT SHOW SUCCESSFUL


INPUT DETAILS TO DATABASE MESSAGE
ACHIEVEMENT
DETAILS

Flow chart:

Start

Input staff details

Achievement Add achievement details


table

Show successful message

Stop

5.3.3.3.1.3 File I/O interfaces


Achievement table
5.3.3.3.1.4 Outputs
If the staff id is valid displays ‘Staff achievement is added’
message else display error message.
5.3.3.3.1.5 Implementation aspects
Edit text, button, list box.

5.3.3.3.2 Update
5.3.3.3.2.1 Input
Staff achievement
5.3.3.3.2.2 Procedural details
Structured chart:

ACHIEVEMENT

82
INPUT DETAILS TO SUCCESSFUL
ACHIEVEMENT DATABASE MESSAGE
DETAILS

Flow chart:
Start

Input Achievement
details

Update achievement
Achievement table details

Show successful message

Stop

5.3.3.3.2.3 File I/O interfaces


Achievement table
5.3.3.3.2.4 Outputs
If the staff id is valid displays ‘Staff achievement is updated’
message else display error message.
5.3.3.3.2.5 Implementation aspects
Button.

5.3.3.4 Staff Attendance


5.3.3.4.1 Input
Button clicks
5.3.3.4.2 Procedural details
Structured chart:

83
ATTENDANCE

VALIDATION SHOW
INPUT STAFF SUCCESSFUL
DETAILS MESSAGE

Store to Error
database message
Staff id Time Date Attend

Flow chart:
Start

Staff attendance details

Show error message Validation


False

True

Attendance table Add attendance details

84
Show successful message
Stop

5.3.3.4.3 File I/O interfaces


Attendance table
5.3.3.4.4 Outputs
If the staff id is valid displays ‘Staff attendance details is
added successfully’ message else display error message.
5.3.3.4.5 Implementation aspects
Button

5.3.3.5 View salary report


5.3.3.5.1 Input
Staff id
5.3.3.5.2 Procedural details
Structured chart:

VIEW SALARY REPORT

VIEW SALARY SHOW


INPUT DETAILS SUCCESSFUL
COMMAND MESSAGE

Flow chart:
Start

Input staff ID

View staff salary report


Salary table

Show Successful message

85
Stop
5.3.3.5.3 File I/O interfaces
Staff salary table
5.3.3.5.4 Outputs
If the staff id is valid Staff can view salary report generated
else display error message.
5.3.3.5.5 Implementation aspects
Button.

6. PROGRAM CODE LISTING


Login page:
from cProfile import label
from email import message
from email.mime import image
from faulthandler import disable
from tkinter import *
from tkinter import ttk, messagebox
import PIL
import pymysql

86
import os
import signup_page
from PIL import Image,ImageTk
import PIL.Image
import smtplib
import stmf
import admin
import random
import staffme
import attend
import login_page
import addis
import datetime
from time import strftime
from tkinter import filedialog

class login_page:
def __init__(self, root):
self.window = root
self.window.title("Login page")
# Set the window size
# Here 0,0 represents the starting point of the window
self.window.geometry("1550x800+0+0")
self.window.config(bg = "white")
self.frame5=Frame(self.window)
self.name=""
self.frame5.place(x=0,y=0,width=1550,height=1000)
imk=PIL.Image.open("bck1.jpg")
re1=imk.resize((2000,1000))
self.poi=ImageTk.PhotoImage(re1)
label=Label(self.frame5,image=self.poi)
label.place(x=0,y=0,width=2000,height=1000)
self.frame3 = Frame(self.frame5, bg="#a8acb3")

87
self.frame3.place(x=140,y=150,width=400,height=450)
self.email_label = Label(self.frame3,text="Email Address",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=40)
self.email_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray")
self.email_entry.place(x=50, y=80, width=300)
self.password_label = Label(self.frame3,text="Password",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=120)
self.password_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.password_entry.place(x=50, y=160, width=300)
self.login_button = Button(self.frame3,text="Log
In",command=self.login_func,font=("times new roman",15,
"bold"),bd=0,cursor="hand2",bg="blue",fg="white").place(x=50,y=200,width=300)
self.forgotten_pass = Button(self.frame3,text="Forgotten
password?",command=self.forgot_func,font=("times new roman",10,
"bold"),bd=0,cursor="hand2",bg="white",fg="blue").place(x=125,y=260,width=150)
self.create_button = Button(self.frame3,text="Create New
Account",command=self.redirect_window,font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=80,y=320,width=250)
radiobutton_1 = Radiobutton(self.frame3, text='Admin', font=("times new
roman",18),value=1,bg="#a8acb3",command=self.adml)
radiobutton_1.place(x=50,y=400,width=100,height=40)
radiobutton_2 = Radiobutton(self.frame3, text='Staff', font=("times new
roman",18),value=0,bg="#a8acb3",command=self.stfl)
radiobutton_2.place(x=250,y=400,width=100,height=40)
def lo(self):
self.frame5=Frame(self.window)
self.frame5.place(x=0,y=0,width=1550,height=1000)
imk=PIL.Image.open("bck1.jpg")
re1=imk.resize((2000,1000))
self.poi=ImageTk.PhotoImage(re1)
label=Label(self.frame5,image=self.poi)
label.place(x=0,y=0,width=2000,height=1000
self.frame3 = Frame(self.frame5, bg="#a8acb3")
self.frame3.place(x=140,y=150,width=400,height=450)

88
self.email_label = Label(self.frame3,text="Email Address",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=40)
self.email_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray")
self.email_entry.place(x=50, y=80, width=300)
self.password_label = Label(self.frame3,text="Password",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=120)
self.password_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.password_entry.place(x=50, y=160, width=300)
self.login_button = Button(self.frame3,text="Log
In",command=self.login_func,font=("times new roman",15,
"bold"),bd=0,cursor="hand2",bg="blue",fg="white").place(x=50,y=200,width=300)
self.forgotten_pass = Button(self.frame3,text="Forgotten
password?",command=self.forgot_func,font=("times new roman",10,
"bold"),bd=0,cursor="hand2",bg="white",fg="blue").place(x=125,y=260,width=150)
self.create_button = Button(self.frame3,text="Create New
Account",command=self.redirect_window,font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=80,y=320,width=250)
radiobutton_1 = Radiobutton(self.frame3, text='Admin', font=("times new
roman",18),value=1,bg="#a8acb3",command=self.adml)
radiobutton_1.place(x=50,y=400,width=100,height=40)
radiobutton_2 = Radiobutton(self.frame3, text='Staff', font=("times new
roman",18),value=0,bg="#a8acb3",command=self.stfl)
radiobutton_2.place(x=250,y=400,width=100,height=40)
def stfl(self):
self.frame3 = Frame(self.frame5, bg="#a8acb3")
self.frame3.place(x=140,y=150,width=400,height=450)
self.email_label = Label(self.frame3,text="Email Address",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=40)
self.email_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray")
self.email_entry.place(x=50, y=80, width=300)
self.password_label = Label(self.frame3,text="Password",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=120)
self.password_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.password_entry.place(x=50, y=160, width=300)

89
self.login_button = Button(self.frame3,text="Log
In",command=self.login_func,font=("times new roman",15,
"bold"),bd=0,cursor="hand2",bg="blue",fg="white").place(x=50,y=200,width=300)
self.forgotten_pass = Button(self.frame3,text="Forgotten
password?",command=self.forgot_func,font=("times new roman",10,
"bold"),bd=0,cursor="hand2",bg="white",fg="blue").place(x=125,y=260,width=150)
self.create_button = Button(self.frame3,text="Create New
Account",command=self.redirect_window,font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=80,y=320,width=250)
radiobutton_1 = Radiobutton(self.frame3, text='Admin', font=("times new
roman",18),value=1,bg="#a8acb3",command=self.adml)
radiobutton_1.place(x=50,y=400,width=100,height=40)
radiobutton_2 = Radiobutton(self.frame3, text='Staff', font=("times new
roman",18),value=0,bg="#a8acb3",command=self.stfl)
radiobutton_2.place(x=250,y=400,width=100,height=40)

def adml(self):
self.frame3 = Frame(self.frame5, bg="#a8acb3")
self.frame3.place(x=140,y=150,width=400,height=450)
self.email_label = Label(self.frame3,text="Email Address",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=40)
self.email_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray")
self.email_entry.place(x=50, y=80, width=300)
self.password_label = Label(self.frame3,text="Password",
font=("helvetica",20,"bold"),bg="#a8acb3", fg="black").place(x=50,y=120)
self.password_entry = Entry(self.frame3,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.password_entry.place(x=50, y=160, width=300)
self.login_button = Button(self.frame3,text="Log
In",command=self.ano,font=("times new roman",15,
"bold"),bd=0,cursor="hand2",bg="blue",fg="white").place(x=50,y=200,width=300)
self.forgotten_pass = Button(self.frame3,text="Forgotten
password?",command=self.forgot_func,font=("times new roman",10,
"bold"),bd=0,cursor="hand2",bg="white",fg="blue").place(x=125,y=260,width=150)
radiobutton_1 = Radiobutton(self.frame3, text='Admin', font=("times new
roman",18),value=1,bg="#a8acb3",command=self.adml)
radiobutton_1.place(x=50,y=400,width=100,height=40)
radiobutton_2 = Radiobutton(self.frame3, text='Staff', font=("times new
roman",18),value=0,bg="#a8acb3",command=self.stfl)

90
radiobutton_2.place(x=250,y=400,width=100,height=40)

def login_func(self):
if self.email_entry.get()=="" or self.password_entry.get()=="":
messagebox.showerror("Error!","All fields are required",parent=self.window)
else:
try:
connection=pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
self.name=self.email_entry.get()
cur.execute("select * from reg where email=%s and passw=%s",
(self.email_entry.get(),self.password_entry.get()))
row=cur.fetchone()
if row == None:
messagebox.showerror("Error!","Invalid USERNAME &
PASSWORD",parent=self.window)
else:
messagebox.showinfo("Success","Wellcome to bck",parent=self.window)
# Clear all the entries
self.reset_fields()
# self.window.destroy()
self.menustaf()
connection.commit()
connection.close()
except Exception as e:
messagebox.showerror("Error!",f"Error due to
{str(e)}",parent=self.window)
def ano(self):
if self.email_entry.get()=="" or self.password_entry.get()=="":
messagebox.showerror("Error!","All fields are required",parent=self.window)
else:
try:

91
connection=pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select * from amb where us=%s and pssw=%s",
(self.email_entry.get(),self.password_entry.get()))
row=cur.fetchone()
if row == None:
messagebox.showerror("Error!","Invalid USERNAME &
PASSWORD",parent=self.window)
else:
messagebox.showinfo("Success","Wellcome
Admin",parent=self.window)
self.window.destroy()
root = Tk()
obj = admin.sta(root)
root.mainloop()
except Exception as e:
messagebox.showerror("Error!",f"Error due to
{str(e)}",parent=self.window)

def forgot_func(self):
if self.email_entry.get()=="":
messagebox.showerror("Error!", "Please enter your valid register Email
Id",parent=self.window)
else:
try:
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select * from reg where email=%s", self.email_entry.get())
row=cur.fetchone()
if row == None:
messagebox.showerror("Error!", " Register Email Id doesn't exists")
else:
self.frame = Frame(self.window, bg="#488583")

92
self.frame.place(x=140,y=150,width=400,height=450)
self.usnmao = Label(self.frame,text="User name",
font=("helvetica",15,"bold"),bg="#488583", fg="black").place(x=50,y=40)
self.usnma= Entry(self.frame,font=("times new
roman",15,"bold"),bg="white",fg="gray")
self.usnma.place(x=50, y=80, width=300)
self.nempasol = Label(self.frame,text=" New Password",
font=("helvetica",15,"bold"),bg="#488583", fg="black").place(x=50,y=120)
self.newpass = Entry(self.frame,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.newpass.place(x=50, y=160, width=300)
self.confrompass = Label(self.frame,text=" Confrom Password",
font=("helvetica",15,"bold"),bg="#488583", fg="black").place(x=50,y=190)
self.confpwss = Entry(self.frame,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.confpwss.place(x=50, y=240, width=300)
self.OTPl = Label(self.frame,text=" OTP ",
font=("helvetica",15,"bold"),bg="#488583", fg="black").place(x=50,y=290)
self.oplm = Entry(self.frame,font=("times new
roman",15,"bold"),bg="white",fg="gray",show="*")
self.oplm.place(x=50, y=320, width=300)
self.create_button = Button(self.frame,text="Send OTP",font=("times
new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white",command=self.very).place(x=9
5,y=350,width=200)
self.create_button = Button(self.frame,text="Verfy &
send",command=self.change_pass,font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=10,y=400,width=200)
#self.create_button = Button(self.frame,text="Submit",font=("times new
roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=120,y=400,width=10
0)
self.create_button =
Button(self.frame,text="Back",command=self.lo,font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="green2",fg="white").place(x=250,y=400,width=10
0)
except Exception as e:
messagebox.showerror("Error", f"{e}")
def very(self):
try:

93
s = smtplib.SMTP("smtp.gmail.com" , 587) # 587 is a port number
s.starttls()
s.login("namegmail.com" , "sdfghjklwqertyui")
self.otp = random.randint(1000, 9999)
self.otp = str(self.otp)
s.sendmail("[email protected]" , self.email_entry.get() , self.otp)
messagebox.showinfo("Send OTP via Email", f"OTP sent to
{self.email_entry.get()}")
s.quit()
except:
messagebox.showinfo("Send OTP via Email", "Please enter the valid email
address OR check an internet connection")
def change_pass(self):
if self.usnma.get() == "":
messagebox.showerror("Error!", "Please enter registred user name")
elif self.newpass.get() == "" or self.confpwss.get() == "" :
messagebox.showerror("error","please enter password and confirm password")
elif self.newpass.get() != self.confpwss.get():
messagebox.showerror("error","password and confirm password is not same")
elif self.oplm.get()=="" :
messagebox.showerror("error","otp is not entered")
else:
try:
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select * from reg where email=%s and usnam=%s",
(self.email_entry.get(),self.usnma.get()))
row=cur.fetchone()
if row == None:
print("p")
messagebox.showerror("Error!", "Entered user name not matched")
else:
try:

94
print("u")
cur.execute("update reg set passw=%s where email=%s",
(self.newpass.get(),self.name))
connection.commit()
messagebox.showinfo("Successful", "Password has changed
successfully")
connection.close()
self.lo
except Exception as er:
messagebox.showerror("Error!", f"{er}")
except Exception as er:
messagebox.showerror("Error!", f"{er}")

def redirect_window(self):
self.window.destroy()
# Importing the signup window.
# The page must be in the same directory
root = Tk()
obj = signup_page.SignUp(root)
root.mainloop()

def reset_fields(self):
self.email_entry.delete(0,END)
self.password_entry.delete(0,END)

def menustaf(self):
self.fr=Frame(self.window,bg="white")
self.fr.place(x=0,y=0,width=1550,height=1000)
imk2=PIL.Image.open("bck8.jpg")
re3=imk2.resize((230,140))
self.poi3=ImageTk.PhotoImage(re3)
label=Label(self.fr,image=self.poi3)
label.place(x=0,y=0,width=230,height=140)

95
imk89=PIL.Image.open("bck55.jpg")
re89=imk89.resize((1500,850))
self.poi89=ImageTk.PhotoImage(re89)
label=Label(self.fr,image=self.poi89)
label.place(x=0,y=0,width=1500,height=850)
#imk3=PIL.Image.open("bck7.jpg")
#re4=imk3.resize((2000,800))
#self.poi4=ImageTk.PhotoImage(re4)
#label=Label(self.window,image=self.poi4)
#label.place(x=100,y=100,width=2000,height=500)
self.log = Button(self.fr, text="logout",font=("times new roman",18,
"bold"),bd=0,cursor="hand2",bg="#FFEBE7",command=self.lo).place(
x=1300, y=10, width=230)
title1 = Label(self.window, text="Menu", font=(
"times new roman", 25, "bold"), bg="#A5C6DB").place(x=0,
y=150,width=230)
nm=self.email_entry.get()
connection=pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select email from admis where email=%s",self.name)
row=cur.fetchone()
if row==None:
cur.execute("select status,email from reg where email=%s",self.name)
row=cur.fetchall()
for i in row:
el=StringVar(value=i[0])
self.aopl = Entry(self.fr, font=("arial"),text=el,state='readonly')
self.aopl.place(x=0, y=150, width=200)
if self.aopl.get()=="aprove":
self.attn = Button(self.fr, text="Admission",font=("times new roman",18,
"bold"),bd=0,cursor="hand2" ,command=self.am).place(
x=0, y=350, width=230)
else:

96
messagebox.showerror("error","You not have
approved",parent=self.window)
self.attn = Button(self.fr, text="Admission",font=("times new roman",18,
"bold"),bd=0,cursor="hand2",state = DISABLED ,command=self.am).place(
x=0, y=350, width=230)
else:
self.atm = Button(self.fr, text="Attendance",font=("times new roman",18,
"bold"),bd=0,cursor="hand2",command=self.amt).place( x=0, y=200, width=230)
self.acm = Button(self.fr, text="Achievement", font=("times new roman",18,
"bold"),bd=0,cursor="hand2",command=self.ach).place(
x=0, y=250, width=230)
self.sal = Button(self.fr, text="Salary Report",font=("times new roman",18,
"bold"),bd=0,cursor="hand2" ,command=self.lok).place(
x=0, y=300, width=230)
# self.senmel=Button(self.fr,text="Request",font=("times new
roman",18,"bold"),bd=0,cursor="hand2",command=self.lmtpo).place(x=0,y=350,widt
h=230)
connection.commit()
connection.close()

def am(self):
self.window.destroy()
root = Tk()
obj = addis.addmis(root)
root.mainloop()

def amt(self):
self.frame = Frame(self.window, bg="#6C7BE6")
self.frame.place(x=8, y=8, width=1000, height=1000)
self.date = StringVar()
imk90=PIL.Image.open("bck56.jpg")
re90=imk90.resize((1000,800))
self.poi90=ImageTk.PhotoImage(re90)
label=Label(self.frame,image=self.poi90)
label.place(x=0,y=0,width=1000,height=800)

97
title1 = Label(self.frame, text="Attendance", font=(
"times new roman", 25, "bold"), bg="#f2fafb").place(x=20, y=10)
usn = Label(self.frame, text="Staff Id", font=(
"helvetica", 15, "bold"), bg="#f2fafb").place(x=30, y=100)
padt = Label(self.frame, text="Date",font=(
"helvetica", 15, "bold"), bg="#f2fafb").place(x=30, y=260)
d1 = datetime.datetime.now()
self.date.set(d1.strftime("%d-%m-%y"))
self.padte = Entry(self.frame, font=("arial"),
state='readonly',textvariable=self.date)
self.padte.place(x=30, y=300, width=200)
self.time1 = ''
self.time2 = strftime('%H:%M:%S %p')
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select stid,email from admis where email=%s",self.name)
row=cur.fetchall()
for i in row:
el=StringVar(value=i[0])
self.stlid = Entry(self.frame, font=("arial"),text=el,state='readonly')
self.stlid.place(x=30, y=130, width=200)
# adding time to Entry
l1 = Label(self.frame, text="Add Time", font=(
"helvetica", 15, "bold"),
bg="#f2fafb",textvariable=self.changeLabel).place(x=30, y=180)
self.watch = Label(self.frame, text=self.time2,
font=("arial"))
self.watch.place(x=30, y=210, width=200)
self.changeLabel()
self.atml = IntVar()
atml=
Checkbutton(self.frame,text="Attend",variable=self.atml,onvalue=1,offvalue=0,bg="#
f2fafb",font=("times new roman",13)).place(x=30, y=350)

98
self.create_button = Button(self.frame, text="submit", font=(
"times new roman", 18, "bold"), bd=0, cursor="hand2", bg="green2",
fg="black",command=self.sen).place(x=30, y=400, width=250)
self.create_button = Button(self.frame, text="Back", font=(
"times new roman", 18, "bold"), bd=0, cursor="hand2", bg="green2",
command=self.menustaf,fg="black").place(x=30, y=450, width=250)
def sen(self):
if self.atml.get() == 0:
messagebox.showerror("Error!","tick the attend part",parent=self.window)
else:
try:
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
p=datetime.datetime.now()
x = p.strftime(' %H:%M:%S')
cur.execute("select * from attend where stid=%s and pdate=%s",
(self.stlid.get(),self.padte.get()))
row=cur.fetchone()
# Check if th entered email id is already exists or not.
if row!=None:
messagebox.showerror("Error!","Registration ID allready
exsits",parent=self.window)
else:
cur.execute("insert into attend (stid,pdate,ptime,present) values(%s,%s,%s,
%s)",
(
self.stlid.get(),
self.padte.get(),
x,
self.atml.get()
))
connection.commit()
connection.close()

99
messagebox.showinfo("attend","Attendance is
Successful",parent=self.window)
except Exception as e:
messagebox.showerror("Error!",f"Error due to
{str(e)}",parent=self.window)

def changeLabel(self):
self.time2 = strftime('%H:%M:%S %p')
self.watch.configure(text=self.time2)
# it'll call itself continuously
self.frame.after(200, self.changeLabel)

def bac(self):
self.window.destroy()
root = Tk()
obj = stmf.sta(root)
root.mainloop()

def ach(self):
self.frame10 = Frame(self.window, bg="#6C7BE6")
self.frame10.place(x=8, y=8, width=1500, height=850)
self.texscrol = Scrollbar(self.window)
self.domte = Text(self.frame10, bg="white",
yscrollcommand=self.texscrol.set, font=("arial"))
self.domte.place(x=510, y=0, width=1010, height=650)
self.texscrol.config(command=self.domte.yview)
self.texscrol.pack(side=RIGHT, fill=Y)
title1 = Label(self.frame10, text="Achievement", font=(
"times new roman", 25, "bold"), bg="#6C7BE6").place(x=20, y=10)
self.upload = Button(self.frame10, text="Back", font=("times new
roman",18),command=self.menustaf).place(x=1000,y=700,width=100)
self.add=Button(self.frame10, text="Add", font=("times new
roman",18),command=self.add_data).place(x=900,y=700,width=100)
# self.add=Button(self.frame10, text="upload", font=("times new
roman",18),command=self.upload_file).place(x=270,y=30)

100
self.add=Button(self.frame10, text="Update", font=("times new
roman",18),command=self.upd).place(x=700,y=700,width=100)
b2 =Button(self.frame10,text="Upload",font=("times new
roman",18),command=self.upload_file) # using Button
b2.place(x=10,y=300,width=300,height=250)
bm=Label(self.frame10,text="If you dont have any certificate then your photo
must be added")
bm.place(x=0,y=250)
self.usn = Label(self.frame10, text="Staff Id", font=("helvetica", 15, "bold"),
bg="#6C7BE6").place(x=30, y=100)
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select stid,email from admis where email=%s",self.name)
row=cur.fetchall()
for i in row:
el=StringVar(value=i[0])
self.stalib = Entry(self.frame10, font=("arial"),text=el,state='readonly')
self.stalib.place(x=30,y=150,width=200)
cur.execute("select image from achev ")
ro=cur.fetchall()
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
conn = connection.cursor()
em=conn.execute("select text from achev where stid=%s ",self.stalib.get())
r1=conn.fetchall()
print("hh",r1[0])
em1=conn.execute("select image from achev where stid=%s ",self.stalib.get())
r2=conn.fetchall()
self.domte.insert(1.0,r1)
self.v={}
for i in r2:
#self.imag=i[0]
#print(self.imag)
self.imk2=PIL.Image.open(i[0])

101
self.re3=self.imk2.resize((300,250))
self.v[i]=ImageTk.PhotoImage(self.re3)
#lb1=Button(self.frame12,image=self.v[i],command=self.uploa_file)
#lb1.place(x=200,y=0,width=150,height=180)
b2 =Button(self.frame10,image=self.v[i],command=self.uploa_file) # using
Button
b2.place(x=10,y=300,width=300,height=250)
# e4=StringVar(value=i[2])
conn.close()
# assume mydb is the connection object of MySQL database
connection.commit() # make sure to commit the change
def upload_file(self): # Image upload and display
global filename,img
f_types =[('Png files','*.png'),('Jpg Files', '*.jpg')]
filename = filedialog.askopenfilename(filetypes=f_types)
self.imk=PIL.Image.open(filename)
self.re2=self.imk.resize((300,250))
img = ImageTk.PhotoImage(self.re2)
b2 =Button(self.frame10,image=img) # using Button
b2.place(x=10,y=300,width=300,height=250)#display uploaded photo
def uploa_file(self): # Image upload and display
global filename,img
f_types =[('Png files','*.png'),('Jpg Files', '*.jpg')]
filename = filedialog.askopenfilename(filetypes=f_types)
self.img = ImageTk.PhotoImage(file=filename)
b2 =Button(self.frame10,image=self.img) # using Button
b2.place(x=10,y=300,width=300,height=250)

def upd(self):
global filename
f=filename
print(f)
if filename=="" or self.domte.get(1.0, "end-1c")=="" :

102
messagebox.showerror("error","photo and text is not added")
else:
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("update achev set image=%s,text=%s Where stid=%s",
(filename,self.domte.get(1.0, "end-1c"),self.stalib.get()))
connection.commit()
connection.close()
messagebox.showinfo("sucess","your file is updated")
def add_data(self): # Add data to MySQL table
global filename
f=filename
print(f)
if filename=="":
messagebox.showerror("error","photo is not added")
else:
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("insert into achev (stid,text,image) values(%s,%s,%s)",
( self.stalib.get(),
self.domte.get(1.0, "end-1c"),
filename ))
connection.commit()
connection.close()
messagebox.showinfo("wow","your achievement photo and text is added")
def op_data(self): # Add data to MySQL table
global filename
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()

cur.execute("insert into achev (stid,text,image) values(%s,%s,%s)",

103
( self.stalib.get(),
self.domte.get(1.0, "end-1c"),
filename ))
connection.commit()
connection.close()
messagebox.showinfo("wow","your achievement photo and text is added")

def lok(self):
self.frame90 = Frame(self.window, bg="#6C7BE6")
self.frame90.place(x=8, y=8, width=500, height=1000)
imk1=Image.open("money.jpg")
re2=imk1.resize((500,800))
self.poi1=ImageTk.PhotoImage(re2)
label=Label(self.frame90,image=self.poi1)
label.place(x=0,y=0,width=500,height=800)
but=Button(self.frame90,text="Back",command=self.menustaf) # using Button
but.place(x=0,y=0,width=250,height=60)
self.frame100 = Frame(self.window, bg="#6C7BE6")
self.frame100.place(x=500, y=8, width=1010, height=830)
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select stid,email from admis where email=%s",self.name)
row=cur.fetchall()
for i in row:
el=StringVar(value=i[0])
self.roll = Entry(self.frame100, font=("arial"),text=el,state='readonly')
self.roll.place(x=30,y=150,width=200)
self.trv = ttk.Treeview(self.frame100, selectmode ='browse')
self.trv.place(x=0,y=0,width=1000,height=800)
# number of columns
self.trv["columns"] = ("1", "2", "3","4","5")
# Defining heading

104
self.trv['show'] = 'headings'
# width of columns and alignment
self.trv.column("1", width = 30, anchor ='c')
self.trv.column("2", width = 80, anchor ='c')
self.trv.column("3", width = 80, anchor ='c')
self.trv.column("4", width = 80, anchor ='c')
self.trv.column("5", width = 80, anchor ='c')
# Headings
# respective columns
self.trv.heading("1", text ="Staff ID")
self.trv.heading("2", text ="Time")
self.trv.heading("3", text ="Date")
self.trv.heading("4", text ="Amount")
self.trv.heading("5", text ="Status")
# getting data from MySQL student table
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
conn = connection.cursor()
conn.execute("select * from salry where stid=%s ",self.roll.get())
for dt in conn:
self.trv.insert("", 'end',iid=dt[2],
values =(dt[0],dt[1],dt[2],dt[3],dt[4]))
hsb=ttk.Scrollbar(self.frame100,orient="vertical")
hsb.configure(command=self.trv.yview)
self.trv.configure(xscrollcommand=hsb.set)
hsb.pack(fill=Y,side=RIGHT)
def lmtpo(self):
self.frame93 = Frame(self.window, bg="#6C7BE6")
self.frame93.place(x=8, y=8, width=500, height=1000)
imk90=PIL.Image.open("bck102.jpg")
re90=imk90.resize((500,1000))
self.poi90=ImageTk.PhotoImage(re90)
label=Label(self.frame93,image=self.poi90)

105
label.place(x=0,y=0,width=500,height=1000)
connection = pymysql.connect(host="localhost", user="root", password="",
database="log")
cur = connection.cursor()
cur.execute("select stid,email from admis where email=%s",self.name)
row=cur.fetchall()
for i in row:
el=StringVar(value=i[0])
self.soplm = Entry(self.frame93, font=("arial"),text=el,state='readonly')
self.soplm.place(x=150,y=150,width=200)
e2=StringVar(value=i[1])
self.emtyui=Entry(self.frame93,
font=("arial"),text=e2,state='readonly').place(x=150,y=200)
connection.commit()
connection.close()
oplut=Label(self.frame93, text="Staff number",font=(
"helvetica", 15, "bold"), bg="#6C7BE6").place(x=0,y=150)
oplut=Label(self.frame93, text="From",font=(
"helvetica", 15, "bold"), bg="#6C7BE6").place(x=0,y=200)
oplut=Label(self.frame93, text="To",font=(
"helvetica", 15, "bold"), bg="#6C7BE6").place(x=0,y=250)
self.eqwe=Label(self.frame93, text="[email protected]",font=(
"arial",15)).place(x=150,y=250)
oplut=Label(self.frame93, text="Message",font=(
"helvetica", 15, "bold"), bg="#6C7BE6").place(x=0,y=300)
self.otpll=Entry(self.frame93, font=("arial"))#Text(self.frame93, bg="green",
font=("arial"))
self.otpll.place(x=10, y=400, width=450, height=60)
self.sulp = Button(self.frame93, text="Upload", font=("times new
roman",18),command=self.tyui,width=10).place(x=10,y=500)
self.sulp = Button(self.frame93, text="Back", font=("times new
roman",18),command=self.menustaf,width=10).place(x=10,y=700)
# The main function
if __name__ == "__main__":

106
root = Tk()
obj = login_page(root)
root.mainloop()

7. USER INTERFACE
7.1 Login page of Staff :

7.2 Login page of Admin:

107
7.3 Registration:

7.4 Admission:

108
7.5 Staff Home page

109
7.6 Staff attendance

7.7 Staff achievement

110
7.8 Staff achievement(blank):

7.9 Staff salary report

111
7.10 Admin Home page

7.11 Admin Staff Registration:

7.12 Admin Staff Admission:

112
7.13 Admin Staff payment:

113
7.14 Admin Staff Attendance:

7.15 Admin staff Attendance report:

114
7.16 Admin staff salary report:

7.17 Admin Staff Achievement report:

115
7.18 Admin Staff Achievement report (after search):

8. TESTING

8.1 Introduction
Testing is the major quality control measures and during the software development it is
used to detect errors that could have occurred during any of the phase like requirement
analysis, design, coding. The goal of the testing is to uncover errors in the program.

8.2 Levels of Testing


Testing is done in different levels which includes the following.
 Unit Testing
 Integration Testing
 System testing
 Acceptance testing
 Unit Testing
In Unit testing each module gets tested during the coding phase itself. The purpose is to
exercise the different parts of the module code to detect the coding errors.
 Integration Testing

116
After new testing the modules are gradually integrated into sub systems. It is performed to
detect design errors by focusing on testing the interconnection between modules.
 System Testing
System is tested against the system requirement if all the requirements are met and if the
system performs as specified by the requirement.
 Acceptance Testing
It is performed to demonstrate to the client on real life data of the client, the operation of the
system.
8.3 Test Case
It is the input that tests the genuineness of the program and successful execution of the test
case revels. that there are no errors in the program that are under testing. it is a set of
conditions or variables under which tester will determine whether an application or software
is working currently

Test case-ID 01

Test Case Title Login in admin

Purpose of testing Testing the login

Test data Email ID and Password

Steps Step:1 IF Email ID and Password is valid THEN


Step:2 DISPLAY Login successful
Step:3 ELSE DISPLAY Login Unsuccessful.

Expected Output Invalid output:

117
Valid output:

118
Test case-ID 02

Test Case Title Login

Purpose of Testing the login


testing

Test data Email ID and Password

Steps Step:1 IF Email ID and Password is valid THEN


Step:2 DISPLAY Login successful
Step:3 ELSE DISPLAY Login Unsuccessful.

Expected Invalid output:


Output

Valid output:

119
Testcase-ID 03

Test Case Title Registration

Purpose of testing To register user for the web-site.

Test data User name, Phone number, Email ,confirm password and
Password.

Steps 1. Click on create account


2. Enter the User name, Phone number, Email ,confirm
password and Password.
3. Click on Signup button
4. If record not entry shows required to enter
5. Else display successful message.
Expected Output Invalid output:

Invalid output:

Invalid output:

120
Test case-ID 04

Test Case Title After registration

Purpose of testing Testing the login

Test data Email ID and Password

Steps Step:1 IF Email ID and Password is valid THEN


Step:2 DISPLAY Login successful
Step:3 ELSE DISPLAY Login Unsuccessful.
Step :4 If email is approved then
Step:5 Admission is enable
Step 6: else Display not approved and admission button
disable

Expected Output Invalid output:

Valid output:

Test case-ID 05

Test Case Title Admission

Purpose of testing Testing the Admission

Test data Name, Designation, Gender, Email_id

121
Steps Step:1Enter Name, Designation, Gender, Email_id and
select date of birth
2. If record not entry shows required to enter
3. Else display successful message.

Expected Output
Invalid output:

Invalid output:

Invalid output:

122
Valid output:

Test case-ID 06

Test Case Title Attendance

Purpose of testing Testing the Attendance

Test data Attend

Steps 1.Tick the check box


2.click send button
3. If check box is ticked
4. Display Attendance is successful

123
5.Else error message as not ticked
6. If again try to click of same day
7.Display Error as already exist

124
Expected Output Invalid output:

Valid output:

Invalid output:

Test case-ID 07

125
Test Case Title Achievement

Purpose of testing Testing the update and add

Test data Text, button

Steps 1.Upload button clicked


3. If image is added on upload button
4. Display image or text is added
5.Else error message not added photo
6. If update button clicked empty photo
7.Display Error as photo and text is not added
8.else Display photo and text is updated
Expected Output
Invalid output(add button):

Invalid output(update button):

126
Invalid output:

Valid output(without text):

Valid output(with text):

127
Valid output(update ):

Test case-ID 08

Test Case Title Admin approve registration

Purpose of Testing the approve


testing

Test data status

Steps 1.approve button clicked


2.if entry field is not entered then
3.Display Error entry not filled
4.else client is approved

Expected Output Invalid output:

128
Valid output:

Test case-ID 09

Test Case Title Admin delete registration

Purpose of Testing the delete


testing

Test data Selected part in table

Steps 1.click in table that must be deleted


2.if not selected then
3.display row is not selected

129
4.else if delete is yes
5.it will delete from database
6.else it will not delete returning to the main application
Expected Output

Invalid output:

Invalid output:

130
Testcase-ID 10

Test Case Title Admin Registration view

Purpose of testing Testing for view

Test data Selected row

Steps 1click in table that must be view


2.if not selected then
3.display row is not selected
4.else show in entry box

Expected Output
Invalid output:

Valid output:

Valid output:

Testcase-ID 11

Test Case Title Admin admission update

Purpose of testing Testing for update131

Test data Selected row


Testcase-ID 12

Test Case Title Admin admission delete

Purpose of testing Testing for delete

Test data Selected row

Steps 1.click in table that must be deleted


2.if not selected then
3.display row is not selected
4.else if delete is yes
5.it will delete from database
6.else it will not delete returning to the main application
Expected Output Invalid output:

Invalid output:

Valid output:

132
133

You might also like