#!/usr/bin/perl #!perl #require "parse.pl"; use lib qw/./; use parse; $data="../dat"; parse_form; if ($FORM{'select'} eq '') {$FORM{'select'}='vw';} if ($FORM{'id'} eq '') {$FORM{'id'}=0;} require "vote.pl"; open CDT, "$data/topic.dat"; @cdt=; close CDT; push @HTML, <Заказать диски
EOF open CD, "$data/vm.dat"; @cd=; close CD; $need=$FORM{'select'}; push @HTML, "". ""; $ltopic=''; for ($n=0; $n<@cd; $n++) { chomp $cd[$n]; ($id, $topic, $title, $exist)=split /\|/, $cd[$n]; unless ($exist) {$exist=' '}; if ($topic eq $need) { if ($ltopic ne $topic) { $ltopic=$topic; $cid=0; push @HTML, ""; } if (($cid>=$FORM{'id'}) && ($cid<$FORM{'id'}+40)) { my $sss='+' if $exist; push @HTML, ""; } if ($cid<$FORM{'id'}+40) {$cid++;} } } $cid--; push @HTML, "
Код
". "Наименование
В наличии
". "
$TOPICS{$topic}
$id$title$sss
"; push @HTML, "
Дальше
" if ($cid>$FORM{'id'}); &OutHTML; ##################################################################### ##################################################################### ##################################################################### sub OutHTML { print "Content-type: text/html\n\n"; open HTM, "../cd.htm"; while ($s=) { print $s; if ($s=~//) {print @HTML;} if ($s=~//) {print $out_htm;} } close HTM; }