This commit was generated by cvs2svn to compensate for changes in r8690,
[freeside.git] / httemplate / search / report_svc_acct.html
1 <% include('/elements/header.html', $title ) %>
2
3 <FORM ACTION="svc_acct.cgi" METHOD="GET">
4 <INPUT TYPE="hidden" NAME="magic" VALUE="advanced">
5 <INPUT TYPE="hidden" NAME="custnum" VALUE="<% $custnum %>">
6
7   <TABLE BGCOLOR="#cccccc" CELLSPACING=0>
8
9     <TR>
10       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Search options</FONT></TH>
11     </TR>
12
13 % unless ( $custnum ) {
14     <% include( '/elements/tr-select-agent.html',
15                    'curr_value'    => scalar( $cgi->param('agentnum') ),
16                    'disable_empty' => 0,
17               )
18     %>
19
20 %   # just this customer's domains?
21     <% include( '/elements/tr-select-domain.html',
22                    'element_name'  => 'domsvc',
23                    'curr_value'    => scalar( $cgi->param('domsvc') ),
24                    'disable_empty' => 0,
25               )
26     %>
27 % }
28
29     <SCRIPT type="text/javascript">
30       function toggle(what) {
31         label = document.getElementById (what + '_label');
32         field = document.getElementById ( what + '_invert');
33         if (field.value == 1) {
34           field.value = 0;
35         } else {
36           field.value = 1;
37         }
38         if (field.value == 1) {
39           label.firstChild.nodeValue = 'Did not ' + label.firstChild.nodeValue;
40         }else{
41           text = label.firstChild.nodeValue;
42           label.firstChild.nodeValue = text.replace(/Did not /, '');
43         }
44       }
45     </SCRIPT>
46 %   foreach my $field (qw( last_login last_logout )) {
47 %     my $invert = $field."_invert";
48
49       <TR>
50         <TD>
51           <TABLE>
52             <TR>
53               <TD ALIGN="right" VALIGN="center" ID="<% $field."_label" %>">
54                 <% $label{$field} %>
55               </TD>
56               <TD>
57                 <INPUT NAME="<% $invert %>" ID="<% $invert %>" TYPE="hidden">
58                 <A HREF="javascript:void(0)" onClick="toggle('<% $field %>'); return false;">Invert</A>
59               </TD>
60             </TR>
61           </TABLE>
62         </TD>
63         <TD>
64           <TABLE>
65             <% include( '/elements/tr-input-beginning_ending.html',
66                           prefix   => $field,
67                           layout   => 'horiz',
68                       )
69             %>
70           </TABLE>
71         </TD>
72       </TR>
73
74 %   }
75     
76     <% include( '/elements/tr-selectmultiple-part_pkg.html' ) %> 
77
78     <TR>
79       <TH BGCOLOR="#e8e8e8" COLSPAN=2>&nbsp;</TH>
80     </TR>
81  
82     <TR>
83       <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Display options</FONT></TH>
84     </TR>
85     <% include( '/elements/tr-select-cust-fields.html' ) %>
86                        
87   </TABLE>
88
89 <BR>
90 <INPUT TYPE="submit" VALUE="Get Report">
91
92 </FORM>
93
94 <% include('/elements/footer.html') %>
95 <%init>
96
97 die "access denied"
98   unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
99
100 my $title = 'Account Report';
101
102 #false laziness w/report_cust_pkg.html
103 my $custnum = '';
104 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
105   $custnum = $1;
106   my $cust_main = qsearchs({
107     'table'     => 'cust_main', 
108     'hashref'   => { 'custnum' => $custnum },
109     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
110   }) or die "unknown custnum $custnum";
111   $title .= ': '. $cust_main->name;
112 }
113
114 </%init>
115 <%once>
116
117 my %label = (
118   'last_login'  => 'Last login',
119   'last_logout' => 'Last logout',
120 );
121
122 </%once>