version 1.7, 2000/10/19 03:05:39
|
version 1.8, 2000/10/19 03:28:25
|
Line 106 sub SelectGroup {
|
Line 106 sub SelectGroup {
|
print "[$arr[0]] $arr[1]\n"; |
print "[$arr[0]] $arr[1]\n"; |
} |
} |
$ParentId = <STDIN>; |
$ParentId = <STDIN>; |
|
chomp $ParentId; |
if (!$ParentId) { |
if (!$ParentId) { |
print "Пропускаем файл $source\n"; |
print "Пропускаем файл $source\n"; |
print STDERR "Файл $source отвергнут оператором\n"; |
print STDERR "Файл $source отвергнут оператором\n"; |
Line 115 sub SelectGroup {
|
Line 116 sub SelectGroup {
|
$sth = $dbh->prepare("INSERT INTO Tournaments |
$sth = $dbh->prepare("INSERT INTO Tournaments |
(Title, Type, ParentId, FileName) |
(Title, Type, ParentId, FileName) |
VALUES ($TourName, 'Ч', $ParentId, |
VALUES ($TourName, 'Ч', $ParentId, |
$source"); |
$source)"); |
$sth->execute; |
$sth->execute; |
my $TournamentId = $sth->{mysql_insertid}; |
my $TournamentId = $sth->{mysql_insertid}; |
return ($TournamentId,$ParentId); |
return ($TournamentId,$ParentId); |
Line 175 sub DeleteTournament {
|
Line 176 sub DeleteTournament {
|
WHERE Id=$Id"); |
WHERE Id=$Id"); |
} |
} |
} |
} |
|
|
|
sub GetTours { |
|
my ($dbh, $ParentId) = @_; |
|
my (@arr, @Tours); |
|
|
|
my ($sth) = $dbh->prepare("SELECT Id FROM Tournaments |
|
WHERE ParentId=$ParentId ORDER BY Id"); |
|
|
|
$sth->execute; |
|
|
|
while (@arr = $sth->fetchrow) { |
|
push @Tours, $arr[0]; |
|
} |
|
|
|
return @Tours; |
|
} |
|
|
|
|
MAIN: |
MAIN: |
{ |
{ |
my($key, $value, $addition); |
my($key, $value, $addition); |