From a6f56779ad3ca2c9a2568bc501917c46454853cb Mon Sep 17 00:00:00 2001 From: Michael Andreen Date: Wed, 9 Jan 2008 13:38:00 +0100 Subject: [PATCH] raid page updated --- NDWeb/Pages/Raids.pm | 7 +++---- templates/raids.tmpl | 28 +++++++++++----------------- 2 files changed, 14 insertions(+), 21 deletions(-) diff --git a/NDWeb/Pages/Raids.pm b/NDWeb/Pages/Raids.pm index 766d5a3..3fb4145 100644 --- a/NDWeb/Pages/Raids.pm +++ b/NDWeb/Pages/Raids.pm @@ -236,20 +236,18 @@ sub render_body { $target{comment} = parseMarkup($target->{comment}) if ($target->{comment}); my $unitscans = $DBH->prepare(q{ - SELECT i.id,i.name, i.tick, i.amount + SELECT DISTINCT ON (name) i.id,i.name, i.tick, i.amount FROM fleets i WHERE i.uid = -1 AND i.sender = ? AND i.mission = 'Full fleet' GROUP BY i.id,i.tick,i.name,i.amount - ORDER BY i.tick,name + ORDER BY name,i.tick DESC }); $unitscans->execute($target->{planet}) or warn $DBH->errstr; my $ships = $DBH->prepare(q{SELECT ship,amount FROM fleet_ships WHERE id = ?}); my @missions; - my $i = 0; while (my $mission = $unitscans->fetchrow_hashref){ - $mission->{ODD} = $i++ % 2; my @ships; $ships->execute($mission->{id}); my $j = 0; @@ -260,6 +258,7 @@ sub render_body { push @ships, {ship => 'No', amount => 'ships'} if @ships == 0; $mission->{ships} = \@ships; $mission->{amount} =~ s/(^[-+]?\d+?(?=(?>(?:\d{3})+)(?!\d))|\G\d{3}(?=\d))/$1,/g; #Add comma for ever 3 digits, i.e. 1000 => 1,000 + delete $mission->{id}; push @missions,$mission; } $target{missions} = \@missions; diff --git a/templates/raids.tmpl b/templates/raids.tmpl index e5c1f4a..af9bc30 100644 --- a/templates/raids.tmpl +++ b/templates/raids.tmpl @@ -87,13 +87,13 @@ - + - + @@ -135,28 +135,22 @@
MetalCrystalEonium
RoidsRoids
ResourcesResources
-
- - - - - - - - - - - -
NameTickAmount
+
+