473,484 Members | 1,596 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Array help

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
1 1612

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
906
by: point | last post by:
Hi there.. I have the folowing array => property = hexonet => property = 2003-12-01 18:46:20.0 => property = hexonet => property = 2003-12-02 02:59:15.0 => property = hexonet =>...
2
1551
by: Antti Nummiaho | last post by:
Consider the following javascript: var temp = new Array(new Array(0)) document.writeln(temp) temp = new Array(new Array(0,1)) document.writeln(temp) One would assume that it would print "0...
8
2090
by: Gactimus | last post by:
I made the program below. It outputs the smallest number in the array. What I would like to know is how do I output the array location. I am at a loss. For example, since the smallest number in...
7
25145
by: ritchie | last post by:
Hi all, I am new to this group and I have question that you may be able to help me with. I am trying to learn C but am currently stuck on this. First of all, I have a function for each sort...
5
2185
by: ritchie | last post by:
Hi, I am writing to ask if anyone can see why my array is not being sorted correctly? It's an array of 4 elements(ints 1,2,3,4) but after calling the selection sort it comes back sorted as...
8
10675
by: intrepid_dw | last post by:
Hello, all. I've created a C# dll that contains, among other things, two functions dealing with byte arrays. The first is a function that returns a byte array, and the other is intended to...
3
8876
by: George | last post by:
Sub ExcelToListBox() Dim xRange As Object Dim ary Dim xValue As String xRange = oXL.Range("A1:A9") 'has letters A-H ary = xRange.value xValue = ary(3, 1) 'xValue = C...
3
3718
by: inkexit | last post by:
I need help figuring out what is wrong with my code. I posted here a few weeks ago with some code about creating self similar melodies in music. The coding style I'm being taught is apparently a...
23
7363
by: sandy | last post by:
I need (okay, I want) to make a dynamic array of my class 'Directory', within my class Directory (Can you already smell disaster?) Each Directory can have subdirectories so I thought to put these...
5
1544
by: fluk | last post by:
Hi Guys, I hope someone can help me with this, because i'm getting crazy to find a good way to do that! This is what I got by querying a db. $arr1 = array("site", "description", "area1" ,...
0
7082
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
6953
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7105
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6813
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7214
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5407
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
3041
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
592
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
235
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.