RecuperaDati($query) ; for($i=0; $i<$n; $i++) { if (! array_key_exists($d['IdFornitori'][$i], $arrVal)) $arrVal[$d['IdFornitori'][$i]] = array('Nome' => $d['Nome'][$i]) ; $arrVal[$d['IdFornitori'][$i]][$d['Mese'][$i]] += $d['TotOrdini'][$i] ; $totaleMese[$d['Mese'][$i]] += $d['TotOrdini'][$i] ; $totaleFornitore[$d['IdFornitori'][$i]] += $d['TotOrdini'][$i] ; } $granTotale = 0 ; $str = "" ; foreach($arrVal as $idFornitore => $arrValSF) // while(list($idFornitore, $arrValSF) = each($arrVal)) { $str .= "" ; $str .= "" . htmlspecialchars($arrValSF['Nome']) . "" ; for ($mese=1; $mese<=12; $mese++ ) { if (array_key_exists($mese, $arrValSF)) $str .= "" . $arrValSF[$mese] . "" ; else $str .= "0" ; } $str .= "" . $totaleFornitore[$idFornitore] . "" ; $granTotale += $totaleFornitore[$idFornitore] ; $str .= "" ; } $str .= "" ; $header = "FORNITORE,GEN,FEB,MAR,APR,MAG,GIU,LUG,AGO,SET,OTT,NOV,DIC,TOTALE" ; $footer = "TOTALE:," . $totaleMese[1] . "," . $totaleMese[2] . "," . $totaleMese[3] . "," . $totaleMese[4] . "," . $totaleMese[5] . "," . $totaleMese[6] . "," . $totaleMese[7] . "," . $totaleMese[8] . "," . $totaleMese[9] . "," . $totaleMese[10] . "," . $totaleMese[11] . "," . $totaleMese[12] . "," . $granTotale ; $strSort = "str,int,int,int,int,int,int,int,int,int,int,int,int,int" ; $iniWP = "30,5,5,5,5,5,5,5,5,5,5,5,5,10" ; $setColType = "ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro,ro" ; $setColAlign = "left,center,center,center,center,center,center,center,center,center,center,center,center,center" ; ?> New Document
  Ordini per Fornitore Ordini per Fornitore per Mese  
Numero Fornitori: (clicca sulla casella di un mese per vedere la lista degli ordini)