Polish language updates
[koha.git] / circ / ysearch.pl
index ee383aa..136ca76 100755 (executable)
@@ -32,6 +32,7 @@ use C4::Auth qw/check_cookie_auth/;
 my $input   = new CGI;
 my $query   = $input->param('query');
 
+binmode STDOUT, ":utf8";
 print $input->header(-type => 'text/plain', -charset => 'UTF-8');
 
 my ($auth_status, $sessionID) = check_cookie_auth($input->cookie('CGISESSID'), { circulate => '*' });
@@ -44,10 +45,11 @@ my $sql = qq(SELECT surname, firstname, cardnumber, address, city, zipcode
              FROM borrowers 
              WHERE surname LIKE ?
              OR firstname LIKE ?
+             OR cardnumber LIKE ?
              ORDER BY surname, firstname);
-            #"OR cardnumber LIKE '" . $query . "%' " . 
 my $sth = $dbh->prepare( $sql );
-$sth->execute("$query%", "$query%");
+$sth->execute("$query%", "$query%", "$query%");
+
 while ( my $rec = $sth->fetchrow_hashref ) {
     print $rec->{surname} . ", " . $rec->{firstname} . "\t" .
           $rec->{cardnumber} . "\t" .