diff options
-rwxr-xr-x | lib/RHRD/rddb.pm | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index 26dcc12..5c7c26d 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -197,6 +197,28 @@ sub get_next_free_slot return ($low_cart, $high_cart); } +sub get_cart_group +{ + my ($ctx, $cart) = @_; + + my $sql = qq{select GROUP_NAME from CART where NUMBER = ?;}; + + my $sth = $ctx->{'dbh'}->prepare($sql) + or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); + + $sth->execute($cart) + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); + + my ($groupname) = $sth->fetchrow_array(); + $sth->finish(); + + unless(defined($groupname)) { + return (undef, 'ERROR', "cart not found"); + } + + return ($groupname, 'OK', 'success'); +} + sub set_cut_evergreen { my ($ctx, $cart, $cut, $value) = @_; |