summaryrefslogtreecommitdiff
path: root/httemplate/search/sqlradius.html
blob: 8c405982f27ce3cc09395ab6f68c83a176ba9c9e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
<% include( '/elements/header.html', 'Search RADIUS sessions' ) %>

<FORM NAME="OneTrueForm" ACTION="sqlradius.cgi" METHOD="GET">
% #include( '/elements/table.html' ) 

<% ntable('#cccccc') %>
<TR>
  <TD ALIGN="right">Username: </TD>
  <TD><INPUT TYPE="text" NAME="username"></TD>
</TR>
<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 ) { 

  <TR>
    <TD ALIGN="right">IP address: </TD>
    <TD><INPUT TYPE="text" NAME="ip"></TD>
  </TR>
  <TR>
    <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 ) { 

  <TR>
    <TD ALIGN="right">Destination prefix:</TD>
    <TD><INPUT TYPE="text" NAME="prefix"></TD>
  </TR>
  <TR>
    <TD></TD>
    <TD><FONT SIZE="-1"><I>(country code or country code and prefix)</I></FONT></TD>
  </TR>
  <TR>
    <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="open_sessions" VALUE="0" onClick="open_changed(this);" CHECKED>Completed sessions<BR>
      <INPUT TYPE="radio" NAME="open_sessions" VALUE="1" onClick="open_changed(this);">Open sessions
    </TD>
  </TR>

  <TR>
    <TH COLSPAN=2>Session start</TD>
  </TR>

  <% include( '/elements/tr-input-beginning_ending.html',
                'prefix'     => 'starttime',
                'input_time' => 1,
            )
  %>

  <SCRIPT TYPE="text/javascript">

    function open_changed(what) {

      var value=get_open_value(what); 
      if ( value == '1' ) {
        what.form.stoptime_beginning_text.disabled = true;
        what.form.stoptime_ending_text.disabled = true;
        what.form.stoptime_beginning_text.style.backgroundColor = '#dddddd';
        what.form.stoptime_ending_text.style.backgroundColor = '#dddddd';
        what.form.stoptime_beginning_button.style.display = 'none';
        what.form.stoptime_ending_button.style.display = 'none';
        what.form.stoptime_beginning_disabled.style.display = '';
        what.form.stoptime_ending_disabled.style.display = '';
      } else if ( value == '0' ) {
        what.form.stoptime_beginning_text.disabled = false;
        what.form.stoptime_ending_text.disabled = false;
        what.form.stoptime_beginning_text.style.backgroundColor = '#ffffff';
        what.form.stoptime_ending_text.style.backgroundColor = '#ffffff';
        what.form.stoptime_beginning_button.style.display = '';
        what.form.stoptime_ending_button.style.display = '';
        what.form.stoptime_beginning_disabled.style.display = 'none';
        what.form.stoptime_ending_disabled.style.display = 'none';
      }

    }

    function get_open_value(what) {
      var rad_val = '';
      for (var i=0; i < what.form.open_sessions.length; i++) {
        if (what.form.open_sessions[i].checked) {
          var rad_val = what.form.open_sessions[i].value;
        }
     }
     return rad_val;
   }

  </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') %>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('List rating data');

</%init>