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.

72 lines
3.1 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $Data['success'] = false;
  5. $Data['msg']= 'Module Not Selected!';
  6. if( isset( $_POST['MID'] ) ){
  7. $MID = intval($_POST['MID']);
  8. if( $MID ){
  9. $Data['msg']='Module Does Not Exists!';
  10. $QS = "SELECT * FROM `server_modules` WHERE `id`={$MID}";
  11. $RR = $DATABASE->Query( $QS );
  12. if( count( $RR ) ){
  13. $CMD = $RR[0];
  14. $Data['success'] = true;
  15. $Data['msg']='';
  16. switch( $CMD['type'] ){
  17. case 3:{
  18. // Kafka
  19. $B_ADDR = $DATABASE->escape( $_POST['ADDR'] );
  20. $B_PORT = intval( $_POST['PORT'] );
  21. $B_SSL = intval( $_POST['SSL']=='true' );
  22. $B_USR = $DATABASE->escape( $_POST['UNAM'] );
  23. $B_PWD = $DATABASE->escape( $_POST['UPWD'] );
  24. $QS = "UPDATE `modules_kafka` SET `brocker_port`={$B_PORT}, `brocker_address`='{$B_ADDR}', `use_ssl`={$B_SSL}, `cred_username`='{$B_USR}', `cred_password`='{$B_PWD}' WHERE `module_id`={$CMD['aux_id']}";
  25. $DATABASE->Query( $QS );
  26. break;
  27. };
  28. case 9:{
  29. // EVE
  30. $SiW = array( 320, 640, 800, 1280, 1024, 1920 );
  31. $SiH = array( 240, 480, 600, 720, 768, 1080 );
  32. $SIZE = intval( $_POST['SIZE'] );
  33. $PORT = intval( $_POST['PORT'] );
  34. $COMP = intval( $_POST['COMPRESSION'] );
  35. $TS_X = intval( $_POST['TS_POSX'] );
  36. $TS_Y = intval( $_POST['TS_POSY'] );
  37. $TS_FF = intval( $_POST['TS_FONT'] );
  38. $TS_FS = intval( $_POST['TS_FONT_SCALE'] );
  39. $TS_FT = intval( $_POST['TS_FONT_THICK'] );
  40. $TS_LT = intval( $_POST['TS_LINE'] );
  41. $TS_TS = intval( $_POST['TS_TRANS'] );
  42. $LB_X = intval( $_POST['LBL_POSX'] );
  43. $LB_Y = intval( $_POST['LBL_POSY'] );
  44. $LB_FF = intval( $_POST['LBL_FONT'] );
  45. $LB_FS = intval( $_POST['LBL_FONT_SCALE'] );
  46. $LB_FT = intval( $_POST['LBL_FONT_THICK'] );
  47. $LB_LT = intval( $_POST['LBL_LINE'] );
  48. $LB_TS = intval( $_POST['LBL_TRANS'] );
  49. $LO_X = intval( $_POST['LOG_POSX'] );
  50. $LO_Y = intval( $_POST['LOG_POSY'] );
  51. $LO_W = intval( $_POST['LOG_W'] );
  52. $LO_H = intval( $_POST['LOG_H'] );
  53. if( $_POST['SHOW1'] ) $STS = 1; else $STS = 0;
  54. if( $_POST['SHOW2'] ) $SLB = 1; else $SLB = 0;
  55. if( $_POST['SHOW3'] ) $SLG = 0; else $SLG = 0;
  56. if( $_POST['TS_TRANS'] ) $TS_TS = 1; else $TS_TS = 0;
  57. if( $_POST['LBL_TRANS'] ) $LB_TS = 1; else $LB_TS = 0;
  58. $QS = "UPDATE `module_embed_video_settings` SET `web_port`={$PORT}, `width`={$SiW[$SIZE]}, `height`={$SiH[$SIZE]}, `compression_quality`={$COMP}, `show_ts`={$STS}, `show_label`={$SLB}, `show_logo`={$SLG}, `ts_x`={$TS_X}, `ts_y`={$TS_Y}, `ts_font_face`={$TS_FF}, `ts_font_thickness`={$TS_FT}, `ts_line_type`={$TS_LT}, `ts_transperant`={$TS_TS}, `label_x`={$LB_X}, `label_y`={$LB_Y}, `label_font_face`={$LB_FF}, `label_font_thickness`={$LB_FT}, `label_line_type`={$LB_LT}, `label_transperant`={$LB_TS}, `logo_x`={$LO_X}, `logo_y`={$LO_Y}, `logo_w`={$LO_W}, `logo_h`={$LO_H} WHERE `id`={$CMD['aux_id']}";
  59. $DATABASE->Query( $QS );
  60. break;
  61. };
  62. };
  63. };
  64. };
  65. };
  66. echo json_encode( $Data );
  67. exit();
  68. };
  69. header( 'location: /');
  70. ?>