phpDocumentor koliportal
[ class tree: koliportal ] [ index: koliportal ] [ all elements ]

Source for file page.roomlist.php

Documentation is available at page.roomlist.php

  1. <?php
  2. /** Szobák listája
  3. * @package koliportal
  4. */
  5. if (isset($_GET["id"]) && is_numeric($_GET["id"]))
  6. {
  7. $room_id = $_GET["id"];
  8. if ('delete-room' == $action)
  9. {
  10. /* elég itt törölni, a room_conn_student-et majd a REFERENCES törli */
  11. $sql_d = "DELETE FROM rooms WHERE roomid = '$room_id'";
  12. debug_echo($sql_d, DEBUG_SQL);
  13. $del_res = mysql_query($sql_d, $database);
  14. if ($del_res === false)
  15. {
  16. $errs[] = "A törlés nem sikerült.";
  17. $errc++;
  18. }
  19. }
  20. }
  21. $action = 'roomlist';
  22.  
  23. $sql_q = "SELECT r1.*, b1.bsname FROM rooms AS r1
  24. LEFT OUTER JOIN buildings AS b1
  25. ON (b1.bid = r1.bid)
  26. ORDER BY r1.space, r1.rtype, r1.rnum
  27. ";
  28. debug_echo($sql_q, DEBUG_SQL);
  29.  
  30. $sql_res = mysql_query($sql_q, $database);
  31. if ($sql_res === false)
  32. {
  33. myerr(ERROR_DB, $sql_q);
  34. }
  35. show_errors($errs);
  36. ?>
  37. <table border="1" alt="Szobalista">
  38. <tr>
  39. <th>ID</th>
  40. <th>épület</th>
  41. <th>Szobaszám</th>
  42. <th>Férőhelyek</th>
  43. <th>Páros szoba</th>
  44. <th>Módosít</th>
  45. <tr>
  46.  
  47.  
  48. <?php
  49. while ($arr = mysql_fetch_assoc ($sql_res))
  50. {
  51. ?>
  52. <tr>
  53. <td><?= $arr["roomid"] ?></td>
  54. <td><?= $arr["bsname"] ?></td>
  55. <td><?= $arr["rnum"] ?></td>
  56. <td><?= ($arr["space"]) ?></td>
  57. <td><?= get_stname($arr["rtype"]) ?></td>
  58. <td><a href="<?= $_SERVER["PHP_SELF"] ?>?id=<?= $arr["roomid"] ?>&amp;action=delete-room">töröl</a></td>
  59. </tr>
  60. <?php
  61. }
  62. ?>
  63.  
  64. </table>

Documentation generated on Wed, 18 May 2005 19:24:44 +0200 by phpDocumentor 1.3.0RC3