Click here to Skip to main content
14,603,916 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hello guys,

I'm thinking of building an overtime system for my company using PHP and MySQL and would like some help from you guys regarding translating the Overtime rate formula into PHP language.

The Formula looks like this :

if the worker works on range time of
6 a.m to 10p.m - the rate should be:
total claim hours = hours of working * 1.125

else
if she/he works from 10pm to 6am, - the rate should be:
total claim hours = hours of working * 1.25

example : I am using two select list of time which allow the user to choose start and
and end time.
Let say the user choose start time as 12am and end time 8am
hours of working should be = 8 hours
but the calculation need to be done in both rate
6 hours * 1.25 (this is for 12am to 6am) = 7.50
2 hours * 1.125 (this is for 6am to 8am) = 2.25

so the total hours claim should be = 7.50 + 2.25
= 9.75
can any one help me with this?
thank you .
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

Here[^] would be a good place to start.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100