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

editnews.php 1.5KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. $setup = array();
  3. $setup['title'] = "Rediger Nyhed";
  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::deleteNews($_GET['id']);
  12. }
  13. die(); // Something went wrong. Dont execute rest of code!
  14. }
  15. // It did, yay! - Lets fetch it
  16. $result = Get::NewsArticle($_GET['id']);
  17. if (isset($_POST['title'])) {
  18. Alter::editNews($_GET['id'], $_POST['title'], $_POST['textinput']);
  19. }
  20. ?>
  21. <div class="page">
  22. <h1>Rediger Nyhed</h1> <div class="pull_right"><a href="?page=newsadmin">Nyheder</a><span class="seperator"></span><a href="?page=eventadmin">Events</a></div>
  23. <div class="border"></div>
  24. <br />
  25. <div class='editorform'>
  26. <form method="POST" action="">
  27. <input type="text" class='editformtitle' required placeholder='Nyhedstitel' value="<?php echo $result['title']; ?>" name="title" />
  28. <br /><br />
  29. <textarea name='textinput' class='editor'><?php echo strip_tags($result['content'], '<br><p><b><i><u><img><a><strong><pre><em><span><div><h1><h2><h3><h4><h5><h6><h7><sub><sup><blockquote><code>'); ?></textarea>
  30. <br />
  31. <input type="submit" class='button btn btn-success pull_right' value="Rediger" />
  32. </form>
  33. </div>
  34. <div class='clear'></div>
  35. </div>
  36. <?php
  37. Design::footer(true);