version 1.159, 2010/04/24 18:04:14
|
version 1.161, 2010/09/24 09:05:48
|
Line 233 sub SelectQuestions {
|
Line 233 sub SelectQuestions {
|
# my $where=join " OR ",@$q; |
# my $where=join " OR ",@$q; |
my $where=join ',',@$q; |
my $where=join ',',@$q; |
$where &&= "QuestionId IN (".(join ',',$where).")"; |
$where &&= "QuestionId IN (".(join ',',$where).")"; |
$where||=1; |
$where||=0; |
$where="($where) AND Questions.ParentId=t1.Id AND t1.ParentId=t2.Id" |
$where="($where) AND Questions.ParentId=t1.Id AND t1.ParentId=t2.Id" |
if $WithTour; |
if $WithTour; |
|
|
Line 824 sub NoCase {
|
Line 824 sub NoCase {
|
|
|
sub PrintList { |
sub PrintList { |
my ($dbh,$Questions,$shablon,$was)=@_; |
my ($dbh,$Questions,$shablon,$was)=@_; |
|
my $total_found = $totalfound||$#$Questions+1; |
my $Output; |
my $Output; |
my $first=param('first') ||1; |
my $first=param('first') ||1; |
$first=$first-($first-1)%$outputkvo; |
$first=$first-($first-1)%$outputkvo; |
my $fkvo=param('fkvo')||($#$Questions+1); |
my $fkvo=param('fkvo')||$total_found; |
my $last=$first+$outputkvo-1; |
my $last=$first+$outputkvo-1; |
$last=$fkvo if $fkvo<$last; |
$last=$fkvo if $fkvo<$last; |
my($f,$l); |
my($f,$l); |
Line 899 sub PrintList {
|
Line 900 sub PrintList {
|
a({href=>$url."?".$qs."\&first=$llprint"},">>").(" "x4) |
a({href=>$url."?".$qs."\&first=$llprint"},">>").(" "x4) |
} |
} |
$Output.= "$nav".br."\n"; |
$Output.= "$nav".br."\n"; |
my @q=@$Questions[$first-1..$last-1]; |
my @q; |
|
if ($totalfound) { |
|
@q = @$Questions; |
|
} else { |
|
@q=@$Questions[$first-1..$last-1]; |
|
} |
my %q=(); |
my %q=(); |
my $sth=SelectQuestions($dbh,\@q,1); |
my $sth=SelectQuestions($dbh,\@q,1); |
my $qq; |
my $qq; |
Line 910 sub PrintList {
|
Line 916 sub PrintList {
|
$q{$Q[$_]{'QuestionId'}}=$Q[$_]; |
$q{$Q[$_]{'QuestionId'}}=$Q[$_]; |
} |
} |
|
|
for (my $i = $first; $i <= $last; $i++) { |
for my $i(0..$#q) { |
my $q=$q{$$Questions[$i-1]}; |
my $q=$q{$q[$i]}; |
my $output; |
my $output; |
$output = &PrintQuestion($dbh, $q, 1, 0, 1,$text,1 ); |
$output = &PrintQuestion($dbh, $q, 1, 0, 1,$text,1 ); |
# if (param('metod') && (param('metod') eq 'rus' || param('metod') eq 'proxy')) |
# if (param('metod') && (param('metod') eq 'rus' || param('metod') eq 'proxy')) |
Line 1235 sub PrintTournament {
|
Line 1241 sub PrintTournament {
|
} |
} |
if (!$isGroup) { |
if (!$isGroup) { |
$output .= center("<font size='-1'>[". |
$output .= center("<font size='-1'>[". |
a({href=>'/v2/print/'.$textid, target=>'_blank'}, 'версия для печати')."] [". |
a({href=>"/v2/tour/$textid/print", target=>'_blank'}, 'версия для печати')."] [". |
a({href=>'/v2/fb2/'.$textid, target=>'_blank'}, 'fb2')."]"."</font>"); |
a({href=>"/v2/tour/$textid/fb2", target=>'_blank'}, 'fb2')."]"."</font>"); |
} |
} |
|
|
return $output; |
return $output; |
Line 1355 sub PrintTour {
|
Line 1361 sub PrintTour {
|
"[" . a({href=>tourhref("$fname$nn",1)}, |
"[" . a({href=>tourhref("$fname$nn",1)}, |
"ответы") . "] " |
"ответы") . "] " |
} |
} |
$bottom .= "[".a({href=>'/v2/print/'.$fname, target=>'_blank'}, 'версия для печати')."] [". |
$bottom .= "[".a({href=>"/v2/tour/$fname/print", target=>'_blank'}, 'версия для печати')."] [". |
a({href=>'/v2/fb2/'.$fname, target=>'_blank'}, 'fb2')."]".br; |
a({href=>"/v2/tour/$fname/fb2/", target=>'_blank'}, 'fb2')."]".br; |
|
|
# $bottom .= "[".a({href=>'/v2/print/'.$fname.'.'.$Tour{'Number'}, target=>'_blank'}, 'версия для печати')."]".br; |
# $bottom .= "[".a({href=>'/v2/print/'.$fname.'.'.$Tour{'Number'}, target=>'_blank'}, 'версия для печати')."]".br; |
|
|