X-Git-Url: https://ruin.nu/git/?a=blobdiff_plain;f=include.pl;h=fe3646d0a1cfe215db5b828eafea2fd9e38a753f;hb=191f4e2ff4e447b1219a4d49975a8cbc1039eb65;hp=34a019a81593763c9b3cf7786d9ea500651bf2a5;hpb=4995a1c474420232ddbbc85cd1f22fda27597cf4;p=ndwebbie.git diff --git a/include.pl b/include.pl index 34a019a..fe3646d 100644 --- a/include.pl +++ b/include.pl @@ -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;