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
https://forums.phpfreaks.com/topic/219637-time-clock-time-worked/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.