Jump to content

Time Clock time worked


The Little Guy

Recommended Posts

I am making a time clock, and I was wondering what is the best way to calculate the number of hours an employee worked?

 

I have a table called "statuses" it holds names of punch types:

- id = the auto_inc

- status = "in/out/break/lunch" text statuses

- paid = whether or not the punch is paid or not (true/false)

 

I have another table called "logging" This table holds the information about the punch type:

- id = the auto_inc

- owner = the member id

- ip = members ip

- inout = the punch type from the statuses table

- location = the city/state of where the punch took place

- date = the time the member punched

 

Maybe I am over thinking this, but what is the best way to calculate the hours a person has worked?

 

Right now I am getting all the punches for for a particular member between a date range. then loop through the data to display it and passing it to a method in a class called Calc. I want to then add the times from punch in to punch out, then the next punch in to punch out.

 

Any suggestions?

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.