dolibarr  7.0.0-beta
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@capnetworks.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 <http://www.gnu.org/licenses/>.
17  * or see http://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  if (empty($hselected)) $hselected='report';
46 
47  print "\n\n<!-- start banner of report -->\n";
48 
49  if(! empty($varlink)) $varlink = '?'.$varlink;
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.'">';
57 
58  dol_fiche_head($head, 'report');
59 
60  foreach($moreparam as $key => $value)
61  {
62  print '<input type="hidden" name="'.$key.'" value="'.$value.'">';
63  }
64  print '<table width="100%" class="border">';
65 
66  $variante = ($periodlink || $exportlink);
67 
68  // Ligne de titre
69  print '<tr>';
70  print '<td width="110">'.$langs->trans("ReportName").'</td>';
71  print '<td>';
72  print $reportname;
73  print '</td>';
74  if ($variante) print '<td></td>';
75  print '</tr>';
76 
77  // Calculation mode
78  if ($calcmode)
79  {
80  print '<tr>';
81  print '<td width="110">'.$langs->trans("CalculationMode").'</td>';
82  print '<td>';
83  print $calcmode;
84  if ($variante) print '<td></td>';
85  print '</td>';
86  print '</tr>';
87  }
88 
89  // Ligne de la periode d'analyse du rapport
90  print '<tr>';
91  print '<td>'.$langs->trans("ReportPeriod").'</td>';
92  print '<td>';
93  if ($period) print $period;
94  if ($variante) print '<td>'.$periodlink.'</td>';
95  print '</td>';
96  print '</tr>';
97 
98  // Ligne de description
99  print '<tr>';
100  print '<td>'.$langs->trans("ReportDescription").'</td>';
101  print '<td>'.$description.'</td>';
102  if ($variante) print '<td></td>';
103  print '</tr>';
104 
105  // Ligne d'export
106  print '<tr>';
107  print '<td>'.$langs->trans("GeneratedOn").'</td>';
108  print '<td>';
109  print dol_print_date($builddate, 'dayhour');
110  print '</td>';
111  if ($variante) print '<td>'.($exportlink ? $langs->trans("Export").': '.$exportlink : '').'</td>';
112  print '</tr>';
113 
114  print '</table>';
115 
116  dol_fiche_end();
117 
118  print '<div class="center"><input type="submit" class="button" name="submit" value="'.$langs->trans("Refresh").'"></div>';
119 
120  print '</form>';
121  print '<br>';
122 
123  print "\n<!-- end banner of report -->\n\n";
124 }
125 
dol_fiche_head($links=array(), $active='0', $title='', $notab=0, $picto='', $pictoisfullpath=0, $morehtmlright='')
Show tab header of a card.
dol_fiche_end($notab=0)
Show tab footer of a card.
dol_print_date($time, $format='', $tzoutput='tzserver', $outputlangs='', $encodetooutput=false)
Output date in a string format according to outputlangs (or langs if not defined).
print
Draft customers invoices.
Definition: index.php:91
report_header($reportname, $notused, $period, $periodlink, $description, $builddate, $exportlink='', $moreparam=array(), $calcmode='', $varlink='')
Show header of a report.
Definition: report.lib.php:41