You are on page 1of 34

EMPLOYEE ATTEDANCE MANAGEMENT SYSTEM

By

NIRMAL KUMAR S - 1802072

ROSINI R - 1802091

Report submitted in partial fulfillment


of the requirements for the
Degree of Bachelor of Engineering
In
Computer Science and Engineering

Sri Ramakrishna Institute of Technology


Coimbatore-641010
November, 2021
ACKNOWLEDGEMENT

“A well-educated sound and motivated work force is the bed rock of special and
economic progress of our nation”. Our heartfelt thanks to the personalities for helping us to bring
out this project in a successful manner.

We would like to express our sincere gratitude and hearty thanks to our principal Dr.

M. PAULRAJ, for providing all kind of technological resources to bring out excellence for us.
We express our profound thanks to Dr. R.M.S. PARVATHI, Head of the Department,
Computer Science and Engineering, for extending her help in using all the lab facilities.

We take immense pleasure to thank our guide Mr. S. RAJESH, Assistant Professor,
Department of Computer Science and Engineering, for spending her valuable time in guiding us
and for her constant encouragement through the success of this project.

We express our sincere thanks to our project Co- Coordinator Ms. V. S. ESTHER
PUSHPAM, Assistant professor, Department of Computer Science and Engineering for being
supportive during our project.

Finally, we would like to express our heartfelt thanks to our beloved parents for their
blessing, our friends for their help and wishes for the successful completion of this project.

ii
APPROVAL AND DECLARATION

This project report titled EMPLOYEE ATTENDANCE MANAGEMENT SYSTEM


was prepared and submitted by S. NIRMAL KUMAR (1802072), R. ROSINI
(1802091) and has been found satisfactory in terms of scope, quality and presentation
as partial fulfillment of the requirement for the Bachelor of Engineering (Computer
Science) in Sri Ramakrishna Institute of Technology, Coimbatore (SRIT).

Checked and Approved by

Mr. S. Rajesh
Project Supervisor
Assistant Professor CSE

Department of Computer Science and Engineering


Sri Ramakrishna Institute of Technology, Coimbatore-10

November, 2021

iii
EMPLOYEE ATTENDANCE MANAGEMENT SYSTEM

ABSTRACT

The purpose of Employee Attendance System Using QR Code is to automate the existing
manual system by the help of computerized equipments and full-fledged computer software,
fulfilling their requirements, so that their valuable data/information can be stored for a longer
period with easy accessing and manipulation of the same. The required software and hardware
are easily available and easy to work with. Employee Attendance System Using QR Code, as
described above, can lead to error free, secure, reliable and fast management system. It can
assist the user to concentrate on their other activities rather to concentrate on the record
keeping. Thus it will help organization in better utilization of resources. The organization can
maintain computerized records without redundant entries. That means that one need not be
distracted by information that is not relevant, while being able to reach the information. The
aim is to automate its existing manual system by the help of computerized equipments and
full-fledged computer software, fulfilling their requirements, so that their valuable
data/information can be stored for a longer period with easy accessing and manipulation of
the same. Basically the project describes how to manage for good performance and better
services for the clients. The aim of this system is to save time and work in better manner. It
help employee to concentrate only on their duties. Also, it helps company or organization to
grow their business.

iv
TABLE OF CONTENTS

TITLE PAGE NO
ACKNOWLEDGMENT ii
APPROVAL AND DECLARATION iii
ABSTRACT iv
TABLE OF CONTENTS v
LIST OF FIGURES vii
LIST OF SYMBOLS, ABBREVIATIONS AND NOMENCLATURE viii

CHAPTER 1 INTRODUCTION
1.1 Background History 1
1.2 Application 1
1.3 Problem Statement 2
1.4 Objective 2
1.5 Scope of the project 2

CHAPTER 2 LITERATUTE SURVEY 3

CHAPTER 3 METHODOLOGY 6
3.1 Modules and design
3.2 Specific Requirements 7
3.2.1 Functional requirements 7
3.2.2 Non-Functional requirements 8
3.2.3 External Interface requirements 9
3.2.4 Performance requirements 9

v
3.2.5 Design Constrain 10
3.2.6 Software System Attributes 11
3.3 Database Design 10
CHAPTER 4 SYSTEM DESIGN 11
4.1 Use Case Diagram 11
4.2 Class diagram 11
4.3 Sequence Diagram 12
4.4 Activity Diagram 13

CHAPTER 5 RESULT AND DISCUSSIONS 16


5.1 Home page 16
5.2 Admin login 17
5.3 Dashboard 18

CHAPTER 6 CONCLUTION 19
6.1 Summary 19
6.2 Recommendations for future project 21

REFERENCES 22

APPENDICES 23

vi
LIST OF FIGURES

Figure No. Title Page No

3.1 Waterfall Model 6

4.0 Use case diagram 12


4.1 Class diagram 12
4.2 Sequence diagram 13
4.3 State chart diagram 14
4.4 Activity diagram 15

vi
LIST OF SYMBOLS, ABBREVIATIONS OR NOMENCLATURE

SQL Structured Query Language

PHP Hyper Text Processor

CSS Cascading Style Sheets

HTML Hyper Text Markup Language

vi
CHAPTER 1

INTRODUCTION

1.1 Background History


The "Employee Attendance System Using QR Code" has been developed to override the
problems prevailing in the practicing manual system. This software is supported to eliminate and
in some cases reduce the hardships faced by this existing system. Moreover this system is
designed for the particular need of the company to carry out operations in a smooth and effective
manner.

1.2 Application

The application is reduced as much as possible to avoid errors while entering the data. It
also provides error message while entering invalid data. No formal knowledge is needed for
the user to use this system. Thus by this all it proves it is user-friendly. Employee Attendance
System Using QR Code , as described above, can lead to error free, secure, reliable and fast
management system. It can assist the user to concentrate on their other activities rather to
concentrate on the record keeping. Thus it will help organization in better utilization of
resources.

Every organization, whether big or small, has challenges to overcome and managing the
information of Attendance, Employee, Leave, Records, Holidays. Every Employee Attendance
System has different Employee needs, therefore we design exclusive employee management
systems that are adapted to your managerial requirements. This is designed to assist in strategic
planning, and will help you ensure that your organization is equipped with the right level of
information and details for your future goals. Also, for those busy executive who are always on
the go, our systems come with remote access features, which will allow you to manage your
workforce anytime, at all times. These systems will ultimately allow you to better manage
resources.

1
1.3 Problem statement

The manual process of taking attendance is a time consuming and inefficient way. The project aims to
automate the process and give a user-friendly and more efficient way. Attendance Management
System is software developed for daily student attendance in schools, colleges and institutes. It
facilitates to access the attendance information of a particular employee in an organisation.
Development of a Smart Based Attendance System. Integrating Android device with QR code and
SQL to store attendance results. Analyzing the attendance on weekly and monthly basis.

1.4 Objective

The main objective of the Project on Employee Attendance System is to manage the details of
Employee, Attendance, Timings, Leave, Holidays. It manages all the information about Employee,
Records, Holidays, Employee. The project is totally built at administrative end and thus only the
administrator is guaranteed the access. The purpose of the project is to build an application program to
reduce the manual work for managing the Employee, Attendance, Records, Timings. It tracks all the
details about the Timings, Leave, Holidays.

1.5 Scope of the project

It may help collecting perfect management in details. In a very short time, the collection will be
obvious, simple and sensible. It will help a person to know the management of passed year perfectly
and vividly. It also helps in current all works relative to Employee Attendance System . It will be also
reduced the cost of collecting the management & collection procedure will go on smoothly.
Our project aims at Business process automation, i.e. we have tried to computerize various processes
of Employee Attendance System .

2
• In computer system the person has to fill the various forms & number of copies of the forms
can be easily generated at a time.
• In computer system, it is not necessary to create the manifest but we can directly print it,
which saves our time.
• To assist the staff in capturing the effort spent on their respective working areas.
• To utilize resources in an efficient manner by increasing their productivity through
automation.
• The system generates types of information that can be used for various purposes.
• It satisfy the user requirement
• Be easy to understand by the user and operator
• Be easy to operate
• Have a good user interface
• Be expandable
• Delivered on schedule within the budget.

Project Category:

Relational Database Management System (RDBMS) : This is an RDBMS based project which is
currently using MySQL for all the transaction statements. MySQL is an opensource RDBMS System .

Brief Introduction about RDBMS :

A relational database management system (RDBMS) is a database management system (DBMS) that is
based on the relational model as invented by E. F. Codd, of IBM's San Jose Research Laboratory. Many
popular databases currently in use are based on the relational database model. RDBMSs have become a
predominant choice for the storage of information in new databases used for financial records,
manufacturing and logistical information, personnel data, and much more since the 1980s. Relational
databases have often replaced legacy hierarchical databases and network databases because they are
easier to understand and use. However, relational databases have been challenged by object databases,
which were introduced in an attempt to address the object-relational impedance mismatch in relational
database,XMLdatabases.

3
CHAPTER 2

LITERATURE SURVEY

“ Gamassi, m., piuri, v., sana, d., scotti, f., scotti, "scalable distributed biometric systems-
advanced techniques for security and safety", ", instrumentation & measurement magazine,
ieee, on page(s): 21 - 28 volume: 9. ” There are many existing systems available in market for
authentication. In some organization biometric devices are used, since biometric is concern with
the measurement of unique human physiological or behavioral characteristics. The technology had
been used to verify the identity of user.

“ Fakhreddine Karray, Jamil Abou Saleh, Mo Nours Arab and Milad Alemzadeh, DzMulti
Modal Biometric Systems: A State of the Art Survey,dz Pattern Analysis and Machine
Intelligence Laboratory, University of Waterloo, Waterloo, CanadaR. Nicole, DzTitle of
paper with only first word capitalized,dz J. Name Stand. Abbrev., in press. ”Another option is
a facial recognition technique. Use of facial recognition technology is to monitor authenticated
user or employee. A neural network-based algorithm was implemented to carry out face detection
and Eigen face method to perform facial recognition. The experimental result demonstrates the
feasibility of user verification for high-level security information system. It is complicated process
as well as very expensive.

“Ching-yin Law, Simon so,dzQR Codes in Educationdz, Hong Kong Institute of Education,
HongKong.” As one more technique is available, manual registration of each and every employee.
It is very time consuming as well as hectic task to manage all this things. So to overcome this
problem we proposed a system which totally works on QR code based identity card.

“Kalyani Bhagwat, Priyanka Salunkhe, Shamal Bangar, DzEmployee Monitoring System


Using Android SmartPhone” In many institutions and organization the attendance is important.
The previous approach in which manually taking attendance and maintain its records was very
inconvenient task.

“Phanuphong Hathaiwichian, DzAndroid Application for Event Management and


Information Propagationdz, Mahidol University, Nakhonpathom, Thailand.” Another
Approach is Biometric device, using biometric device like fingerprint scanner, in which fingerprint
is capture by user interface, which is likely to be an optical, solid state or an ultrasound sensor.
Generally, there are two approaches for fingerprint verification system among them first one is

4
minutiae based technique, in which minutiae has represented by ending or termination. Another is
imaging based method or matching pattern, which take account of global feature of any fingerprint
image. This method is more useful than the first one because it solved some intractable problem of
method one.

“Ricciardi, S. , Santos-Boada, G. , Careglio, D. , Palmieri. ,DzEvaluating energy savings in


WOL-enabled networks of PCsdz, U.Industrial Electronics (ISIE), 2013 IEEE International
Symposium on Year: 2013.” After scanning the QR code based identity card with second scanner
employee attendance will be updated in database, display name of employee who are currently
absent in the absent employee list and employee's personal computer will be started with the help
of Wake on LAN (WOL).

“Yilmaz, Y.S., Aydin, B.I., DzGoogle cloud messaging (GCM): An evaluationdz


Communications” WOL has enabled computers essentially wait for a Dzmagic packetdz to arrive
that includes the NIC’s MAC address in it. These magic packet are sent out by professional
software made for any platform, but can also be sent by routers and internet-based websites.

“Popa, M., Slavici, T., DzEmbedded server with Wake on LAN[ function” T.EUROCON
2009, EUROCON '09. IEEE Year: 2009” Wake-on-LAN is an industry standard protocol for
waking computers up from a very low power mode remotely. The definition of low power mode
has changed a bit over time, but we can take it to mean while the computer has Dzoffdz and has
access to a power source. The protocol also allows for a supplementary Wake-onWireless-LAN
ability as well. WOL has depends on two things: motherboard and network card. Motherboard
must be hooked up to an ATX-compatible power supply it has most computers in the past decade.
Ethernet or wireless card must also support this functionality.

“Fadi Masalha, Nael Hirzallah, DzA Student Attendance System Using QR Codedz, Applied
Science University” Various parameters of QR Code are as follows: Received data parameters,
size parameters, char setsource parameters, char set-target parameters, bgcolor parameters, color
parameters, margin parameters, zone parameters, format parameters. In data parameters minimal
char count, maximal char count, best practice and the size parameters contain the format of QR
code, maximal and minimal size of QR code.

5
CHAPTER 3

METHODOLOGY

We have used Iterative and Incremental Development model (IID) for our project development. This
development approach is also referred to as Iterative Waterfall Development approach. Iterative and
Incremental Development is a software development process developed in response to the more
traditional waterfall model. This model is designed to take care of such big project. The large and
complicate project chiefly demand better development and testing procedure. The waterfall model is
well known for its repeated testing process. Hence I choose the waterfall model for developing my
software.

Figure 3.1 Waterfall Model

Some advantages of waterfall model:


• Simple and easy to understand and use.
• Easy to manage due to the rigidity of the model.
• Phases are processed and completed one at a time
• Works well for smaller projects where requirements are very well understood

3.1 MODULES AND DESIGN

The entire project consists of modules, which are,

• Employee Management Module: Used for managing the Employee details.

• Holidays Module : Used for managing the details of Holidays

• Records Module : Used for managing the details of Records

• Attendance Management Module: Used for managing the information and details of the
6
Attendance.

• Timings Module : Used for managing the Timings details

• Leave Module : Used for managing the Leave information

• Login Module: Used for managing the login details

• Users Module : Used for managing the users of the system

3.2 Specific requirements


3.2.1 Functional requirements
There are a lot of software requirements specifications included in the functional requirements
of the Employee Attendance Management System, which contains various process, namely
Registration, Report Generation, and Database.

Registration Process
Adding Employee: The Employee Attendance Management enables the employee to
include new into the system.
Report Generation

• It generates the report on Employee, Attendance, Records


• Provide filter reports on Timings, Leave, Holidays
• You can easily export PDF for the Employee,Records, Leave
• Application also provides excel export for Attendance, Timings, Holidays
• You can also export the report into csv format for Employee, Attendance, Holidays

Database

• Mandatory Employee Information: Every employee has some necessary data like phone
number, their first and last name, personal health number, postal code, country, address,
city, 'employee's ID number, etc.

• Updating information of the Employee: The employee management system enables


users to update the information of the employee as described in the mandatory
information included.

7
3.2.2 Non-Functional requirements

There are a lot of software requirements specifications included in the non-functional


requirements of the Hospital Management System, which contains various process, namely
Security, Performance, Maintainability, and Reliability.

Security:

● Eployee Identification: The system needs the employee to recognize herself or himself
using the phone.

● Logon ID: Any users who make use of the system need to hold a Logon ID and password.

● Modifications: Any modifications like insert, delete, update, etc. for the database can be
synchronized quickly and executed only by the ward administrator.

● Administrator rights: The administrator can view as well as alter any information in the
Employee Attendance Management System.

Performance:

● Response Time: The system provides acknowledgment in just one second once the
employee’s information is checked.

● Capacity: The system needs to support at least 1000 employee at once.

● User-Interface: The user interface acknowledges within five seconds.

● Conformity: The system needs to ensure that the guidelines of the Microsoft accessibilities are
followed.

Maintainability:

● Back-Up: The system offers the efficiency for data back up.

● Errors: The system will track every mistake as well as keep a log of it.

Reliability:

● Availability: The system is available all the time.

8
3.2.3 External Interface Requirements
User Interfaces:

The software provides good graphical interface for the user any administrator can operate on
the system, performing the required task such as create, update, viewing the details of the
patient.

Hardware Interfaces:

Operating system: Windows 10 , Windows7, Linux

Hard disk: 20 GB

RAM: 128 MB

Processor: Pentium III 630 MHz

Software Interfaces:

Php 2 Runtime Environment

Any of Mozilla, Opera, Chrome etc

MS SQL server

Communications Interfaces:

Window

3.2.4 Performance Requirements:

Performance requirements define acceptable response times for system functionality.


The load time for user interface screens shall take no longer than two seconds.
The log in information shall be verified within five seconds.
Queries shall return results within five seconds.

3.2.5 Design Constraints

The Employee Attendance Management System shall be a stand-alone system


running in a Windows environment. The system shall be developed using c#, html,
css, bootstrap, JQuery, Ajax, Razor syntax, and an Access or MS-SQL database.

9
3.2.6 Software system requirements:

OS: Windows 10, Windows7, Linux


Disk Storage: 20 GB
Internet: Internet connection required with 1mbps.

3.3 Database design

Database design is the process of producing a detailed data model of database. This data model
contains all the need logical and physical design choices and physical storage parameters needed
to generate a design in a data definition language, which can then be used to create a database. A
fully attributed data model contains detailed attributes for each entity. The term database design
can be used to describe many different part of the design of an overall database system.
Principally, and most correctly, it can be thought of as the logical design of the base data structure
used to store the data. In the relational model these are the tables and views. In an object database
the entities and relationships map directly to object classes and named relationships. However,
the term database design could also be used to apply to the overall process of designing, not just
the base data structure, but also the forms and queries used as part of the overall database
application within the database management system.

10
CHAPTER 4

SYSTEM DESIGN

4.1 Use case diagram

Figure 4.1 Use case diagram

4.2 Class diagram

11
Figure 4.2 class diagram

4.3 Sequence diagram

Figure 4.3 Sequence diagram

12
4.4 Activity diagram

Figure 4.5 Activity diagram

Testing Process Used Employee Attendance System Using QR Code

• All the fields such as Employee, Timings, Holidays are validated and does not take invalid values
• Each form for Employee, Attendance, Records can not accept blank value fields
• Avoiding errors in data
• Controlling amount of input
• Integration of all the modules/forms in the system.
• Preparation of the test cases.
• Preparation of the possible test data with all the validation checks.
• Actual testing done manually.
• Recording of all the reproduced errors.
• Modifications done for the errors found during testing.
• Prepared the test result scripts after rectification of the errors.
• Functionality of the entire module/forms.
• Validations for user input.
• Checking of the Coding standards to be maintained during coding.
• Testing the module with all the possible test data.
• Testing of the functionality involving all type of calculations etc.
• Commenting standard in the source files.

13
The steps in the software testing:

• Preparation of the test cases.


• Preparation of the possible test data with all the validation checks.
• Complete code review of the module. d. Actual testing done manually.
• Modifications done for the errors found during testing.
• Prepared the test result scripts.

The unit testing done included the testing of the following items:

• Functionality of the entire module/forms.


• Validations for user input.
• Checking of the Coding standards to be maintained during coding.
• Testing the module with all the possible test data.
• Testing of the functionality involving all type of calculations etc.
• Commenting standard in the source files.
After completing the Unit testing of all the modules, the whole system is integrated with all its
dependencies in that module. While System Integration, We integrated the modules one by one and
tested the system at each step. This helped in reduction of errors at the time of the system testing.

The steps involved during System testing are as follows:

• Integration of all the modules/forms in the system.


• Preparation of the test cases.
• Preparation of the possible test data with all the validation checks.
• Actual testing done manually.
• Recording of all the reproduced errors.
• Modifications done for the errors found during testing.
• Prepared the test result scripts after rectification of the errors.

The System Testing done included the testing of the following items:

• Functionality of the entire system as a whole.


• User Interface of the system.
• Testing the dependent modules together with all the possible test data scripts.
• Verification and Validation testing.
• Testing the reports with all its functionality.
After the completion of system testing, the next following phase was the Acceptance Testing. Clients at
their end did this and accepted the system with appreciation. Thus, we reached the final phase of the
project delivery.

There are other six tests, which fall under special category:

• Peak Load Test: It determines whether the system will handle the volume of activities that occur
when the system is at the peak of its processing demand. For example, test the system by
activating all terminals at the same time.
• Storage Testing: It determines the capacity of the system to store transaction data on a disk or in
14
other files.
• Performance Time Testing: it determines the length of time system used by the system to process
transaction data. This test is conducted prior to implementation to determine how long it takes to
get a response to an inquiry, make a backup copy of a file, or send a transmission and get a
response.
• Recovery Testing: This testing determines the ability of user to recover data or re-start system
after failure. For example, load backup copy of data and resume processing without data or
integrity loss.
• Procedure Testing: It determines the clarity of documentation on operation and uses of system by
having users do exactly what manuals request. For example, powering down system at the end of
week or responding to paper-out light on printer.
• Human Factors Testing: It determines how users will use the system when processing data or
preparing reports.

15
CHAPTER 5

RESULTS AND DISCUSSION

5.1 Home page

This is the home page of the project. The users (Admin,) can login from this page. It has features
like login, Active employees, Total employees ,Inactive employees and contact. Admin can
login using this page .

16
5.2 Admin l

This is the Admin login page of the web application. Only Admin can work in this page. Admin can

check all the details regarding available employees data.

17
18
5.3 Dashboard

This is the dashboard of the web application. This employee dashboard provides a detailed description
of theinformation available in the company.

19
CHAPTER 6

CONCLUSION

6.1 Summary

Our project EMPLOYEE ATTENDANCE MANAGEMENT SYSTEM is only a


humble venture to satisfy the needs to manage their project work. Several user friendly
coding have also adopted. This package shall prove to be a powerful package in satisfying all
the requirements of the school. The objective of software planning is to provide a frame work
that enables the manger to make reasonable estimates made within a limited time frame at the
beginning of the software project and should be updated regularly as the project progresses.

6.2 Recommendations for future project

In a nutshell, it can be summarized that the future scope of the project circles
around maintaining information regarding:
• We can add printer in future.
• We can give more advance software for Employee Attendance System Using
QR Code including more facilities
• We will host the platform on online servers to make it accessible worldwide
• Integrate multiple load balancers to distribute the loads of the system
• Create the master and slave database structure to reduce the overload of the
database queries
• Implement the backup mechanism for taking backup of codebase and
database on regular basis on different servers
The above mentioned points are the enhancements which can be done to increase
the applicability and usage of this project. Here we can maintain the records of Employee and
Attendance. Also, as it can be seen that now-a-days the players are versatile, i.e. so there is a
scope for introducing a method to maintain the Employee Attendance System Using QR
Code. Enhancements can be done to maintain all the Employee, Attendance, Timings, Leave,
Holidays. We have left all the options open so that if there is any other future requirement in
the system by the user for the enhancement of the system then it is possible to implement
them.In the last we would like to thanks all the persons involved in the development of the
20
system directly or indirectly. We hope that the project will serve its purpose for which it is
develop there by underlining success of process.

21
REFERENCES

Anupindi R, Chopra S, Deshmukh S, Miegham JAV, Zemel E. Managing business


process flows (2005) Principles of operations management. Englewood Cliffs, NJ:
Prentice Hall.
Praveen K.A and Gomes L.A. (2006). A Study of the Hospital Information System
(HIS) In the Medical Records Department of a Tertiary Teaching Hospital,Journal
of the Academy of Hospital Administration, Vol. 18, No. 1 .
Michael R. Neuman, Gail D. Baura, Stuart Meldrum,OrhanSoykan, Max E.
Valentinuzzi. (2012). Advances in Medical Devices and Medical Electronics, Vol.
100.
Bell EJ, Takhar SS, Beloff JR, Schuur JD, Landman AB.( 2013) Information
technology improves emergency department patient discharge instructions
completeness and performance on a national quality measure: A quasi-
experimental study. Applied Clinical Informatics,Pg: 499–515.
National Informatics Centre (2013). E – Hospital management solution. Accessed
from: http://tsu.trp.nic.in/ehospital/images/e-hospital_brochure.pdf
Armstrong N, Herbert G, Aveling EL, Dixon-Woods M, Martin G.(2013)
Optimizing patient involvement in quality improvement. Health Expectations, E36–
E47.
Rashmi A.Nimbalkar, R.A. Fadnavis.(2014).Domain Specific Search Of Nearest
Hospital And Health care Management System .
Anhang Price R, Elliott MN, Zaslavsky AM, Hays RD, Lehrman WG, Rybowski
L, Edgman-Levitan S, Cleary PD. (2014) Examining the role of patient experience
surveys in measuring health care quality. Medical Care Research and Review. Pg:
522–554.
Darshana Shah, AdityaBakshi (2017). REVIEW ON HOSPITAL
MANAGEMENT SYSTEM, International Journal of Research in Science &
Engineering Volume: 1 Special Issue: 1.

WEB REFERENCES

1. www.google.com
2. www.htmlcodetutorial.com

22
APPENDICES

SQL CODE

Table structure for table `attendance`


CREATE TABLE `attendance`
(`id` int(11) NOT NULL,
`empid`int(11)NOTNULL ,
`attdate` varchar(10) NOT NULL,
`attstatus` varchar(1) NOT NULL,
`createdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP)
ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- Table structure for table `users`


--

CREATE TABLE `users` (


`id` int(11) NOT NULL,
`username` varchar(250) NOT NULL,
`password` varchar(500) NOT NULL,
`usertype` varchar(1) NOT NULL COMMENT '0 - admin, 1 - users',
`active` varchar(1) NOT NULL COMMENT '1 - active, 0 - inactive',
`createdate` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

PHP CODE

define('ENVIRONMENT', isset($_SERVER['CI_ENV']) ? $_SERVER['CI_ENV'] : 'development');


Switch (ENVIRONMENT)
{
case 'development':
error_reporting(-1);
ini_set('display_errors', 1);
break;

case 'testing':
case 'production':
ini_set('display_errors', 0);
if (version_compare(PHP_VERSION, '5.3', '>='))
{
error_reporting(E_ALL & ~E_NOTICE & ~E_DEPRECATED & ~E_STRICT &
~E_USER_NOTICE & ~E_USER_DEPRECATED);
}
else
{
error_reporting(E_ALL & ~E_NOTICE & ~E_STRICT & ~E_USER_NOTICE);
}
break; 23
default:
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'The application environment is not set correctly.';
exit(1); // EXIT_ERROR
}

$system_path = 'system';

$application_folder = 'application';

$view_folder = '';

if (defined('STDIN'))
{
chdir(dirname(__FILE__));
}

if (($_temp = realpath($system_path)) !== FALSE)


{
$system_path = $_temp.DIRECTORY_SEPARATOR;
}
else
{
// Ensure there's a trailing slash
$system_path = strtr(
rtrim($system_path, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
).DIRECTORY_SEPARATOR;
}

define('SELF', pathinfo(__FILE__, PATHINFO_BASENAME));

define('BASEPATH', $system_path);

define('FCPATH', dirname(__FILE__).DIRECTORY_SEPARATOR);

define('SYSDIR', basename(BASEPATH));

if (is_dir($application_folder))
{
if (($_temp = realpath($application_folder)) !== FALSE)
{
$application_folder = $_temp;
}
else
{
$application_folder = strtr(
rtrim($application_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
}
}
elseif (is_dir(BASEPATH.$application_folder.DIRECTORY_SEPARATOR))
{
$application_folder = BASEPATH.strtr(
trim($application_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
24
}
else
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your application folder path does not appear to be set correctly. Please
open the following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}

define('APPPATH', $application_folder.DIRECTORY_SEPARATOR);
if ( ! isset($view_folder[0]) && is_dir(APPPATH.'views'.DIRECTORY_SEPARATOR))
{
$view_folder = APPPATH.'views';
}
elseif (is_dir($view_folder))
{
if (($_temp = realpath($view_folder)) !== FALSE)
{
$view_folder = $_temp;
}
else
{
$view_folder = strtr(
rtrim($view_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
}
}
elseif (is_dir(APPPATH.$view_folder.DIRECTORY_SEPARATOR))
{
$view_folder = APPPATH.strtr(
trim($view_folder, '/\\'),
'/\\',
DIRECTORY_SEPARATOR.DIRECTORY_SEPARATOR
);
}
else
{
header('HTTP/1.1 503 Service Unavailable.', TRUE, 503);
echo 'Your view folder path does not appear to be set correctly. Please open the
following file and correct this: '.SELF;
exit(3); // EXIT_CONFIG
}

define('VIEWPATH', $view_folder.DIRECTORY_SEPARATOR);

BASEPATH.'core/CodeIgniter.php';

25
26

You might also like