This commit was generated by cvs2svn to compensate for changes in r9232,
[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
86 %   #move to /elements/tr-select-cust_pkg-fields if anything else needs it...
87     <TR>
88       <TD ALIGN="right">Package fields</TD>
89       <TD>
90         <SELECT NAME="cust_pkg_fields">
91           <OPTION VALUE="">(none)
92           <OPTION VALUE="setup,last_bill,bill,cancel">Setup date | Last bill date | Next bill date | Cancel date
93         </SELECT>
94       </TD>
95     </TR>
96
97     <% include( '/elements/tr-select-cust-fields.html' ) %>
98                        
99   </TABLE>
100
101 <BR>
102 <INPUT TYPE="submit" VALUE="Get Report">
103
104 </FORM>
105
106 <% include('/elements/footer.html') %>
107 <%init>
108
109 die "access denied"
110   unless $FS::CurrentUser::CurrentUser->access_right('List packages'); #?
111
112 my $title = 'Account Report';
113
114 #false laziness w/report_cust_pkg.html
115 my $custnum = '';
116 if ( $cgi->param('custnum') =~ /^(\d+)$/ ) {
117   $custnum = $1;
118   my $cust_main = qsearchs({
119     'table'     => 'cust_main', 
120     'hashref'   => { 'custnum' => $custnum },
121     'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql,
122   }) or die "unknown custnum $custnum";
123   $title .= ': '. $cust_main->name;
124 }
125
126 </%init>
127 <%once>
128
129 my %label = (
130   'last_login'  => 'Last login',
131   'last_logout' => 'Last logout',
132 );
133
134 </%once>