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.

35 lines
1.1 KiB

6 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php ?><html lang="en">
  2. <head>
  3. <meta charset=utf-8/>
  4. <!-- CSS -->
  5. <link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
  6. <!-- JS code -->
  7. <script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
  8. <script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
  9. <script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
  10. </head>
  11. <body>
  12. <?php
  13. $DATA = `usbrelay`;
  14. $tArr = explode( "\n", $DATA );
  15. $Rel = array();
  16. print_r( $DATA );
  17. print_r( $tArr );
  18. foreach( $tArr as $AR ){
  19. $CC = explode('=', trim($AR) );
  20. if( strlen($CC[0]) > 4 ) $Rel[]=$CC[0];
  21. };
  22. if( count( $Rel ) ){
  23. echo "<br/> Relay Found!<br/>\n";
  24. $CMD_TO_ISSUE = 'usbrelay ';
  25. foreach( $Rel as $R ){
  26. $CMD_TO_ISSUE .= $R . '=0 ';
  27. echo "Relay ". $R ." is about to set Off!<br/>\n";
  28. };
  29. $AA = `$CMD_TO_ISSUE`;
  30. echo "Command issued: " . $CMD_TO_ISSUE . " Code Received: " . $AA . "<br/>\n";
  31. } else {
  32. echo "<br/>No Relay Found<br/>\n";
  33. };
  34. ?>
  35. </body>
  36. </html>