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.

30 lines
945 B

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