5 # Copyright 2000-2002 Katipo Communications
7 # This file is part of Koha.
9 # Koha is free software; you can redistribute it and/or modify it under the
10 # terms of the GNU General Public License as published by the Free Software
11 # Foundation; either version 2 of the License, or (at your option) any later
14 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
15 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
16 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License along with
19 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
20 # Suite 330, Boston, MA 02111-1307 USA
26 use vars qw($VERSION @ISA @EXPORT);
28 # set the version for version checking
29 $VERSION = $VERSION = do { my @v = '$Revision$' =~ /\d+/g;
30 shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v );
35 C4::Stats - Update Koha statistics (log)
43 The C<&UpdateStats> function adds an entry to the statistics table in
44 the Koha database, which acts as an activity log.
53 @EXPORT = qw(&UpdateStats);
57 &UpdateStats($branch, $type, $value, $other, $itemnumber,
58 $itemtype, $borrowernumber);
60 Adds a line to the statistics table of the Koha database. In effect,
63 C<$branch>, C<$type>, C<$value>, C<$other>, C<$itemnumber>,
64 C<$itemtype>, and C<$borrowernumber> correspond to the fields of the
65 statistics table in the Koha database.
72 #module to insert stats data into stats table
75 $amount, $other, $itemnum,
76 $itemtype, $borrowernumber
79 my $dbh = C4::Context->dbh;
80 # FIXME - Use $dbh->do() instead
81 my $sth = $dbh->prepare(
82 "Insert into statistics (datetime,branch,type,value,
83 other,itemnumber,itemtype,borrowernumber) values (now(),?,?,?,?,?,?,?)"
86 $branch, $type, $amount,
87 $other, $itemnum, $itemtype, $borrowernumber,
99 Koha Developement team <info@koha.org>