newsletter.php 925 B

123456789101112131415161718192021222324252627282930
  1. <html>
  2. <head>
  3. <title>Administration</title>
  4. <link rel="stylesheet" type="text/css" href="http://yui.yahooapis.com/2.9.0/build/reset/reset-min.css" />
  5. <link rel="stylesheet" type="text/css" href="adminstyle.css" />
  6. </head>
  7. <body>
  8. <h1>Pack 596 Administration - Newsletter</h1>
  9. <?php include("navigation.php"); ?>
  10. <div id="main">
  11. <label for="newTitle">Title:</label><input id="newTitle" type="text" /><br />
  12. <label for="newBody">Body:</label><textarea id="newBody"></textarea><button id="addNew">Add New Post</button>
  13. <?php require_once('DB.inc');
  14. $db = new DB();
  15. try {
  16. $result = $db->select("SELECT * FROM newsletter");
  17. } catch (Exception $e) {
  18. echo "Something went wrong " . $e->getMessage() . "<br />\n";
  19. }
  20. foreach($result as $post) { ?>
  21. <div class="post">
  22. <?=$post['title']?> - <?=date('Y-m-d H:i:s', strtotime($post['dateposted']))?><br />
  23. <p><?=$post['body']?></p>
  24. </div>
  25. <?php }
  26. ?>
  27. </div>
  28. </body>
  29. </html>