Parašė Hardrock· 2008 Vas. 12 18:02:14
#16
Jeigu ir dabar nerodo - galutinis variantas yra toks.
<?
require_once "../../maincore.php";
require_once BASEDIR."subheader.php";
require_once BASEDIR."side_left.php";
opentable("rezai");
echo "<table width='100%'>\n";
$uzklausa=mysql_query("SELECT komanda1, rez1, rez2, komanda2 from ".$db_prefix."keitimai order by id");
if (dbrows($uzklausa)) {
echo "<tr>
<td class='tbl1'><b>Komanda</b></td>
<td class='tbl1'><b>rezultatas</b></td>
<td class='tbl1'><b>rezultatas</b></td>
<td class='tbl1'><b>Komanda</b></td>
<td class='tbl1'>Skirtumas</td>
</tr>\n";
$i = 1;
while ($data = dbarray($uzklausa)) {
$rez1 = $data['rez1'];
$rez2 = $data['rez2'];
$skirtumas = $rez1 - $rez2;
$i = $i+1;
$tbl = $i%2 == 0 ? "class='tbl2'" : "class='tbl1'";
echo "<tr>
<td $tbl>".$data['komanda1']."</td>
<td $tbl>".$data['rez1']."</td>
<td $tbl>".$data['rez2']."</td>
<td $tbl>".$data['komanda2']."</td>
<td $tbl> $skirtumas</td>
</tr>\n";
}
}
echo "</table>\n";
closetable();
require_once BASEDIR."side_right.php";
require_once BASEDIR."footer.php";
?>