task #4450 : Rapport Mensuels

This commit is contained in:
sparkyx 2005-07-27 12:23:00 +00:00
parent b1d823fabb
commit 471a7ae908
3 changed files with 165 additions and 45 deletions

View file

@ -36,23 +36,60 @@ $User->Check();
$Form=new rapport($cn,$_POST['form_id']);
$Form->GetName();
$array=$Form->GetRow( $_POST['from_periode'],
$_POST['to_periode']
);
if ( count($Form->row ) == 0 )
exit;
echo "\"Description\"\t,".
"\"Montant\"\t";
// Step ?
//--
if ( $_POST['p_step'] == 0 )
{
$array=$Form->GetRow( $_POST['from_periode'],
$_POST['to_periode']
);
if ( count($Form->row ) == 0 )
exit;
echo "\"Description\"\t,".
"\"Montant\"\t";
foreach ( $Form->row as $op ) {
foreach ( $Form->row as $op ) {
echo '"'.$op['desc'].'"'."\t,".
sprintf("%8.2f",$op['montant'])."\t".
"\n";
}
}
}
else
{
// Gather all the data
//---
for ($e=$_POST['from_periode'];$e<=$_POST['to_periode'];$e+=$_POST['p_step'])
{
$array[]=$Form->GetRow($e,$e);
$periode_name[]=getPeriodeName($cn,$e);
}
// Display column heading
//--
$x="";
foreach ($array[0] as $e)
{
printf("%s%s",$x,$e['desc']);
$x=";";
}
printf("\n");
// Display value for each line
//--
$a=0;
foreach ($array as $e )
{
print $periode_name[$a];
$a++;
foreach ($e as $elt)
{
printf(";%s",$elt['montant']);
}
printf("\n");
}
}
exit;
?>