Problem in Looping

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
gsairam
Forum Newbie
Posts: 4
Joined: Fri Sep 05, 2008 5:38 am

Problem in Looping

Post by gsairam »

Hi All, :P
Description
For example: Say Mr.X has applied leave for 3days ie.,14.08.2008,15.08.2008,16.08.2008. I have to display the Work hours per day as follows[On Weekly Basis]
Working Hours:
Day : 14 15 16 17 18 19 20
Hrs : 0 0 0 9 9 9 --
*(Since 20 is Saturday the working hours will be --(nill)).
Here I am able to display the above metioned Days & Hrs perfectly in my coding.
Problem Description
But my task is to display 'L' in the Hrs place in the above table.
Since, Mr.X is on leave from 14-16 the coding has to display as follows:
Working Hours
Day : 14 15 16 17 18 19 20
Hrs : L L L 9 9 9 --
Here I am not able to get the above output. How to generate the above output using 'Loops?'.
Please help me. Thankyou one and all in advance.
User avatar
Stryks
Forum Regular
Posts: 746
Joined: Wed Jan 14, 2004 5:06 pm

Re: Problem in Looping

Post by Stryks »

Can you post the code that outputs the part you can get?

It will make it much easier to see how best to apply a solution.

Cheers
Post Reply