version 1.2, 2002/01/15 03:34:31
|
version 1.4, 2002/01/17 08:00:24
|
Line 1
|
Line 1
|
#!perl |
#!perl |
use DBI; |
use DBI; |
@months=('000','Jan',"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct", |
@months=('000','Jan',"Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct", |
"Nov","Dec"); |
"Nov","Dec"); |
Line 29 sub WriteFile {
|
Line 29 sub WriteFile {
|
Editors, EnteredBy, PlayedAt, CreatedAt |
Editors, EnteredBy, PlayedAt, CreatedAt |
from Tournaments where FileName=".$dbh->quote("$fname.txt"); |
from Tournaments where FileName=".$dbh->quote("$fname.txt"); |
my $sth=$dbh->prepare($query); |
my $sth=$dbh->prepare($query); |
my (%Question,%editor,%qnumber,%copyright,%author,%vid,%tourtitle); |
my (%Question,%editor,%qnumber,%copyright,%author,%vid,%tourtitle,%info); |
$sth->execute; |
$sth->execute; |
my ($Id, $Title, $Copyright, $Info, $URL, |
my ($Id, $Title, $Copyright, $Info, $URL, |
$Editors, $EnteredBy, $PlayedAt, $CreatedAt)= |
$Editors, $EnteredBy, $PlayedAt, $CreatedAt)= |
Line 48 sub WriteFile {
|
Line 48 sub WriteFile {
|
|
|
print OUT "Дата:\n".PrintDate($PlayedAt)."\n\n" if $PlayedAt; |
print OUT "Дата:\n".PrintDate($PlayedAt)."\n\n" if $PlayedAt; |
|
|
|
print OUT "Обработан:\n$EnteredBy\n\n" if $EnteredBy; |
|
|
$query= "SELECT Id, Title, Copyright, Editors, PlayedAt from Tournaments where ParentId=$Id order by Id"; |
|
|
$query= "SELECT Id, Title, Copyright, Editors, PlayedAt, Info from Tournaments where ParentId=$Id order by Id"; |
$sth=$dbh->prepare($query); |
$sth=$dbh->prepare($query); |
$sth->execute; |
$sth->execute; |
my ($tourid,$tourtitle,$cright,$editor,@tours,$vid,$author,$tourauthor); |
my ($tourid,$tourtitle,$cright,$editor,@tours,$vid,$author,$tourauthor); |
|
|
|
|
while (($tourid,$tourtitle,$cright,$editor,$date)=$sth->fetchrow,$tourid) |
while (($tourid,$tourtitle,$cright,$editor,$date,$info)=$sth->fetchrow,$tourid) |
{ |
{ |
# $text{$tourid}="Тур:\n$tourtitle\n\n"; |
# $text{$tourid}="Тур:\n$tourtitle\n\n"; |
$query= "SELECT * from Questions where ParentId=$tourid order by QuestionId"; |
$query= "SELECT * from Questions where ParentId=$tourid order by QuestionId"; |
Line 64 sub WriteFile {
|
Line 66 sub WriteFile {
|
push(@tours,$tourid); |
push(@tours,$tourid); |
$tourtitle{$tourid}=$tourtitle; |
$tourtitle{$tourid}=$tourtitle; |
$copyright{$tourid}=$cright; |
$copyright{$tourid}=$cright; |
|
$info{$tourid}=$info; |
$editor{$tourid}=$editor; |
$editor{$tourid}=$editor; |
$date{$tourid}=$date; |
$date{$tourid}=$date if $date; |
$vid=''; |
$vid=''; |
my $author=''; |
my $author=''; |
my $eqauthor=1; |
my $eqauthor=1; |
Line 111 sub WriteFile {
|
Line 114 sub WriteFile {
|
my $eqvid=1; |
my $eqvid=1; |
my $eqauthor=1; |
my $eqauthor=1; |
my $eqdate=1; |
my $eqdate=1; |
|
my $eqinfo=1; |
$date=''; |
$date=''; |
|
|
|
|
Line 131 sub WriteFile {
|
Line 135 sub WriteFile {
|
{ |
{ |
$eqdate=0; |
$eqdate=0; |
} |
} |
|
$info||=$info{$_}; |
|
if (!$info{$_} || ($info{$_} ne $info)) |
|
{ |
|
$eqinfo=0; |
|
} |
|
|
} |
} |
print OUT "Вид:\n$vid\n\n" if $eqvid; |
print OUT "Вид:\n$vid\n\n" if $eqvid; |
print OUT "Автор:\n$author\n\n" if $eqauthor; |
print OUT "Автор:\n$author\n\n" if $eqauthor; |
Line 141 sub WriteFile {
|
Line 151 sub WriteFile {
|
print OUT "Вид:\n$vid{$tour}\n\n" if !$eqvid; |
print OUT "Вид:\n$vid{$tour}\n\n" if !$eqvid; |
print OUT "Копирайт:\n$copyright{$tour}\n\n" if $copyright{$tour} && ($copyright{$tour} ne $Copyright); |
print OUT "Копирайт:\n$copyright{$tour}\n\n" if $copyright{$tour} && ($copyright{$tour} ne $Copyright); |
print OUT "Редактор:\n$editor{$tour}\n\n" if $editor{$tour} && ($editor{$tour} ne $Editors); |
print OUT "Редактор:\n$editor{$tour}\n\n" if $editor{$tour} && ($editor{$tour} ne $Editors); |
print OUT "Дата:\n".PrintDate($date{$tour})."\n\n" if !$eqdate && $date{$tour} || !$PlayedAt; |
print OUT "Дата:\n".PrintDate($date{$tour})."\n\n" if $date{$tour} && (!$eqdate || !$PlayedAt || $PlayedAt ne $date{$tour}); |
|
print OUT "Инфо:\n$info{$tour}\n\n" if $info{$tour} && (!$eqinfo || !$Info || $Info ne $info{$tour}); |
$tourauthor=0; |
$tourauthor=0; |
if (!$eqauthor && $author{$tour}) |
if (!$eqauthor && $author{$tour}) |
{ |
{ |