[! 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'); my @header_sum = ( '1', '450px', __('Contact'), '1', '40px', '' . __('Count') . '', '1', '70px', 'KByte', ); my $table_sum = Proxmox::HTMLTable->new (\@cellwidth); $table_sum->add_headline (\@header_sum); my @cellwidth2 = ('450px', '70px', '40px', '70px', '70px'); my @header_details = ( '1', '450px', "Sender", '1', '70px', "" . __('Date') . "", '1', '40px', "" . __('Time') . "", '1', '70px', "KByte", '1', '70px', "" . __('Virus info') . "", ); 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_contact_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), $ref->{virusinfo}); } $out .= $table_details->out_table(); } else { my $res = $stat->user_stat_contact ($rdb, 200, $fdat{orderby}); $out .= "

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

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