]> ruin.nu Git - ndwebbie.git/blobdiff - ND/Web/Pages/Check.pm
show ship classes and add links on def calls overview
[ndwebbie.git] / ND / Web / Pages / Check.pm
index 48186b3d290cfaa6778c564415d16e4c8b9d3bb1..394c8b02ee95c8061a8688a81b3a84c4edbabcb8 100644 (file)
@@ -166,6 +166,14 @@ sub render_body {
                $scan .= q{</table>};
                push @scans, {Scan => $scan};
 
+               $query = $DBH->prepare(q{SELECT DISTINCT ON (type) type,scan_id, tick, scan FROM scans WHERE planet = ?
+                       GROUP BY type,scan_id, tick, scan ORDER BY type,tick DESC});
+               $query->execute($planet_id);
+               my %scans;
+               while (my($type,$scan_id,$tick,$scan) = $query->fetchrow){
+                       $scans{$type} = [$scan_id,$tick,$scan];
+               }
+
                $query = $DBH->prepare(q{SELECT x,y,z,tick FROM planet_stats WHERE id = ? ORDER BY tick ASC});
                $scan = q{
                <p>Previous Coords</p>
@@ -181,16 +189,10 @@ sub render_body {
                        }
                }
                $scan .= q{</table>};
+               $scan .= $scans{'Ship Classes'}->[2] if $scans{'Ship Classes'};
                push @scans, {Scan => $scan};
 
-               $query = $DBH->prepare(q{SELECT DISTINCT ON (type) type,scan_id, tick, scan FROM scans WHERE planet = ?
-                       GROUP BY type,scan_id, tick, scan ORDER BY type,tick DESC});
-               $query->execute($planet_id);
-               my %scans;
-               while (my($type,$scan_id,$tick,$scan) = $query->fetchrow){
-                       $scans{$type} = [$scan_id,$tick,$scan];
-               }
-               for my $type ('Planet','Jumpgate','Unit','Advanced Unit','Fleet Analysis','Surface Analysis','Technology Analysis','News'){
+               for my $type ('Planet','Jumpgate','Unit','Advanced Unit','Surface Analysis','Technology Analysis','Fleet Analysis','News'){
                        next unless exists $scans{$type};
                        my $scan_id = $scans{$type}->[0];
                        my $tick = $scans{$type}->[1];