dolibarr  13.0.2
report.lib.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (C) 2008-2012 Laurent Destailleur <eldy@users.sourceforge.net>
3  * Copyright (C) 2012 Regis Houssin <regis.houssin@inodbox.com>
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  * or see https://www.gnu.org/
18  */
19 
41 function report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink = '', $moreparam = array(), $calcmode = '', $varlink = '')
42 {
43  global $langs;
44 
45  print "\n\n<!-- start banner of report -->\n";
46 
47  if (!empty($varlink)) $varlink = '?'.$varlink;
48 
49  $head = array();
50 
51  $h = 0;
52  $head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
53  $head[$h][1] = $langs->trans("Report");
54  $head[$h][2] = 'report';
55 
56  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].$varlink.'">'."\n";
57  print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
58 
59  print dol_get_fiche_head($head, 'report');
60 
61  foreach ($moreparam as $key => $value)
62  {
63  print '<input type="hidden" name="'.$key.'" value="'.$value.'">'."\n";
64  }
65 
66  print '<table class="border tableforfield centpercent">'."\n";
67 
68  $variante = ($periodlink || $exportlink);
69 
70  // Ligne de titre
71  print '<tr>';
72  print '<td width="150">'.$langs->trans("ReportName").'</td>';
73  print '<td>';
74  print $reportname;
75  print '</td>';
76  if ($variante) print '<td></td>';
77  print '</tr>'."\n";
78 
79  // Calculation mode
80  if ($calcmode)
81  {
82  print '<tr>';
83  print '<td width="150">'.$langs->trans("CalculationMode").'</td>';
84  print '<td>';
85  print $calcmode;
86  if ($variante) print '<td></td>';
87  print '</td>';
88  print '</tr>'."\n";
89  }
90 
91  // Ligne de la periode d'analyse du rapport
92  print '<tr>';
93  print '<td>'.$langs->trans("ReportPeriod").'</td>';
94  print '<td>';
95  if ($period) print $period;
96  if ($variante) print '<td class="nowraponall">'.$periodlink.'</td>';
97  print '</td>';
98  print '</tr>'."\n";
99 
100  // Ligne de description
101  print '<tr>';
102  print '<td>'.$langs->trans("ReportDescription").'</td>';
103  print '<td>'.$description.'</td>';
104  if ($variante) print '<td></td>';
105  print '</tr>'."\n";
106 
107  // Ligne d'export
108  print '<tr>';
109  print '<td>'.$langs->trans("GeneratedOn").'</td>';
110  print '<td>';
111  print dol_print_date($builddate, 'dayhour');
112  print '</td>';
113  if ($variante) print '<td>'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'</td>';
114  print '</tr>'."\n";
115 
116  print '</table>'."\n";
117 
119 
120  print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
121 
122  print '</form>';
123  print '<br>';
124 
125  print "\n<!-- end banner of report -->\n\n";
126 }
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink= '', $moreparam=array(), $calcmode= '', $varlink= '')
Show header of a report.
Definition: report.lib.php:41
print $_SERVER["PHP_SELF"]
Edit parameters.
dol_get_fiche_head($links=array(), $active= '', $title= '', $notab=0, $picto= '', $pictoisfullpath=0, $morehtmlright= '', $morecss= '', $limittoshow=0, $moretabssuffix= '')
Show tabs of a record.
print
Draft customers invoices.
Definition: index.php:89
dol_print_date($time, $format= '', $tzoutput= 'auto', $outputlangs= '', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
dol_get_fiche_end($notab=0)
Return tab footer of a card.