lasts commits before 1.3.3 release
[koha.git] / reports.pl
1 #!/usr/bin/perl
2
3 # $Id$
4
5 #script to display reports
6 #written 8/11/99
7
8
9 # Copyright 2000-2002 Katipo Communications
10 #
11 # This file is part of Koha.
12 #
13 # Koha is free software; you can redistribute it and/or modify it under the
14 # terms of the GNU General Public License as published by the Free Software
15 # Foundation; either version 2 of the License, or (at your option) any later
16 # version.
17 #
18 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
19 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
20 # A PARTICULAR PURPOSE.  See the GNU General Public License for more details.
21 #
22 # You should have received a copy of the GNU General Public License along with
23 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
24 # Suite 330, Boston, MA  02111-1307 USA
25
26 use strict;
27 use CGI;
28 use C4::Output;
29 use C4::Stats;
30 use C4::Stock;
31 use HTML::Template;
32
33 my $input = new CGI;
34 my $type=$input->param('type');
35 # 2002/12/19 hdl@ifrance.com templating
36 my $template=gettemplate("reports.tmpl");
37 #print startpage();
38 #print startmenu('issue');
39 # 2002/12/19 hdl@ifrance.com templating end
40
41 my @dataloop;
42 if ($type eq 'search'){
43  @dataloop=statsreport('search','something');
44 }
45 if ($type eq 'issue'){
46  @dataloop=statsreport('issue','today');
47 }
48 if ($type eq 'stock'){
49  @dataloop=stockreport();
50 }
51
52 # 2002/12/19 hdl@ifrance.com templating
53 $template->param(       type => $type,
54                                                                 dataloop => \@dataloop);
55 #print endmenu('issue');
56 #print endpage();
57 print "Content-Type: text/html\n\n", $template->output;
58 # 2002/12/19 hdl@ifrance.com templating