Attendance and Payroll System using PHP/MySQLi Source Code

Language

This is a simple Attendance and Payroll System using PHP and MySQLi-OOP as DB driver. It has attendance on the client-side and payroll on the admin side. This system is written in pure PHP with no framework so it is understandable to beginners.

*Submitted: 02-2-18

*Last Updated: 12-01-20 (tested in PHP version 7.2.33)

Features:

  • CRUD - Employee Attendance
  • CRUD - Employee
  • Employee Cash Advance
  • Employee Overtime
  • Employee Schedule
  • Payroll on Date Range
  • Payslip on Date Range

Plugins:

  • AdminLTE
  • TCPDF library

Installation

  1. Download the source code using the Download button below.
  2. Extract the downloaded file to your localhost folder ex. htdocs for XAMMP.
  3. Import the included .sql file which is the database of the system. If you have no idea how to import, please refer to my tutorial on How import .sql file to restore MySQL database.
  4. After a successful import, open the extracted folder and open conn.php in both the root folder and in admin/includes folder. Edit the database name in the connection depending on the name of database you created in importing the included .sql file.

Accessing the Admin

You can access the admin side by adding /admin/. You should be able to navigate to the admin login page.

You can then use the below admin credential:

Username: nurhodelta

Password: password

That's it. You should now be able to run the simple system :)

Installation and System Feature Demo Video

If you have any suggestions, comments, or reactions, feel free to comment below or message me.

Happy Coding :)

*Updates: 05-21-18

  1. Fixed dynamic buttons (edit, delete, etc ) not functioning on page2 or more of the table.
  2. Fixed time in showing late even on time.

*Updates: 12-1-20

  1. Fixed dynamic buttons (edit, delete, etc ) on page2 or more of the table.

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. After downloading it, you will need a program like Winzip to decompress it.

Virus note: All files are scanned once-a-day by SourceCodester.com for viruses, but new viruses come out every day, so no prevention program can catch 100% of them.

FOR YOUR OWN SAFETY, PLEASE:

1. Re-scan downloaded files using your personal virus checker before using it.
2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

Comments

Field 'status' doesn't have a default value

Hi. I downloaded and wanted to explore this system but i cant login as admin..i used username and pswd in the database and even tried changing several times but it keeps saying incorrect pswd on the admin login page. Pls help

Hi there. After adding employees or positions and even the attendance..after going to the next page..the edit and delete buttons dont work from the second page. Kindly advise

Just change the button for edit and delete.. For edit: $(document).on('click', '.edit', function(e){ e.preventDefault(); ///the codes here }); For delete $(document).on('click', '.delete', function(e){ e.preventDefault(); ///the codes here }); Same goes for other dynamic buttons

Hey. Thanks so much, your earlier feedback worked perfectly for the edit and delete buttons. What should i do about the employee sign in..its now not working or submiting emp id. Ua help will be appreciated.

Hi. When i make changes say with the edit and delete buttons from page 2 onwards, the page always reloads to the first page. How can i make it to remain on the current page after changes. Thank u

Hi. The system doesnt record overtime unless i add it manually. Can it reflect automatically? Pls advise

How can i change the index/login page background color(currently grey-ish) to cover image and which file do i need to go to. Regards

Hello. I would like for the employee to be able to login using employee_id and passwd. Employee would be able to view his/her details e.g, attendance records of himself/herself,deductions, cash advance,schedule and position. How do i address this pls help

This system is useless without user mode, I suggest that when the user is login it will only see his/ her information.

How would i change the background image of the index pages. Please help. Great system by the way.

Fatal error: Call to undefined function password_verify() in C:\wamp\www\Downloaded Projects\apsystem_0\apsystem\admin\login.php on line 17 Call Stack # Time Memory Function Location 1 0.0000 147984 {main}( ) ..\login.php:0

In reply to by Norshami (not verified)

Fatal error: Call to undefined function password_verify() in C:\wamp\www\Downloaded Projects\apsystem_0\apsystem\admin\login.php on line 17 I am also facing this error

hi,kindly help me with the full documentation of this project.

Hi, i ran the code in wamp server but the page it viewed is only the employee login asking only two fields time-in or time-out and employee id.when i clicked on the sign-in option it showed "Time - in: 'and the name'" nothing else happened .So what should i have to do to run this project........ pls reply me....

This is the error i get wen logging in as an administrator pls help Fatal error: Call to undefined function password_verify() in C:\wamp\www\apsystem\admin\login.php on line 17

In reply to by Bashir Babatun… (not verified)

Use Php version 5.5.0 to avoid the problem

great information i received on this site.

Thank you for the best source code. How to set width for modal?

How do I make the punch in and out details shown in same page as punch page? So, user can see their punch in and out details on the spot. It is like the punch section on the top of page and the details at the bottom of page.

Hi, how can i run this source code? where? can you help me?

In reply to by Path path (not verified)

Have xammp installed on your machine After you unzip the file, go to C drive Open xammp file, scroll down to htdc Pu the files you downloaded in that folder Open your browser. Type http://127.0.0.1/phpMyAdmin/. Create database and name it after the name given from the database provided. Import database from the folder located in htdocs. Thus it You can now simply point the browser to the url/path of the app

Hi neovic, I was eager to learn PHP dashboard concept but all tutorials i followed were not this much elaborated. It's very rare to find very good hearts like you in this world and I am taking this opportunity to thank you and may triple gems bless you and your family. Please do send me your email to [email protected]. With Best Regards, Manoj Perera

Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\htdocs\apsystem_0\apsystem\tcpdf\tcpdf.php on line 17778 TCPDF ERROR: Some data has already been output, can't send PDF file

How can the system calculate the overtime

Hi, When I Customized the html modal form and the length of the script is to long. When I clicked the value button of modal it doesn't show but when removed temporarily the other includes php modals html script it show the modal form

Hi I encountered error when i tried to print Payslip, hoping for your positive feedback. Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in D:\SkyLeigH\htdocs\apsystem\tcpdf\tcpdf.php on line 17778 Warning: chr() expects parameter 1 to be int, string given in D:\SkyLeigH\htdocs\apsystem\tcpdf\include\tcpdf_fonts.php on line 1671 TCPDF ERROR: Some data has already been output, can't send PDF file

Hello, i hope someone still watches the comments here. When i try to log in as admin using the credentials offered here i get "Connection failed: Connection timed out" all the time, what could be the issue?

Sir, I had uploaded this System on my server, everything is working good but the 2 things I am facing that, the system is taking check-in time Wrong, and automatically taking checkout time, please fix this asap, I want to use this system in my office for employees

Hi can you help me how to fix on time and late not showing? thank you

<strong><h4>Manupilate the entire  document through this method</h4></strong>
<strong>1 </strong>Open the employee.php file using any text editor.
<strong>2</strong> Change the script inside the function

<strong>instead of getting one page</strong>
  $('.edit').click(function(e){
    e.preventDefault();
    $('#edit').modal('show');
    var id = $(this).data('id');
    getRow(id);
  });

<strong>Use the document query js.
</strong> $(document).on('click', '.edit', function(e){
    e.preventDefault();
    $('#edit').modal('show');
    var id = $(this).data('id');
    getRow(id);
  });

Hi, when i click on payslip button it generates this error from this page payslip_generate.php Warning: "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in C:\xampp\htdocs\apsyste\tcpdf\tcpdf.php on line 17778 Warning: chr() expects parameter 1 to be int, string given in C:\xampp\htdocs\apsyste\tcpdf\include\tcpdf_fonts.php on line 1671 TCPDF ERROR: Some data has already been output, can't send PDF file

hi sir i want to open admin but is saying that "The requested URL was not found on this server." how can i fixed this?

Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\htdocs\apsyste\tcpdf\tcpdf.php on line 16893 while using payroll button

The included tcpdf codes in the system are now deprecated. instead download the latest in github and replace the original tcpdf folder. It will run as-is just replace the old files.

Fatal error: Array and string offset access syntax with curly braces is no longer supported in C:\xampp\htdocs\apsyste\tcpdf\tcpdf.php on line 16893

Just delete the tcpdf folders and replace it with this https://github.com/tecnickcom/TCPDF just extract it and rename it to tcpdf. Big thanks to you sir nurhodelta_17

Add new comment