include("samon.php");
if ($plane == "")
{
$plane="init";
}
$qh = mysql_query("select description from samon where plane='$plane' AND x=0 AND y=0");
if ($qh > 0 && mysql_num_rows($qh) > 0)
{
list($description) = mysql_fetch_row($qh);
mysql_free_result($qh);
}
else
{
for ($x=0; $x<12; $x++)
{
for ($y=0; $y<12; $y++)
{
$qh = mysql_query("INSERT INTO samon (plane, x, y) VALUES ('$plane', $x, $y)");
}
}
}
echo "
";
for ($x=0; $x<12; $x++)
{
echo "";
$qh = mysql_query("SELECT type, parm1, parm2, parm3, parm4 FROM samon WHERE plane='$plane' AND x=$x ORDER BY y");
for ($y=0; $y<12; $y++)
{
list($type, $parm1, $parm2, $parm3, $parm4) = mysql_fetch_row($qh);
$delta = s_draw($type, $parm1, $parm2, $parm3, $parm4);
while ($delta > 1)
{
list($type, $parm1, $parm2, $parm3, $parm4) = mysql_fetch_row($qh);
$delta --;
$y++;
}
}
mysql_free_result($qh);
echo "
\n";
echo "";
for ($y=0; $y<12; $y++)
{
echo "| ";
echo "";
echo "EDIT | ";
}
echo "
\n";
}
?>