include ("../common/public.php") ;
if ($_POST["anno"] != "")
$GLOBALS["anno"] = $_POST["anno"] ;
$query = " select count(*) as totordini from ordini where Anno = $anno" ;
$db->query($query) ;
while ($db->next_record())
$totordini = $db->f("totordini") ;
$str = "" ;
$dbt = new FC_SQL ;
$totfornitori = 0 ;
$qf = "
select
*
from
fornitori
where
(attivo = '1') or
(attivo = '0' and AnnoDisattivazione > $anno)
order by
Nome
" ;
$db->query($qf) ;
while ($db->next_record())
{
$totfornitori ++ ;
$totf = 0 ;
$id = $db->f("IdFornitori") ;
$dbt->query("select count(*) as totf from ordini where idfornitore = $id and Anno = $anno") ;
while ($dbt->next_record())
{
$item[0][] = $db->f("Nome") ;
$item[1][] = $dbt->f("totf") ;
$item[2][] = $id ;
}
}
for ($i=0; $i<$totfornitori; $i++)
{
if ($totordini > 0)
$percf = @nfp($item[1][$i] * 100 / $totordini) ;
else
$percf = @nfp(0) ;
$str .= "| " . htmlspecialchars($item[0][$i]) . " | " . $item[1][$i] . " | $percf |
" ;
}
$str .= "" ;
$header = "NOME FORNITORE,NUMERO ORDINI, % ORDINI" ;
$strSort = "str,int,int" ;
$iniWP = "40,10,10" ;
$setColType = "ro,ro,ro" ;
$setColAlign = "left,center,center" ;
?>
echo TITLE ?>
| |
Ordini per Fornitore |
Ordini per Fornitore per Mese |
|
Numero Fornitori: echo $totfornitori ?>
(per selezionare un fornitore clicca sulla riga corrispondente)