/[A3C]/lib/A3C/View.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /lib/A3C/View.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 79 by dpavlin, Fri Apr 11 23:23:42 2008 UTC revision 83 by dpavlin, Sat Apr 12 10:29:30 2008 UTC
# Line 25  template '/' => page { Line 25  template '/' => page {
25          dt { _('Number of persons in system') }          dt { _('Number of persons in system') }
26          dd { $people->count }          dd { $people->count }
27    
28          my $sql = A3C::SQL->new({ query => qq{          my $by_towns = A3C::SQL->new({ query => qq{
29                  select count(uid),l                  select count(uid),l
30                  from organizations                  from organizations
31                  inner join towns on towns.name = l                  inner join towns on towns.name = l
# Line 34  template '/' => page { Line 34  template '/' => page {
34                  limit 25                  limit 25
35          }});          }});
36    
37          dt { _('Top %1 towns by schools', $sql->count) }          dt { _('Top %1 towns by schools', $by_towns->count) }
38          dd {          dd {
39                  ul {                  ul {
40                          while ( my $row = $sql->next ) {                          while ( my $row = $by_towns->next ) {
41                                  li { outs_raw( $row->count, ' ', $row->l ) }                                  li { outs_raw( $row->count, ' ', $row->l ) }
42                          }                          }
43                  }                  }
44          }          }
45    
46            my $by_county = A3C::SQL->new({ query => qq{
47                    select
48                            count(uid) as schools,
49                            county,
50                            count(distinct municipality) as municipalities
51                    from organizations
52                    inner join towns on towns.name = l
53                    group by county
54                    order by schools desc
55            }});
56    
57            dt { _('Schools by counties') }
58            dd {
59                    table {
60                            th { _('Schools') }
61                            th { _('County') }
62                            th { _('Municipalities') };
63                            while ( my $row = $by_county->next ) {
64                                    row {
65                                            cell { $row->schools }
66                                            cell { $row->county }
67                                            cell { $row->municipalities }
68                                    }
69                            }
70                    }
71            }
72  };  };
73    
74    

Legend:
Removed from v.79  
changed lines
  Added in v.83

  ViewVC Help
Powered by ViewVC 1.1.26