Formatage html
This commit is contained in:
parent
71e43ecdc2
commit
36a82f99d8
@ -1,5 +1,5 @@
|
|||||||
<?PHP
|
<?PHP
|
||||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or modify
|
* This program is free software; you can redistribute it and/or modify
|
||||||
@ -105,77 +105,84 @@ for ($mois = 1 ; $mois < 13 ; $mois++)
|
|||||||
print "<td>".strftime("%B",mktime(1,1,1,$mois,1,2000))."</td>";
|
print "<td>".strftime("%B",mktime(1,1,1,$mois,1,2000))."</td>";
|
||||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||||
{
|
{
|
||||||
$casenow = strftime("%Y-%m",mktime());
|
$casenow = strftime("%Y-%m",mktime());
|
||||||
$case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee));
|
$case = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee));
|
||||||
$caseprev = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee-1));
|
$caseprev = strftime("%Y-%m",mktime(1,1,1,$mois,1,$annee-1));
|
||||||
|
|
||||||
// Montant CA
|
|
||||||
|
// Valeur CA
|
||||||
|
|
||||||
print '<td align="right">';
|
print '<td align="right">';
|
||||||
if ($cum[$case])
|
if ($cum[$case])
|
||||||
{
|
{
|
||||||
print price($cum[$case]);
|
print price($cum[$case],1);
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
if ($case <= $casenow) { print '0'; }
|
{
|
||||||
else { print ' '; }
|
if ($case <= $casenow) { print '0'; }
|
||||||
|
else { print ' '; }
|
||||||
}
|
}
|
||||||
print "</td>";
|
print "</td>";
|
||||||
// Pourcentage evol
|
// Pourcentage evol
|
||||||
if ($cum[$caseprev]) {
|
if ($cum[$caseprev]) {
|
||||||
if ($case <= $casenow) {
|
if ($case <= $casenow) {
|
||||||
if ($cum[$caseprev])
|
if ($cum[$caseprev])
|
||||||
print '<td align="center">'.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'%</td>';
|
print '<td align="center">'.(round(($cum[$case]-$cum[$caseprev])/$cum[$caseprev],4)*100).'%</td>';
|
||||||
else
|
else
|
||||||
print '<td align="center">+Inf%</td>';
|
print '<td align="center">+Inf%</td>';
|
||||||
}
|
|
||||||
else {
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
if ($case <= $casenow) {
|
|
||||||
print '<td align="center">-</td>';
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
print '<td> </td>';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if ($case <= $casenow) {
|
||||||
|
print '<td align="center">-</td>';
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
$total[$annee]+=$cum[$case];
|
$total[$annee]+=$cum[$case];
|
||||||
}
|
}
|
||||||
|
|
||||||
print '</tr>';
|
print '</tr>';
|
||||||
}
|
}
|
||||||
|
|
||||||
// Affiche total
|
// Affiche total
|
||||||
print "<tr><td align=\"right\"><b>Total :</b></td>";
|
print "<tr><td align=\"right\"><b>Total :</b></td>";
|
||||||
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
for ($annee = $year_start ; $annee <= $year_end ; $annee++)
|
||||||
{
|
{
|
||||||
print "<td align=\"right\"><b>".($total[$annee]?$total[$annee]:" ")."</b></td>";
|
print "<td align=\"right\"><b>".($total[$annee]?$total[$annee]:" ")."</b></td>";
|
||||||
|
|
||||||
// Pourcentage evol
|
// Pourcentage evol
|
||||||
if ($total[$annee-1]) {
|
if ($total[$annee-1]) {
|
||||||
if ($annee <= $year_current) {
|
if ($annee <= $year_current) {
|
||||||
if ($total[$annee-1])
|
if ($total[$annee-1])
|
||||||
print '<td align="center"><b>'.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'%</b></td>';
|
print '<td align="center"><b>'.(round(($total[$annee]-$total[$annee-1])/$total[$annee-1],4)*100).'%</b></td>';
|
||||||
else
|
else
|
||||||
print '<td align="center">+Inf%</td>';
|
print '<td align="center">+Inf%</td>';
|
||||||
}
|
}
|
||||||
else {
|
else
|
||||||
print '<td> </td>';
|
{
|
||||||
}
|
print '<td> </td>';
|
||||||
} else {
|
}
|
||||||
if ($annee <= $year_current) {
|
}
|
||||||
print '<td align="center">-</td>';
|
else
|
||||||
}
|
{
|
||||||
else {
|
if ($annee <= $year_current)
|
||||||
print '<td> </td>';
|
{
|
||||||
}
|
print '<td align="center">-</td>';
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
print '<td> </td>';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
|
|
||||||
print "</table>";
|
print "</table>";
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user