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.
 
 
 
 

36 lines
1.1 KiB

<?php ?><html lang="en">
<head>
<meta charset=utf-8/>
<!-- CSS -->
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
<!-- JS code -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
</head>
<body>
<?php
$DATA = `usbrelay`;
$tArr = explode( "\n", $DATA );
$Rel = array();
print_r( $DATA );
print_r( $tArr );
foreach( $tArr as $AR ){
$CC = explode('=', trim($AR) );
if( strlen($CC[0]) > 4 ) $Rel[]=$CC[0];
};
if( count( $Rel ) ){
echo "<br/> Relay Found!<br/>\n";
$CMD_TO_ISSUE = 'usbrelay ';
foreach( $Rel as $R ){
$CMD_TO_ISSUE .= $R . '=0 ';
echo "Relay ". $R ." is about to set Off!<br/>\n";
};
$AA = `$CMD_TO_ISSUE`;
echo "Command issued: " . $CMD_TO_ISSUE . " Code Received: " . $AA . "<br/>\n";
} else {
echo "<br/>No Relay Found<br/>\n";
};
?>
</body>
</html>