chiark
/
gitweb
/
~yarrgweb
/
ypp-sc-tools.web-live.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Tickbox for each line
[ypp-sc-tools.web-live.git]
/
yarrg
/
web
/
query_route
diff --git
a/yarrg/web/query_route
b/yarrg/web/query_route
index 66dee1dd08135de011871b15d71d963f7db235af..18c3ecb1390af1f2d3a3fc4f2108d2a64f5c90ce 100644
(file)
--- a/
yarrg/web/query_route
+++ b/
yarrg/web/query_route
@@
-35,6
+35,8
@@
</%doc>
<%args>
$quri
</%doc>
<%args>
$quri
+$dbh
+$prselector
$routestring => '';
$someresults
$emsgokorprint
$routestring => '';
$someresults
$emsgokorprint
@@
-49,17
+51,20
@@
my %islandid2;
my $qa= \%ARGS;
</%perl>
my $qa= \%ARGS;
</%perl>
+<h1>Specify route</h1>
+
+% $prselector->('ShowStalls');
+
%#---------- textbox, user enters route as string ----------
% if (!$qa->{Dropdowns}) {
%#---------- textbox, user enters route as string ----------
% if (!$qa->{Dropdowns}) {
-<h1>Specify route</h1>
-
Enter route (islands, or archipelagoes, separated by |s or commas;
abbreviations are OK):<br>
<form action="<% $quri->() |h %>" method="get">
Enter route (islands, or archipelagoes, separated by |s or commas;
abbreviations are OK):<br>
<form action="<% $quri->() |h %>" method="get">
-<&| qtextstring, qa => $qa, thingstring => 'routestring', emsgstore => \$emsg,
+<&| qtextstring, qa => $qa, dbh => $dbh,
+ thingstring => 'routestring', emsgstore => \$emsg,
perresult => sub {
my ($canonname, $island, $arch) = @_;
push @islandids, $island;
perresult => sub {
my ($canonname, $island, $arch) = @_;
push @islandids, $island;
@@
-90,8
+95,6
@@
my $optionlistmap= sub {
return $out;
};
return $out;
};
-my $dbh= dbw_connect($qa->{Ocean});
-
$sth= $dbh->prepare("SELECT DISTINCT archipelago FROM islands
ORDER BY archipelago;");
$sth->execute();
$sth= $dbh->prepare("SELECT DISTINCT archipelago FROM islands
ORDER BY archipelago;");
$sth->execute();
@@
-120,8
+123,6
@@
foreach my $arch (keys %islandlistdata) {
$optionlistmap->($islandlistdata{$arch}, '');
}
$optionlistmap->($islandlistdata{$arch}, '');
}
-$dbh->rollback();
-
</%perl>
<&| script &>
</%perl>
<&| script &>
@@
-165,9
+166,8
@@
function ms_Setarch(dd) {
% } #---------- end of dropdowns, now common middle of page code ----------
<input type=submit name=submit value="Go">
% } #---------- end of dropdowns, now common middle of page code ----------
<input type=submit name=submit value="Go">
-% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring/; };
+% my $ours= sub { $_[0] =~ m/^island|^archipelago|^routestring
|^rtsel[ag]_
/; };
<& "lookup:formhidden", ours => $ours &>
<& "lookup:formhidden", ours => $ours &>
-</form>
<%perl>
#========== results ==========
<%perl>
#========== results ==========
@@
-206,5
+206,11
@@
for my $dd (0..$qa->{Dropdowns}-1) {
% if (@islandids) {
% $someresults->();
% if (@islandids) {
% $someresults->();
-<& routetrade, islandids => \@islandids, archipelagoes => \@archipelagoes &>
+<& routetrade,
+ dbh => $dbh,
+ islandids => \@islandids,
+ archipelagoes => \@archipelagoes,
+ qa => $qa
+ &>
+</form>
% }
% }