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