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.

44 lines
1.2 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
4 years ago
​
​
​
​
​
​
4 years ago
​
​
​
​
4 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 && $CUser->Data['access'] > 5 ){
  4. $Data = array();
  5. $Data['success'] = false;
  6. if( isset( $_POST['OPID'] ) ){
  7. $CMD = intval( $_POST['OPID'] );
  8. } else {
  9. $CMD = 0;
  10. };
  11. if( $CMD > 0 ){
  12. switch( $CMD ){
  13. case 1:{//Debug Mode
  14. $PARAM = intval( $_POST['OPCODE'] );
  15. $QS = "UPDATE `system_props` SET `work_mode`={$PARAM} WHERE `id`=1";
  16. $DATABASE->Query( $QS );
  17. $Data['q'] = $QS;
  18. $Data['success'] = true;
  19. break;
  20. };
  21. case 2:{//Layout
  22. $PARAM = intval( $_POST['OPCODE'] );
  23. $QS = "UPDATE `system_props` SET `app_layout`={$PARAM} WHERE `id`=1";
  24. $DATABASE->Query( $QS );
  25. $Data['q'] = $QS;
  26. $Data['success'] = true;
  27. break;
  28. };
  29. case 3:{
  30. $RBASE = new SQLite_DB( '/dev/shm/argus/mem_db.db');
  31. $PARAM = md5( time() );
  32. $QS = "INSERT INTO `nodes_qcq`(`node_id`,`cmd`,`status`,`parameter`) VALUES(1,249,0,'{$PARAM}')";
  33. $RBASE->Query( $QS, false );
  34. $Data['q'] = $QS;
  35. $Data['success'] = true;
  36. };
  37. };
  38. } else {
  39. $Data['msg']='Wrong Parameters!';
  40. };
  41. echo json_encode( $Data );
  42. exit();
  43. };
  44. header('location: /');
  45. ?>