################################################################# ## Get News infor for one item ################################################################# sub print_update_news_block{ my $ID = shift; my $color = shift; my %news_info = get_news_info($ID); my ($date, $time) = split(/\s+/,$news_info{"Date"}); my $date = convert_date_to_display($date); $news_info{"News"} =~ s/
/\n/g; print <<__HTML__;


$date update
__HTML__ } ################################################################# ## Get News infor for one item ################################################################# sub get_news_info{ my $event_id = shift; my %return_hash = (); $dbh = get_dbh(); # prepare and execute query $query = "SELECT * FROM News WHERE `Key` = $event_id"; $sth = $dbh->prepare($query); $sth->execute(); # assign fields to variables $sth->bind_columns(\$Key, \$Org_ID, \$League_ID, \$Team_ID, \$Date, \$Title, \$News); while($sth->fetch()) { $return_hash{"Key"} = "$Key"; $return_hash{"Org_ID"} = "$Org_ID"; $return_hash{"League_ID"} = "$League_ID"; $return_hash{"Team_ID"} = "$Team_ID"; $return_hash{"Date"} = "$Date"; $return_hash{"Title"} = "$Title"; $return_hash{"News"} = "$News"; } $sth->finish(); # disconnect from database $dbh->disconnect; return %return_hash; } ################################################################# ## Print the Update Form ################################################################# sub print_new_news_block{ my $org_id = shift; my $league_id = shift; my $color = shift; my $date = get_date(); print <<__HTML__;
$date add
__HTML__ } 1