X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?a=blobdiff_plain;f=yarrg%2Fweb%2Fquery_routesearch;h=9c583b8899338489228249fef319dc360e7d3883;hb=3dbb2f33eae3a509123ffc99e48e35f858a8292a;hp=fadc20ed8db5d0b5b12e6942ba09742c9fa3854b;hpb=cb6af6f4bf6b6c3f7852912ebec58e773a724a5a;p=ypp-sc-tools.db-test.git
diff --git a/yarrg/web/query_routesearch b/yarrg/web/query_routesearch
index fadc20e..9c583b8 100644
--- a/yarrg/web/query_routesearch
+++ b/yarrg/web/query_routesearch
@@ -36,14 +36,17 @@
<%args>
$quri
$dbh
+$baseqf
$queryqf
$islandstring => '';
$capacitystring => '';
$lossperleague => '';
$capitalstring => '';
$distance => '';
+$prselector
$someresults
$emsgokorprint
+$allargs
%args>
<%perl>
@@ -64,12 +67,15 @@ my $maxcountea=15;
%perl>
+
Find most profitable routes and trades
% if ($qa->{Dropdowns}) {
This feature is not available from the "drop down menus" interface.
% } else {
+% $prselector->('RouteSearchType');
+
+
+
<%perl>
if (!$emsg && $maxdist > $maxmaxdist) {
@@ -104,9 +112,12 @@ if (!$emsg && $maxdist > $maxmaxdist) {
" supported, sorry.";
}
-$emsgokorprint->($emsg) or return;
-@islandids or return;
-defined $routeparams->{MaxMass} or defined $routeparams->{MaxVolume} or return;
+print("
"), return
+ unless $emsgokorprint->($emsg)
+ and @islandids
+ and $allargs->{'submit'}
+ and (defined $routeparams->{MaxMass} or
+ defined $routeparams->{MaxVolume});
#---------- prepare island names ----------
@@ -137,7 +148,9 @@ foreach my $k (qw(MaxMass MaxVolume MaxCapital)) {
push @rsargs, defined $routeparams->{LossPerLeaguePct}
? $routeparams->{LossPerLeaguePct}*0.01 : 1e-9;
push @rsargs, '0';
-push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea, 'any', @islandids;
+push @rsargs, 'search',$maxdist, $maxcountea,$maxcountea;
+push @rsargs, $ARGS{RouteSearchType} ? 'circ' : 'any';
+push @rsargs, @islandids;
m/[^-.0-9a-zA-Z]/ and die "$_ $& ?" foreach @rsargs;
@@ -199,7 +212,7 @@ while (<$fh>) {
for ($i=1; $i < @i-1; $i++) {
push @{ $item->{Vias} }, $i[$i];
}
- my %linkqf= %$queryqf;
+ my %linkqf= (%$baseqf, %$queryqf);
delete $linkqf{'query'};
$linkqf{'routestring'}= join ', ', @fi;
$item->{Url}= $quri->(%linkqf);
@@ -265,7 +278,7 @@ $someresults->();
% } else {
Best routes for profit per league
% }
-
+
@@ -285,7 +298,6 @@ $someresults->();
Start
| Via
| Finish
- |
| | | | | |
% my $datarow=0;
% my %sortkeys;
@@ -337,7 +349,4 @@ Per league values count each island visited as one
to be sailed. All profit figures are somewhat approximate; get a
complete trading plan for a route for accurate information.
-<%perl>
-
-
-%perl>
+
|
---|