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.
 
 
 
 

34 lines
1.2 KiB

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
$SiteID = intval($_POST['NID']);
$NodeType = intval($_POST['TYPE']);
if( $NodeType ){
$QS = "INSERT INTO nodes SET type={$NodeType}, site_id={$SiteID}";
$DATABASE->Query( $QS, false );
$DevID = $DATABASE->getLastInsertID();
if( $DevID ){
switch( $NodeType ){
case 1://Als
case 2://Lfs
case 3://Pls
case 4://pls
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_IN . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Device Control Line'";
$DATABASE->Query( $QS, false );
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_OUT . ", `type`=" . COM_TYPE_UART . ", binded=0, md5='{$MM}', `name`='Camera Control Line'";
$DATABASE->Query( $QS, false );
break;
case 5://3D
$MM = md5(microtime());
$QS = "INSERT INTO sockets SET node_id={$DevID}, `mode`=" . COM_MODE_INOUT . ", `type`=" . COM_TYPE_TCP . ", binded=0, md5='{$MM}', `name`='Network Connection'";
$DATABASE->Query( $QS, false );
break;
};
};
};
} else {
header('location: /');
};
?>