Skip to content
Newer
Older
100755 82 lines (68 sloc) 2.53 KB
d0374d0 Initial revision
rangi authored
1 #!/usr/bin/perl
2
7197a37 Added magic RCS comment.
arensb authored
3 # $Id$
4
d0374d0 Initial revision
rangi authored
5 #script to do a borrower enquiery/brin up borrower details etc
6 #written 20/12/99 by chris@katipo.co.nz
7
1e67687 Added copyright statement to all .pl and .pm files
tonnesen authored
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
d0374d0 Initial revision
rangi authored
26 use strict;
9d54a64 adding authentification with Auth.pm
tipaul authored
27 use C4::Auth;
d0374d0 Initial revision
rangi authored
28 use C4::Output;
52a5fd4 Moved C4/Charset.pm to C4/Interface/CGI/Output.pm
acli authored
29 use C4::Interface::CGI::Output;
d0374d0 Initial revision
rangi authored
30 use CGI;
31 use C4::Search;
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
32 use HTML::Template;
d0374d0 Initial revision
rangi authored
33
34 my $input = new CGI;
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
35
d6f6462 Use the default theme if it wasn't given as a CGI parameter.
arensb authored
36 my $theme = $input->param('theme') || "default";
37 # only used if allowthemeoverride is set
6e9e3cf templating stuff : use of gettemplate method
tipaul authored
38 #my %tmpldata = pathtotemplate ( template => 'member.tmpl', theme => $theme, language => 'fi' );
d6f6462 Use the default theme if it wasn't given as a CGI parameter.
arensb authored
39 # FIXME - Error-checking
6e9e3cf templating stuff : use of gettemplate method
tipaul authored
40 #my $template = HTML::Template->new( filename => $tmpldata{'path'},
41 # die_on_bad_params => 0,
42 # loop_context_vars => 1 );
9d54a64 adding authentification with Auth.pm
tipaul authored
43 my ($template, $loggedinuser, $cookie)
44 = get_template_and_user({template_name => "members/member.tmpl",
45 query => $input,
46 type => "intranet",
47 authnotrequired => 0,
48 flagsrequired => {borrowers => 1},
49 debug => 1,
50 });
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
51
d0374d0 Initial revision
rangi authored
52 my $member=$input->param('member');
53 $member=~ s/\,//g;
54
55 my $env;
56 my ($count,$results)=BornameSearch($env,$member,'web');
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
57
58 my @resultsdata;
d0374d0 Initial revision
rangi authored
59 for (my $i=0; $i < $count; $i++){
60 #find out stats
61 my ($od,$issue,$fines)=borrdata2($env,$results->[$i]{'borrowernumber'});
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
62
63 my %row = (
64 borrowernumber => $results->[$i]{'borrowernumber'},
65 cardnumber => $results->[$i]{'cardnumber'},
66 surname => $results->[$i]{'surname'},
67 firstname => $results->[$i]{'firstname'},
68 categorycode => $results->[$i]{'categorycode'},
69 streetaddress => $results->[$i]{'streetaddress'},
70 city => $results->[$i]{'city'},
71 odissue => "$od/$issue",
72 fines => $fines,
73 borrowernotes => $results->[$i]{'borrowernotes'});
74 push(@resultsdata, \%row);
d0374d0 Initial revision
rangi authored
75 }
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
76
ade845c Handle non-latin1 charsets
acli authored
77 $template->param(
0f24c70 templatified:set templatedirectory in koha.conf to use the templates
dnmeid authored
78 member => $member,
79 resultsloop => \@resultsdata );
7197a37 Added magic RCS comment.
arensb authored
80
52a5fd4 Moved C4/Charset.pm to C4/Interface/CGI/Output.pm
acli authored
81 output_html_with_http_headers $input, $cookie, $template->output;
Something went wrong with that request. Please try again.