Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Apr 2004
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question TimeclockTimeperiod Listing

    I' creating a timecard, and I am at the point where I am coding the reports. So what I am trying to set up is for a list of all the payperiods Employee X has worked.

    For example:

    Each payperiod begins on Friday and ends on Thurday. So:

    Employee X starts working on May 18 (a Thursday) and is still working in the present, so in theory the script would print the report like this:

    05/12/06 - 05/18/06
    05/19/06 - 05/25/06
    05/26/06 - 06/01/06
    06/02/06 - 06/08/06

    Where every payperiod that has AT LEAST one day worked is displayed. (starts displaying upon first day of work and stops displaying when it reaches the current time. - ie: doesn't show every payperiod for '06 right off the bat)

    The idea behind it of course is to lead to being able to click into a certain payperiod and see the individual days worked in order to make edits and so forth.

    Any help is appreciated.

  • #2
    Regular Coder
    Join Date
    Sep 2005
    Posts
    394
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hrmmm, not 100% sure exactly what you are wanting, but have a look at PHP's date and mktime functions.

    ~Phil~

  • #3
    New Coder
    Join Date
    Apr 2004
    Posts
    80
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi, thanks for the reply. To answer, no its not a question of formatting the time, what I'm asking is how I can get PHP to generate dynamic links starting with the begining of the payperiod and ended with the end of the payperiod.

    For example: We'll say the payperiod is 1 week long, and starts on a June 1 and ends on June 5.

    So now we have the payperiod established. Now lets say Employee A has worked with the company for 3 weeks.

    How can I get PHP to generate the three payperods Employee A has worked?

    It would generate something to this effect:

    Payperiods for Employee A:
    June 05 - June 09
    June 12 - June 16
    June 19 - June 23

    I hope this is easier to understand.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •