From 73953baf99c55abc44ff1a0493fbb787845d6f8d Mon Sep 17 00:00:00 2001 From: tipaul Date: Wed, 24 Mar 2004 10:42:35 +0000 Subject: [PATCH] *** empty log message *** --- admin/categorie.pl | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/admin/categorie.pl b/admin/categorie.pl index 6bffa9da1a..b491fde00f 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -122,7 +122,7 @@ if ($op eq 'add_form') { $template->param(delete_confirm => 1); my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("select count(*) as total from categoryitem where categorycode=?"); + my $sth=$dbh->prepare("select count(*) as total from borrowers where categorycode=?"); $sth->execute($categorycode); my $total = $sth->fetchrow_hashref; $sth->finish; @@ -185,7 +185,17 @@ if ($op eq 'add_form') { } } $template->param(loop => \@loop); - + # check that I (institution) and C (child) exists. otherwise => warning to the user + my $dbh = C4::Context->dbh; + my $sth=$dbh->prepare("select categorycode from categories where categorycode='C'"); + $sth->execute; + my ($categoryChild) = $sth->fetchrow; + $template->param(categoryChild => $categoryChild); + $sth=$dbh->prepare("select categorycode from categories where categorycode='I'"); + $sth->execute; + my ($categoryInstitution) = $sth->fetchrow; + $template->param(categoryInstitution => $categoryInstitution); + $sth->finish; } #---- END $OP eq DEFAULT -- 2.39.5