--- lib/A3C/View.pm 2008/04/11 23:23:42 79 +++ lib/A3C/View.pm 2008/05/20 09:47:59 122 @@ -13,36 +13,62 @@ h1 { _('Statistics') } - my $orgs = A3C::Model::OrganizationCollection->new; + my $orgs = A3C::Model::hrEduOrgCollection->new; $orgs->unlimit; dt { _('Number of schools in system') } dd { $orgs->count } - my $people = A3C::Model::PersonCollection->new; + my $people = A3C::Model::hrEduPersonCollection->new; $people->unlimit; dt { _('Number of persons in system') } dd { $people->count } - my $sql = A3C::SQL->new({ query => qq{ + my $by_towns = A3C::SQL->new({ query => qq{ select count(uid),l - from organizations + from hr_edu_orgs inner join towns on towns.name = l group by l order by count desc limit 25 }}); - dt { _('Top %1 towns by schools', $sql->count) } + dt { _('Top %1 towns by schools', $by_towns->count) } dd { ul { - while ( my $row = $sql->next ) { + while ( my $row = $by_towns->next ) { li { outs_raw( $row->count, ' ', $row->l ) } } } } + my $by_county = A3C::SQL->new({ query => qq{ + select + count(uid) as schools, + county, + count(distinct municipality) as municipalities + from hr_edu_orgs + inner join towns on towns.name = l + group by county + order by schools desc + }}); + + dt { _('Schools by counties') } + dd { + table { + th { _('Schools') } + th { _('County') } + th { _('Municipalities') }; + while ( my $row = $by_county->next ) { + row { + cell { $row->schools } + cell { $row->county } + cell { $row->municipalities } + } + } + } + } }; @@ -74,7 +100,7 @@ h1 { _('Find people') } my $action = new_action( - class => 'SearchPerson', + class => 'SearchhrEduPerson', moniker => 'search-users', sticky_on_success => 1, sticky_on_failure => 1, @@ -112,7 +138,7 @@ ); form { - render_action( $action => [ 'cn' ] ); + render_action( $action => [ 'org_uid' ] ); form_submit( label => _('Sync Organization') ); };