-<%= include( '/elements/header.html', 'Search RADIUS sessions' ) %>
+<% include( '/elements/header.html', 'Search RADIUS sessions' ) %>
<FORM NAME="OneTrueForm" ACTION="sqlradius.cgi" METHOD="GET">
-<% #include( '/elements/table.html' ) %>
-<%= ntable('#cccccc') %>
+% #include( '/elements/table.html' )
+
+<% ntable('#cccccc') %>
<TR>
<TD ALIGN="right">Username: </TD>
<TD><INPUT TYPE="text" NAME="username"></TD>
</TR>
+<% include( '/elements/tr-checkbox.html',
+ 'field' => 'summarize',
+ 'label' => 'Summarize',
+ 'value' => 'Y',
+ )
+%>
<TR>
<TD></TD>
<TD><FONT SIZE="-1"><I>(leave blank to show all users)</I></FONT></TD>
</TR>
+% my @part_export = qsearch( 'part_export', { 'exporttype' => 'sqlradius' } );
+% push @part_export,
+% qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } );
+%
+% if ( grep { ! $_->option('hide_ip') } @part_export ) {
-<% my @part_export = qsearch( 'part_export', { 'exporttype' => 'sqlradius' } );
- push @part_export,
- qsearch( 'part_export', { 'exporttype' => 'sqlradius_withdomain' } );
-%>
-
-<% if ( grep { ! $_->option('hide_ip') } @part_export ) { %>
<TR>
<TD ALIGN="right">IP address: </TD>
<TD><INPUT TYPE="text" NAME="ip"></TD>
<TD></TD>
<TD><FONT SIZE="-1"><I>(leave blank to show all IPs)</I></FONT></TD>
</TR>
-<% } %>
+% }
+% if ( grep { $_->option('show_called_station') } @part_export ) {
-<% if ( grep { $_->option('show_called_station') } @part_export ) { %>
<TR>
<TD ALIGN="right">Destination prefix:</TD>
<TD><INPUT TYPE="text" NAME="prefix"></TD>
<TD></TD>
<TD><FONT SIZE="-1"><I>(leave blank to show all destinations)</I></FONT></TD>
</TR>
-<% } %>
+% }
+
+ <TR>
+ <TD>Show:</TD>
+ <TD>
+ <INPUT TYPE="radio" NAME="session_status" VALUE="" onClick="enable_stop(true);" CHECKED>All sessions<BR>
+ <INPUT TYPE="radio" NAME="session_status" VALUE="closed" onClick="enable_stop(true);">Completed sessions<BR>
+ <INPUT TYPE="radio" NAME="session_status" VALUE="open" onClick="enable_stop(false);">Open sessions
+ </TD>
+ </TR>
+
+ <TR>
+ <TH COLSPAN=2>Session start</TD>
+ </TR>
+
+ <% include( '/elements/tr-input-beginning_ending.html',
+ 'prefix' => 'starttime',
+ 'input_time' => 1,
+ )
+ %>
-<%= include( '/elements/tr-input-beginning_ending.html' ) %>
+ <SCRIPT TYPE="text/javascript">
+
+ function enable_stop(value) {
+
+ var f = document.OneTrueForm;
+ if ( value ) {
+ f.stoptime_beginning_text.disabled = false;
+ f.stoptime_ending_text.disabled = false;
+ f.stoptime_beginning_text.style.backgroundColor = '#ffffff';
+ f.stoptime_ending_text.style.backgroundColor = '#ffffff';
+ f.stoptime_beginning_button.style.display = '';
+ f.stoptime_ending_button.style.display = '';
+ f.stoptime_beginning_disabled.style.display = 'none';
+ f.stoptime_ending_disabled.style.display = 'none';
+ } else {
+ f.stoptime_beginning_text.disabled = true;
+ f.stoptime_ending_text.disabled = true;
+ f.stoptime_beginning_text.style.backgroundColor = '#dddddd';
+ f.stoptime_ending_text.style.backgroundColor = '#dddddd';
+ f.stoptime_beginning_button.style.display = 'none';
+ f.stoptime_ending_button.style.display = 'none';
+ f.stoptime_beginning_disabled.style.display = '';
+ f.stoptime_ending_disabled.style.display = '';
+ }
+
+ }
+
+ </SCRIPT>
+
+ <TR>
+ <TH COLSPAN=2>Session end</TD>
+ </TR>
+
+ <% include( '/elements/tr-input-beginning_ending.html',
+ 'prefix' => 'stoptime',
+ 'input_time' => 1,
+ )
+ %>
</TABLE>
<BR><INPUT TYPE="submit" VALUE="View sessions">
</FORM>
-<%= include('/elements/footer.html') %>
+<% include('/elements/footer.html') %>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List rating data');
+
+</%init>