|
Lines 1349-1365
sub checkuniquemember {
Link Here
|
| 1349 |
my ( $collectivity, $surname, $firstname, $dateofbirth ) = @_; |
1349 |
my ( $collectivity, $surname, $firstname, $dateofbirth ) = @_; |
| 1350 |
my $dbh = C4::Context->dbh; |
1350 |
my $dbh = C4::Context->dbh; |
| 1351 |
my $request = ($collectivity) ? |
1351 |
my $request = ($collectivity) ? |
| 1352 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? " : |
1352 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) " : |
| 1353 |
($dateofbirth) ? |
1353 |
($dateofbirth) ? |
| 1354 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? and firstname=? and dateofbirth=?" : |
1354 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) and upper(firstname) = upper(?) and dateofbirth=?" : |
| 1355 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE surname=? and firstname=?"; |
1355 |
"SELECT borrowernumber,categorycode FROM borrowers WHERE upper(surname) = upper(?) and upper(firstname) = upper(?)"; |
| 1356 |
my $sth = $dbh->prepare($request); |
1356 |
my $sth = $dbh->prepare($request); |
| 1357 |
if ($collectivity) { |
1357 |
if ($collectivity) { |
| 1358 |
$sth->execute( uc($surname) ); |
1358 |
$sth->execute( $surname ); |
| 1359 |
} elsif($dateofbirth){ |
1359 |
} elsif($dateofbirth){ |
| 1360 |
$sth->execute( uc($surname), ucfirst($firstname), $dateofbirth ); |
1360 |
$sth->execute( $surname, $firstname, $dateofbirth ); |
| 1361 |
}else{ |
1361 |
}else{ |
| 1362 |
$sth->execute( uc($surname), ucfirst($firstname)); |
1362 |
$sth->execute( $surname, $firstname); |
| 1363 |
} |
1363 |
} |
| 1364 |
my @data = $sth->fetchrow; |
1364 |
my @data = $sth->fetchrow; |
| 1365 |
( $data[0] ) and return $data[0], $data[1]; |
1365 |
( $data[0] ) and return $data[0], $data[1]; |
| 1366 |
- |
|
|