By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,776 Members | 1,400 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,776 IT Pros & Developers. It's quick & easy.

Array help

P: n/a
Hello all!

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

Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a

"ZMAN" <vz******@verizon.net> wrote in message
news:VUTOd.24672$uc.17602@trnddc09...
Hello all!

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


Use an ORDER BY clause to sort the results from the query by name first,
then print out the name/email only when it's different from the current one.
Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.