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.

adminculog.php 1.2KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?PHP
  2. if (!defined('LIB_DATABASE')) { require_once('lib/database.php'); }
  3. if (!defined('LIB_COMMON')) { require_once('lib/common.php'); }
  4. if (!defined('ADMIN') || !ADMIN) { die('Admins only'); }
  5. ?>
  6. <div class="block" id="log">
  7. <h2>ADMIN: Control panel log</h2>
  8. <table class="innerblock">
  9. <tr>
  10. <th>Time</th>
  11. <th>Level</th>
  12. <th>Message</th>
  13. </tr>
  14. <?PHP
  15. $i = 0;
  16. $sql = 'SELECT user_id, user_name, log_level, log_time, log_message FROM log ';
  17. $sql .= 'NATURAL JOIN users WHERE user_id = '.m($_GET['n']).' ORDER BY log_time DESC LIMIT 0,50';
  18. $res = mysql_query($sql) or mf(__FILE__, __LINE__, $sql);
  19. while ($row = mysql_fetch_array($res)) {
  20. echo '<tr class="'.(($i != 0) ? 'odd':'even').'"><td>'.substr(gmdate('r',$row['log_time']),0,-6).'</td>';
  21. switch($row['log_level']) {
  22. case 'critical':
  23. echo '<td style="color: red; font-weight: bold;">Critical</td>';
  24. break;
  25. case 'important':
  26. echo '<td style="font-weight: bold;">Important</td>';
  27. break;
  28. case 'normal':
  29. case 'unknown':
  30. echo '<td>'.ucfirst($row['log_level']).'</td>';
  31. break;
  32. case 'info':
  33. echo '<td style="color: gray">Information</td>';
  34. }
  35. echo '<td>'. $row['log_message'].'</td></tr>';
  36. $i = 1 - $i;
  37. }
  38. ?>
  39. </table>
  40. </div>