Unsupported scripts and control panel web app for a hosting company
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.

admin.announcements.php 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <?PHP
  2. require_once('lib/database.php');
  3. require_once('lib/common.php');
  4. ?>
  5. <div class="block">
  6. <h2>ADMIN: Announcements and messages</h2>
  7. <table class="innerblock">
  8. <tr>
  9. <th>&nbsp;</th>
  10. <th>Title</th>
  11. <th>View</th>
  12. <th>Type</th>
  13. <th>Date</th>
  14. </tr>
  15. <?PHP
  16. $sql = 'SELECT message_id, message_type, message_title, message_time FROM messages ORDER BY message_time';
  17. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  18. $i = 0;
  19. $n = 0;
  20. if (mysql_num_rows($res) == 0) {
  21. echo '<tr><td colspan="5" style="font-style: italic; text-align: center;">';
  22. echo 'There are no current announcements</td></tr>';
  23. }
  24. while ($row = mysql_fetch_array($res)) {
  25. $n++;
  26. ?>
  27. <tr<?PHP if ($i == 1) { echo ' class="odd"'; } ?>>
  28. <td><?PHP echo $n; ?>.</td>
  29. <td><?PHP echo $row['message_title']; ?></td>
  30. <td><a href="<?PHP echo CP_PATH; ?>viewmessage/<?PHP echo $row['message_id']; ?>">View</a></td>
  31. <td><?PHP echo ucfirst($row['message_type']); ?></td>
  32. <td><?PHP echo substr(gmdate('r', $row['message_time']),0,-6); ?></td>
  33. </tr>
  34. <?PHP
  35. $i = 1 - $i;
  36. }
  37. ?>
  38. </table>
  39. </div>