All pastes #124227 Raw Edit

Miscellany

public php v1 · immutable
·published 2006-08-09 22:16 UTC
rendered paste body
<?php$j = 1;$total = 0;while($j < count($pickList)) //Loop through rows and carry out actions	{		//Look through array for particular product and add to search terms			if (in_array($pickList[$j][12], $productSearchTerms) == false) # if product not present in list, then add.		{		$productSearchTerms[] = $pickList[$j][12];		$searchKey = array_search($pickList[$j][12], $productSearchTerms);		$productSearchTerms[$searchKey][1] = $pickList[$j][11]; # Pick number		$productSearchTerms[$searchKey][2] = $pickList[$j][14]; # Price		}		//Calculate Individual Product Quantities		if (in_array($pickList[$j][12], $productSearchTerms) == true) 		{		$productSearchTerms[$searchKey][3] += $pickList[$j][13]; # Add quantity of that product.		}		$j++;		}//Display individual product quantities//======================================asort($productSearchTerms);$i=0;while ($i < count($productSearchTerms)){//echo ($i.". ".$productSearchTerms[$i]."<br>");	echo ($i.". ".$productSearchTerms[$i]." | ".$productSearchTerms[$i][1]." | ".$productSearchTerms[$i][3].	" | ".$productSearchTerms[$i][3]*$productSearchTerms[$i][2]."<br>");		$i++;	}?>