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];
$QS = "SELECT * FROM servers WHERE id = {$Props['aux_id']}";
$Result = $DATABASE->Query( $QS, false );
$Server = $Result[0];
$TName = 'props/0_node_prop.js';
$Data = file_get_contents( $TName );
$Data = str_replace('%%%NODEID%%%', ''.$Node, $Data );
$Data = str_replace('%%%NODENAME%%%', $Props['name'] , $Data );
//Info
$InfoData = '';
$InfoParts = array();
$InfoParts[] = '{ xtype: \'panel\', html: \'
'.$Server['identity'].'
\'}';
if($Props['online']){
$InfoParts[] = '{ xtype: \'panel\', html: \'Online
\'}';
}else{
$InfoParts[] = '{ xtype: \'panel\', html: \'Offline
\'}';
};
$InfoData = implode( ',', $InfoParts );
$Data = str_replace('%%%INFO%%%', $InfoData, $Data );
// Get Sockets
$SocketsData = '';
$SockDataParts = array();
$QS = "SELECT * FROM sockets WHERE `node_id`={$Node}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
foreach( $Result as $R ){
switch( $R['type'] ){
case ARGUS_NODE_SOCK_TYPE_SERIAL_PORT:
//Uart
$SockDataParts[] = '{ xtype: \'panel\', html: \''.$R['name'].'
\'}';
break;
case ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER:
//Video Grabber
$SockDataParts[] = '{ xtype: \'panel\', html: \''.$R['name'].'
\'}';
break;
case ARGUS_NODE_SOCK_TYPE_NETWORK:
//Network Interface
$SockDataParts[] = '{ xtype: \'panel\', html: \''.$R['name'].'
\'}';
break;
default:
$SockDataParts[] = '{ xtype: \'panel\', html: \''.$R['name'].'
\'}';
};
};
$SocketsData = implode( ',', $SockDataParts );
};
$Data = str_replace('%%%SOCKETS%%%', $SocketsData, $Data );
//Get Modules
$ModulesData = '{}';
$Data = str_replace('%%%MODULES%%%', $ModulesData, $Data );
echo $Data;
} else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
};
} else {
header('location: /');
};
?>