dolibarr  16.0.5
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)) {
48  $varlink = '?'.$varlink;
49  }
50 
51  $head = array();
52 
53  $h = 0;
54  $head[$h][0] = $_SERVER["PHP_SELF"].$varlink;
55  $head[$h][1] = $langs->trans("Report");
56  $head[$h][2] = 'report';
57 
58  print '<form method="POST" action="'.$_SERVER["PHP_SELF"].$varlink.'">'."\n";
59  print '<input type="hidden" name="token" value="'.newToken().'">'."\n";
60 
61  print dol_get_fiche_head($head, 'report');
62 
63  foreach ($moreparam as $key => $value) {
64  print '<input type="hidden" name="'.$key.'" value="'.$value.'">'."\n";
65  }
66 
67  print '<table class="border tableforfield centpercent">'."\n";
68 
69  $variante = ($periodlink || $exportlink);
70 
71  // Ligne de titre
72  print '<tr>';
73  print '<td width="150">'.$langs->trans("ReportName").'</td>';
74  print '<td>';
75  print $reportname;
76  print '</td>';
77  if ($variante) {
78  print '<td></td>';
79  }
80  print '</tr>'."\n";
81 
82  // Calculation mode
83  if ($calcmode) {
84  print '<tr>';
85  print '<td width="150">'.$langs->trans("CalculationMode").'</td>';
86  print '<td>';
87  print $calcmode;
88  if ($variante) {
89  print '<td></td>';
90  }
91  print '</td>';
92  print '</tr>'."\n";
93  }
94 
95  // Ligne de la periode d'analyse du rapport
96  print '<tr>';
97  print '<td>'.$langs->trans("ReportPeriod").'</td>';
98  print '<td>';
99  if ($period) {
100  print $period;
101  }
102  if ($variante) {
103  print '<td class="nowraponall">'.$periodlink.'</td>';
104  }
105  print '</td>';
106  print '</tr>'."\n";
107 
108  // Ligne de description
109  print '<tr>';
110  print '<td>'.$langs->trans("ReportDescription").'</td>';
111  print '<td>'.$description.'</td>';
112  if ($variante) {
113  print '<td></td>';
114  }
115  print '</tr>'."\n";
116 
117  // Ligne d'export
118  print '<tr>';
119  print '<td>'.$langs->trans("GeneratedOn").'</td>';
120  print '<td>';
121  print dol_print_date($builddate, 'dayhour');
122  print '</td>';
123  if ($variante) {
124  print '<td>'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'</td>';
125  }
126  print '</tr>'."\n";
127 
128  print '</table>'."\n";
129 
130  print dol_get_fiche_end();
131 
132  print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
133 
134  print '</form>';
135  print '<br>';
136 
137  print "\n<!-- end banner of report -->\n\n";
138 }
dol_print_date
dol_print_date($time, $format='', $tzoutput='auto', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
Definition: functions.lib.php:2514
dol_get_fiche_head
dol_get_fiche_head($links=array(), $active='', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='', $morecss='', $limittoshow=0, $moretabssuffix='')
Show tabs of a record.
Definition: functions.lib.php:1822
dol_get_fiche_end
dol_get_fiche_end($notab=0)
Return tab footer of a card.
Definition: functions.lib.php:2018
report_header
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41