Jump to content

PHP Time Calculation


whsjr86

Recommended Posts

No I do not have any code I have written so far. This is an idea a friend and I came up with for an event we're running at our college and I'm a php noobie, so I was looking here for some help. Any kind of contribution would be greatly appreciated.
Link to comment
Share on other sites

I created a simple timeclock system awhile back that I can get you the code for tonight. Basically I just built a MySQL table that held user info, such as username/password/department/etc. Then I built a table that stored an auto_ID, employee_ID which referenced the user table, timestamp column, a column for whether it was a clock in or clock out (0 or 1) and a column for calculated time worked. I think all I did was have two links (one for clock-in, one for clock-out) that access a script checking the last entry for that employee and if they were trying to clock in and it already showed them logged in, it would pass them back with an error message saying that they had already logged in, else it would record the timestamp. When they clocked out, it checked to ensure that they weren't already clocked out, and if not, store the timestamp and calculate the time worked. The admin panel pulled the sum of the time worked for the employee, and period specified. You could also include a column in the employee table for payrate and calculate the employees check taking into account overtime.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.