Web Interface For Lite Argus Control modules
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
999 B

<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['NID'] ) ){
$NID = intval( $_POST['NID'] );
if( $NID ){
$QS="SELECT `data` FROM `lrf_draw` WHERE `node_id`={$NID} AND `type`=0 ORDER BY `ts` DESC LIMIT 1";
$SS = $DATABASE->Query( $QS );
$Data['count'] = 0;
if( count( $SS ) ){
$DUDU= $SS[0]['data'];
$FD = fopen( 'data/device_draws/' . $DUDU.'.raw', "r" );
if( $FD ){
$C = fread( $FD, 4 );
if( $C !== false ){
$U = unpack("L", $C );
$Data['count'] = $U[1];
$C = fread( $FD, 4*$Data['count'] );
$U = unpack("S*", $C );
$idx = 1;
$C = array();
$Data['data']=array();
for( $i = 0; $i < $Data['count']; $i++ ){
$C['S'] = $U[$idx++];
$C['M'] = $U[$idx++];
$Data['data'][]=$C;
};
};
fclose( $FD );
};
};
echo json_encode( $Data );
exit();
};
};
};
header('location: /');
?>