Документ взят из кэша поисковой машины. Адрес оригинального документа : http://hea.iki.rssi.ru/Z-90/program.pl~
Дата изменения: Sun Dec 12 23:30:00 2004
Дата индексирования: Mon Oct 1 20:17:54 2012
Кодировка:

Поисковые слова: rosat
#!/usr/bin/perl

#use Text::BibTeX;


require "bp.pl";

%posterw=();
$posterw{'A'}=100;
$posterw{'B'}=200;
$posterw{'C'}=300;
$posterw{'D'}=400;

# get current time and data
@TIME = localtime(time);
$DATE = @TIME[3].".".(@TIME[4]+1).".".(@TIME[5]+1900);
$time = @TIME[2].":".@TIME[1].":".@TIME[0];


$bib_file1="/export/web/www/Z-90/data/z90-form.bib";
$bib_file2="/export/web/www/Z-90/data/reg-db.bib";

$head="/export/web/www/Z-90/head.html";
$tail="/export/web/www/Z-90/tail.html";
$form="form";

@TIME = localtime(time);
$DATE = @TIME[3].".".(@TIME[4]+1).".".(@TIME[5]+1900);
$time = @TIME[2].":".@TIME[1].":".@TIME[0];
$query;

if($ENV{'REQUEST_METHOD'} eq 'GET'){
$query = $ENV{'QUERY_STRING'};
}elsif($ENV{'REQUEST_METHOD'} eq 'POST'){
sysread(STDIN,$query,$ENV{'CONTENT_LENGTH'});
}
$query=urldecode($query);



if($query ne ''){
@fvalues = split(/&/,$query);

foreach $i (0 .. $#fvalues){
$str=$fvalues[$i];
($name,$val) = split(/=/,$fvalues[$i],2);
$name=&urldecode($name);
$val=&urldecode($val);
$field{$name} = $val;
}
}

$bib_file=$bib_file1;
if(defined $field{'db'}){
$bib_file=$bib_file1 if ($field{'db'} eq "1");
$bib_file=$bib_file2 if ($field{'db'} eq "2");
}

print "Content-Type: text/html\n\n";


if(checkf($head)){
open FD,"<$head" ;
while (){
print;
}close FD;
}

$totrecs = 0;


if(checkf($tail)){
open FD,"<$tail" ;
while (){
print;
}close FD;
}



sub urldecode{
local($val)=@_;
#$val =~ s/\+/ /g;
$val =~ s/%([0-9a-hA-H]{2})/pack('C',hex($1))/ge;
return $val;
}


sub check{
&bib'format("auto");

%prelist=();

print "";

$oral=1;

start:
$totrecs=0;
$cdinner=0;
$calive=0;
%prelist=();
foreach $file ($bib_file1,$bib_file2){

next unless &bib'open($file);
while ($record = &bib'read($file)){
%entry = &bib'explode($record);
next if(defined $entry{'unable'});
next if(defined $entry{'hide'});
next if(defined $entry{'oral'});
next unless(defined $entry{'confirm_poster'});
next if(defined $entry{'no_report'});
next if(defined $entry{'use_preregistration'});
$poster="";
$hotel="";


# if($oral){
# next unless(defined $entry{'oral'});
# $poster="hotel" if(defined $entry{'confirmed'});
# }else{
# next if(defined $entry{'oral'});
# $poster="confirm" if(defined $entry{'confirm_poster'});
# }

#unless(defined $entry{'oral'}){
# next unless($entry{'alive'} eq "yes");
#}

$poster="confirm" if(defined $entry{'confirm_poster'});
$entry{'author'} = $entry{'author1'}." ".$entry{'author2'} unless(defined $entry{'author'});
$work = $entry{'author'};
$work =~ s/^([A-Za-z])[a-z]*/$1./;
$work =~ s /\.\./\./;
@l = split ' ',$work;
$work =~ s / /\ /;
$entry{'author'}=$work;
$key = pop @l; push @l," $key";

$key=$entry{'poster_num'};
$k=$key;
$k =~ s/(.)//; $first_letter = $1;
($keynum) = split ('\D',$k);
$key = $posterw{$first_letter} + $keynum;
if(defined $prelist{$key}){
$key.=$idx++;
print "WARNING: $prelist{$key}
" if(defined $prelist{$key});
}


if($entry{'poster_num'} ne ""){
$prelist{$key}.=" $entry{'poster_num'}\n";
}else{
if($entry{'oral'} ne ""){
$prelist{$key}.="talk\n";
}else{
$prelist{$key}.=" \n";
}
}

$prelist{$key}.="$entry{'author'}\n";

#$entry{'title'}=~s/^ /_/;

if((!defined $entry{'oral'}) && (!defined $entry{'confirm_poster'})){
$prelist{$key}.=" \n";
}else{
if($entry{'abstract'} ne ""){
$abstract=$entry{abstract};
$abstract=~s/\'+/´/g;
$abstract=~s/\"/´/g;
$abstract=~s/\\+/\\\\/g;
$prelist{$key}.=
"$entry{'title'}\n";
}else{
$prelist{$key}.="$entry{'title'}\n";
}
}

#$prelist{$key}.=" $poster\n";

#if(defined $entry{'alive'}){
# $calive++;
# $prelist{$key}.=" $entry{'alive'}\n";
#}else{
# $prelist{$key}.=" \n";
#}
$prelist{$key}.="\n";
$totrecs++;
}
&bib'close($file);
}


$c=1;
print "";
print "";
open HTML," while(){
if(/^ next if($c);
s/bgcolor=\"\#ffffff\"//;
if(/\/12/){
s/size=\"4\">/size=\"3\" style=\"font-weight:bold;\">/;
}else{
s/size=\"4\">/size=\"2\" >/;
}

s/font-size:x-small/font-size:small/;
s/font-family:\"Arial\";//;

s/bgcolor=\"\#99ccff\"//;
s/bgcolor=\"\#ffcc99\"/style=\"font-weight:bold;\"/;

s/<\/body>//;
s/<\/html>//;


print;
}
close HTML;
print "";

print "
POSTER SESSION

";



print "";
#print "";

foreach $i (sort keys %prelist){
print "$prelist{$i}";
}
print "
ParticipantP (\%)Title From...
";



print "";

}

sub checkf{
unless (-f $_[0]){
print "ERROR: Can\'t open file \"$_[0]\"" ;
return false;
}else{
return true;
}
}