<? include('checkcookie.php');

$status=$_POST["status"];
if($status=="del")
{ $id=$_POST["id"];
 mysql_query("DELETE FROM wel_xak WHERE id='$id'");
 echo "<br><center>Запись удалена</center>";
}

echo <<<HTML
<center><br><br><table width=600 cellspacing="0" cellpadding="0">
<tr>
<th width=20 align=center>№id</th>
<th width=100 align=center>username</th>
<th width=150 align=center>ip Пользователя</th>
<th width=130 align=center>Дата</th>
<th width=100 align=center>Удалить</th>
</tr>
HTML;

$res = mysql_query("SELECT * FROM wel_xak ORDER BY id ASC");
while ($row = mysql_fetch_array($res)) {echo <<<HTML
<tr>
<td>{$row['id']}</td>
<td>{$row['username']}</td>
<td>{$row['ipadres']}</td>
<td>{$row['data']}</td>
<td>
<form method="post" action="adminmain.php?p=welxak">
<input name="status" type="hidden" value="del">
<input name="id" type="hidden" value="{$row['id']}">
<input type="submit" value="Удалить" class="button">
</form>
</td>
</tr>
HTML;
}

?>