Guys I need your help please
the code below reads off the DB a DateTime Field and gets the Time only as HH:MM
here is the code:
$countDay = 0;
while ($countDay < 14) {
$count = 0;
mysql_data_seek($result_Clock, 0);
while($row = mysql_fetch_object($result_Clock)){
if ($row->TimeValue != "") {
list($this_date,$this_time) = explode(" ", $row->TimeValue);
list($this_hour,$this_minute,$this_second) = explode(":", $this_time);
if (date_format($row->TimeValue) == $CellDate[$countDay]) {
$DailyTime[$countDay][$count] = $this_hour . ":" . $this_minute;
echo "DailyTime[$countDay][$count] ---" . $DailyTime[$countDay][$count] . "\n";
$count = $count + 1;
} } }
echo "<HR>";
$countDay = $countDay + 1;
}
it works perfect but I need to calculate the hours worked for each day
please help
The echo statment will view this:
DailyTime[1][0] ---08:00
DailyTime[1][1] ---13:00
DailyTime[1][2] ---14:00
DailyTime[1][3] ---17:00
DailyTime[3][0] ---08:00
DailyTime[3][1] ---13:00
DailyTime[3][2] ---14:00
DailyTime[3][3] ---17:00
DailyTime[4][0] ---08:00
DailyTime[4][1] ---13:00
DailyTime[4][2] ---14:00
DailyTime[4][3] ---17:00
etc ...
sorry for the long code but I realy need help I'm stuck in this for a long time.
:roll: