"OdenseTrack" is a school assignment/project from AspIT https://aspit.dfine.net/odensetrack
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

editevent.php 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. Alter::editEvent($_GET['id'], $_POST['title'], $_POST['textinput'], $_POST['type'], $_POST['eventdate']);
  18. }
  19. ?>
  20. <div class="page">
  21. <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>
  22. <div class="border"></div>
  23. <br />
  24. <div class='editorform'>
  25. <form method="POST" action="">
  26. <input type="text" class='editformtitle' required placeholder='Nyhedstitel' value="<?php echo $result['title']; ?>" name="title" />
  27. <br /><br />
  28. <select class='editformtitle' name="type">
  29. <option <?php if ($result['type'] == 1) {
  30. echo "selected";
  31. } ?> value="1">Event</option>
  32. <option <?php if ($result['type'] == 2) {
  33. echo "selected";
  34. } ?> value="2">Baneaktivitet</option>
  35. </select>
  36. <br /><br />
  37. <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" />
  38. <br /><br />
  39. <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>
  40. <br />
  41. <input type="submit" class='button btn btn-success pull_right' value="Rediger" />
  42. </form>
  43. </div>
  44. <div class='clear'></div>
  45. </div>
  46. <?php
  47. Design::footer(true);