<html><head><meta http-equiv="content-type" content="text/html; charset=cp1251">
<title>Игра Словеса</title>
</head><body><center>
<b>Заголовок</b>
<br>
<br>
<table>
<td bgcolor="#A9A9A9" align=Center><b>Место</b></td>
<td bgcolor="#A9A9A9" align=Center><a href="stats.php?sort=1"><b>Ник </b></a></td>
<td bgcolor="#A9A9A9" align=Center><a href="stats.php?sort=2"><b>Столбик 1</b></a></td>
<td bgcolor="#A9A9A9" align=Center><a href="stats.php?sort=3"><b>Столбик 2</b></a></td>
<td bgcolor="#A9A9A9" align=Center><a href="stats.php?sort=4"><b>Столбик 3</b></a></td><tr>
<?
$lines = file('victlist.txt');
$i = 0;
foreach ($lines as $line_num => $line) {
$arr = explode(" ", $line);
$place[$i] = $i;
$nicks[$i] = $arr[0];
$st1[$i] = $arr[1];
$st2[$i] = $arr[2];
$st3[$i] = $arr[3];
$i++;
}
if (isset($_GET['sort'])) {
switch ($_GET['sort']) {
case 1:
array_multisort ( $nicks, SORT_ASC, SORT_STRING, $st1, $st2, $st3);
break;
case 2:
array_multisort ( $st1, SORT_DESC, SORT_NUMERIC, $st2, $st3, $nicks);
break;
case 3:
array_multisort ( $st2, SORT_DESC, SORT_NUMERIC, $st3, $nicks, $st1);
break;
case 4:
array_multisort ( $st3, SORT_DESC, SORT_NUMERIC, $nicks, $st1, $st2);
break;
}
}
$i = 0;
foreach ($lines as $line_num => $line) {
$lines[$i] = "$nicks[$i] $st1[$i] $st2[$i] $st3[$i]";
$i++;
}
$i = 0;
foreach ($lines as $line_num => $line) {
$i++;
$arr = explode(" ", $line);
$ka = $i / 2;
if ($arr[0] == "") { continue;}
if (is_int($ka)) { $color = "#c8d2df"; } else { $color = "#c8d2df"; }
echo "<td align=center bgcolor=$color nowrap>$i</td>";
echo "<td align=center bgcolor=$color nowrap>$arr[0]";
echo "<td align=center bgcolor=$color nowrap>$arr[1]</td>";
echo "<td align=center bgcolor=$color nowrap>$arr[2]</td>";
echo "<td align=center bgcolor=$color nowrap>$arr[3]</td><tr>";
}
?>
</font>
</TABLE></center><br>
</center></body></html>