Witam to znowu ja i mój panel. Teraz chce, żeby po kliknięciu na edytuj pokazał się formularz w którym domyślnie podane by były dane sprzed modyfikowania, a typ byłby selectem z domyślnie zaznaczoną wartością sprzed, sam dokończe tego selecta trzeba mi tylko wzór. O to aktualny kod
<?php
include("lib.php");
$player = check_user($secret_key, $db);
?>
<img src="templates/images/header.png"><br />
<div id="menu">
<?php
include("templates/admin_header.php")
?>
</div>
<table>
<tr>
<th width="30%"><font color="white"><b>Nazwa</b></font></td>
<th width="40%"><font color="white"><b>Opis</b></font></td>
<th width="10%"><font color="white"><b>Typ</b></font></td>
<th width="5%"><font color="white"><b>Efektywność</b></font></td>
<th width="5%"><font color="white"><b>Koszt</b></font></td>
<th width="10%"><font color="white"><b>Akcja</b></font></td>
</tr>
<?php
$query = $db->execute("select `id`, `name`, `description`, `type`, `effectiveness`, `price` from `blueprint_items` order by `type`, `price`");
while($item = $query->fetchrow())
{
echo "<td>" . $item['name'] . "</td>\n"; echo "<td>" . $item['description'] . "</td>\n"; echo "<td>" . $item['type'] . "</td>\n"; echo "<td>" . $item['effectiveness'] . "</td>\n"; echo "<td>" . $item['price'] . "</td>\n"; echo "<td><a href=\"admin_items.php?delete=" . $item['id'] . "\">Usuń</a>\n <a href=\"admin_items.php?edit=" . $item['id'] . "\">Edytuj</a></td>\n ";
}
?>
<?php
if(is_numeric($_GET["delete"]) && $_GET["delete"] > 0
) { $q = "delete from blueprint_items where id=".$_GET["delete"];
$result = $db->execute($q);
if(!$result) {
}
else {
echo '<script language="JavaScript"> alert("Usunięto")
</script>';
}
}
?>