version 1.7, 2000/10/19 03:05:39
|
version 1.9, 2000/10/20 00:39:27
|
Line 70 sub getField {
|
Line 70 sub getField {
|
chomp $key; |
chomp $key; |
if ($key eq 'Дата') { |
if ($key eq 'Дата') { |
$value =~ s/^(.*)-(.*)-(.*)$/$3-$2-$1/; |
$value =~ s/^(.*)-(.*)-(.*)$/$3-$2-$1/; |
my($month) = $RevMonths{$2}; |
my($month) = $RevMonths{$2} || '000'; |
$value =~ s/$2/$month/; |
$value =~ s/$2/$month/; |
} |
} |
$value = $dbh->quote($value); |
$value = $dbh->quote($value); |
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 173 sub DeleteTournament {
|
Line 174 sub DeleteTournament {
|
if($DeleteMyself) { |
if($DeleteMyself) { |
$sth = $dbh->prepare("DELETE FROM Tournaments |
$sth = $dbh->prepare("DELETE FROM Tournaments |
WHERE Id=$Id"); |
WHERE Id=$Id"); |
|
$sth->execute or die $dbh->errstr; |
} |
} |
} |
} |
|
|
|
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); |