-<% include( '/elements/header.html', 'RADIUS Sessions',
- include('/elements/menubar.html',
- 'Main menu' => $p, # popurl(2),
- ),
-
- )
-%>
+<% include( '/elements/header.html', 'RADIUS Sessions') %>
% ###
% # and finally, display the thing
<TR>
% foreach my $field ( keys %efields ) {
+% my $html = &{ $efields{$field}->{fmt} }( $session->{$field},
+% $session,
+% $part_export,
+% );
+% my $class = ( $html =~ /<TABLE/ ? 'inv' : 'grid' );
- <TD CLASS="grid" BGCOLOR="<% $bgcolor %>" ALIGN="<% $efields{$field}->{align} %>">
- <% &{ $efields{$field}->{fmt} }( $session->{$field},
- $session,
- $part_export,
- )
- %>
+ <TD CLASS="<%$class%>" BGCOLOR="<% $bgcolor %>" ALIGN="<% $efields{$field}->{align} %>">
+ <% $html %>
</TD>
% }
</TR>
% }
-
<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
+
###
# parse cgi params
###
my $beginning = '';
my $ending = '';
if ( $cgi->param('beginning')
- && $cgi->param('beginning') =~ /^([ 0-9\-\/]{0,10})$/ ) {
+ && $cgi->param('beginning') =~ /^([ 0-9\-\/\:\w]{0,54})$/ ) {
$beginning = str2time($1);
}
if ( $cgi->param('ending')
- && $cgi->param('ending') =~ /^([ 0-9\-\/]{0,10})$/ ) {
- $ending = str2time($1) + 86399;
+ && $cgi->param('ending') =~ /^([ 0-9\-\/\:\w]{0,54})$/ ) {
+ $ending = str2time($1); # + 86399;
}
if ( $cgi->param('begin') && $cgi->param('begin') =~ /^(\d+)$/ ) {
$beginning = $1;
my $hour = int($seconds/3600);
my $min = int( ($seconds%3600) / 60 );
my $sec = $seconds%60;
- '<TABLE BORDER=0 CELLSPACING=0 CELLPADDING=0>'.
- '<TR><TD ALIGN="right">'.
+ '<TABLE CLASS="inv" BORDER=0 CELLSPACING=0 CELLPADDING=0>'.
+ '<TR><TD CLASS="inv" ALIGN="right">'.
( $hour ? "<B>$hour</B>h" : ' ' ).
- '</TD><TD ALIGN="right">'.
+ '</TD><TD CLASS="inv" ALIGN="right">'.
( ( $hour || $min ) ? "<B>$min</B>m" : ' ' ).
- '</TD><TD ALIGN="right">'.
+ '</TD><TD CLASS="inv" ALIGN="right">'.
"<B>$sec</B>s".
'</TD></TR></TABLE>';
};