dolibarr  7.0.0-beta
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 
31 /*
32  * View
33  */
34 
35 llxHeader();
36 
39 
40 $mesg = '';
41 
42 print load_fiche_titre($langs->trans("StatisticsOfSendings").' '.$_GET["year"], $mesg);
43 
44 $stats = new ExpeditionStats($db);
45 $data = $stats->getNbExpeditionByMonth($_GET["year"]);
46 
47 dol_mkdir($conf->expedition->dir_temp);
48 
49 $filename = $conf->expedition->dir_temp."/expedition".$year.".png";
50 $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=expeditionstats&file=expedition'.$year.'.png';
51 
52 $px = new DolGraph();
53 $mesg = $px->isGraphKo();
54 if (! $mesg)
55 {
56  $px->SetData($data);
57  $px->SetMaxValue($px->GetCeilMaxValue());
58  $px->SetWidth($WIDTH);
59  $px->SetHeight($HEIGHT);
60  $px->SetYLabel($langs->trans("NbOfOrders"));
61  $px->SetShading(3);
62  $px->SetHorizTickIncrement(1);
63  $px->SetPrecisionY(0);
64  $px->draw($filename,$fileurl);
65 }
66 
67 print '<table class="border" width="100%">';
68 print '<tr><td align="center">Nombre d expedition par mois</td>';
69 print '<td align="center">';
70 print $px->show();
71 print '</td></tr>';
72 print '</table>';
73 
74 llxFooter();
75 
76 $db->close();
llxFooter()
Empty footer.
Definition: wrapper.php:58
static getDefaultGraphSizeForStats($direction, $defaultsize='')
getDefaultGraphSizeForStats
load_fiche_titre($titre, $morehtmlright='', $picto='title_generic.png', $pictoisfullpath=0, $id=0, $morecssontable='', $morehtmlcenter='')
Load a title with picto.
llxHeader()
Empty header.
Definition: wrapper.php:46
print
Draft customers invoices.
Definition: index.php:91
Class to build graphs.
dol_mkdir($dir, $dataroot='', $newmask=null)
Creation of a directory (this can create recursive subdir)
Class to manage shipment statistics.