* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ require("./pre.inc.php"); /* * Sécurité accés client */ if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } llxHeader(); $year = $_GET["year"]; $mesg = ''; print_fiche_titre('Statistiques des factures '.$year, $mesg); print ''.($year-1).' - '; print ''.($year + 1).''; /* * * */ $stats = new FactureStats($db, $socidp); $dir = DOL_DOCUMENT_ROOT; //////////////////////// $data = $stats->getNbByMonth($year); $filev = "/document/images/facture$year.png"; $px = new BarGraph($data); $px->SetMaxValue($px->GetMaxValue()); $px->SetWidth(500); $px->SetHeight(280); $px->draw($dir.$filev, $data, $year); ///// $res = $stats->getAmountByMonth($year); $data = array(); for ($i = 1 ; $i < 13 ; $i++) { $data[$i-1] = array(strftime("%b",mktime(12,12,12,$i,1,$year)), $res[$i]); } $file_amount = "/document/images/factureamount$year.png"; $px = new BarGraph($data); $px->SetYLabel("Montant"); $px->SetMaxValue($px->GetAmountMaxValue()); $px->SetWidth(500); $px->SetHeight(250); $px->draw($dir.$file_amount, $data, $year); $res = $stats->getAverageByMonth($year); $data = array(); for ($i = 1 ; $i < 13 ; $i++) { $data[$i-1] = array(strftime("%b",mktime(12,12,12,$i,1,$year)), $res[$i]); } $file_avg = "/document/images/factureaverage$year.png"; $px = new BarGraph($data); $px->SetYLabel("Montant moyen"); $px->SetMaxValue($px->GetAmountMaxValue()); $px->SetWidth(500); $px->SetHeight(250); $px->draw($dir.$file_avg, $data, $year); print '
| Nombre par mois | '; print '';
print ' |
| Sommes | '; print '';
print ' |
| Montant moyen | '; print '';
print ' |