# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. *
#**************************************************************************/
-package ND::Web::Pages::GalaxyRankings;
+package NDWeb::Pages::GalaxyRankings;
use strict;
use warnings FATAL => 'all';
use CGI qw/:standard/;
-use ND::Web::Include;
+use NDWeb::Include;
-use base qw/ND::Web::XMLPage/;
+use base qw/NDWeb::XMLPage/;
-$ND::Web::Page::PAGES{galaxyrankings} = __PACKAGE__;
+$NDWeb::Page::PAGES{galaxyrankings} = __PACKAGE__;
sub parse {
#TODO: Need to fix some links first
ORDER BY $order LIMIT 100 OFFSET ?});
$query->execute($offset) or $error .= p($DBH->errstr);
my @galaxies;
- my $i = 0;
while (my $galaxy = $query->fetchrow_hashref){
for my $type (qw/planets size score xp value/){
#$galaxy->{$type} = prettyValue($galaxy->{$type});
$galaxy->{$type} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000
}
}
- $i++;
- $galaxy->{ODD} = $i % 2;
push @galaxies,$galaxy;
}
$BODY->param(Galaxies => \@galaxies);