X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~yarrgweb/git?p=ypp-sc-tools.web-live.git;a=blobdiff_plain;f=yarrg%2Fweb%2Froutetrade;h=72e9bf7a8a96cf706e4557d6fd26cadfb2dfd2e2;hp=08bad334569ea32178ec8e6e7d3345bf4d8060e5;hb=9c3c0cfe4257a1365c8d82ff6f9b7908a4eb74a1;hpb=aeb0304dee70abf1c3a674d5eb38a45b0df7cd41 diff --git a/yarrg/web/routetrade b/yarrg/web/routetrade index 08bad33..72e9bf7 100644 --- a/yarrg/web/routetrade +++ b/yarrg/web/routetrade @@ -693,25 +693,31 @@ Generated by YARRG at <% } unless $$todo; $$todo->{'commodname'}= $f->{'commodname'}; $$todo->{'posinclass'}= ''; - if ($f->{'posinclass'}) { - my $findclass= $dbh->prepare(<{'posinclass'}; + + my $findclass= $dbh->prepare(<execute($f->{'commodclassid'}); - my $classinfo= $findclass->fetchrow_hashref(); - if ($classinfo->{'maxposinclass'} >= 8) { + $findclass->execute($f->{'commodclassid'}); + my $classinfo= $findclass->fetchrow_hashref(); + if ($classinfo) { + my $clname= $classinfo->{'commodclass'}; + my $desc= encode_entities(sprintf "%s is under %s", + $f->{'commodname'}, $clname); + my $abbrev= substr($clname,0,1); + if ($incl) { my $maxpic= $classinfo->{'maxposinclass'}; - my $inpic= $f->{'posinclass'}; - my @tmbs= qw(TT T M B BB); - my $tmbi= ($inpic+0.5)*$#tmbs/$maxpic; - my $desc= (sprintf "%s is under %s,". - " commodity %d of %d", - $f->{'commodname'}, - $classinfo->{'commodclass'}, - $inpic, $maxpic); - $$todo->{'posinclass'}= - "
$tmbs[$tmbi]
"; + $desc.= (sprintf ", commodity %d of %d", + $incl, $maxpic); + if ($classinfo->{'maxposinclass'} >= 8) { + my @tmbs= qw(tt t m b bb); + my $tmbi= ($incl+0.5)*$#tmbs/$maxpic; + $abbrev.= " ".$tmbs[$tmbi]; + } } + $$todo->{'posinclass'}= + "
" + .$abbrev."
"; } $$todo->{'stallname'}= $stallname; $$todo->{Price}= $price;