Going Nuts with this array.
My goal is to have a time system report on delinquent time that looks like
this.
Tom Doe
To*@workplace.com.
Entered: 0
Hour(s) on: 2005-02-02
Entered: 0
Hour(s) on: 2005-02-01
*****************
Jane Doe
ja**@workplace.com.
Entered: 0
Hour(s) on: 2005-02-02
Entered: 0
Hour(s) on: 2005-02-03
>>>>>>>>>>>>>>>>>>
What I'm getting is this
Ja**@workplace.com.
You have entered insufficient time on:
Employee: Jane Doe
Entered: 0
Hour(s) on: 2005-02-01
To*@workplace.com.
You have entered insufficient time on:
Employee: Tom Doe
Entered: 0
Hour(s) on: 2005-02-01
Ha***@workplace.com.
You have entered insufficient time on:
Employee: Harry Doe
Entered: 0
Hour(s) on: 2005-02-02
Ja**@workplace.com.
You have entered insufficient time on:
Employee: Jane Doe
Entered: 0
Hour(s) on: 2005-02-02
To*@workplace.com.
You have entered insufficient time on:
Employee: Tom Doe
Entered: 0
Hour(s) on: 2005-02-02
>>>>>>>>>>>>>>>>>>
My code after the sql returns is:
while($row = $result->fetchRow(DB_FETCHMODE_ASSOC)) {
$email = $row['EmployeeID'] . "@workplace.com";
$firstname=$row['FirstName'];
$lastname=$row['LastName'];
$fullname = $row['FirstName'] . " ". $row['LastName'];
$duration=$row['Duration'];
$day=$row['_Date'];
// if they have entered less than 8 hours, push them into
reporting array
if ($duration < 8){
// send report to offending individual
$individualNotice["$email"] = array();
array_push($individualNotice["$email"], " Employee: " . $fullname, "
Entered: " . $duration, " Hour(s) on: " . $day, "\n");
foreach( $individualNotice as $email=>$infos )
{
echo ' <li><b>'.$email."</b>.<br />\n";
echo " You have entered insufficient time on: </li>\n";
echo " <ul>\n";
$infos; // sorts the list of info
foreach( $infos as $info )
{
echo $info . '<br>';
}
echo " </ul>\n";
}
echo "</ol>\n";
}
Any help would be greatly appreciated.
Thanks in advance!
BZ