i had forgotten tmpl tags for delete_confirm and delete_confirmed
[koha.git] / member.pl
1 #!/usr/bin/perl
2
3 # $Id$
4
5 #script to do a borrower enquiery/brin up borrower details etc
6 #written 20/12/99 by chris@katipo.co.nz
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 C4::Output;
28 use CGI;
29 use C4::Search;
30 use HTML::Template;
31
32 my $input = new CGI;
33
34 my $theme = $input->param('theme') || "default";
35                         # only used if allowthemeoverride is set
36 #my %tmpldata = pathtotemplate ( template => 'member.tmpl', theme => $theme, language => 'fi' );
37         # FIXME - Error-checking
38 #my $template = HTML::Template->new( filename => $tmpldata{'path'},
39 #                                   die_on_bad_params => 0,
40 #                                   loop_context_vars => 1 );
41 my $template = gettemplate("members/member.tmpl");
42
43 my $member=$input->param('member');
44 $member=~ s/\,//g;
45
46 my $env;
47 my ($count,$results)=BornameSearch($env,$member,'web');
48
49 my @resultsdata;
50 for (my $i=0; $i < $count; $i++){
51   #find out stats
52   my ($od,$issue,$fines)=borrdata2($env,$results->[$i]{'borrowernumber'});
53
54   my %row = (
55         borrowernumber => $results->[$i]{'borrowernumber'},
56         cardnumber => $results->[$i]{'cardnumber'},
57         surname => $results->[$i]{'surname'},
58         firstname => $results->[$i]{'firstname'},
59         categorycode => $results->[$i]{'categorycode'},
60         streetaddress => $results->[$i]{'streetaddress'},
61         city => $results->[$i]{'city'},
62         odissue => "$od/$issue",
63         fines => $fines,
64         borrowernotes => $results->[$i]{'borrowernotes'});
65   push(@resultsdata, \%row);
66 }
67
68 $template->param( startmenumember => join ('', startmenu('member')),
69                         endmenumember   => join ('', endmenu('member')),
70                         member          => $member,
71                         resultsloop     => \@resultsdata );
72
73 print "Content-Type: text/html\n\n", $template->output;