[! use strict; use Proxmox::Utils; use Proxmox::RuleDB; use Proxmox::HTMLTable; use Proxmox::HTMLDropDown; use Proxmox::Statistic; use Proxmox::Config::System; !] [- Execute ('date_selection.epl'); -]
[- my $out = ""; my $system_cfg = $fdat{__system_config}; my $advfilter = $system_cfg->get('administration', 'advfilter'); my $stat = Proxmox::Statistic->new ($udat{statistic_from}, $udat{statistic_to}, $advfilter); my @cellwidth = ('450px', '40px', '70px', '40px', '70px'); my @header_sum = ( '1', '450px', __('Receiver'), '1', '40px', '' . __('Count') . '', '1', '70px', 'KByte', '1', '40px', '' . __('Virus count') . '', '1', '70px', '' . __('Spam count') . '', ); my $table_sum = Proxmox::HTMLTable->new (\@cellwidth); $table_sum->add_headline (\@header_sum); my @cellwidth2 = ('450px', '70px', '40px', '40px', '100px', '40px'); my @header_details = ( '1', '450px', __("Sender"), '1', '70px', "" . __('Date') . "", '1', '40px', "" . __('Time') . "", '1', '40px', "KByte", '1', '100px', "" . __('Virus info') . "", '1', '40px', "" . __('Spam level') . "", ); my $table_details = Proxmox::HTMLTable->new (\@cellwidth2); $table_details->add_headline (\@header_details); my $rdb = Proxmox::RuleDB->new(); my $limit = 200; if ($fdat{showinfo}) { my $tmp = Proxmox::Utils::escape_html ($fdat{showinfo}); $out .="

"; $out .= sprintf (__("%s received mail from the following senders (max %d entries)") . ":

", $tmp, $limit); my $res = $stat->user_stat_receiver_details ($rdb, $fdat{showinfo}, $limit, $fdat{orderby}); foreach my $ref (@$res) { my $date = Proxmox::Utils::time2date ($ref->{time}); my $hm = Proxmox::Utils::time2hm ($ref->{time}); $table_details->add_row ('', Proxmox::Utils::email2html ($ref->{sender}, $ref->{blocked}), $date, $hm, sprintf ("%.1f", $ref->{bytes}/1000.0), "" . (Proxmox::Utils::escape_html ($ref->{virusinfo}) || " ") . "", $ref->{spamlevel}); } $out .= $table_details->out_table(); } else { my $res = $stat->user_stat_receiver ($rdb, $limit, $fdat{orderby}); $out .="

"; $out .= sprintf (__("Receiver overview (max. %d entries)") . "

", $limit); foreach my $ref (@$res) { $table_sum->set_row_link ("?showinfo=$ref->{receiver}"); my $spamper = sprintf ("%.1f", $ref->{count} ? ($ref->{spamcount}*100.0)/$ref->{count} : 0); $table_sum->add_row ('', Proxmox::Utils::email2html ($ref->{receiver}, 0), $ref->{count}, sprintf ("%.1f", $ref->{bytes}/1000.0), $ref->{viruscount}, "$ref->{spamcount} ($spamper %)"); } $out .= $table_sum->out_table(); } print OUT $out; -]