Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Panel administracyjny własnej roboty
furman12
post 31.12.2009, 17:05:02
Post #1





Grupa: Zarejestrowani
Postów: 118
Pomógł: 4
Dołączył: 3.12.2009

Ostrzeżenie: (0%)
-----


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
  1. <?php
  2. include("lib.php");
  3. define("PAGENAME", "Home");
  4. $player = check_user($secret_key, $db);
  5. ?>
  6. <img src="templates/images/header.png"><br />
  7. <div id="menu">
  8. <?php
  9. include("templates/admin_header.php")
  10. ?>
  11. </div>
  12. <table>
  13. <tr>
  14. <th width="30%"><font color="white"><b>Nazwa</b></font></td>
  15. <th width="40%"><font color="white"><b>Opis</b></font></td>
  16. <th width="10%"><font color="white"><b>Typ</b></font></td>
  17. <th width="5%"><font color="white"><b>Efektywność</b></font></td>
  18. <th width="5%"><font color="white"><b>Koszt</b></font></td>
  19. <th width="10%"><font color="white"><b>Akcja</b></font></td>
  20. </tr>
  21. <?php
  22. $query = $db->execute("select `id`, `name`, `description`, `type`, `effectiveness`, `price` from `blueprint_items` order by `type`, `price`");
  23.  
  24. while($item = $query->fetchrow())
  25. {
  26. echo "<tr>";
  27. echo "<td>" . $item['name'] . "</td>\n";
  28. echo "<td>" . $item['description'] . "</td>\n";
  29. echo "<td>" . $item['type'] . "</td>\n";
  30. echo "<td>" . $item['effectiveness'] . "</td>\n";
  31. echo "<td>" . $item['price'] . "</td>\n";
  32. echo "<td><a href=\"admin_items.php?delete=" . $item['id'] . "\">Usuń</a>\n
  33. <a href=\"admin_items.php?edit=" . $item['id'] . "\">Edytuj</a></td>\n ";
  34. }
  35. ?>
  36. <?php
  37. if(is_numeric($_GET["delete"]) && $_GET["delete"] > 0) {
  38. $q = "delete from blueprint_items where id=".$_GET["delete"];
  39. $result = $db->execute($q);
  40. if(!$result) {
  41. }
  42. else {
  43. echo '<script language="JavaScript">
  44. alert("Usunięto")
  45. </script>';
  46. }
  47. }
  48. ?>
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 15.08.2025 - 14:42