Web UI for ARGUS server
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.

38 lines
1.6 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Node = intval( $_POST['NODE'] );
  5. $QS = "SELECT * FROM nodes WHERE id = {$Node}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $Props = $Result[0];
  9. $Type = intval( $Props['type'] );
  10. $TName = 'props/'.$Type.'_node_prop.js';
  11. $Data = file_get_contents( $TName );
  12. switch( $Type ){
  13. case ARGUS_3D_SENSOR:{
  14. $Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
  15. $Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
  16. //Info
  17. $InfoData = '';
  18. $InfoParts = array();
  19. $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
  20. switch( intval($Props['online']) ){
  21. case 0: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}'; break;
  22. case 1: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Handler Online</div>\'}'; break;
  23. case 3: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Master Online</div>\'}'; break;
  24. case 5: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Slave Online</div>\'}'; break;
  25. case 7: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Device Online</div>\'}'; break;
  26. };
  27. $InfoData = implode( ',', $InfoParts );
  28. $Data = str_replace('%%%INFO%%%', $InfoData, $Data );
  29. break;
  30. };
  31. };
  32. echo $Data;
  33. } else {
  34. echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
  35. };
  36. } else {
  37. header('location: /');
  38. };
  39. ?>