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.

24 lines
863 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. $QS = "SELECT * FROM `metro_lines` ORDER BY `name`";
  8. $Result = $DATABASE->Query( $QS, false );
  9. if( count( $Result ) ){
  10. $SenPart = array();
  11. foreach( $Result as $R ){
  12. $AA = ($R['status']=='E')?'active_blue':'active_gray';
  13. $SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item '.$AA.'" id="LINE_TAG_'.$R['id'].'" onclick="editLine('.$R['id'].');">'.urldecode($R['name']).'</a>\'}';
  14. };
  15. $Data['status']='ok';
  16. $Data['lines'] = '['.implode( ',', $SenPart ) .']';
  17. } else {
  18. $Data['status']='na';
  19. };
  20. $Data['messages'] = ob_get_clean();
  21. echo json_encode( $Data );
  22. } else {
  23. header('location: /');
  24. };
  25. ?>