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.

32 lines
911 B

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Data = array();
  5. $Data['success'] = false;
  6. if( isset( $_POST['NID'] ) ) {
  7. $NodeID = intval($_POST['NID']);
  8. } else $NodeID = 0;
  9. if( isset( $_POST['CMD'] ) ){
  10. $CMD = intval( $_POST['CMD'] );
  11. } else {
  12. $CMD = 0;
  13. };
  14. if( isset( $_POST['PARAM'] ) ){
  15. $PARAM = $DATABASE->escape( $_POST['PARAM'] );
  16. } else {
  17. $PARAM = '';
  18. };
  19. if( $NodeID > 0 && $CMD > 0 ){
  20. $Data['success'] = true;
  21. $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES({$NodeID},{$CMD},0,'{$PARAM}')";
  22. $Data['query'] = $QS ;
  23. @$MEMDB = new SQLite_DB( '/dev/shm/argus/mem_db.db');
  24. $MEMDB->Query( $QS, false );
  25. $Data['operation_id'] = intval( $MEMDB->getLastInsertID() );
  26. } else {
  27. $Data['msg']='Wrong Parameters';
  28. };
  29. echo json_encode( $Data );
  30. exit();
  31. };
  32. header('location: /');
  33. ?>