Online Timesheet

This is an all-electronic bi-weekly timesheet system designed to track employee hours. It features auto-calulating hours entry for employee time accuracy. The timesheet may be printed or electronically submitted. Supervisor approvals and administrative staff reporting are also electronic. The technologies leveraged are PHP and MySQL.

5/25/12: Version 3.5.0 released.

Download Code

See Development for descriptions of the versions.

3.5.0 (ZIP)

1.9.1 (PHP)
1.9.0 (PHP)
1.8.0 (PHP)
1.7.0 (PHP)
1.6.0 (PHP)
1.5.0 (PHP)
1.4.0 (PHP)
1.3.0 (PHP)
1.2.0 (PHP)

History

This project was originally commissioned by the Department of Political Science. The goal was to transition the bi-weekly employee timekeeping from paper to digital. This was to save HR staff time, reduce calculation errors, improve reporting, and give supervisors increased accountability. A globally available timesheet would enable sheets to be filled out off campus and brought in. There would no longer be a bottle neck at acquiring a specific form from the front office.

Other methods were looked at including an excel template, fillable PDF forms, and stand-alone programs. It was decided that a fillable, printable web form would offer the most access, ease of usability, ease of programmability, and the least amount of potential client requirements.

When a PHP version was graciously supplied by my friend Jason Lockhart, PHP was decided as the technology of choice. This was my first major PHP project.

Department use was discontinued in the autumn of 2010, due to the adoption of a university wide solution.

Development

The timesheet has already undergone many versions as functionality was added.

Revisions (Public)

With version 3.5.0, the timesheet is designed to be customized with a variety of settings. Effort is made for easy installation and configuration. More thought is given to those who may not have access to the database itself.

3.5.0 - Extensive code rewrite for simplicity. New configuration file to allow quick customizations of settings. Administrative staff can now control account creation of requested accounts (previously handled by database admin). Administrative staff can update user's information (name, id, record, email address) in addition to the employee being able to update these themselves. Email addresses now stored in the database rather than calculated based on username and a known domain name. This allows for use of email addresses from any domain. The idea of Federal Work Study employees converted to 'limited funds' employees. Migration of all database table access to views and functions for database security. Increased error checking. Almost all error messages now centralized in the custom error function for ease of changing the displayed message.

Revisions (Merged)

With version 3.0.0, both the part-time and full-time timesheets have been merged into a single page that auto-detects and displays the appropriate type.

3.1.2 v2 - Work study hours left form entry changed from hours to dollar amount to reflect the new way information is given to us by Federal Work Study. Administrators can now modify an employee's supervisor. Now testing with Safari 4.

Administrative Summary Page

3.1.2 - The pay rate is now controlled by the administrative staff and cannot be changed by the user. Rates are saved with timesheets as a historical record and a change in rate is applied at the next creation of a timesheet. Accordingly a new updating form has been created for administrative staff to enter pay rate changes. The supervisor view has been delayed two days after the end of a pay period (Sunday and Monday) so that by default it will display the pay period just completed for approvals. This is for ease of use. Database permissions have been adjusted and restricted. An administrative report has been developed, to be automatically emailed to the DB admin, containing a log summary of notable events. Minor updates to page style and display. Now testing with IE 8.

Timesheet 3.1.2 Index Page

Administrative Summary Page

3.1.1 - Full-time leave codes displayed for reference, these were printed in version 2 and are now added back. Created a database function for updating user info (more secure). Created a report to show which employees have been inactive for the last two or three pay periods. This report can be viewed in the administrative staff section. A message was added on the supervisor summary page to indicate if no employees have saved timesheets for the displayed pay period. Additional contact information is also given. Minor updates to page style and display. Now testing with IE 8 beta.

Timesheet 3.1.1 Index Page

Employee Page

Supervisor Summary Page

Supervisor Summary With No Timesheets

3.1.0 - Changed hoursleft to float to record down to hundredth of an hour; added change info page where students can change their name, id, record in a more sensible location; changed hoursentry, supervisor summary, admin summary to sort alphabetically by username (last name); modified automatic emailing so that it can be turned off for selected users; now testing with Safari 3.2; email notification for employee submission, supervisor denial

3.0.2 - Put as much database credentials as possible into one function for ease of directing the app from one database to another during upgrades or migrations. Added the OSU favicon. Added a message to user if login failed due to too many attempts. Added automatic email messaging to supervisor when employee submits a timesheet for approval.

3.0.1 - Developed first version of front page, separate login pages, supervisor summary and review pages, and staff summary and review pages. Brought timesheet system up to the complete design specifications of the version 3 design files. In addition to the original design files: added staff entry field to track when entered into HR system, added warnings and tracking of available work study hours, added links to email employees or supervisors. Now testing with Firefox 3.

Supervisor Summary Page

Supervisor Review Page

Staff Summary Page

Staff Review Page

3.0.0 - Migrated code to various functions, encapsulated much of the work for less need to rewrite code between pages (database connection, calculations, form printing). Began migration of user time entry page to the new database design.

Revisions (Full-time with Leave)

A version for bi-weekly full time employees has also been designed. It takes leave such as sick or vacation time into account. It has one less time block to make room as full time employees generally only clock out for lunch.

2.1.4 - Migrated Timesheet version 2.1.4 changes. Added error checking in the case where sick and vacation time conflict with normal hour entry, i.e. any combination of them add up to more than eight hours. Added error checking for leave codes being used without hours filled in. More intelligent highlighting of errors. Code clean up for time calculation, name and id error checking. Added more error messages for errors detected. Fixed bug where a three letter leave code could not be used. Fixed bug to allow decimals in sick and vacation time values.

Timesheet Full 2.1.4

Timesheet Full Errors

2.1.1 - Renumbered for consistency with Timesheet. Migrated Timesheet version 2.1.1 changes

1.0.1 - Migrated Timesheet version 2.0.1 changes and pay period discovery from a table as in Timesheet version 2.0.0

1.0.0 - Modified Timesheet version 2.0.0 to include columns for Sick and Vacation time. Removed one hour block for layout contraints

Revisions (Part-time)

2.1.5 - Removed employee ID error checking for 9 versus 8 digit length. New employee IDs can be 9 digits starting with any number and 8 digit numbers are still being retained.

2.1.4 - Tightened up code for security by bounding input using php in addition to maxlength in html. Passwords now stored in the database using SHA-256.

2.1.3 - Changed error checking to display error code for time entries which add up to more than 8 hours in a day. Now testing with Safari 3.1.

2.1.2 - Adapted to allow for 8 or 9 digit ID numbers, according to new ID rules. Error checking for time entries which add up to more than 24 hours in a day.

Timesheet 2.1.2

2.1.1 - Added user password encryption via PHP crypt.

2.1.0 - Changed authorization method from Basic web authentication to MySQL table of stored usernames / passwords. This is so that compromised accounts will not gain any access to the web server, just the timesheet. It does not even grant access to a MySQL account other than the generic one with limited privileges being used by the timesheet. Designed new login page to accompany.

Timesheet Login Page

2.0.1 - Added Change button next to pay period drop down box for interface usability.

2.0.0 - Added MySQL database support for the ability to save information from pay periods to be edited or printed later. Pay periods calculated from database table instead of hardcoded array, this allows easy year end additions without the need for code changes.

1.9.1 - Modified pay period calculations to allow for crossing a fiscal year (period 26 -> period 1).

Timesheet 1.9.1

1.9.0 - Added record number box, pay period number printing, recoded time calculations to be based on a hard coded pay period date array, added error checking for pay periods out-of-bounds.

1.8.0 - Improved error checking on employee id, now checks if mistakenly entered SSN or mistyped a digit twice. Added a Print button to print directly from the page.

1.7.0 - Changed "Calc Hours" button to "Save For Printing" to reflect new purpose. Added more direct usage notes.

1.6.0 - Added error checking for non-numeric values, errors highlighted in red. Added employee id box and comment box. Made name and employee id boxes required.

Timesheet 1.6.0

1.5.0 - Added name box. Error checking for invalid hour/minute value and midnight rollover with warning messages. Added testing with Safari 2.0.4.

Timesheet 1.5.0

1.4.0 - Changed drop down to calculate pay periods dynamically and automatically set to the current one. Now displays three previous, current, and two future pay periods based on today's date. Changed logo to match Department website.

1.3.0 - Converted pay period entry to a hard-coded drop down list. Added more color and style using official University web colors. Testing with both IE 7 and Firefox 2.0.

Timesheet 1.3.0

1.2.0 - Added Sunday, Saturday, and pay period following the previous design. Added auto calculating dates based on one provided by the user in mm/dd/yyy format. Added signature lines for employee and supervisor at printing.

Timesheet 1.2.0