diff options
Diffstat (limited to 'lib')
-rwxr-xr-x | lib/RHRD/rddb.pm | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index a3c4f7a..df514d7 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -1105,6 +1105,24 @@ sub list_showids return @showids; } +sub check_show_exists +{ + my ($ctx, $showid) = @_; + + my $sql = qq{select count(*) from CART where NUMBER = ?}; + + my $sth = $ctx->{'dbh'}->prepare($sql) + or return (undef, 'ERROR', "Database Error: " . $ctx->{'dbh'}->errstr); + + $sth->execute($showid) + or return (undef, 'ERROR', "Database Error: " . $sth->errstr); + + my ($result) = $sth->fetchrow_array(); + $sth->finish(); + + return ($result, 'OK', "successfully fetched show status"); +} + sub create_show_group { my ($ctx, $groupname) = @_; |