/[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 71 by dpavlin, Thu Apr 10 21:33:37 2008 UTC revision 79 by dpavlin, Fri Apr 11 23:23:42 2008 UTC
# Line 5  use warnings; Line 5  use warnings;
5    
6  use Jifty::View::Declare -base;  use Jifty::View::Declare -base;
7  use A3C::LDAP;  use A3C::LDAP;
8    use A3C::SQL;
9    
10  use Data::Dump qw/dump/;  use Data::Dump qw/dump/;
11    
12    template '/' => page {
13    
14            h1 { _('Statistics') }
15    
16            my $orgs = A3C::Model::OrganizationCollection->new;
17            $orgs->unlimit;
18    
19            dt { _('Number of schools in system') }
20            dd { $orgs->count }
21    
22            my $people = A3C::Model::PersonCollection->new;
23            $people->unlimit;
24    
25            dt { _('Number of persons in system') }
26            dd { $people->count }
27    
28            my $sql = A3C::SQL->new({ query => qq{
29                    select count(uid),l
30                    from organizations
31                    inner join towns on towns.name = l
32                    group by l
33                    order by count desc
34                    limit 25
35            }});
36    
37            dt { _('Top %1 towns by schools', $sql->count) }
38            dd {
39                    ul {
40                            while ( my $row = $sql->next ) {
41                                    li { outs_raw( $row->count, ' ', $row->l ) }
42                            }
43                    }
44            }
45    
46    };
47    
48    
49  template 'ldap' => page {  template 'ldap' => page {
50          h1 { _('LDAP data about Schools in system') };          h1 { _('LDAP data about Schools in system') };

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

  ViewVC Help
Powered by ViewVC 1.1.26