[followup](bug #4051) add borrower "title", and complete address in csv
[koha.git] / members / guarantor_search.pl
index 78eaf07..881df94 100755 (executable)
@@ -1,6 +1,5 @@
 #!/usr/bin/perl
 
-# $Id$
 
 # script to find a guarantor
 
 use strict;
 use C4::Auth;
 use C4::Output;
-use C4::Interface::CGI::Output;
 use CGI;
-
-#op
-use C4::Date;
+use C4::Dates qw/format_date/;
 use C4::Members;
 
 my $input = new CGI;
@@ -65,15 +61,15 @@ my $background = 0;
 if ($member ne ''){
        if(length($member) == 1)
        {
-               ($count,$results)=GuarantornameSearch($member,$orderby,"simple");
+               ($count,$results)=SearchMember($member,$orderby,"simple",'A');
        }
        else
        {
-               ($count,$results)=GuarantornameSearch($member,$orderby,"advanced");
+               ($count,$results)=SearchMember($member,$orderby,"advanced",'A');
        }
        for (my $i=0; $i < $count; $i++){
        #find out stats
-       my ($od,$issue,$fines)=borrdata2($results->[$i]{'borrowerid'});
+       my ($od,$issue,$fines)=GetMemberIssuesAndFines($results->[$i]{'borrowerid'});
        my $guarantorinfo=uc($results->[$i]{'surname'})." , ".ucfirst($results->[$i]{'firstname'});
        my %row = (
                background => $background,
@@ -83,8 +79,10 @@ if ($member ne ''){
                surname => $results->[$i]{'surname'},
                firstname => $results->[$i]{'firstname'},
                categorycode => $results->[$i]{'categorycode'},
+               streetnumber => $results->[$i]{'streetnumber'},
                address => $results->[$i]{'address'},
                city => $results->[$i]{'city'},
+               zipcode => $results->[$i]{'zipcode'},
                branchcode => $results->[$i]{'branchcode'},
                guarantorinfo =>$guarantorinfo,
                #op
@@ -104,4 +102,4 @@ $template->param(
                        
                        resultsloop     => \@resultsdata );
 
-output_html_with_http_headers $input, $cookie, $template->output;
\ No newline at end of file
+output_html_with_http_headers $input, $cookie, $template->output;