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
729 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. ob_start();
  4. $UID = intval( $CUser->Data['id'] );
  5. $ACCESS = intval( $CUser->Data['access'] );
  6. if( $UID > 1 ){
  7. $Data = array();
  8. $QS = "SELECT * FROM `metro_stations`";
  9. $Result = $DATABASE->Query( $QS, false );
  10. if( count( $Result ) ){
  11. $Data['status']='ok';
  12. $Data['stations'] = array();
  13. foreach( $Result as $R ) {
  14. $CS['id'] = $R['id'];
  15. $CS['x'] = $R['x'];
  16. $CS['y'] = $R['y'];
  17. $CS['status'] = 0;
  18. $Data['stations'][] = $CS;
  19. };
  20. } else {
  21. $Data['status']='ok';
  22. $Data['stations'] = '[]';
  23. };
  24. $Data['messages'] = ob_get_clean();
  25. echo json_encode( $Data );
  26. } else {
  27. header('location: /');
  28. };
  29. ?>