#!/usr/bin/perl
print "Content-type: text/html\n\n";
print "\n";
print "
\n";
print "";
print "a";
print "\n";
print "\n";
$kdo = '0'; # 0 vsechny teamy jinak vyber
$kdo = 'ZNO'; # 0 vsechny teamy jinak vyber
use Env;
@tempo = split /&/, $QUERY_STRING;
#print "
Pocet polozek: ",$#tempo,"
";
for $i ( 0 .. $#tempo ){
@temp = split /=/, $tempo[$i];
if ($temp[0] eq "kdo") { $kdo = $temp[1]; }
};
@team = '';
@hraci = '';
open (SBR, 'data.hraci.csv');
while ( ) {
chomp;
push(@hraci, $_)
};
close (SBR);
open (SBR, 'data.team.csv');
while ( ) {
chomp;
push(@team, $_)
};
close (SBR);
# ---- Nazev teamu ----------------------------------
for $i (1 .. $#team){
@tmp = split ";",$team[$i];
if ($kdo eq $tmp[1]) { $nad = $tmp[3];}
}
print "\n";
print "\n";
print "";
print $nad;
print " | \n";
print "
\n";
print "
\n";
print "\n";
print "\n";
print " | \n";
print "post | \n";
print "jméno | \n";
print "číslo | \n";
print "ročník | \n";
print "
\n";
$q = '0';
for $i(1 .. $#hraci){
@tmp = split ";",$hraci[$i];
if ($tmp[0] eq $kdo){
$q = $q + 1;
if ($q eq "1") { $color = "#E5E5E5";}
if ($q eq "2") {
$color = "#E2E4FE";
$q = 0;}
print "\n";
print " | \n";
print "\n";
if ($tmp[1] eq "b") { print "brankář"; }
if ($tmp[1] eq "o") { print "obránce"; }
if ($tmp[1] eq "u") { print "útočník"; }
if ($tmp[1] eq "t") { print "trenér"; }
print " | \n";
print "",$tmp[2]," | \n";
print "",$tmp[3]," | \n";
print "",$tmp[4]," | \n";
print "
\n";
}
}
print "
\n";