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.

29 lines
913 B

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. if( $CUser->Data['access'] > 5 ){
  5. $Records = array();
  6. $QS = "SELECT * FROM `server_log_messages` ORDER BY `ts` DESC, `id` DESC LIMIT 64";
  7. $DATA = $DATABASE->Query( $QS );
  8. $LID = 0;
  9. $AID = 1;
  10. foreach( $DATA as $DATUM ){
  11. $cnode['id'] = $DATUM['id'];
  12. $cnode['type']=$DATUM['lvl'];
  13. $cnode['ts'] = $DATUM['ts'];
  14. $TArr = explode( ':', $DATUM['msg'] );
  15. $TBrr = explode( ' ', $TArr[0] );
  16. $cnode['ptr'] = $TBrr[0];
  17. $cnode['module'] = $TBrr[1];
  18. $cnode['msg'] = substr( $DATUM['msg'], strlen( $cnode['ptr'] )+strlen( $cnode['module'] )+2 );
  19. $Records['records'][] = $cnode;
  20. };
  21. } else {
  22. $Records['records'] = array();
  23. };
  24. $Records['totalCount']= count($Records['records']);
  25. echo json_encode( $Records );
  26. } else {
  27. header('location: /');
  28. };
  29. ?>