dolibarr  9.0.0
month.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
3  * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net>
4  *
5  * This program is free software; you can redistribute it and/or modify
6  * it under the terms of the GNU General Public License as published by
7  * the Free Software Foundation; either version 3 of the License, or
8  * (at your option) any later version.
9  *
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  */
18 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/expedition/class/expeditionstats.class.php';
28 require_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
29 
30 $year = GETPOST('year', 'int');
31 
32 
33 /*
34  * View
35  */
36 
37 llxHeader();
38 
41 
42 $mesg = '';
43 
44 print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$year, $mesg);
45 
46 $stats = new ExpeditionStats($db);
47 $data = $stats->getNbExpeditionByMonth($year);
48 
49 dol_mkdir($conf->expedition->dir_temp);
50 
51 $filename = $conf->expedition->dir_temp."/expedition".$year.".png";
52 $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=expeditionstats&file=expedition'.$year.'.png';
53 
54 $px = new DolGraph();
55 $mesg = $px->isGraphKo();
56 if (! $mesg)
57 {
58  $px->SetData($data);
59  $px->SetMaxValue($px->GetCeilMaxValue());
60  $px->SetWidth($WIDTH);
61  $px->SetHeight($HEIGHT);
62  $px->SetYLabel($langs->trans("NbOfOrders"));
63  $px->SetShading(3);
64  $px->SetHorizTickIncrement(1);
65  $px->SetPrecisionY(0);
66  $px->draw($filename,$fileurl);
67 }
68 
69 print '<table class="border" width="100%">';
70 print '<tr><td align="center">Nombre d expedition par mois</td>';
71 print '<td align="center">';
72 print $px->show();
73 print '</td></tr>';
74 print '</table>';
75 
76 // End of page
77 llxFooter();
78 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:56
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id='', $morecssontable='', $morehtmlcenter='')
Load a title with picto.
GETPOST($paramname, $check='none', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
print
Draft customers invoices.
Definition: index.php:91
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
llxHeader()
Empty header.
Definition: wrapper.php:44
Class to build graphs.
dol_mkdir($dir, $dataroot='', $newmask=null)
Creation of a directory (this can create recursive subdir)
Class to manage shipment statistics.