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.
39 lines
1.6 KiB
39 lines
1.6 KiB
<?php
|
|
require_once('../ajax_asm.php');
|
|
if( $CUser->Data['id'] > 1 ){
|
|
$Node = intval( $_POST['NODE'] );
|
|
$QS = "SELECT * FROM nodes WHERE id = {$Node}";
|
|
$Result = $DATABASE->Query( $QS, false );
|
|
if( count( $Result ) ){
|
|
$Props = $Result[0];
|
|
$Type = intval( $Props['type'] );
|
|
$TName = 'props/'.$Type.'_node_prop.js';
|
|
$Data = file_get_contents( $TName );
|
|
switch( $Type ){
|
|
case ARGUS_3D_SENSOR:{
|
|
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
|
|
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
|
|
//Info
|
|
$InfoData = '';
|
|
$InfoParts = array();
|
|
$InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ID">'.$Server['identity'].'</div>\'}';
|
|
switch( intval($Props['online']) ){
|
|
case 0: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_OFF">Offline</div>\'}'; break;
|
|
case 1: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Handler Online</div>\'}'; break;
|
|
case 3: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Master Online</div>\'}'; break;
|
|
case 5: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Slave Online</div>\'}'; break;
|
|
case 7: $InfoParts[] = '{ xtype: \'panel\', html: \'<div class="sideInfo_item" id="INFO_ON">Device Online</div>\'}'; break;
|
|
};
|
|
$InfoData = implode( ',', $InfoParts );
|
|
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
|
|
break;
|
|
};
|
|
};
|
|
echo $Data;
|
|
} else {
|
|
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
|
|
};
|
|
} else {
|
|
header('location: /');
|
|
};
|
|
?>
|