/lib/php/Scaffold/tmp/mak/mak_tartalom/index.php

https://github.com/pixelephant/mak-web · PHP · 59 lines · 45 code · 11 blank · 3 comment · 1 complexity · 5161e867e65d6a40541c089ee6a7b039 MD5 · raw file

  1. <?php
  2. include('../inc.functions.php');
  3. print_header('mak » Mak Tartalom');
  4. if (isset($_GET['msg'])) echo '<p id="msg">'.$_GET['msg'].'</p>';
  5. /* Default search criteria (may be overriden by search form) */
  6. $conds = 'TRUE';
  7. include('inc.search3.php');
  8. /* Default paging criteria (may be overriden by paging functions) */
  9. $start = 0;
  10. $per_page = 50;
  11. $count_sql = 'SELECT COUNT(id) AS tot FROM `mak_tartalom` WHERE ' . $conds;
  12. include('../inc.paging.php');
  13. /* Get selected entries! */
  14. $sql = "SELECT * FROM `mak_tartalom` WHERE $conds " . get_order('mak_tartalom') . " LIMIT $start,$per_page";
  15. echo '<table>
  16. <tr>
  17. <th>Id ' . put_order('id') . '</th>
  18. <th>Almenu Id ' . put_order('almenu_id') . '</th>
  19. <th>Cim ' . put_order('cim') . '</th>
  20. <th>Szoveg ' . put_order('szoveg') . '</th>
  21. <th>Kep ' . put_order('kep') . '</th>
  22. <th>Alt ' . put_order('alt') . '</th>
  23. <th>Sorrend ' . put_order('sorrend') . '</th>
  24. <th>Modositas ' . put_order('modositas') . '</th>
  25. <th colspan="2" style="text-align:center">Actions</th>
  26. </tr>
  27. ';
  28. $r = mysql_query($sql) or trigger_error(mysql_error());
  29. while($row = mysql_fetch_array($r)) {
  30. echo ' <tr>
  31. <td>' . htmlentities($row['id']) . '</td>
  32. <td>' . htmlentities($row['almenu_id']) . '</td>
  33. <td>' . htmlentities($row['cim']) . '</td>
  34. <td>' . htmlentities(limit_chars(nl2br($row['szoveg']))) . '</td>
  35. <td>' . htmlentities($row['kep']) . '</td>
  36. <td>' . htmlentities($row['alt']) . '</td>
  37. <td>' . htmlentities($row['sorrend']) . '</td>
  38. <td>' . htmlentities(humanize($row['modositas'])) . '</td>
  39. <td><a href="crud_tartalom.php?id=' . $row['id'] . '">Edit</a></td>
  40. <td><a href="crud_tartalom.php?delete=1&amp;id=' . $row['id'] . '" onclick="return confirm(\'Are you sure?\')">Delete</a></td>
  41. </tr>' . "
  42. ";
  43. }
  44. echo "</table>\n\n";
  45. include('../inc.paging.php');
  46. echo '<p><a href="crud_tartalom.php">New entry</a></p>';
  47. print_footer();
  48. ?>