"OdenseTrack" is a school assignment/project from AspIT https://aspit.dfine.net/odensetrack
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

editevent.php 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. <?php
  2. $setup = array();
  3. $setup['title'] = "Rediger Event";
  4. $setup['headline'] = "Odense Track - Administration";
  5. $setup['keywords'] = "administration,admin";
  6. $setup['description'] = "Odense Track Administration";
  7. Design::header($setup, 100);
  8. // First we need to know if we are deleting something!
  9. if (isset($_GET['action'])) { // We are deleting this!
  10. if ($_GET['action'] == 'del') {
  11. Alter::deleteEvent($_GET['id']);
  12. }
  13. die(); // Something went wrong. Dont execute rest of code!
  14. }
  15. $result = Get::ViewEvent($_GET['id']);
  16. if (isset($_POST['title'])) {
  17. if (isset($_FILES['thumbnail'])) {
  18. $uploaded = Upload::handleUpload($_FILES['thumbnail']);
  19. if ($uploaded == false) {
  20. // Fail!
  21. }
  22. }
  23. Alter::editEvent($_GET['id'], $_POST['title'], $_POST['textinput'], $_POST['type'], $_POST['eventdate'], $uploaded);
  24. }
  25. ?>
  26. <div class="page">
  27. <h1>Rediger Event</h1> <div class="pull_right"><a href="?page=newsadmin">Nyheder</a><span class="seperator"></span><a href="?page=eventadmin">Events</a></div>
  28. <div class="border"></div>
  29. <br />
  30. <div class='editorform'>
  31. <form method="POST" action="" enctype="multipart/form-data">
  32. <input type="text" class='editformtitle' required placeholder='Event titel' value="<?php echo $result['title']; ?>" name="title" />
  33. <br /><br />
  34. <p>Thumbnail (Intet valgt billede beholder nuværende)</p>
  35. <input type="file" class='editformtitle' name="thumbnail" />
  36. <br /><br />
  37. <select class='editformtitle' name="type">
  38. <option <?php if ($result['type'] == 1) {
  39. echo "selected";
  40. } ?> value="1">Event</option>
  41. <option <?php if ($result['type'] == 2) {
  42. echo "selected";
  43. } ?> value="2">Baneaktivitet</option>
  44. </select>
  45. <br /><br />
  46. <input type="datetime" class="datetime editformtitle" name="eventdate" autocomplete="off" value="<?php echo date('Y/m/d H:i', $result['time']); ?>" placeholder="Dato og Tid" />
  47. <br /><br />
  48. <textarea name='textinput' class='editor'><?php echo strip_tags($result['description'], '<br><p><b><i><u><img><a><strong><pre><em><span><div><h1><h2><h3><h4><h5><h6><h7><sub><sup><blockquote><code>'); ?></textarea>
  49. <br />
  50. <input type="submit" class='button btn btn-success pull_right' value="Rediger" />
  51. </form>
  52. </div>
  53. <div class='clear'></div>
  54. </div>
  55. <?php
  56. Design::footer(true);