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