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.

22 lines
803 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. ob_start();
  4. if( $CUser->Data['id'] > 1 ){
  5. $Data['status'] = 'na';
  6. $EID = intval( $_POST['PID'] );
  7. $QS = "SELECT * FROM `modbus_modules` WHERE `platform_id`={$EID}";
  8. $Result = $DATABASE->Query( $QS, false );
  9. if( count( $Result ) ){
  10. $SenPart = array();
  11. foreach( $Result as $R ){
  12. $AA = ($R['wm']=='E')?'active_green':'active_gray';
  13. $SenPart[] = '{ xtype: \'panel\', boder: false, frame: false, html: \'<a class="sideInfo_item '.$AA.'" onclick="editScadaModule('.$R['id'].');">'.$R['ip4'].' '.urldecode($R['label']).'</a>\'}';
  14. };
  15. $Data['status']='ok';
  16. $Data['modules'] = '['.implode( ',', $SenPart ) .']';
  17. };
  18. $Data['messages'] = ob_get_clean();
  19. echo json_encode( $Data );
  20. } else {
  21. header('location: /');
  22. };
  23. ?>