add svc_elec_features merged from reference code RT#7643
[freeside.git] / httemplate / index.html
1 % my $conf = new FS::Conf; 
2
3 <% include('/elements/header.html', 'Billing Main' ) %>
4
5 <% include('/elements/dashboard-install_welcome.html') %>
6
7 <% include('/elements/dashboard-toplist.html') %>
8
9 %  my $sth = dbh->prepare(
10 %    #"SELECT DISTINCT custnum FROM h_cust_main JOIN cust_main USING ( custnum )
11 %    "SELECT custnum FROM h_cust_main JOIN cust_main USING ( custnum )
12 %       WHERE ( history_action = 'insert' OR history_action = 'replace_new' ) 
13 %         AND history_user = ?
14 %       ORDER BY history_date desc" # LIMIT 10
15 %    ) or die dbh->errstr;
16 %
17 %  $sth->execute( getotaker() ) or die $sth->errstr;
18 %
19 %  my %saw = ();
20 %  my @custnums = grep { !$saw{$_}++ } map $_->[0], @{ $sth->fetchall_arrayref };
21 %
22 %  my $curuser = $FS::CurrentUser::CurrentUser;
23 %  my $number_of_customers =
24 %    $curuser->option('dashboard_customer_history_length') || 10;
25 %  @custnums = splice(@custnums, 0, $number_of_customers);
26 %
27 %  if ( @custnums ) {
28
29   <% include('/elements/table-grid.html') %>
30
31 % my $bgcolor1 = '#eeeeee';
32 %     my $bgcolor2 = '#ffffff';
33 %     my $bgcolor = $bgcolor2;
34
35   <TR>
36     <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=1>Customers I recently added or modified</TH>
37   </TR>
38
39 % foreach my $custnum ( @custnums ) { 
40 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); 
41 % next unless $cust_main; 
42
43     <TR>
44       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->display_custnum %>: <% $cust_main->name %></A></TD>
45     </TR>
46
47 %       if ( $bgcolor eq $bgcolor1 ) {
48 %          $bgcolor = $bgcolor2;
49 %        } else {
50 %          $bgcolor = $bgcolor1;
51 %        }
52 %    
53 % } 
54
55   </TABLE>
56
57 % } 
58
59 <% include('/elements/footer.html') %>