#!/usr/bin/perl -w use lib qw!/home/webpaper/perl/lib/perl5 /home/webpaper/perl/lib/perl5/site_perl!; use Fcntl; use CGI qw/:standard/; use MLDBM qw/DB_File Storable/; tie %db, 'MLDBM', '/home/webpaper/public_html/cgi-bin/webpaper_ans.db', O_RDWR, 0666 or die $!; print header; print start_html( -title => "WebPaper - Registo de Clă", -style => { -code => <<"EOCSS"}); td { border: solid 1px; padding: 2px; } body { background: url("/~webpaper/webpaper.png") no-repeat } input { border: solid 1px } div { margin-left: 25%; margin-right: 25%; text-align: center; padding: 15px; border: dotted 1px #999} h1 { text-align: center; margin-top: 15%; margin-bottom: 10px; } EOCSS print h1("WebPaper - Estado de submissőes"); print "\n"; print Tr(th("Cla ID"),th("Submission Time"),th("Punctuation"),th("status")); for (keys %db) { print Tr(td($_), td($db{$_}{tim}), td($db{$_}{pts}), td({-style=>status($db{$_}{status})},$db{$_}{status}), td(a({-href=>"/~webpaper/cgi-bin/validate?cla=$_"}, "Validar"))); } print "
\n"; print end_html(); sub status { my $status = shift; if ($status eq "done") { "background-color: #00bb00; color: #fff; text-align: center;" } elsif ($status eq "busy") { "background-color: #bbbb00; text-align: center;" } else { "background-color: #bb0000;" } }