※上記の広告は60日以上更新のないWIKIに表示されています。更新することで広告が下部へ移動します。

#!C:\Perl\bin\perl

#ファイル
$soua='soua.txt';
$entry='kaku.cgi';

#テーブル背景色
$tbcolor1='#bbbbff';
$tbcolor2='#eeeeff';
$tbcolor3='#e0ffff';

#勝敗表示ファイル
open (ptitle,"$soua");
@sout = <ptitle>;
close (ptitle);
@soua=split(/<>/,"@sout");


#パスワード
open(PS,"<pass.cgi");
@PS=<PS>;
close(PS);
($ps0,$ps1,$ps2,$ps3,$ps4)=split(/<>/,"@PS");



#ファイルを読み込んで出力
open(NOTE,"<$entry");
@DATA=<NOTE>;
close(NOTE);

$datano=@DATA;
$cno= $datano -1;

if($ps2 < 1){$ps2 = 1;}
$waru = $ps2;

$block = int($datano / 2);

if($datano % $waru == 0) {$block = int($datano / $waru);}
else {$block = int($datano / $waru) + 1;}

use CGI;
$form=CGI->new();
$iteams=$form->param("teams");
if($iteams eq ''){$teams=$block;}else{$teams=$iteams;}


#データオープン
open (ptitle,"ptitle.txt");
@ptitle = <ptitle>;
close (ptitle);
($p0,$p1,$p2,$p3,$p4,$p5,$p6,$p7,$p8,$p9,$p10,$p11)=split(/<>/,"@ptitle");

#HTML作成
print "Content-type: text/html\n\n";
print <<"HTML";
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<HTML lang="ja">
<HEAD>
<META http-equiv="Content-Script-Type" content="text/javascript">
<META http-equiv="Content-Style-Type" content="text/css">
<META http-equiv="Content-Type" content="text/html; charset=Shift_JIS">
<TITLE>$ps0</TITLE>
</HEAD>
<BODY style="background-color:$p0">

HTML




$wid = (80+50+30)+(71*$teams)+(14*4);

print << "HTML";
$p10
<div style="text-align:center">
<span style="font-size:20;">$p3</span>
<BR>
<span style="font-size:$p5; color:$p6">$p4</span><BR>
<span style="font-size:$p8; color:$p9">$p7</span>

HTML

$ALL=0;
$all_no1 = 0;
$all_no2 = 0;
$bn = A;
for($a=0; $waru > $a;$a++){
if($ps2 > 1){print"<span style=\"font-size:18px\"><strong><BR>$bnブロック</strong></span>";}
$bn++;

if($ps2 > 1){
open (IN,"block.txt");
@block_op = <IN>;
close (IN);
print << "HTML";
  <span style="color:#ff0000"><strong>勝者「@block_op[$a]」</strong></span>
HTML
}


print << "HTML";
<table style="width:$wid; background-color:$tbcolor1" summary="外枠"><TR><TD>
<TABLE summary="上枠"><TR><TD>
<table cellspacing=4 style="background-color:$tbcolor1">
<TR style="background-color:$tbcolor3">
<TD style="width:80px; height:30px; text-align:center">エントリー</TD>
</TR></table>
</TD><TD>
<table cellspacing=4 style="background-color:$tbcolor1">
<TR style="background-color:$tbcolor3">
HTML

for($i=0;$i<$teams;$i++){
($dt1,$dt2)=split(/\t/,@DATA[$all_no1]);
$all_no1 ++;
print << "HTML";
<TD style="width:65px; height:30px; text-align:center">
<code><span style="font-size:12px;color:#000000">$dt1</span>
<BR><span style="font-size:12px;color:#0000f0">$dt2</span></code></TD>
HTML
}
print << "HTML";
<TD style="width:50px; text-align:center">点</TD>
</TR></table>
</TD><TD>
<table cellspacing=4 style="background-color:$tbcolor1">
<TR style="background-color:$tbcolor3">
<TD style="width:30px; height:30px; text-align:center"><code>順位</code></TD>
</TR></table>
</TR></table>
<TABLE summary="下大枠"><TR><TD>
HTML



for($i=0;$i<$teams;$i++){
($dt1,$dt2)=split(/\t/,@DATA[$all_no2]);
$all_no2 ++;
print <<"HTML";
<table cellspacing=4 style="background-color:$tbcolor1">
<TR style="background-color:$tbcolor3">
<TD style="height:26px; width:80px; text-align:right">$dt1</TD>
</TR></table>
HTML
}
print"</TD><TD>";#中の大枠、左から右

for($no=0;$no<$teams;$no++){
print"<table cellspacing=4 style=\"background-color:$tbcolor1\">
<TR style=\"background-color:$tbcolor2\">";
for($non=0;$non<$teams;$non++){
	if($no == $non){print"<TD 
style=\"height:26px; width:65px; text-align:center; background-color:#cccccc\"
  • ";}
	if($no != $non){
		if($no < $non){
		print "
		<TD style=\"width:65px; text-align:center;\"><strong>@soua[$ALL]</strong>";$ALL++;
		}

		if($no > $non){
		print"<TD style=\"width:65px; text-align:center;\"><strong>@soua[$ALL]</strong>";$ALL++;
		}
	}
}

print"</TD><TD style=\"width:50px; text-align:center;\">@soua[$ALL]
</TD></TR></table>";
$ALL++;
}
print"</TD><TD>";


for($i=0;$i<$teams;$i++){
print "<table cellspacing=4 style=\"background-color:$tbcolor1\">
<TR style=\"background-color:$tbcolor2\">";
if(@soua[$ALL] eq "1"){print"
<TD style=\"background-color:#ffd0d0; height:26px; width:30px; text-align:center;\">";}
else{print "<TD style=\"height:26px; width:30px; text-align:center;\">";}
print"@soua[$ALL]</TD></TR></table>";
$ALL++;
}


print <<"HTML";
</TD></TR></table>
</TD></TR></table>
HTML
}

print <<"HTML";
</div>
</BODY></HTML>
HTML

exit;