dolibarr  13.0.2
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 <https://www.gnu.org/licenses/>.
17  */
18 
25 require '../../main.inc.php';
26 require_once DOL_DOCUMENT_ROOT.'/reception/class/reception.class.php';
27 require_once DOL_DOCUMENT_ROOT.'/reception/class/receptionstats.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 
40 $HEIGHT = DolGraph::getDefaultGraphSizeForStats('height');
41 
42 $mesg = '';
43 
44 print load_fiche_titre($langs->trans("StatisticsOfReceptions").' '.GETPOST("year", 'int'), $mesg);
45 
46 $stats = new ReceptionStats($db);
47 $data = $stats->getNbReceptionByMonth(GETPOST("year", 'int'));
48 
49 dol_mkdir($conf->reception->dir_temp);
50 
51 $filename = $conf->reception->dir_temp."/reception".$year.".png";
52 $fileurl = DOL_URL_ROOT.'/viewimage.php?modulepart=receptionstats&file=reception'.$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->draw($filename, $fileurl);
66 }
67 
68 print '<table class="border centpercent">';
69 print '<tr><td class="center">Nombre d reception par mois</td>';
70 print '<td class="center">';
71 print $px->show();
72 print '</td></tr>';
73 print '</table>';
74 
75 llxFooter();
76 
77 $db->close();
GETPOST($paramname, $check= 'alphanohtml', $method=0, $filter=null, $options=null, $noreplace=0)
Return value of a param into GET or POST supervariable.
Class to manage reception statistics.
llxHeader()
Empty header.
Definition: wrapper.php:45
load_fiche_titre($titre, $morehtmlright= '', $picto= 'generic', $pictoisfullpath=0, $id= '', $morecssontable= '', $morehtmlcenter= '')
Load a title with picto.
print
Draft customers invoices.
Definition: index.php:89
Class to build graphs.
static getDefaultGraphSizeForStats($direction, $defaultsize= '')
getDefaultGraphSizeForStats
llxFooter()
Empty footer.
Definition: wrapper.php:59
dol_mkdir($dir, $dataroot= '', $newmask=null)
Creation of a directory (this can create recursive subdir)