X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fpirate-route;h=e414e6e87513cfda4f030fbd1f224bb273e6b349;hb=55c0517c2048155553c3e593125135ba83acd679;hp=f58d47c20f450041eb39d2b13ee3d8784b4f1442;hpb=007700c6236644463a0e78724b8260f14be4bedd;p=ypp-sc-tools.web-live.git diff --git a/yarrg/web/pirate-route b/yarrg/web/pirate-route index f58d47c..e414e6e 100644 --- a/yarrg/web/pirate-route +++ b/yarrg/web/pirate-route @@ -7,7 +7,7 @@ my @vars; @vars= ({ Name => 'Ocean', Before => 'Ocean: ', CmpCanon => sub { ucfirst lc $_[0] }, - Values => [ qw(Midnight Ice) ] + Values => [ ocean_list() ] }, { Name => 'Dropdowns', Before => 'Interface: ', CmpCanon => sub { !!$_[0] }, @@ -55,7 +55,7 @@ foreach my $var (@vars) { $qf{$n}= $value; } } - my $uri= URI->new($self_url); + my $uri= URI->new($m->current_comp()->name()); $uri->query_form(%qf); print ''; $after= ''; @@ -66,6 +66,9 @@ foreach my $var (@vars) { print '

'; } +die "unknown ocean $a{Ocean} ?" + unless grep { $_ eq $a{Ocean} } ocean_list(); + db_setocean($a{Ocean}); db_connect(); @@ -75,73 +78,118 @@ db_connect();

% if (!$a{Dropdowns}) { -Enter route (islands, or archipelagoes, separated by commas; +Enter route (islands, or archipelagoes, separated by |s or commas; abbreviations are OK):

-

+ onchange="tr_element= event.currentTarget; tr_Needed();" + onkeydown="tr_element= event.currentTarget; tr_Later();">
+
 

% } else { <%perl> -my $sth=$dbh->prepare("SELECT islandid,islandname +my $sth=$dbh->prepare("SELECT islandid,islandname,archipelago FROM islands ORDER BY islandname;"); $sth->execute(); my $row; my $islandlistdata=''; +my %archmap=(); while ($row=$sth->fetchrow_arrayref) { $islandlistdata.= sprintf('', - map { encode_entities($_) } @$row); + map { encode_entities($_) } @$row[0..1]); + $archmap{$row->[0]}= $row->[2]; +} + +$sth=$dbh->prepare("SELECT DISTINCT archipelago FROM islands + ORDER BY archipelago;"); +$sth->execute(); +my $archlistdata=''; + +while ($row=$sth->fetchrow_arrayref) { + $archlistdata.= + sprintf('', + map { encode_entities($_) } (@$row, @$row)); } + + + + +% for my $dd (0..$a{Dropdowns}-1) { + +% } + + % for my $dd (0..$a{Dropdowns}-1) { % } +
% }