]> ruin.nu Git - ndwebbie.git/blobdiff - include.pl
show all information from raids
[ndwebbie.git] / include.pl
index 34a019a81593763c9b3cf7786d9ea500651bf2a5..fe3646d0a1cfe215db5b828eafea2fd9e38a753f 100644 (file)
@@ -83,4 +83,16 @@ ORDER BY r.tick+c.wave,x,y,z});
        return $template->output;
 }
 
+sub alliances {
+       my ($alliance) = @_;
+       my @alliances;
+       push @alliances,{Id => -1, Name => ' ', Selected => not $alliance};
+       my $query = $ND::DBH->prepare(q{SELECT id,name FROM alliances ORDER BY name});
+       $query->execute;        
+       while (my $ally = $query->fetchrow_hashref){
+               push @alliances,{Id => $ally->{id}, Name => $ally->{name}, Selected => $alliance eq $ally->{name}};
+       }
+       return @alliances;
+}
+
 1;