diff options
Diffstat (limited to 'lib/RHRD/rddb.pm')
-rwxr-xr-x | lib/RHRD/rddb.pm | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/RHRD/rddb.pm b/lib/RHRD/rddb.pm index da3a1e5..4f8f469 100755 --- a/lib/RHRD/rddb.pm +++ b/lib/RHRD/rddb.pm @@ -2064,6 +2064,36 @@ sub create_multi_show return ($number, 'OK', 'success'); } +sub get_multi_show_info +{ + my ($ctx, $showid) = @_; + + my $sql = qq{select TITLE,USER_DEFINED 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 ($title, $shows) = $sth->fetchrow_array(); + $sth->finish(); + + my $entry = {}; + $entry->{'ID'} = $showid; + $entry->{'TITLE'} = $title; + $entry->{'SHOWS'} = {}; + + my @showlist = split(';', $shows); + foreach my $show (@showlist) { + my ($week, $showid) = split(':', $show, 2); + next unless(defined($week) && defined($showid)); + $entry->{'SHOWS'}{int($week)} = int($showid); + } + + return ($entry, 'OK', 'success'); +} + sub remove_multi_show { my ($ctx, $showid) = @_; |