user_system_msg.php 781 B

1234567891011121314151617181920212223242526
  1. <?php
  2. if ($myUser == null) {
  3. redirectToLogin();
  4. }
  5. $header_row = <<<EOD
  6. <tr>
  7. <th>消息</th>
  8. <th style="width:15em">时间</th>
  9. </tr>
  10. EOD;
  11. function echoSysMsg($msg) {
  12. echo $msg['read_time'] == null ? '<tr class="table-warning">' : '<tr>';
  13. echo '<td>';
  14. echo '<h4>'.$msg['title'].'</h4>';
  15. echo $msg['content'];
  16. echo '</td>';
  17. echo '<td>'.$msg['send_time'].'</td>';
  18. echo '</tr>';
  19. }
  20. ?>
  21. <?php echoUOJPageHeader('系统消息') ?>
  22. <h2>系统消息</h2>
  23. <?php echoLongTable(array('*'), 'user_system_msg', "receiver='" . Auth::id() . "'", 'order by id desc', $header_row, 'echoSysMsg', array('table_classes' => array('table'))) ?>
  24. <?php DB::update("update user_system_msg set read_time = now() where receiver = '" . Auth::id() . "'") ?>
  25. <?php echoUOJPageFooter() ?>