Ajout totaux
This commit is contained in:
parent
9686c908f3
commit
06f1ddeeb0
@ -43,6 +43,7 @@ $h++;
|
|||||||
|
|
||||||
$year = strftime("%Y",time());
|
$year = strftime("%Y",time());
|
||||||
$total = 0;
|
$total = 0;
|
||||||
|
$var = True;
|
||||||
dolibarr_fiche_head($head, $hselected, "Distributeurs");
|
dolibarr_fiche_head($head, $hselected, "Distributeurs");
|
||||||
|
|
||||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||||
@ -88,14 +89,15 @@ $sql = "SELECT sum(valeur),legend FROM ".MAIN_DB_PREFIX."telephonie_stats";
|
|||||||
$sql .= " WHERE graph = 'distributeur.gain.mensuel'";
|
$sql .= " WHERE graph = 'distributeur.gain.mensuel'";
|
||||||
$sql .= " GROUP BY legend DESC";
|
$sql .= " GROUP BY legend DESC";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
$total = 0;
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_row($resql))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]><td>".$row[1].'</td>';
|
print "<tr $bc[$var]><td>".$row[1].'</td>';
|
||||||
print '<td align="right">'.price($row[0]).'</td></tr>';
|
print '<td align="right">'.price($row[0]).'</td></tr>';
|
||||||
|
$total += $row[0];
|
||||||
|
$var=!$var;
|
||||||
}
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
@ -103,6 +105,8 @@ else
|
|||||||
{
|
{
|
||||||
print $db->error() . ' ' . $sql;
|
print $db->error() . ' ' . $sql;
|
||||||
}
|
}
|
||||||
|
print "<tr $bc[$var]><td>Total</td>";
|
||||||
|
print '<td align="right">'.price($total).'</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
print '</td></tr><tr><td valign="top" width="70%">';
|
print '</td></tr><tr><td valign="top" width="70%">';
|
||||||
@ -117,28 +121,31 @@ $sql = "SELECT valeur,legend FROM ".MAIN_DB_PREFIX."telephonie_stats";
|
|||||||
$sql .= " WHERE graph = 'distributeur.commission.mensuel'";
|
$sql .= " WHERE graph = 'distributeur.commission.mensuel'";
|
||||||
$sql .= " GROUP BY legend DESC";
|
$sql .= " GROUP BY legend DESC";
|
||||||
$resql = $db->query($sql);
|
$resql = $db->query($sql);
|
||||||
|
$total = 0;
|
||||||
if ($resql)
|
if ($resql)
|
||||||
{
|
{
|
||||||
while ($row = $db->fetch_row($resql))
|
while ($row = $db->fetch_row($resql))
|
||||||
{
|
{
|
||||||
$var=!$var;
|
|
||||||
print "<tr $bc[$var]><td>".$row[1].'</td>';
|
print "<tr $bc[$var]><td>".$row[1].'</td>';
|
||||||
print '<td align="right">'.price($row[0]).'</td></tr>';
|
print '<td align="right">'.price($row[0]).'</td></tr>';
|
||||||
|
$total += $row[0];
|
||||||
|
$var=!$var;
|
||||||
}
|
}
|
||||||
$db->free();
|
$db->free();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
print $db->error() . ' ' . $sql;
|
print $db->error() . ' ' . $sql;
|
||||||
}
|
}
|
||||||
print '</table>';
|
print "<tr $bc[$var]><td>Total</td>";
|
||||||
|
print '<td align="right">'.price($total).'</td></tr>';
|
||||||
|
print '</table>';
|
||||||
|
|
||||||
|
|
||||||
print '</td></tr>';
|
print '</td></tr>';
|
||||||
print '</table>';
|
print '</table>';
|
||||||
|
|
||||||
$db->close();
|
$db->close();
|
||||||
|
|
||||||
|
|
||||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user