Translation Area body<= prepare("SELECT lnid, lncode, lnname, lastupdate FROM ml_langs"); $sth->execute; my %lang; $lang{$_->{'lnid'}} = $_ while $_ = $sth->fetchrow_hashref; $sth = $dbr->prepare("SELECT lnid, staleness > 1, COUNT(*) FROM ml_latest GROUP by 1, 2"); $sth->execute; while (my ($lnid, $stale, $ct) = $sth->fetchrow_array) { next unless exists $lang{$lnid}; $lang{$lnid}->{'_total'} += $ct; $lang{$lnid}->{'_good'} += (1-$stale) * $ct; $lang{$lnid}->{'percent'} = 100 * $lang{$lnid}->{'_good'} / ($lang{$lnid}->{'_total'}||1); } my $sortcol = exists $lang{'1'}->{$FORM{'s'}} ? $FORM{'s'} : "lnname"; my @cols = (['lncode','Code'], ['lnname','Language Name', sub { my $r = shift; "
$_->[1] | "; } else { $ret .= "[0]\">$_->[1] | "; } if ($_->[0] eq $sortcol && $_->[3]) { $sorter = $_->[3]; } } $ret .= "
$r->{$_->[0]} | "; } $ret .= "