[! use strict; use Proxmox::Utils; use Proxmox::RuleDB; use Proxmox::HTMLTable; use Proxmox::HTMLDropDown; use Proxmox::Statistic; !] [- Execute ('date_selection.epl'); -]
[- my $stat = Proxmox::Statistic->new ($udat{statistic_from}, $udat{statistic_to}); my @cellwidth = ( '250px', '150','340px'); my @header_sum = ( '3', '200px', __('Detected Spam Mails')); my @header_bad = ( '3', '200px', __('Spam Level Chart')); my $table_sum = Proxmox::HTMLTable->new (\@cellwidth); my $table_bad = Proxmox::HTMLTable->new (\@cellwidth); $table_sum->add_headline (\@header_sum); $table_bad->add_headline (\@header_bad); my $rdb = Proxmox::RuleDB->new(); my $sres = $stat->total_mail_stat ($rdb); my $width = 200; $table_sum->add_row ('', __("Incoming Mails"), $sres->{count_in}, $stat->out_bar(0, $width)); $table_sum->add_row ('', sprintf (__("Spam Mails") . " (%.1f%)", $sres->{spamcount_in_per}), $sres->{spamcount_in}, $stat->out_bar(1, $sres->{spamcount_in_per}*$width/100)); my $aref = $stat->total_spam_stat ($rdb); my $rest = $sres->{spamcount_in}; foreach my $ref (@$aref) { next if $ref->{spamlevel} >= 10; $rest -= $ref->{count} if $ref->{spamlevel} >= 3; $table_bad->add_row ('', "Level $ref->{spamlevel}", $ref->{count}); } $table_bad->add_row ('', "Level >= 10", $rest); my $out = $table_sum->out_table() . "
" . $table_bad->out_table(); print OUT $out; -]