5b550dba7d98e5628b1a9c6108572d577a03b61a
[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 %  @custnums = splice(@custnums, 0, 10);
23 %
24 %  if ( @custnums ) {
25
26   <% include('/elements/table-grid.html') %>
27
28 % my $bgcolor1 = '#eeeeee';
29 %     my $bgcolor2 = '#ffffff';
30 %     my $bgcolor = $bgcolor2;
31
32   <TR>
33     <TH CLASS="grid" BGCOLOR="#cccccc" COLSPAN=1>Customers I recently added or modified</TH>
34   </TR>
35
36 % foreach my $custnum ( @custnums ) { 
37 % my $cust_main = qsearchs('cust_main', { 'custnum' => $custnum } ); 
38 % next unless $cust_main; 
39
40     <TR>
41       <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><A HREF="view/cust_main.cgi?<% $custnum %>"><% $cust_main->display_custnum %>: <% $cust_main->name %></A></TD>
42     </TR>
43
44 %       if ( $bgcolor eq $bgcolor1 ) {
45 %          $bgcolor = $bgcolor2;
46 %        } else {
47 %          $bgcolor = $bgcolor1;
48 %        }
49 %    
50 % } 
51
52   </TABLE>
53
54 % } 
55
56 <% include('/elements/footer.html') %>