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.

3094 lines
82 KiB

​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
2 years ago
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
2 years ago
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. //<?php require_once('../../js_asm.php'); ?>
  2. var helpContentTopicID = -1;
  3. var SelectedPlatform = 0;
  4. var oSelectedPlatform = 0;
  5. var SelectedStation = 0;
  6. var oSelectedStation = 0;
  7. var SelectedLine = 0;
  8. var oSelectedLine = 0;
  9. var SelectedTrack = 0;
  10. var oSelectedTrack = 0;
  11. var SelectedModule = 0;
  12. var oSelectedModule = 0;
  13. var muploader = null;
  14. var uploads_store_id = 0;
  15. var uploads_store = new Ext.data.ArrayStore({
  16. autoDestroy: false,
  17. storeId: 'up_store',
  18. idIndex: 0,
  19. fields: [
  20. {name: 'id', type: 'int' },
  21. {name: 'file_name', type: 'string'},
  22. {name: 'file_id', type: 'string'},
  23. {name: 'size', type: 'string'},
  24. {name: 'progress', type: 'int'},
  25. {name: 'status', type: 'string' }
  26. ]
  27. });
  28. var uploaded_store_id = 0;
  29. var uploaded_store = new Ext.data.ArrayStore({
  30. autoDestroy: false,
  31. storeId: 'mod_store',
  32. idIndex: 0,
  33. fields: [
  34. {name: 'id', type: 'int' },
  35. {name: 'file_name', type: 'string'},
  36. {name: 'size', type: 'int'},
  37. {name: 'status', type: 'int'},
  38. {name: 'ts', type: 'string' },
  39. {name: 'memo', type: 'string' }
  40. ]
  41. });
  42. function progressRenderer( value, meta, record ){
  43. Ext.defer( function( id ){
  44. var p = new Ext.ProgressBar({
  45. id: 'progress_'+id,
  46. renderTo: 'div_'+id,
  47. animate: false,
  48. width: '100%',
  49. value: 0,
  50. text: 'Upload Pending',
  51. });
  52. }, 50, undefined, [ record.data.file_id ] );
  53. return '<div id="div_' + record.data.file_id + '"></div>';
  54. };
  55. var fileUploadsColModel_ops = {
  56. columns: [
  57. {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
  58. {header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 280, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
  59. {header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  60. {header: "<?=$Labels->GetLabel('_PROGRESS_');?>", width: 150, renderer: progressRenderer, dataIndex: 'progress' },
  61. {header: " ", width: 50, dataIndex: 'status3' }
  62. ],
  63. defaults: {
  64. sortable: false,
  65. fixed: true,
  66. menuDisabled: true,
  67. width: 100
  68. }
  69. };
  70. function onModuleFileRenderer( value, meta, record ){
  71. if( value == 0 ){
  72. rv = '<img title="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" alt="<?=$Labels->GetLabel('_READY_TO_UPLO_');?>" src="/style/assets/bul_green.png">';
  73. } else {
  74. if( value < 101 ){
  75. rv = '<img title="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" alt="<?=$Labels->GetLabel('_UPLO_IN_PROGRESS_');?>" src="/style/assets/bul_gray.png">';
  76. } else {
  77. rv = '<img title="<?=$Labels->GetLabel('_UPLO_DONE_');?>" alt="<?=$Labels->GetLabel('_UPLO_DONE_');?>" src="/style/assets/bul_blue.png">';
  78. };
  79. };
  80. return rv;
  81. };
  82. var fileModuleColModel_ops = {
  83. columns: [
  84. {header: "ID", width: 50, align: 'center', css: 'vertical-align: middle;', dataIndex: 'id' },
  85. {header: "<?=$Labels->GetLabel('_FILE_NAME_');?>", width: 60, fixed: false, align: 'left', css: 'vertical-align: middle;', dataIndex: 'file_name' },
  86. {header: "<?=$Labels->GetLabel('_SIZE_');?>", width: 80, /*renderer: plupload.formatSize,*/ align: 'left', css: 'vertical-align: middle;', dataIndex: 'size' },
  87. {header: "<?=$Labels->GetLabel('_TIME_');?>", width: 150, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
  88. {header: "<?=$Labels->GetLabel('_STATUS_');?>", width: 50, renderer: onModuleFileRenderer, dataIndex: 'status' },
  89. {header: "<?=$Labels->GetLabel('_MEMO_');?>", dataIndex: 'memo' }
  90. ],
  91. defaults: {
  92. sortable: false,
  93. fixed: true,
  94. menuDisabled: true,
  95. width: 100
  96. }
  97. };
  98. var fileUploadsSelModel_ops = {
  99. singleSelect: true
  100. };
  101. var targetWidthTable_store = new Ext.data.ArrayStore({
  102. autoDestroy: false,
  103. storeId: 'width_table_store',
  104. idIndex: 0,
  105. fields: [
  106. {name: 'id', type: 'int' },
  107. {name: 'width', type: 'int'},
  108. {name: 'range', type: 'sting'},
  109. {name: 'range_m', type: 'sting'}
  110. ]
  111. });
  112. var cWTRowSelected = null;
  113. var cWTRowSelectedRange = 0;
  114. var cWTRowSelectedRangeP = 0;
  115. var WTSelectedSensor = 0;
  116. var widthTableSelModel_ops = {
  117. singleSelect: true,
  118. listeners: {
  119. rowselect: function( sm, row, rec ) {
  120. cWTRowSelected = rec.data.id;
  121. cWTRowSelectedRange = rec.data.range_m;
  122. cWTRowSelectedRangeP = rec.data.range;
  123. //todo
  124. Ext.getCmp('edit_btn_width_table').enable();
  125. }
  126. }
  127. };
  128. function deleteWTRow(){
  129. Ext.Ajax.request({
  130. url: '/lib/controller/delWidthTableRecord.php',
  131. params: {
  132. UID: <?=$UserID;?>,
  133. SID: '<?=$Session;?>',
  134. DID: WTSelectedSensor,
  135. RID: cWTRowSelected
  136. },
  137. success: function( response, opts ){
  138. Ext.getCmp('del_btn_width_table').disable();
  139. loadWidthTable( WTSelectedSensor );
  140. },
  141. failure: failureAJAXFunction
  142. });
  143. };
  144. var targetWidthTableColModel_ops = {
  145. columns: [
  146. {header: "<?=$Labels->GetLabel('_WIDTH_CORRECT_');?> (%)", width: 250, align: 'center', css: 'vertical-align: middle;', dataIndex: 'width' },
  147. {header: "<?=$Labels->GetLabel('_RANGE_');?> (%)", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'range' },
  148. {header: "<?=$Labels->GetLabel('_RANGE_').' ('.$Labels->GetLabel('_METERS_') . ')';?>", width: 150, align: 'center', css: 'vertical-align: middle;', dataIndex: 'range_m' },
  149. ],
  150. defaults: {
  151. sortable: false,
  152. fixed: true,
  153. menuDisabled: true
  154. }
  155. };
  156. var widthTableEditDialog = null;
  157. function editWidthTableRecord(){
  158. if( widthTableEditDialog == null ){
  159. widthTableEditDialog = new Ext.Window({
  160. title: '<?=$Labels->GetLabel('_EDIT_WTR_');?>',
  161. modal: true,
  162. layout: 'form',
  163. labelWidth: 200,
  164. closeAction: 'hide',
  165. labelAlign: 'right',
  166. items:[{
  167. xtype: 'textfield',
  168. id: 'wt_ad_range_val',
  169. readOnly: true,
  170. fieldLabel: '<?=$Labels->GetLabel('_RANGE_');?> (%)',
  171. value: cWTRowSelectedRangeP
  172. },{
  173. xtype: 'textfield',
  174. id: 'wt_ad_rangea_val',
  175. readOnly: true,
  176. fieldLabel: '<?=$Labels->GetLabel('_RANGE_');?> (<?=$Labels->GetLabel('_METERS_');?>)',
  177. value: cWTRowSelectedRange
  178. },{
  179. xtype: 'numberfield',
  180. id: 'wt_ad_width_val',
  181. fieldLabel: '<?=$Labels->GetLabel('_WIDTH_');?> (%)',
  182. value: '100'
  183. },{
  184. xtype: 'button',
  185. width: '100%',
  186. text: '<?=$Labels->GetLabel('_APPLY_CHANGES_');?>',
  187. handler: function(){
  188. var tWidth = Ext.getCmp('wt_ad_width_val').getValue();
  189. Ext.Ajax.request({
  190. url: '/lib/controller/updateWidthTableRecord.php',
  191. params: {
  192. UID: <?=$UserID;?>,
  193. SID: '<?=$Session;?>',
  194. DID: WTSelectedSensor,
  195. RID: cWTRowSelected,
  196. NWW: tWidth
  197. },
  198. success: function( response, opts ){
  199. widthTableEditDialog.hide();
  200. loadWidthTable( WTSelectedSensor );
  201. },
  202. failure: failureAJAXFunction
  203. });
  204. }
  205. }]
  206. });
  207. };
  208. Ext.getCmp('wt_ad_range_val').setValue( cWTRowSelectedRangeP );
  209. Ext.getCmp('wt_ad_rangea_val').setValue( cWTRowSelectedRange );
  210. widthTableEditDialog.show();
  211. };
  212. function loadWidthTable( SensorID ){
  213. WTSelectedSensor = SensorID;
  214. Ext.Ajax.request({
  215. url: '/lib/controller/getWidthTable.php',
  216. params: {
  217. UID: <?=$UserID;?>,
  218. SID: '<?=$Session;?>',
  219. DID: SensorID
  220. },
  221. success: function( response, opts ){
  222. var data = Ext.decode( response.responseText );
  223. targetWidthTable_store.removeAll();
  224. targetWidthTable_store.loadData( data.rows );
  225. },
  226. failure: failureAJAXFunction
  227. });
  228. };
  229. function loadModuleFiles( sensorID ){
  230. Ext.Ajax.request({
  231. url: '/lib/controller/getDeviceFiles.php',
  232. params: {
  233. UID: <?=$UserID;?>,
  234. SID: '<?=$Session;?>',
  235. DID: sensorID
  236. },
  237. success: function( response, opts ){
  238. var data = Ext.decode( response.responseText );
  239. uploaded_store.removeAll();
  240. uploaded_store.loadData( data.files );
  241. },
  242. failure: failureAJAXFunction
  243. });
  244. };
  245. function loadHelpContent( topicID ){
  246. if( helpContentTopicID == topicID ) return;
  247. helpContentTopicID = topicID;
  248. Ext.Ajax.request({
  249. url: '/lib/controller/getHelpTopic.php',
  250. params: {
  251. UID: <?=$UserID;?>,
  252. SID: '<?=$Session;?>',
  253. TID: topicID
  254. },
  255. success: function( response, opts ){
  256. var tData = Ext.decode(response.responseText);
  257. var tPanel = Ext.getCmp('help_content');
  258. tPanel.removeAll( true );
  259. tPanel.add( tData );
  260. tPanel.doLayout();
  261. },
  262. failure: failureAJAXFunction
  263. });
  264. };
  265. function moveStation( station_id, dir ){
  266. doStationOperation( station_id, 5, JSON.stringify( { DIR: dir, LINE: SelectedLine } ), true );
  267. };
  268. var moduleControlWindow = null;
  269. function moduleControl(){
  270. if( moduleControlWindow == null ){
  271. moduleControlWindow = new Ext.Window({
  272. title: 'Module Control',
  273. height: Ext.getBody().getViewSize().height*0.9,
  274. width: Ext.getBody().getViewSize().width*0.9,
  275. modal: true,
  276. items:[{
  277. html:'<iframe frameBorder=0 width="100%" height="'+(Ext.getBody().getViewSize().height*0.9-32)+'" src="/lib/controller/doModuleOperations.php?OPID=1&MID='+SelectedModule+'"></iframe>'
  278. }],
  279. listeners:{
  280. beforedestroy: function(){
  281. moduleControlWindow = null;
  282. }
  283. }
  284. });
  285. };
  286. moduleControlWindow.show();
  287. };
  288. function moduleCamControl(){
  289. if( moduleControlWindow == null ){
  290. moduleControlWindow = new Ext.Window({
  291. title: 'Module Control',
  292. height: Ext.getBody().getViewSize().height*0.9,
  293. width: Ext.getBody().getViewSize().width*0.9,
  294. modal: true,
  295. items:[{
  296. html:'<iframe frameBorder=0 width="100%" height="'+(Ext.getBody().getViewSize().height*0.9-32)+'" src="/lib/controller/doModuleOperations.php?OPID=3&MID='+SelectedModule+'"></iframe>'
  297. }],
  298. listeners:{
  299. beforedestroy: function(){
  300. moduleControlWindow = null;
  301. }
  302. }
  303. });
  304. };
  305. moduleControlWindow.show();
  306. };
  307. function moduleHostControl(){
  308. if( moduleControlWindow == null ){
  309. moduleControlWindow = new Ext.Window({
  310. title: 'Module Control',
  311. height: Ext.getBody().getViewSize().height*0.9,
  312. width: Ext.getBody().getViewSize().width*0.9,
  313. modal: true,
  314. items:[{
  315. html:'<iframe frameBorder=0 width="100%" height="'+(Ext.getBody().getViewSize().height*0.9-32)+'" src="/lib/controller/doModuleOperations.php?OPID=2&MID='+SelectedModule+'"></iframe>'
  316. }],
  317. listeners:{
  318. beforedestroy: function(){
  319. moduleControlWindow = null;
  320. }
  321. }
  322. });
  323. };
  324. moduleControlWindow.show();
  325. };
  326. function bindStationToLine( station_id ){
  327. doStationOperation( station_id, 3, SelectedLine, true );
  328. };
  329. function clearHelpContent(){
  330. helpContentTopicID = -1;
  331. };
  332. function loadRessources(){
  333. Ext.Ajax.request({
  334. url: '/lib/controller/getResources.php',
  335. params: {
  336. UID: <?=$UserID;?>,
  337. SID: '<?=$Session;?>',
  338. },
  339. success: function( response, opts ){
  340. var tData = Ext.decode(response.responseText);
  341. var tPanel = Ext.getCmp('resources_container');
  342. if( tData.status == 'ok' ){
  343. var res = Ext.decode( tData.resources );
  344. tPanel.removeAll( true );
  345. tPanel.add( res );
  346. tPanel.doLayout();
  347. } else {
  348. };
  349. },
  350. failure: failureAJAXFunction
  351. });
  352. };
  353. function loadModules(){
  354. Ext.Ajax.request({
  355. url: '/lib/controller/getModules.php',
  356. params: {
  357. UID: <?=$UserID;?>,
  358. SID: '<?=$Session;?>',
  359. },
  360. success: function( response, opts ){
  361. var tData = Ext.decode(response.responseText);
  362. var tPanel = Ext.getCmp('modules_container');
  363. if( tData.status == 'ok' ){
  364. var res = Ext.decode( tData.modules );
  365. tPanel.removeAll( true );
  366. tPanel.add( res );
  367. tPanel.doLayout();
  368. } else {
  369. tPanel.removeAll( true );
  370. tPanel.doLayout();
  371. var tPanel = Ext.getCmp('mod_ed_small');
  372. tPanel.removeAll( true );
  373. tPanel.add( { html:"<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  374. tPanel.doLayout();
  375. };
  376. },
  377. failure: failureAJAXFunction
  378. });
  379. };
  380. function loadFilters(){
  381. Ext.Ajax.request({
  382. url: '/lib/controller/getFilters.php',
  383. params: {
  384. UID: <?=$UserID;?>,
  385. SID: '<?=$Session;?>',
  386. },
  387. success: function( response, opts ){
  388. var tData = Ext.decode(response.responseText);
  389. var tPanel = Ext.getCmp('filters_container');
  390. if( tData.status == 'ok' ){
  391. var res = Ext.decode( tData.modules );
  392. tPanel.removeAll( true );
  393. tPanel.add( res );
  394. tPanel.doLayout();
  395. } else {
  396. tPanel.removeAll( true );
  397. tPanel.doLayout();
  398. var tPanel = Ext.getCmp('flt_ed_small');
  399. tPanel.removeAll( true );
  400. tPanel.add( { html:"<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  401. tPanel.doLayout();
  402. };
  403. },
  404. failure: failureAJAXFunction
  405. });
  406. };
  407. function loadPhoneBook(){
  408. Ext.Ajax.request({
  409. url: '/lib/controller/getPhoneBook.php',
  410. params: {
  411. UID: <?=$UserID;?>,
  412. SID: '<?=$Session;?>',
  413. },
  414. success: function( response, opts ){
  415. var data = Ext.decode(response.responseText);
  416. //var tPanel = Ext.getCmp('main_portal');
  417. //tPanel.removeAll(true);
  418. //for( i=0; i < data.length; i++) tPanel.add( data[i] );
  419. //tPanel.doLayout();
  420. },
  421. failure: failureAJAXFunction
  422. });
  423. };
  424. var addNPNWindow = null;
  425. function addNewPhoneNumber(){
  426. if( addNPNWindow == null ){
  427. addNPNWindow = new Ext.Window({
  428. title: '<?=$Labels->GetLabel('_ADD_NEW_PHN_');?>',
  429. modal: true,
  430. closeAction: 'hide',
  431. resizable: false,
  432. width: 400,
  433. height: 300,
  434. items:[{
  435. xtype: 'form',
  436. labelWidth: 120,
  437. labelAlign: 'right',
  438. items: [{
  439. xtype: 'textfield',
  440. fieldLabel: '<?=$Labels->GetLabel('_NAME_LABEL_');?>',
  441. id: 'ph_name',
  442. width: 220,
  443. value: ''
  444. },{
  445. xtype: 'textfield',
  446. fieldLabel: '<?=$Labels->GetLabel('_PHONE_NUMBER_');?>',
  447. id: 'ph_number',
  448. width: 220,
  449. validator: function( a ){
  450. return true;
  451. },
  452. value: ''
  453. },{
  454. xtype: 'radio',
  455. id: 'r_ph_call',
  456. fieldLabel: '<?=$Labels->GetLabel('_CALL_ONLY_');?>',
  457. name: 'ph_cam',
  458. checked: true,
  459. value: '1'
  460. },{
  461. xtype: 'radio',
  462. id: 'r_ph_msg',
  463. fieldLabel: '<?=$Labels->GetLabel('_SMS_ONLY_');?>',
  464. name: 'ph_cam',
  465. value: '0'
  466. },{
  467. xtype: 'textarea',
  468. fieldLabel: '<?=$Labels->GetLabel('_CUSTOM_MSG_');?>',
  469. width: 220,
  470. height: 130,
  471. id: 'cus_sms',
  472. name: 'cus_sms'
  473. }]
  474. }],
  475. bbar:['->',{
  476. text: 'Add',
  477. handler: function(){
  478. var num = Ext.getCmp( 'ph_number' ).getValue();
  479. var lbl = Ext.getCmp( 'ph_name' ).getValue();
  480. var con = (Ext.getCmp( 'r_ph_call' ).getValue())?1:0;
  481. var cust = Ext.getCmp( 'cus_sms' ).getValue();
  482. Ext.Ajax.request({
  483. url: '/lib/controller/addPhoneBookRecord.php',
  484. params: {
  485. UID: <?=$UserID;?>,
  486. SID: '<?=$Session;?>',
  487. PNUM: num,
  488. PNAM: lbl,
  489. PCAL: con,
  490. PMSG: cust
  491. },
  492. success: function( response, opts ){
  493. var data = Ext.decode(response.responseText);
  494. if( data.success ){
  495. } else {
  496. Ext.Msg.show({
  497. title:'<?=$Labels->GetLabel('_ERROR_');?>',
  498. msg: data.msg,
  499. buttons: Ext.Msg.OK,
  500. icon: Ext.MessageBox.ERROR//,
  501. //fn: function(btn, text){
  502. // if( btn == 'yes' ){
  503. // cleanupChangeNotifier();
  504. // } else {
  505. // loadEditor = false;
  506. // };
  507. //}
  508. });
  509. };
  510. //var tPanel = Ext.getCmp('main_portal');
  511. //tPanel.removeAll(true);
  512. //for( i=0; i < data.length; i++) tPanel.add( data[i] );
  513. //tPanel.doLayout();
  514. },
  515. failure: failureAJAXFunction
  516. });
  517. }
  518. },{
  519. text: 'Cancel',
  520. handler: function(){
  521. addNPNWindow.hide();
  522. }
  523. }]
  524. });
  525. };
  526. addNPNWindow.show();
  527. };
  528. function loadDetectedCameras(){
  529. Ext.Ajax.request({
  530. url: '/lib/controller/getCameras.php',
  531. params: {
  532. UID: <?=$UserID;?>,
  533. TYP: 0,
  534. SID: '<?=$Session;?>',
  535. },
  536. success: function( response, opts ){
  537. var tData = Ext.decode(response.responseText);
  538. var tPanel = Ext.getCmp('dcam_container');
  539. if( tData.status == 'ok' ){
  540. var res = Ext.decode( tData.cameras );
  541. tPanel.removeAll( true );
  542. tPanel.add( res );
  543. tPanel.doLayout();
  544. var zPanel = Ext.getCmp('dcam_op_small');
  545. zPanel.removeAll( true );
  546. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  547. zPanel.doLayout();
  548. } else {
  549. tPanel.removeAll( true );
  550. tPanel.doLayout();
  551. var zPanel = Ext.getCmp('dcam_op_small');
  552. zPanel.removeAll( true );
  553. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  554. zPanel.doLayout();
  555. };
  556. },
  557. failure: failureAJAXFunction
  558. });
  559. };
  560. function loadAssignedCameras(){
  561. Ext.Ajax.request({
  562. url: '/lib/controller/getCameras.php',
  563. params: {
  564. UID: <?=$UserID;?>,
  565. TYP: 1,
  566. SID: '<?=$Session;?>',
  567. },
  568. success: function( response, opts ){
  569. var tData = Ext.decode(response.responseText);
  570. var tPanel = Ext.getCmp('acam_container');
  571. if( tData.status == 'ok' ){
  572. var res = Ext.decode( tData.cameras );
  573. tPanel.removeAll( true );
  574. tPanel.add( res );
  575. tPanel.doLayout();
  576. var zPanel = Ext.getCmp('acam_op_small');
  577. zPanel.removeAll( true );
  578. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  579. zPanel.doLayout();
  580. } else {
  581. tPanel.removeAll( true );
  582. tPanel.doLayout();
  583. var zPanel = Ext.getCmp('acam_op_small');
  584. zPanel.removeAll( true );
  585. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  586. zPanel.doLayout();
  587. };
  588. },
  589. failure: failureAJAXFunction
  590. });
  591. };
  592. function loadAttachedSensors(){
  593. Ext.Ajax.request({
  594. url: '/lib/controller/getSensors.php',
  595. params: {
  596. UID: <?=$UserID;?>,
  597. SID: '<?=$Session;?>',
  598. },
  599. success: function( response, opts ){
  600. var tData = Ext.decode(response.responseText);
  601. var tPanel = Ext.getCmp('sens_container');
  602. if( tData.status == 'ok' ){
  603. var res = Ext.decode( tData.sensors );
  604. tPanel.removeAll( true );
  605. tPanel.add( res );
  606. tPanel.doLayout();
  607. var zPanel = Ext.getCmp('sens_op_small');
  608. zPanel.removeAll( true );
  609. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  610. zPanel.doLayout();
  611. } else {
  612. tPanel.removeAll( true );
  613. tPanel.doLayout();
  614. var zPanel = Ext.getCmp('sens_op_small');
  615. zPanel.removeAll( true );
  616. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  617. zPanel.doLayout();
  618. };
  619. },
  620. failure: failureAJAXFunction
  621. });
  622. };
  623. function loadMetroLines( suse ){
  624. if( suse == undefined ){
  625. suse = 0;
  626. };
  627. oSelectedLine = 0;
  628. Ext.Ajax.request({
  629. url: '/lib/controller/getLines.php',
  630. params: {
  631. UID: <?=$UserID;?>,
  632. SID: '<?=$Session;?>',
  633. },
  634. success: function( response, opts ){
  635. var tData = Ext.decode(response.responseText);
  636. var tPanel = Ext.getCmp('lines_container');
  637. if( tData.status == 'ok' ){
  638. var res = Ext.decode( tData.lines );
  639. tPanel.removeAll( true );
  640. tPanel.add( res );
  641. tPanel.doLayout();
  642. if( suse == 0 ){
  643. var zPanel = Ext.getCmp('line_op_small');
  644. zPanel.removeAll( true );
  645. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  646. zPanel.doLayout();
  647. var tComp = Ext.getCmp('stations_tab');
  648. tComp.setDisabled( true );
  649. } else {
  650. editLine( suse );
  651. };
  652. } else {
  653. tPanel.removeAll( true );
  654. tPanel.doLayout();
  655. var zPanel = Ext.getCmp('line_op_small');
  656. zPanel.removeAll( true );
  657. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  658. zPanel.doLayout();
  659. var tComp = Ext.getCmp('stations_tab');
  660. tComp.setDisabled( true );
  661. };
  662. },
  663. failure: failureAJAXFunction
  664. });
  665. };
  666. function loadMetroStations( line_id, suse ){
  667. if( suse == undefined ){
  668. suse = 0;
  669. };
  670. oSelectedStation = 0;
  671. Ext.Ajax.request({
  672. url: '/lib/controller/getStations.php',
  673. params: {
  674. UID: <?=$UserID;?>,
  675. SID: '<?=$Session;?>',
  676. LID: line_id
  677. },
  678. success: function( response, opts ){
  679. var tData = Ext.decode(response.responseText);
  680. var tPanel = Ext.getCmp('stations_container');
  681. if( tData.status == 'ok' ){
  682. tPanel.removeAll( true );
  683. var res = Ext.decode( tData.line_tag );
  684. tPanel.add( res );
  685. res = Ext.decode( tData.stations );
  686. tPanel.add( res );
  687. tPanel.doLayout();
  688. if( suse == 0 ){
  689. var zPanel = Ext.getCmp('station_op_small');
  690. zPanel.removeAll( true );
  691. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  692. zPanel.doLayout();
  693. var tComp = Ext.getCmp('platform_tab');
  694. tComp.setDisabled( true );
  695. } else {
  696. editStation( suse );
  697. };
  698. } else {
  699. tPanel.removeAll( true );
  700. tPanel.doLayout();
  701. var zPanel = Ext.getCmp('station_op_small');
  702. zPanel.removeAll( true );
  703. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  704. zPanel.doLayout();
  705. var tComp = Ext.getCmp('platform_tab');
  706. tComp.setDisabled( true );
  707. };
  708. },
  709. failure: failureAJAXFunction
  710. });
  711. };
  712. function loadMetroStationPlatforms( station_id, suse ){
  713. if( suse == undefined ){
  714. suse = 0;
  715. };
  716. oSelectedPlatform = 0;
  717. Ext.Ajax.request({
  718. url: '/lib/controller/getPlatforms.php',
  719. params: {
  720. UID: <?=$UserID;?>,
  721. SID: '<?=$Session;?>',
  722. OID: station_id
  723. },
  724. success: function( response, opts ){
  725. var tData = Ext.decode(response.responseText);
  726. var tPanel = Ext.getCmp('platform_container');
  727. if( tData.status == 'ok' ){
  728. tPanel.removeAll( true );
  729. var res = Ext.decode( tData.line_tag );
  730. tPanel.add( res );
  731. res = Ext.decode( tData.platforms );
  732. tPanel.add( res );
  733. tPanel.doLayout();
  734. if( suse == 0 ){
  735. var zPanel = Ext.getCmp('platform_op_small');
  736. zPanel.removeAll( true );
  737. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  738. zPanel.doLayout();
  739. var tComp = Ext.getCmp('modules_tab');
  740. tComp.setDisabled( true );
  741. } else {
  742. editPlatform( suse );
  743. };
  744. } else {
  745. tPanel.removeAll( true );
  746. tPanel.doLayout();
  747. var zPanel = Ext.getCmp('platform_op_small');
  748. zPanel.removeAll( true );
  749. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  750. zPanel.doLayout();
  751. var tComp = Ext.getCmp('modules_tab');
  752. tComp.setDisabled( true );
  753. };
  754. },
  755. failure: failureAJAXFunction
  756. });
  757. };
  758. function loadMetroPlatformModules( platform_id, suse ){
  759. if( suse == undefined ){
  760. suse = 0;
  761. };
  762. oSelectedPlatform = 0;
  763. Ext.Ajax.request({
  764. url: '/lib/controller/getModules.php',
  765. params: {
  766. UID: <?=$UserID;?>,
  767. SID: '<?=$Session;?>',
  768. OID: platform_id
  769. },
  770. success: function( response, opts ){
  771. var tData = Ext.decode(response.responseText);
  772. var tPanel = Ext.getCmp('module_container');
  773. if( tData.b_a_b ) Ext.getCmp('mod_add_btn').disable(); else Ext.getCmp('mod_add_btn').enable();
  774. if( tData.status == 'ok' ){
  775. tPanel.removeAll( true );
  776. //var res = Ext.decode( tData.line_tag );
  777. //tPanel.add( res );
  778. res = Ext.decode( tData.modules );
  779. tPanel.add( res );
  780. tPanel.doLayout();
  781. if( suse == 0 ){
  782. var zPanel = Ext.getCmp('module_op_small');
  783. zPanel.removeAll( true );
  784. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  785. zPanel.doLayout();
  786. } else {
  787. editModule( suse );
  788. };
  789. } else {
  790. tPanel.removeAll( true );
  791. tPanel.doLayout();
  792. var zPanel = Ext.getCmp('module_op_small');
  793. zPanel.removeAll( true );
  794. zPanel.add( { html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>" } );
  795. zPanel.doLayout();
  796. };
  797. },
  798. failure: failureAJAXFunction
  799. });
  800. };
  801. var addMetroStationWindow = null;
  802. function addStationPlatform( station_id ){
  803. };
  804. function addMetroStation( line_id ){
  805. if( addMetroStationWindow == null ){
  806. //debugger;
  807. addMetroStationWindow = new Ext.Window({
  808. title: 'Add Station',
  809. width: 800,
  810. height: 600,
  811. items:[{
  812. xtype: 'tabpanel',
  813. frame: false,
  814. id: 'jjua_content',
  815. border: false,
  816. activeTab: 0,
  817. items:[{
  818. xtype: 'panel',
  819. flex: 1,
  820. title: 'Assign Existed Station',
  821. items:[{
  822. xtype: 'spacer',
  823. height: 10
  824. },{
  825. xtype: 'textfield',
  826. id: 'zizi',
  827. width: '100%',
  828. enableKeyEvents : true,
  829. emptyText: 'Start Type Station Name Here',
  830. value: '',
  831. listeners:{
  832. keyup: function( t, e ){
  833. nv = t.getRawValue();
  834. if( nv.length > 2 ){
  835. Ext.Ajax.request({
  836. url: '/lib/controller/getStations.php',
  837. params: {
  838. UID: <?=$UserID;?>,
  839. SID: '<?=$Session;?>',
  840. LID: SelectedLine,
  841. ABQ: nv
  842. },
  843. success: function( response, opts ){
  844. var tData = Ext.decode(response.responseText);
  845. var tPanel = Ext.getCmp('ex_station_container');
  846. if( tData.status == 'ok' ){
  847. tPanel.removeAll( true );
  848. var res = Ext.decode( tData.stations );
  849. tPanel.add( res );
  850. tPanel.doLayout();
  851. } else {
  852. tPanel.removeAll( true );
  853. tPanel.doLayout();
  854. };
  855. },
  856. failure: failureAJAXFunction
  857. });
  858. };
  859. }
  860. }
  861. },{
  862. xtype: 'spacer',
  863. height: 10
  864. },{
  865. xtype: 'panel',
  866. id: 'ex_station_container',
  867. flex: 1,
  868. height: 500,
  869. items:[]
  870. }]
  871. }]
  872. }],
  873. listeners:{
  874. beforedestroy: function(){
  875. addMetroStationWindow = null;
  876. }
  877. }
  878. });
  879. };
  880. addMetroStationWindow.show();
  881. };
  882. function editResource( rid ){
  883. var loadEditor = true;
  884. if( settingsAreChanged ){
  885. Ext.Msg.show({
  886. title:'<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>',
  887. msg: '<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>',
  888. buttons: Ext.Msg.YESNO,
  889. icon: Ext.MessageBox.WARNING,
  890. fn: function(btn, text){
  891. if( btn == 'yes' ){
  892. cleanupChangeNotifier();
  893. } else {
  894. loadEditor = false;
  895. };
  896. }
  897. });
  898. };
  899. if( loadEditor ){
  900. Ext.Ajax.request({
  901. url: '/lib/controller/getResourceEditor.php',
  902. params: {
  903. RID: rid,
  904. UID: <?=$UserID;?>,
  905. SID: '<?=$Session;?>',
  906. },
  907. success: function( response, opts ){
  908. var data = Ext.decode(response.responseText);
  909. var resourceEdPanel = Ext.getCmp('res_ed_small');
  910. if( resourceEdPanel ){
  911. resourceEdPanel.removeAll( true );
  912. resourceEdPanel.add( data );
  913. resourceEdPanel.doLayout();
  914. };
  915. },
  916. failure: failureAJAXFunction
  917. });
  918. };
  919. };
  920. function editFilter( fid ){
  921. var loadEditor = true;
  922. if( settingsAreChanged ){
  923. Ext.Msg.show({
  924. title: "<?=$Labels->GetLabel('_SETTINGS_CHANGED_');?>",
  925. msg: "<?=$Labels->GetLabel('_SET_CHANGED_WOULD_SAVE_');?>",
  926. buttons: Ext.Msg.YESNO,
  927. icon: Ext.MessageBox.WARNING,
  928. fn: function(btn, text){
  929. if( btn == 'yes' ){
  930. cleanupChangeNotifier();
  931. } else {
  932. loadEditor = false;
  933. };
  934. }
  935. });
  936. };
  937. if( loadEditor ){
  938. Ext.Ajax.request({
  939. url: '/lib/controller/getFilterEditor.php',
  940. params: {
  941. FID: fid,
  942. UID: <?=$UserID;?>,
  943. SID: '<?=$Session;?>',
  944. },
  945. success: function( response, opts ){
  946. var data = Ext.decode(response.responseText);
  947. var resourceEdPanel = Ext.getCmp('flt_ed_small');
  948. if( resourceEdPanel ){
  949. resourceEdPanel.removeAll( true );
  950. resourceEdPanel.add( data );
  951. resourceEdPanel.doLayout();
  952. };
  953. },
  954. failure: failureAJAXFunction
  955. });
  956. };
  957. };
  958. function editModule( s_id ){
  959. if( oSelectedModule ){
  960. var tt = document.getElementById('MODULE_TAG_'+oSelectedModule );
  961. tt.classList.remove('selected_green');
  962. tt.classList.add('active_green');
  963. };
  964. var tt = document.getElementById('MODULE_TAG_'+s_id );
  965. if( tt!= undefined ){
  966. tt.classList.remove('active_green');
  967. tt.classList.add('selected_green');
  968. };
  969. if( oSelectedModule == s_id ) return;
  970. Ext.Ajax.request({
  971. url: '/lib/controller/getModuleEditor.php',
  972. params: {
  973. MID: s_id,
  974. UID: <?=$UserID;?>,
  975. SID: '<?=$Session;?>'
  976. },
  977. success: function( response, opts ){
  978. var data = Ext.decode( response.responseText );
  979. var tComp = Ext.getCmp('module_op_small');
  980. if( tComp!= null ){
  981. tComp.removeAll( true );
  982. tComp.add( data );
  983. tComp.doLayout();
  984. };
  985. oSelectedModule = s_id;
  986. if( SelectedModule != s_id ){
  987. SelectedModule = s_id;
  988. //tComp = Ext.getCmp('btn_unb_station');
  989. //tComp.setDisabled( false );
  990. //tComp = Ext.getCmp('btn_del_station');
  991. //tComp.setDisabled( false );
  992. //tComp = Ext.getCmp('modules_tab');
  993. //tComp.setDisabled( false );
  994. };
  995. }
  996. });
  997. };
  998. function enableModule( ID ){
  999. Ext.Ajax.request({
  1000. url: '/lib/controller/doModuleOperation.php',
  1001. params: {
  1002. OPID: 2,
  1003. OPCODE: 1,
  1004. MID: ID,
  1005. UID: <?=$UserID;?>,
  1006. SID: '<?=$Session;?>'
  1007. },
  1008. success: function(){
  1009. //showSettings( SelectedNodeID, 2 );
  1010. loadModules();
  1011. }
  1012. });
  1013. };
  1014. function disableModule( ID ){
  1015. Ext.Ajax.request({
  1016. url: '/lib/controller/doModuleOperation.php',
  1017. params: {
  1018. OPID: 2,
  1019. OPCODE: 0,
  1020. MID: ID,
  1021. UID: <?=$UserID;?>,
  1022. SID: '<?=$Session;?>'
  1023. },
  1024. success: function(){
  1025. //showSettings( SelectedNodeID, 2 );
  1026. loadModules();
  1027. }
  1028. });
  1029. };
  1030. //cursor: url('data:image/svg+xml;utf8,<svg fill="%23FF0000" height="48" viewBox="0 0 24 24" width="48" xmlns="http://www.w3.org/2000/svg"><path d="M0 0h24v24H0z" fill="none"/><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"/></svg>') 24 24, auto;
  1031. function doCamOperation( cid, op, param, reload = false ){
  1032. Ext.Ajax.request({
  1033. url: '/lib/controller/doCameraOperation.php',
  1034. params: {
  1035. CID: cid,
  1036. CMD: 10,
  1037. OPID: op,
  1038. OPCODE: param,
  1039. UID: <?=$UserID;?>,
  1040. SID: '<?=$Session;?>'
  1041. },
  1042. success: function(){
  1043. if( reload ) loadDetectedCameras();
  1044. if( reload ) loadAssignedCameras();
  1045. }
  1046. });
  1047. };
  1048. function doApplicationOperation( op, param, reload = false ){
  1049. Ext.Ajax.request({
  1050. url: '/lib/controller/doApplicationOperation.php',
  1051. params: {
  1052. OPID: op,
  1053. OPCODE: param,
  1054. UID: <?=$UserID;?>,
  1055. SID: '<?=$Session;?>'
  1056. },
  1057. success: function(){
  1058. //if( reload ) loadDetectedCameras();
  1059. //if( reload ) loadAssignedCameras();
  1060. }
  1061. });
  1062. };
  1063. function doModuleOperation( moduleid, op, param, reload = false ){
  1064. Ext.Ajax.request({
  1065. url: '/lib/controller/doModuleOperations.php',
  1066. params: {
  1067. MID: moduleid,
  1068. OPID: op,
  1069. OPCODE: param,
  1070. UID: <?=$UserID;?>,
  1071. SID: '<?=$Session;?>'
  1072. },
  1073. success: function(){
  1074. if( reload ) loadMetroPlatformModules( SelectedPlatform, SelectedModule );
  1075. }
  1076. });
  1077. };
  1078. function doLineOperation( lineID, operation, param, reload ){
  1079. Ext.Ajax.request({
  1080. url: '/lib/controller/doLineOperations.php',
  1081. params: {
  1082. ID: lineID,
  1083. OPID: operation,
  1084. OPCODE: param,
  1085. UID: <?=$UserID;?>,
  1086. SID: '<?=$Session;?>'
  1087. },
  1088. success: function(){
  1089. oSelectedLine = 0;
  1090. if( reload ) loadMetroLines( SelectedLine );
  1091. }
  1092. });
  1093. };
  1094. function doStationOperation( StationID, operation, param, reload ){
  1095. Ext.Ajax.request({
  1096. url: '/lib/controller/doStationOperations.php',
  1097. params: {
  1098. ID: StationID,
  1099. OPID: operation,
  1100. OPCODE: param,
  1101. UID: <?=$UserID;?>,
  1102. SID: '<?=$Session;?>'
  1103. },
  1104. success: function(){
  1105. if( reload ) loadMetroStations( SelectedLine, SelectedStation );
  1106. }
  1107. });
  1108. };
  1109. function doPlatformOperation( PlatformID, operation, param, reload ){
  1110. Ext.Ajax.request({
  1111. url: '/lib/controller/doPlatformOperations.php',
  1112. params: {
  1113. ID: PlatformID,
  1114. OPID: operation,
  1115. OPCODE: param,
  1116. UID: <?=$UserID;?>,
  1117. SID: '<?=$Session;?>'
  1118. },
  1119. success: function(){
  1120. if( reload ) loadMetroStationPlatforms( SelectedStation, SelectedPlatform );
  1121. }
  1122. });
  1123. };
  1124. function doResourceOperation( resourceid, op, param, value, reload = false ){
  1125. Ext.Ajax.request({
  1126. url: '/lib/controller/doResourceOperation.php',
  1127. params: {
  1128. RID: resourceid,
  1129. OPID: op,
  1130. OPCODE: param,
  1131. OPVAL: value,
  1132. UID: <?=$UserID;?>,
  1133. SID: '<?=$Session;?>'
  1134. },
  1135. success: function(){
  1136. if( reload ) loadAttachedSensors();
  1137. }
  1138. });
  1139. };
  1140. function removeModule( ID ){
  1141. Ext.Msg.show({
  1142. title: "<?=$Labels->GetLabel('_PLS_CONFIRM_');?>",
  1143. msg: "<?=$Labels->GetLabel('_RUS_DELETE_MODULE_');?>",
  1144. buttons: Ext.Msg.YESNOCANCEL,
  1145. fn: function( btn, text ){
  1146. if( btn == 'yes' ){
  1147. Ext.Ajax.request({
  1148. url: '/lib/controller/doModuleOperation.php',
  1149. params: {
  1150. OPID: 1,
  1151. MID: ID,
  1152. UID: <?=$UserID;?>,
  1153. SID: '<?=$Session;?>'
  1154. },
  1155. success: function(){
  1156. //showSettings( SelectedNodeID, 2 );
  1157. loadModules();
  1158. }
  1159. });
  1160. };
  1161. },
  1162. icon: Ext.MessageBox.QUESTION
  1163. });
  1164. };
  1165. function disableServOps(){
  1166. var tC = Ext.getCmp('servopPanel01');
  1167. tC.removeClass('servopInfo_item01');
  1168. tC.addClass('servopInfo_item00');
  1169. tC.disable();
  1170. Ext.getCmp('tbtn_sop01').disable();
  1171. //tC.doLayout();
  1172. tC = Ext.getCmp('servopPanel02');
  1173. tC.removeClass('servopInfo_item11');
  1174. tC.addClass('servopInfo_item10');
  1175. tC.disable();
  1176. Ext.getCmp('tbtn_sop02').disable();
  1177. //tC.doLayout();
  1178. tC = Ext.getCmp('servopPanel03');
  1179. tC.removeClass('servopInfo_item21');
  1180. tC.addClass('servopInfo_item20');
  1181. tC.disable();
  1182. Ext.getCmp('tbtn_sop03').disable();
  1183. //tC.doLayout();
  1184. tC = Ext.getCmp('servopPanel04');
  1185. tC.removeClass('servopInfo_item31');
  1186. tC.addClass('servopInfo_item30');
  1187. tC.disable();
  1188. Ext.getCmp('tbtn_sop04').disable();
  1189. //tC.doLayout();
  1190. };
  1191. function enableServOps(){
  1192. var tC = Ext.getCmp('servopPanel01');
  1193. if( tC != undefined ){
  1194. tC.removeClass('servopInfo_item00');
  1195. tC.addClass('servopInfo_item01');
  1196. Ext.getCmp('tbtn_sop01').enable();
  1197. tC.enable();
  1198. };
  1199. //tC.doLayout();
  1200. tC = Ext.getCmp('servopPanel02');
  1201. if( tC != undefined ){
  1202. tC.removeClass('servopInfo_item10');
  1203. tC.addClass('servopInfo_item11');
  1204. tC.enable();
  1205. Ext.getCmp('tbtn_sop02').enable();
  1206. };
  1207. //tC.doLayout();
  1208. tC = Ext.getCmp('servopPanel03');
  1209. if( tC != undefined ){
  1210. tC.removeClass('servopInfo_item20');
  1211. tC.addClass('servopInfo_item21');
  1212. tC.enable();
  1213. Ext.getCmp('tbtn_sop03').enable();
  1214. };
  1215. //tC.doLayout();
  1216. tC = Ext.getCmp('servopPanel04');
  1217. if( tC != undefined ){
  1218. tC.removeClass('servopInfo_item30');
  1219. tC.addClass('servopInfo_item31');
  1220. tC.enable();
  1221. Ext.getCmp('tbtn_sop04').enable();
  1222. };
  1223. //tC.doLayout();
  1224. };
  1225. function serverStatusUpdater(){
  1226. Ext.Ajax.request({
  1227. url: '/lib/controller/getServerStatus.php',
  1228. params: {
  1229. SERVID: 1,
  1230. UID: <?=$UserID;?>,
  1231. SID: '<?=$Session;?>'
  1232. },
  1233. success: function( response, opts ){
  1234. // If the response is JSON, you have to decode it
  1235. var sps = document.getElementById("INFO_SPS");
  1236. if( sps == undefined ) return;
  1237. var data = Ext.decode(response.responseText);
  1238. if( data.status == 'ok' ){
  1239. serverIsOnLine = true;
  1240. enableServOps();
  1241. document.getElementById('HW_INFO').innerHTML = data.hw_info;
  1242. document.getElementById('OS_INFO').innerHTML = data.os_info;
  1243. document.getElementById('SW_INFO').innerHTML = data.build;
  1244. setDonatStatus( 1, 0, data.stats.stat_cpu15 );
  1245. setDonatStatus( 1, 1, data.stats.stat_mem );
  1246. setDonatStatus( 1, 2, data.stats.stat_disk );
  1247. setDonatStatus( 1, 3, data.stats.temp0 );
  1248. sps.classList.remove('setEd_infoPanel');
  1249. sps.classList.add('setEl_infoPanel');
  1250. } else {
  1251. serverIsOnLine = false;
  1252. disableServOps();
  1253. if( data.status == 'na' ){
  1254. setDonatStatus( 1, 0, -1 );
  1255. setDonatStatus( 1, 1, -1 );
  1256. setDonatStatus( 1, 2, -1 );
  1257. setDonatStatus( 1, 3, -1 );
  1258. sps.classList.remove('setEl_infoPanel');
  1259. sps.classList.add('setEd_infoPanel');
  1260. } else {
  1261. Ext.Msg.show({
  1262. title: "<?=$Labels->GetLabel("_INFO_MSG_");?>",
  1263. msg: data.messages,
  1264. buttons: Ext.Msg.OK,//YESNOCANCEL,
  1265. fn: function(){
  1266. },
  1267. icon: Ext.MessageBox.INFO //QUESTION
  1268. });
  1269. };
  1270. };
  1271. if( tlInterval == null ){
  1272. tlInterval = window.setInterval( serverStatusUpdater, 1200, selectedSite );
  1273. };
  1274. },
  1275. failure: failureAJAXFunction
  1276. });
  1277. };
  1278. var devUploadTimeout = null;
  1279. var devUploadID = -1;
  1280. function fetchDeviceUploadStatus(){
  1281. clearTimeout( devUploadTimeout );
  1282. if( devUploadID < 1 ) return;
  1283. Ext.Ajax.request({
  1284. url: '/lib/controller/getDeviceUploadStatus.php',
  1285. params: {
  1286. UID: <?=$UserID;?>,
  1287. SID: '<?=$Session;?>',
  1288. DID: devUploadID
  1289. },
  1290. success: function( response, opts ){
  1291. var data = Ext.decode(response.responseText);
  1292. var tT = Ext.getCmp('upp_ttext');
  1293. if( tT != undefined ){
  1294. if( data.count > 0 ){
  1295. devUploadTimeout = setTimeout( fetchDeviceUploadStatus, 1000 );
  1296. };
  1297. if( data.current != undefined ){
  1298. tT.update('<p class="UPTTEXT">Uploading '+data.count+' file(s)</p>');
  1299. document.getElementById('upp_ctext').innerHTML ='<p class="UPCTEXT">Current File: '+data.current+'</p>';
  1300. Ext.getCmp('upp_pbar').updateProgress( data.progress, Math.round( data.progress*100 )+'%', true );
  1301. devUploadTimeout = setTimeout( fetchDeviceUploadStatus, 1000 );
  1302. } else {
  1303. Ext.getCmp('upload_progres_panel').hide();
  1304. Ext.getCmp('uploaded_grid').show();
  1305. loadModuleFiles( devUploadID );
  1306. };
  1307. };
  1308. },
  1309. failure: failureAJAXFunction
  1310. });
  1311. };
  1312. function downloadSettings(){
  1313. ReportMask = new Ext.LoadMask(Ext.getBody(), {msg:"<?=$Labels->GetLabel('_Please_Wait_');?>..."});
  1314. ReportMask.show();
  1315. const formData = new FormData();
  1316. formData.append("UID",<?=$UserID;?>);
  1317. formData.append("SID",'<?=$Session;?>');
  1318. fetch('/lib/controller/downloadSettings.php',{
  1319. method: "POST",
  1320. body: formData
  1321. })
  1322. .then(resp => resp.blob())
  1323. .then(blob => {
  1324. const url = window.URL.createObjectURL(blob);
  1325. const a = document.createElement('a');
  1326. a.style.display = 'none';
  1327. a.href = url;
  1328. var today=new Date();
  1329. var SY=1900+today.getYear();
  1330. var SMO=today.getMonth()+1;
  1331. var SD=today.getDate();
  1332. var SH = today.getHours();
  1333. var SM = today.getMinutes();
  1334. var SS = today.getSeconds();
  1335. a.download = 'backup_'+SY+'.'+SMO+'.'+SD+'_'+SH+'-'+SM+'-'+SS+'.db';
  1336. document.body.appendChild(a);
  1337. a.click();
  1338. window.URL.revokeObjectURL(url);
  1339. ReportMask.hide();
  1340. Ext.Msg.show({
  1341. title:'<?=$Labels->GetLabel('_SUCCESS_');?>',
  1342. msg: '<?=$Labels->GetLabel('_DB_FILE_HAS_DOWNLOADED_');?>',
  1343. buttons: Ext.Msg.OK,
  1344. icon: Ext.MessageBox.INFO
  1345. });
  1346. })
  1347. .catch(() => {
  1348. ReportMask.hide();
  1349. Ext.Msg.show({
  1350. title:'<?=$Labels->GetLabel('_REQ_FAILURE_');?>',
  1351. msg: '<?=$Labels->GetLabel('_AJX_REQFAILURE_');?>',
  1352. buttons: Ext.Msg.OK,
  1353. icon: Ext.MessageBox.ERROR
  1354. });
  1355. });
  1356. };
  1357. function addModule(){
  1358. Ext.Ajax.request({
  1359. url: '/lib/controller/getAddModuleWindow.php',
  1360. params: {
  1361. UID: <?=$UserID;?>,
  1362. SID: '<?=$Session;?>',
  1363. PID: SelectedPlatform
  1364. },
  1365. success: function( response, opts ){
  1366. var data = Ext.decode(response.responseText);
  1367. var addModuleWindow = new Ext.Window( data );
  1368. addModuleWindow.show();
  1369. },
  1370. failure: failureAJAXFunction
  1371. });
  1372. };
  1373. function addFilter(){
  1374. var addFilterWindow = new Ext.Window({
  1375. id: 'fulu_boa',
  1376. title: "<?=$Labels->GetLabel( '_ADD_EVT_FILTER_' );?>",
  1377. modal: true,
  1378. width: 400,
  1379. height: 300,
  1380. items:[{
  1381. xtype: 'form',
  1382. items: [{
  1383. xtype: 'combo',
  1384. fieldLabel: "<?=$Labels->GetLabel( 'MOD_TYPE' );?>",
  1385. id: 'flt_type',
  1386. lazyRender: true,
  1387. mode: 'local',
  1388. forceSelection: true,
  1389. triggerAction: 'all',
  1390. editable: false,
  1391. disableKeyFilter: true,
  1392. store: new Ext.data.ArrayStore({
  1393. fields: ['az_t','az_txt'],
  1394. data: [<?php
  1395. $QS="SELECT `id`,`name` FROM `target_filter_types`";
  1396. //$JIJI=$DATABASE->Query( $QS );
  1397. $OOP = array();
  1398. foreach( $JIJI as $JI ) $OOP[] = "[{$JI['id']},'".$Labels->getLabel($JI['name'])."']";
  1399. echo implode(',', $OOP );
  1400. ?>]
  1401. }),
  1402. valueField: 'az_t',
  1403. displayField: 'az_txt',
  1404. value: 1,
  1405. listeners:{
  1406. select: function( t, r, i ){
  1407. var n = r.data.az_t;
  1408. Ext.Ajax.request({
  1409. url: '/lib/controller/getFilterInfo.php',
  1410. params: {
  1411. FID: n,
  1412. UID: <?=$UserID;?>,
  1413. SID: '<?=$Session;?>'
  1414. },
  1415. success: function( response, opts ){
  1416. Ext.getCmp('filt_infopan').update( response.responseText );
  1417. }
  1418. });
  1419. }
  1420. }
  1421. },{
  1422. xtype: 'panel',
  1423. id: 'filt_infopan',
  1424. html: ''
  1425. }]
  1426. }],
  1427. bbar:[{
  1428. text: "<?=$Labels->GetLabel( '_CANCEL_' );?>",
  1429. handler: function(){
  1430. addFilterWindow.close();
  1431. }
  1432. },{
  1433. text: "<?=$Labels->GetLabel( '_ADD_' );?>",
  1434. handler: function(){
  1435. var mtyp = Ext.getCmp('flt_type').getValue();
  1436. Ext.Ajax.request({
  1437. url: '/lib/controller/addFilter.php',
  1438. params: {
  1439. SERVID: 1,
  1440. TYPE: mtyp,
  1441. UID: <?=$UserID;?>,
  1442. SID: '<?=$Session;?>'
  1443. },
  1444. success: function( response, opts ){
  1445. // If the response is JSON, you have to decode it
  1446. var data = Ext.decode(response.responseText);
  1447. if( data.status == 'ok' ){
  1448. addFilterWindow.close();
  1449. loadFilters();
  1450. } else {
  1451. Ext.Msg.show({
  1452. title: "<?=$Labels->GetLabel("_INFO_MSG_");?>",
  1453. msg: data.message,
  1454. buttons: Ext.Msg.OK,//YESNOCANCEL,
  1455. fn: function(){
  1456. //SettingsLidar3D.hide();
  1457. },
  1458. icon: Ext.MessageBox.INFO //QUESTION
  1459. });
  1460. }
  1461. },
  1462. failure: failureAJAXFunction
  1463. });
  1464. }
  1465. }]
  1466. });
  1467. addFilterWindow.show();
  1468. Ext.Ajax.request({
  1469. url: '/lib/controller/getFilterInfo.php',
  1470. params: {
  1471. FID: 1,
  1472. UID: <?=$UserID;?>,
  1473. SID: '<?=$Session;?>'
  1474. },
  1475. success: function( response, opts ){
  1476. Ext.getCmp('filt_infopan').update( response.responseText );
  1477. }
  1478. });
  1479. };
  1480. function showSettingsServer(){
  1481. stopStatusUpdater();
  1482. if( contentView.l[3] == undefined ){
  1483. contentView.l[3] = {v:0,p:''};
  1484. };
  1485. Ext.Ajax.request({
  1486. url: '/lib/controller/getServerSettings.php',
  1487. params: {
  1488. UID: <?=$UserID;?>,
  1489. TYP: contentView.l[3].v,
  1490. SID: '<?=$Session;?>',
  1491. },
  1492. success: function( response, opts ){
  1493. var tData = Ext.decode(response.responseText);
  1494. var tPanel = Ext.getCmp('main_content');
  1495. tPanel.removeAll( true );
  1496. tPanel.add(Ext.decode(tData.content));
  1497. tPanel.doLayout();
  1498. if( contentView.l[3].v == 0 ) serverStatusUpdater();
  1499. },
  1500. failure: failureAJAXFunction
  1501. });
  1502. };
  1503. function showSettingsInfrastructure(){
  1504. stopStatusUpdater();
  1505. if( contentView.l[3] == undefined ){
  1506. contentView.l[3] = {v:0,p:''};
  1507. };
  1508. var tPanel = Ext.getCmp('main_content');
  1509. tPanel.removeAll( true );
  1510. tPanel.add({
  1511. xtype: 'tabpanel',
  1512. frame: false,
  1513. id: 'node_settings_content',
  1514. border: false,
  1515. activeTab: contentView.l[3].v,
  1516. listeners:{
  1517. tabchange: function( tp, t ){
  1518. switch( t.getId() ){
  1519. case 'lines_tab': {
  1520. stopStatusUpdater();
  1521. loadMetroLines( SelectedLine );
  1522. break;
  1523. };
  1524. case 'stations_tab': {
  1525. stopStatusUpdater();
  1526. loadMetroStations( SelectedLine, SelectedStation );
  1527. break;
  1528. };
  1529. case 'platform_tab':{
  1530. stopStatusUpdater();
  1531. loadMetroStationPlatforms( SelectedStation, SelectedPlatform );
  1532. break;
  1533. };
  1534. case 'modules_tab':{
  1535. stopStatusUpdater();
  1536. loadMetroPlatformModules( SelectedPlatform, SelectedModule );
  1537. break;
  1538. };
  1539. };
  1540. }
  1541. },
  1542. items: [{
  1543. xtype: 'panel',
  1544. id: 'lines_tab',
  1545. title: "<?=$Labels->GetLabel( '_LBL_LINES_' );?>",
  1546. layout: 'hbox',
  1547. items:[{
  1548. xtype: 'panel',
  1549. id: 'lines_container',
  1550. tbar:[{
  1551. text: "<?=$Labels->GetLabel( '_SMM_ADD_LINE_' );?>",
  1552. handler: function(){}
  1553. }],
  1554. flex: 1,
  1555. height: PanelH-15,
  1556. autoScroll: 'auto',
  1557. items:[]
  1558. },{
  1559. xtype: 'panel',
  1560. id: 'line_op_small',
  1561. flex: 1,
  1562. height: PanelH-15,
  1563. layout: 'fit',
  1564. items:[{
  1565. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1566. }]
  1567. }]
  1568. },{
  1569. xtype: 'panel',
  1570. id: 'stations_tab',
  1571. disabled: (SelectedLine == 0 ),
  1572. title: "<?=$Labels->GetLabel( '_LBL_STATIONS_' );?>",
  1573. layout: 'hbox',
  1574. items:[{
  1575. xtype: 'panel',
  1576. id: 'stations_container',
  1577. tbar:[{
  1578. text: "<?=$Labels->GetLabel( '_SMM_ADD_STATION_' );?>",
  1579. handler: addMetroStation
  1580. }],
  1581. flex: 1,
  1582. height: PanelH-15,
  1583. autoScroll: 'auto',
  1584. items:[]
  1585. },{
  1586. xtype: 'panel',
  1587. id: 'station_op_small',
  1588. flex: 1,
  1589. height: PanelH-15,
  1590. layout: 'fit',
  1591. items:[{
  1592. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1593. }]
  1594. }]
  1595. },{
  1596. xtype: 'panel',
  1597. id: 'platform_tab',
  1598. disabled: (SelectedStation == 0),
  1599. title: "<?=$Labels->GetLabel( '_LBL_PLATFORMS_' );?>",
  1600. layout: 'hbox',
  1601. items:[{
  1602. xtype: 'panel',
  1603. id: 'platform_container',
  1604. tbar:[{
  1605. text: "<?=$Labels->GetLabel( '_SMM_ADD_PLATFORM_' );?>",
  1606. handler: addStationPlatform
  1607. }],
  1608. flex: 1,
  1609. height: PanelH-15,
  1610. autoScroll: 'auto',
  1611. items:[]
  1612. },{
  1613. xtype: 'panel',
  1614. id: 'platform_op_small',
  1615. flex: 1,
  1616. height: PanelH-15,
  1617. layout: 'fit',
  1618. items:[{
  1619. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1620. }]
  1621. }]
  1622. },{
  1623. xtype: 'panel',
  1624. id: 'modules_tab',
  1625. disabled: ( SelectedPlatform==0 ),
  1626. title: "<?=$Labels->GetLabel('_MODULES_');?>",
  1627. layout: 'hbox',
  1628. items:[{
  1629. xtype: 'panel',
  1630. id: 'module_container',
  1631. tbar:[{
  1632. id: 'mod_add_btn',
  1633. text: "<?=$Labels->GetLabel( '_ADD_MODULE_' );?>",
  1634. handler: addModule
  1635. }],
  1636. flex: 1,
  1637. height: PanelH-15,
  1638. autoScroll: 'auto',
  1639. items:[]
  1640. },{
  1641. xtype: 'panel',
  1642. id: 'module_op_small',
  1643. flex: 1,
  1644. height: PanelH-15,
  1645. layout: 'fit',
  1646. items:[{
  1647. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1648. }]
  1649. }]
  1650. }]
  1651. });
  1652. tPanel.doLayout();
  1653. oSelectedLine = 0;
  1654. loadMetroLines( SelectedLine );
  1655. };
  1656. var SNAPE_Icon = L.icon({
  1657. iconUrl: '/style/assets/cursor.png',
  1658. iconSize: [32, 32], // size of the icon
  1659. iconAnchor: [16, 16], // point of the icon which will correspond to marker's location
  1660. popupAnchor: [0, -15] // point from which the popup should open relative to the iconAnchor
  1661. //shadowUrl: 'leaf-shadow.png',
  1662. //shadowSize: [50, 64], // size of the shadow
  1663. //shadowAnchor: [4, 62], // the same for the shadow
  1664. });
  1665. function updateSchemeLocation( e ){
  1666. Ext.Ajax.request({
  1667. url: '/lib/controller/doStationOperations.php',
  1668. params: {
  1669. STATION: SelectedStation,
  1670. OPID: 11,
  1671. TYPE: 0,
  1672. UID: <?=$UserID;?>,
  1673. SID: '<?=$Session;?>',
  1674. Y: e.target._latlng.lat,
  1675. X: e.target._latlng.lng
  1676. },
  1677. failure: failureAJAXFunction
  1678. });
  1679. };
  1680. function updateGisLocation( e ){
  1681. Ext.Ajax.request({
  1682. url: '/lib/controller/doStationOperations.php',
  1683. params: {
  1684. STATION: SelectedStation,
  1685. OPID: 11,
  1686. TYPE: 1,
  1687. UID: <?=$UserID;?>,
  1688. SID: '<?=$Session;?>',
  1689. LAT: e.target._latlng.lat,
  1690. LON: e.target._latlng.lng
  1691. },
  1692. failure: failureAJAXFunction
  1693. });
  1694. };
  1695. var schematic_editor = null;
  1696. function inintSchematicEditor( map_id, x, y ){
  1697. var mapLayers = [];
  1698. if( schematic_editor != null ){
  1699. schematic_editor.off();
  1700. schematic_editor.remove();
  1701. schematic_editor = null;
  1702. };
  1703. schematic_editor = L.map( map_id,{
  1704. crs: L.CRS.Simple,
  1705. attributionControl: false,
  1706. preferCanvas: true,
  1707. zoomControl: true,
  1708. center: [x,y],
  1709. zoom: 0,
  1710. minZoom: -3,
  1711. maxZoom: 0,
  1712. keyboard: false
  1713. });
  1714. var bounds = [[SCHEMATIC_SET.bounds_lx,SCHEMATIC_SET.bounds_ly], [SCHEMATIC_SET.bounds_rx,SCHEMATIC_SET.bounds_ry]];
  1715. var image = L.imageOverlay( SCHEMATIC_SET.layer_url, bounds ).addTo( schematic_editor );
  1716. L.marker([x, y], { draggable: true, icon: SNAPE_Icon, zIndexOffset: 1000, mycustomid: SelectedStation } ).addTo( schematic_editor ).on('dragend', updateSchemeLocation );
  1717. };
  1718. var gis_editor = null;
  1719. function inintGisEditor( map_id, Lat, Lon ){
  1720. var mapLayers = [];
  1721. if( gis_editor != null ){
  1722. //ToDo: must be moved to Upper Menu changer
  1723. gis_editor.off();
  1724. gis_editor.remove();
  1725. gis_editor = null;
  1726. };
  1727. gis_editor = L.map( map_id,{
  1728. attributionControl: false,
  1729. preferCanvas: true,
  1730. zoomControl: true,
  1731. center: [Lat, Lon],
  1732. /*zoomControl: false,
  1733. zoom: 17,
  1734. minZoom: 17,
  1735. maxZoom: 17,*/
  1736. keyboard: false
  1737. });
  1738. gis_editor.setView([Lat, Lon], 17 );
  1739. //mapLayers[ MAP_SET.name ] = L.tileLayer( MAP_SET.layer_url, {
  1740. // attribution: MAP_SET.attribution,
  1741. // maxNativeZoom: MAP_SET.maxNativeZoom,
  1742. // maxZoom: MAP_SET.maxZoom
  1743. //});
  1744. L.tileLayer( MAP_SET.layer_url, {
  1745. attribution: MAP_SET.attribution,
  1746. attributionControl: false,
  1747. maxNativeZoom: MAP_SET.maxNativeZoom,
  1748. //minZoom: 0,
  1749. maxZoom: MAP_SET.maxZoom
  1750. }).addTo( gis_editor );
  1751. L.marker([Lat, Lon], { draggable: true, icon: SNAPE_Icon, zIndexOffset: 1000, mycustomid: SelectedStation } ).addTo( gis_editor ).on('dragend', updateGisLocation );
  1752. };
  1753. function showSettingsDetection(){
  1754. stopStatusUpdater();
  1755. content_lvl1 = 1;
  1756. content_lvl2 = 4;
  1757. var tPanel = Ext.getCmp('main_content');
  1758. tPanel.removeAll( true );
  1759. tPanel.add({
  1760. xtype: 'panel',
  1761. id: 'sen_set',
  1762. layout: 'hbox',
  1763. tbar:[{
  1764. text: "<?=$Labels->GetLabel( '_SMM_ADD_LSEN_' );?>",
  1765. handler: function(){
  1766. addSensor();
  1767. }
  1768. }],
  1769. items:[{
  1770. xtype: 'panel',
  1771. id: 'sens_container',
  1772. flex: 1,
  1773. height: PanelH-15,
  1774. autoScroll: 'auto',
  1775. items:[]
  1776. },{
  1777. xtype: 'panel',
  1778. id: 'sens_op_small',
  1779. flex: 1,
  1780. height: PanelH-15,
  1781. layout: 'fit',
  1782. items:[{
  1783. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  1784. }]
  1785. }]
  1786. });
  1787. tPanel.doLayout();
  1788. loadAttachedSensors();
  1789. };
  1790. function editPlatform( s_id ){
  1791. if( oSelectedPlatform ){
  1792. var tt = document.getElementById('PLATFORM_TAG_'+oSelectedPlatform );
  1793. tt.classList.remove('selected_green');
  1794. tt.classList.add('active_green');
  1795. };
  1796. var tt = document.getElementById('PLATFORM_TAG_'+s_id );
  1797. if( tt!= undefined ){
  1798. tt.classList.remove('active_green');
  1799. tt.classList.add('selected_green');
  1800. };
  1801. if( oSelectedPlatform == s_id ) return;
  1802. Ext.Ajax.request({
  1803. url: '/lib/controller/getPlatformEditor.php',
  1804. params: {
  1805. PID: s_id,
  1806. UID: <?=$UserID;?>,
  1807. SID: '<?=$Session;?>'
  1808. },
  1809. success: function( response, opts ){
  1810. var data = Ext.decode( response.responseText );
  1811. var tComp = Ext.getCmp('platform_op_small');
  1812. if( tComp!= null ){
  1813. tComp.removeAll( true );
  1814. tComp.add( data );
  1815. tComp.doLayout();
  1816. };
  1817. oSelectedPlatform = s_id;
  1818. if( SelectedPlatform != s_id ){
  1819. SelectedPlatform = s_id;
  1820. //tComp = Ext.getCmp('btn_unb_station');
  1821. //tComp.setDisabled( false );
  1822. //tComp = Ext.getCmp('btn_del_station');
  1823. //tComp.setDisabled( false );
  1824. tComp = Ext.getCmp('modules_tab');
  1825. tComp.setDisabled( false );
  1826. };
  1827. }
  1828. });
  1829. };
  1830. function editStation( s_id ){
  1831. if( oSelectedStation ){
  1832. var tt = document.getElementById('STATION_TAG_'+oSelectedStation );
  1833. tt.classList.remove('selected_green');
  1834. tt.classList.add('active_green');
  1835. };
  1836. var tt = document.getElementById('STATION_TAG_'+s_id );
  1837. if( tt!= undefined ){
  1838. tt.classList.remove('active_green');
  1839. tt.classList.add('selected_green');
  1840. };
  1841. if( oSelectedStation == s_id ) return;
  1842. Ext.Ajax.request({
  1843. url: '/lib/controller/getStationEditor.php',
  1844. params: {
  1845. CID: s_id,
  1846. UID: <?=$UserID;?>,
  1847. SID: '<?=$Session;?>'
  1848. },
  1849. success: function( response, opts ){
  1850. var data = Ext.decode( response.responseText );
  1851. var tComp = Ext.getCmp('station_op_small');
  1852. if( tComp!= null ){
  1853. tComp.removeAll( true );
  1854. tComp.add( data );
  1855. tComp.doLayout();
  1856. };
  1857. tComp = Ext.getCmp('btn_unb_station');
  1858. tComp.setDisabled( false );
  1859. tComp = Ext.getCmp('btn_del_station');
  1860. tComp.setDisabled( false );
  1861. oSelectedStation = s_id;
  1862. if( SelectedStation != s_id ){
  1863. SelectedStation = s_id;
  1864. SelectedPlatform = 0;
  1865. SelectedModule = 0;
  1866. tComp = Ext.getCmp('platform_tab');
  1867. tComp.setDisabled( false );
  1868. tComp = Ext.getCmp('modules_tab');
  1869. tComp.setDisabled( true );
  1870. };
  1871. },
  1872. failure: function(){
  1873. }
  1874. });
  1875. };
  1876. function editLine( l_id ){
  1877. if( oSelectedLine ){
  1878. var tt = document.getElementById('LINE_TAG_'+oSelectedLine );
  1879. if( tt.classList.contains('selected_blue') ){
  1880. tt.classList.remove('selected_blue');
  1881. tt.classList.add('active_blue');
  1882. };
  1883. if( tt.classList.contains('selected_gray') ){
  1884. tt.classList.remove('selected_gray');
  1885. tt.classList.add('active_gray');
  1886. };
  1887. };
  1888. var tt = document.getElementById('LINE_TAG_'+l_id );
  1889. if( tt!= undefined ){
  1890. if( tt.classList.contains('active_blue') ){
  1891. tt.classList.remove('active_blue');
  1892. tt.classList.add('selected_blue');
  1893. };
  1894. if( tt.classList.contains('active_gray') ){
  1895. tt.classList.remove('active_gray');
  1896. tt.classList.add('selected_gray');
  1897. };
  1898. };
  1899. if( oSelectedLine == l_id ) return;
  1900. Ext.Ajax.request({
  1901. url: '/lib/controller/getLineEditor.php',
  1902. params: {
  1903. LID: l_id,
  1904. UID: <?=$UserID;?>,
  1905. SID: '<?=$Session;?>'
  1906. },
  1907. success: function( response, opts ){
  1908. var data = Ext.decode( response.responseText );
  1909. var tComp = Ext.getCmp('line_op_small');
  1910. if( tComp!= null ){
  1911. tComp.removeAll( true );
  1912. tComp.add( data );
  1913. tComp.doLayout();
  1914. };
  1915. tComp = Ext.getCmp('stations_tab');
  1916. tComp.setDisabled( false );
  1917. oSelectedLine = l_id;
  1918. if( SelectedLine != l_id ){
  1919. SelectedLine = l_id;
  1920. SelectedStation = 0;
  1921. SelectedPlatform = 0;
  1922. SelectedModule = 0;
  1923. tComp = Ext.getCmp('platform_tab');
  1924. tComp.setDisabled( true );
  1925. tComp = Ext.getCmp('modules_tab');
  1926. tComp.setDisabled( true );
  1927. };
  1928. }
  1929. });
  1930. };
  1931. function editSensorHW( cid ){
  1932. SelectedSensor = cid;
  1933. Ext.Ajax.request({
  1934. url: '/lib/controller/getSensorEditor.php',
  1935. params: {
  1936. CID: SelectedSensor,
  1937. UID: <?=$UserID;?>,
  1938. SID: '<?=$Session;?>'
  1939. },
  1940. success: function( response, opts ){
  1941. var data = Ext.decode( response.responseText );
  1942. var tComp = Ext.getCmp('sens_op_small');
  1943. if( data.status == 'ok' ){
  1944. if( tComp!= null ){
  1945. var content = Ext.decode( data.content );
  1946. tComp.removeAll( true );
  1947. tComp.add( content );
  1948. tComp.doLayout();
  1949. };
  1950. } else {
  1951. if( tComp!= null ){
  1952. tComp.removeAll( true );
  1953. tComp.add( data );
  1954. tComp.doLayout();
  1955. };
  1956. };
  1957. },
  1958. failure: function(){
  1959. }
  1960. });
  1961. };
  1962. var cameraEditorContent = null;
  1963. function editCamera( cid, etyp ){
  1964. SelectedCam = cid;
  1965. switch( etyp ){
  1966. case 0: cameraEditorContent = Ext.getCmp('dcam_op_small'); break;
  1967. case 1: cameraEditorContent = Ext.getCmp('acam_op_small'); break;
  1968. };
  1969. Ext.Ajax.request({
  1970. url: '/lib/controller/getCameraEditor.php',
  1971. params: {
  1972. CID: SelectedCam,
  1973. UID: <?=$UserID;?>,
  1974. SID: '<?=$Session;?>'
  1975. },
  1976. success: function( response, opts ){
  1977. var data = Ext.decode( response.responseText );
  1978. if( data.status == 'ok' ){
  1979. if( cameraEditorContent!= null ){
  1980. var content = Ext.decode( data.content );
  1981. cameraEditorContent.removeAll( true );
  1982. cameraEditorContent.add( content );
  1983. cameraEditorContent.doLayout();
  1984. };
  1985. } else {
  1986. if( cameraEditorContent!= null ){
  1987. cameraEditorContent.removeAll( true );
  1988. cameraEditorContent.add( data );
  1989. cameraEditorContent.doLayout();
  1990. };
  1991. };
  1992. },
  1993. failure: function(){
  1994. }
  1995. });
  1996. };
  1997. function showSettingsVideo(){
  1998. stopStatusUpdater();
  1999. //content_lvl1 = 1;
  2000. //content_lvl2 = 4;
  2001. var tPanel = Ext.getCmp('main_content');
  2002. tPanel.removeAll( true );
  2003. tPanel.add({
  2004. xtype: 'tabpanel',
  2005. frame: false,
  2006. id: 'node_settings_content',
  2007. border: false,
  2008. activeTab: 0,//content_lvl3,
  2009. items: [{
  2010. xtype: 'panel',
  2011. title: "<?=$Labels->GetLabel('_CAM_DET_LIST_');?>",
  2012. id: 'cam_det_tab',
  2013. layout: 'hbox',
  2014. items:[{
  2015. xtype: 'panel',
  2016. id: 'dcam_container',
  2017. flex: 1,
  2018. height: PanelH-15,
  2019. autoScroll: 'auto',
  2020. tbar:[{
  2021. text: "<?=$Labels->GetLabel( '_MANUADD_CAMERA_' );?>",
  2022. handler: function(){
  2023. addDetectedIPCam();
  2024. }
  2025. }],
  2026. items:[]
  2027. },{
  2028. xtype: 'panel',
  2029. id: 'dcam_op_small',
  2030. flex: 1,
  2031. height: PanelH-15,
  2032. layout: 'fit',
  2033. items:[{
  2034. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2035. }]
  2036. }]
  2037. },{
  2038. xtype: 'panel',
  2039. id: 'cam_ass_tab',
  2040. title: "<?=$Labels->GetLabel('_CAM_ASS_LIST_');?>",
  2041. layout: 'hbox',
  2042. items:[{
  2043. xtype: 'panel',
  2044. id: 'acam_container',
  2045. flex: 1,
  2046. height: PanelH-15,
  2047. autoScroll: 'auto',
  2048. items:[]
  2049. },{
  2050. xtype: 'panel',
  2051. id: 'acam_op_small',
  2052. flex: 1,
  2053. height: PanelH-15,
  2054. layout: 'fit',
  2055. items:[{
  2056. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2057. }]
  2058. }]
  2059. }],
  2060. listeners:{
  2061. tabchange: function( tp, t ){
  2062. switch( t.getId() ){
  2063. case 'cam_det_tab': {
  2064. content_lvl3=0;
  2065. stopStatusUpdater();
  2066. loadDetectedCameras();
  2067. break;
  2068. };
  2069. case 'cam_ass_tab': {
  2070. content_lvl3=1;
  2071. stopStatusUpdater();
  2072. loadAssignedCameras();
  2073. break;
  2074. };
  2075. case 'mod_tab':{
  2076. content_lvl3=2;
  2077. stopStatusUpdater();
  2078. loadModules();
  2079. break;
  2080. };
  2081. case 'net_tab':{
  2082. content_lvl3=3;
  2083. stopStatusUpdater();
  2084. break;
  2085. };
  2086. };
  2087. updateUserContent();
  2088. },
  2089. afterrender: function(){
  2090. settingsAreChanged = false;
  2091. }
  2092. }
  2093. });
  2094. tPanel.doLayout();
  2095. updateUserContent();
  2096. serverStatusUpdater();
  2097. };
  2098. function showSettingsApplication(){
  2099. stopStatusUpdater();
  2100. content_lvl1 = 1;
  2101. content_lvl2 = 3;
  2102. //Load Location
  2103. prepareMapData();
  2104. var tPanel = Ext.getCmp('main_content');
  2105. tPanel.removeAll( true );
  2106. tPanel.add({
  2107. xtype: 'tabpanel',
  2108. frame: false,
  2109. id: 'settings_a_content',
  2110. border: false,
  2111. activeTab: 0,
  2112. items:[{
  2113. title: "<?=$Labels->GetLabel('_WORKING_MODE_');?>",
  2114. xtype: 'form',
  2115. labelAlign: 'right',
  2116. labelWidth: 180,
  2117. height: PanelH - 30,
  2118. items:[{
  2119. xtype: 'spacer',
  2120. height: 10
  2121. },{
  2122. xtype: 'panel',
  2123. frame: false,
  2124. border: true,
  2125. bodyStyle: 'background-color: white;',
  2126. <?php
  2127. echo "html: '<center><img height=\"120px\" src=\"/style/assets/{$AP_DATA['oem_logo']}.png\"></center>',";
  2128. ?>
  2129. height: 130
  2130. },{
  2131. xtype: 'spacer',
  2132. height: 10
  2133. },{
  2134. xtype: 'textfield',
  2135. fieldLabel: "<?=$Labels->GetLabel( '_INSTANCE_ID_' );?>",
  2136. width: 300,
  2137. value: '<?php
  2138. $QS = "SELECT `identity` FROM `servers` LIMIT 1";
  2139. $TT = array();//$DATABASE->Query( $QS );
  2140. if( count( $TT ) ){
  2141. echo $TT[0]['identity'];
  2142. } else {
  2143. echo "----No-Identity-Set---";
  2144. };
  2145. ?>'
  2146. },{
  2147. xtype: 'spacer',
  2148. height: 10
  2149. },{
  2150. xtype: 'button',
  2151. text: "<?=$Labels->GetLabel( '_GEN_INSTANCE_ID_' );?>",
  2152. width: 500,
  2153. handler: function(){
  2154. doApplicationOperation( 3, 0 );
  2155. }
  2156. },{
  2157. xtype: 'spacer',
  2158. height: 10
  2159. },{
  2160. xtype: 'combo',
  2161. fieldLabel: "<?=$Labels->GetLabel('_DEBUGGING_MODE_');?>",
  2162. editable: false,
  2163. typeAhead: true,
  2164. triggerAction: 'all',
  2165. width: '100%',
  2166. lazyRender:true,
  2167. mode: 'local',
  2168. store: new Ext.data.ArrayStore({
  2169. fields: ['sid', 'snam'],
  2170. data: [[0,"<?=$Labels->GetLabel('__DISABLED__');?>"], [1,"<?=$Labels->GetLabel('___ENABLED__');?>"]]
  2171. }),
  2172. value: <?=intval( $AP_DATA['work_mode'] );?>,
  2173. valueField: 'sid',
  2174. displayField: 'snam',
  2175. listeners:{
  2176. select: function( t, r, i ){
  2177. doApplicationOperation( 1, i );
  2178. }
  2179. }
  2180. }]
  2181. },
  2182. <?php if( $AP_DATA['type']!=1){ ?>
  2183. {
  2184. title: "<?=$Labels->GetLabel('_GEO_LOCATION_');?>",
  2185. layout: 'column',
  2186. items:[{
  2187. columnWidth: 0.83,
  2188. frame: false,
  2189. border: false,
  2190. items: [{
  2191. //layout: 'fit',
  2192. //height: PanelH-150,
  2193. //flex: 1,
  2194. //border: true,
  2195. //items:{
  2196. xtype: 'panel',
  2197. id: 'sys_location_map',
  2198. height: PanelH-170,
  2199. html: '&nbsp;',
  2200. listeners:{
  2201. afterrender: function( t, state ){
  2202. loadLocationEditor('sys_location_map');
  2203. }
  2204. }
  2205. //}
  2206. },{
  2207. layout: 'table',
  2208. title: "<?=$Labels->GetLabel('_SITE_PROP_LBL_');?>",
  2209. flex: 1,
  2210. defaults: {
  2211. bodyStyle:'padding:20px'
  2212. },
  2213. layoutConfig: {
  2214. // The total column count must be specified here
  2215. columns: 8,
  2216. textAlign: 'center'
  2217. },
  2218. items:[{
  2219. border: false,
  2220. id: 'lab_123',
  2221. html: "<?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?> "+((MAP_IS_LOCAL)?'Pos X':"<?=$Labels->GetLabel('_LON_SHORT_LBL_');?>")+':'
  2222. },{
  2223. xtype: 'numberfield',
  2224. width: 100,
  2225. decimalPrecision: 8,
  2226. id: 'siteLon',
  2227. value: SiteLon
  2228. },{
  2229. border: false,
  2230. id: 'lab_124',
  2231. html: ((MAP_IS_LOCAL)?'Pos Y':"<?=$Labels->GetLabel('_LAT_SHORT_LBL_');?>")+':'
  2232. },{
  2233. xtype: 'numberfield',
  2234. id: 'siteLat',
  2235. decimalPrecision: 8,
  2236. width: 100,
  2237. value: SiteLat
  2238. },{
  2239. border: false,
  2240. html: "<?=$Labels->GetLabel('_ALT_SHORT_LBL_');?>:"
  2241. },{
  2242. xtype: 'numberfield',
  2243. decimalPrecision: 2,
  2244. width: 100,
  2245. id: 'siteAlt',
  2246. value: SiteAlt
  2247. },{
  2248. xtype: 'button',
  2249. text: "<?=$Labels->GetLabel('_UPDATE_LBL_');?>",
  2250. handler: updateSiteAnchor
  2251. },{
  2252. xtype: 'panel',
  2253. frame: false,
  2254. border: false,
  2255. rowspan: 2,
  2256. html: ((MAP_IS_LOCAL)?'<img id="lab_125" height="64px" src="/style/assets/map_mode_decart.png">':'<img id="lab_125" height="64px" src="/style/assets/map_mode_wgs84.png">')
  2257. },{
  2258. border: false,
  2259. html: "<?=$Labels->GetLabel('_MAP_TYP_LBL_');?>:"
  2260. },/*{
  2261. xtype: 'radio',
  2262. name: 'map_type',
  2263. boxLabel: '<?=$Labels->GetLabel('_MAP_REG_LBL_');?>',
  2264. checked: true,
  2265. value: 0
  2266. },{
  2267. xtype: 'radio',
  2268. name: 'map_type',
  2269. boxLabel: '<?=$Labels->GetLabel('_MAP_CUST_LBL_');?>',
  2270. colspan: 2,
  2271. value: 1
  2272. },*/{
  2273. xtype: 'combo',
  2274. disabled: false,
  2275. typeAhead: true,
  2276. triggerAction: 'all',
  2277. id: 'siteMap',
  2278. lazyRender:true,
  2279. colspan: 3,
  2280. mode: 'local',
  2281. store: mapListStore /*new Ext.data.ArrayStore({
  2282. id: 0,
  2283. fields: ['map_id', 'map_text' ],
  2284. data: [[1, 'OpenStreetMap'], [2, 'OpenTopoMap'], [3, 'EsriSat'], [4, 'EsriStreet'], [5, 'EsriTopo']]
  2285. })*/,
  2286. value: MAP_ID,
  2287. valueField: 'map_id',
  2288. displayField: 'map_name',
  2289. listeners:{
  2290. select: function(){
  2291. updateSiteMap();
  2292. LoadNodesList();
  2293. }
  2294. }
  2295. }/*,{
  2296. xtype: 'button',
  2297. disabled: false,
  2298. text: '<?=$Labels->GetLabel('_EDIT_');?>',
  2299. handler: function(){
  2300. editCurrentMap();
  2301. }
  2302. }*/,{
  2303. xtype: 'button',
  2304. disabled: false,
  2305. text: "<?=$Labels->GetLabel('_DELETE_');?>",
  2306. handler: function(){
  2307. deleteCurrentMap();
  2308. }
  2309. },{
  2310. xtype: 'button',
  2311. id: 'add-c_map-btn',
  2312. disabled: false,
  2313. text: "<?=$Labels->GetLabel('_CREATE_NEW_LBL_');?>",
  2314. handler: function(){
  2315. createNewMap();
  2316. }
  2317. }]
  2318. }]
  2319. },{
  2320. //title: 'Properties',
  2321. frame: true,
  2322. border: false,
  2323. xtype: 'panel',
  2324. flex: 1,
  2325. height: PanelH,
  2326. columnWidth: 0.17,
  2327. layout: 'fit',
  2328. id: 'prop_content',
  2329. items:[{
  2330. html: "<div class='setEd_infoPanel' id='NUNU'><?=$Labels->GetLabel('_PLS_SEL_LEFT_ITEM_');?></div>"
  2331. }]
  2332. }]
  2333. },
  2334. <?php };?>{
  2335. title: "<?=$Labels->GetLabel('_BACKUP_SETTINGS_');?>",
  2336. xtype: 'form',
  2337. id: 'as_dbbackup',
  2338. fileUpload: true,
  2339. labelAlign: 'right',
  2340. labelWidth: 180,
  2341. height: PanelH - 30,
  2342. items:[{
  2343. xtype: 'spacer',
  2344. height: 10
  2345. },{
  2346. xtype: 'button',
  2347. text: "<?=$Labels->GetLabel( '_DOWNLOAD_SETTINGS_' );?>",
  2348. width: 500,
  2349. handler: downloadSettings
  2350. },{
  2351. xtype: 'spacer',
  2352. height: 10
  2353. },{
  2354. xtype: 'fileuploadfield',
  2355. id: 'db_file',
  2356. emptyText: "<?=$Labels->GetLabel('_DB_BACKUP_');?>",
  2357. fieldLabel: "<?=$Labels->GetLabel('_SELE_DBBACKUP_');?>",
  2358. width: 300,
  2359. name: 'db_file',
  2360. buttonText: "<?=$Labels->GetLabel('_BROWSE_');?>"
  2361. },{
  2362. xtype: 'spacer',
  2363. height: 10
  2364. },{
  2365. xtype: 'button',
  2366. text: "<?=$Labels->GetLabel( '_APLY_DBBACKUP_' );?>",
  2367. width: 500,
  2368. handler: function(){
  2369. if( Ext.getCmp('as_dbbackup').getForm().isValid()){
  2370. Ext.getCmp('as_dbbackup').getForm().submit({
  2371. url: '/lib/controller/doDatabaseOperation.php',
  2372. waitMsg: "<?=$Labels->GetLabel('_DB_UPLOAD_BACKUP_');?>...",
  2373. encoding: 'multipart/form-data',
  2374. success: function(fp, o){
  2375. }
  2376. });
  2377. };
  2378. }
  2379. },{
  2380. xtype: 'spacer',
  2381. height: 10
  2382. }<?php
  2383. if( file_exists( '../../controller/data/factory.db' ) ){
  2384. ?>,{
  2385. xtype: 'button',
  2386. text: "<?=$Labels->GetLabel( '_FACTORY_RESET_' );?>",
  2387. width: 500,
  2388. handler: function(){
  2389. doDeviceOperation( 1, 254, '', true );
  2390. }
  2391. }<?php
  2392. };
  2393. ?>]
  2394. },{
  2395. title: "<?=$Labels->GetLabel('_REPORT_STORAGE_');?>",
  2396. xtype: 'form',
  2397. id: 'as_reposit',
  2398. labelAlign: 'right',
  2399. labelWidth: 180,
  2400. height: PanelH - 30,
  2401. items:[{
  2402. xtype: 'spacer',
  2403. height: 10
  2404. },{
  2405. xtype: 'numberfield',
  2406. id: 'stor_days',
  2407. fieldLabel: "<?=$Labels->GetLabel('_STORE_DAYS_');?>",
  2408. width: 300,
  2409. value: <?=intval($AP_DATA['report_cleanup']);?>,
  2410. name: 'stor_time',
  2411. listeners: {
  2412. change: function( t, b, o ){
  2413. doApplicationOperation( 4, b );
  2414. }
  2415. }
  2416. },{
  2417. xtype: 'spacer',
  2418. height: 10
  2419. },{
  2420. xtype: 'slider',
  2421. id: 'stor_space',
  2422. fieldLabel: "<?=$Labels->GetLabel('_STORE_EMPTY_SPACE_');?>",
  2423. value: <?=intval($AP_DATA['preserve_empty']);?>,
  2424. width: 300,
  2425. name: 'stor_space',
  2426. listeners: {
  2427. change: function( t, b, o ){
  2428. doApplicationOperation( 5, b );
  2429. }
  2430. }
  2431. },{
  2432. xtype: 'spacer',
  2433. height: 10
  2434. },{
  2435. xtype: 'button',
  2436. text: "<?=$Labels->GetLabel( '_APPLY_SETTINGS_' );?>",
  2437. width: 500,
  2438. handler: function(){
  2439. doDeviceOperation( 1, 250, '', true );
  2440. }
  2441. },{
  2442. xtype: 'spacer',
  2443. height: 10
  2444. }]
  2445. }]
  2446. });
  2447. tPanel.doLayout();
  2448. updateUserContent();
  2449. };
  2450. function showSettingsUpgrade(){
  2451. stopStatusUpdater();
  2452. content_lvl1 = 1;
  2453. content_lvl2 = 4;
  2454. var tPanel = Ext.getCmp('main_content');
  2455. tPanel.removeAll( true );
  2456. initial_md5 = '';
  2457. tPanel.add({
  2458. columnWidth: 1.0,
  2459. frame: false,
  2460. border: false,
  2461. items: [{
  2462. frame: false,
  2463. border: false,
  2464. collapsible: false,
  2465. draggable: false,
  2466. layout: 'vbox',
  2467. //layoutConfig: {
  2468. // align : 'stretch',
  2469. // pack : 'start',
  2470. //},
  2471. height: PanelH,
  2472. items:[{
  2473. title: "<?=$Labels->getLabel('_MAP_MONITORING_');?>",
  2474. xtype: 'panel',
  2475. height: PanelH-300,
  2476. //flex: 1,
  2477. frame: true,
  2478. width: '100%',
  2479. border: false,
  2480. layout: {
  2481. type: 'table',
  2482. columns: 2,
  2483. tableAttrs: {
  2484. valign: 'top',
  2485. style: 'valign:top;width:100%;'
  2486. }
  2487. },
  2488. defaults: {
  2489. frame: true,
  2490. border: false,
  2491. height: ( PanelH-400 ) / 2,
  2492. style: 'margin: 5px;width:400px;display:block;'
  2493. },
  2494. items:[{
  2495. title: 'Current System Info',
  2496. width: '100%',
  2497. //flex: 1,
  2498. html: '<p>Current Web Version:&nbsp;<b><?=$ARGUS_WEB_VERSION;?></b></p>'
  2499. },{
  2500. title: 'Tasks',
  2501. //width: 400,
  2502. layout: 'vbox',
  2503. items:[{
  2504. xtype: 'button',
  2505. width: '100%',
  2506. text: 'Create Database Backup',
  2507. handler: function(){
  2508. createNewTask( 2 );
  2509. }
  2510. },{
  2511. xtype: 'button',
  2512. width: '100%',
  2513. text: 'Create Full Snapeshot',
  2514. handler: function(){
  2515. createNewTask( 255 );
  2516. }
  2517. }]
  2518. },{
  2519. title: 'Archives',
  2520. height: 250,
  2521. width: '100%',
  2522. tbar:[{
  2523. text: 'Restore',
  2524. id: 'ar_restore_btn',
  2525. handler: function(){
  2526. createNewTask(1, selectedArchiveRecord.data.file_name );
  2527. }
  2528. },{
  2529. text: 'Download',
  2530. id: 'ar_download_btn',
  2531. handler: function(){
  2532. if( selectedArchiveRecord!= null ){
  2533. window.open( '/lib/php/setup_toolkit/vault/'+selectedArchiveRecord.data.base_version + '/'+ selectedArchiveRecord.data.file_name );
  2534. };
  2535. }
  2536. },{
  2537. text: 'Delete',
  2538. id: 'ar_delete_btn',
  2539. handler: function(){
  2540. createNewTask(100, selectedArchiveRecord.data.file_name );
  2541. }
  2542. }],
  2543. items:[{
  2544. xtype: 'grid',
  2545. id: 'archives_grid',
  2546. border: false,
  2547. frame: false,
  2548. autoScroll: true,
  2549. //width: '100%',
  2550. lazyRender: true,
  2551. height: 210,
  2552. ds: archives_store,
  2553. cm: new Ext.grid.ColumnModel( archivesColModel_ops ),
  2554. sm: new Ext.grid.RowSelectionModel( archivesSelModel_ops ),
  2555. viewConfig: {
  2556. // forceFit: true
  2557. },
  2558. }]
  2559. },{
  2560. title: 'Task Status',
  2561. height: 250,
  2562. //flex: 1,
  2563. items:[{
  2564. xtype: 'spacer',
  2565. height: 4
  2566. },{
  2567. id: 'ctask_status',
  2568. border: true,
  2569. html: ''
  2570. },{
  2571. xtype: 'spacer',
  2572. height: 4
  2573. },{
  2574. xtype: 'textarea',
  2575. id: 'task_log',
  2576. height: ( PanelH-320 ) / 2 - 120,
  2577. style: 'font-size:9px;width:100%;margin-bottom:4px;',
  2578. readOnly: true,
  2579. autoScroll: true,
  2580. value: ''
  2581. },{
  2582. xtype: 'progress',
  2583. id: 'task_progress',
  2584. value: 1.0,
  2585. text: 'idle',
  2586. disabled: true
  2587. }],
  2588. tbar:[{
  2589. text: 'Cancel Task',
  2590. id: 'ch_ta_btn',
  2591. disabled: true,
  2592. handler: deleteNewTask
  2593. }]
  2594. }]
  2595. },{
  2596. title: '<?=$Labels->getLabel('_UPLOAD_PACKAGE_');?>',
  2597. xtype: 'panel',
  2598. height: 300,
  2599. //flex: 1,
  2600. frame: true,
  2601. border: false,
  2602. //layout: 'vbox',
  2603. items:[{
  2604. xtype:'button',
  2605. id: 'pickfiles',
  2606. width: '100%',
  2607. text: 'Choose File'
  2608. },{
  2609. height: 200,
  2610. xtype: 'grid',
  2611. id: 'upload_grid',
  2612. border: false,
  2613. frame: false,
  2614. mode: 'local',
  2615. lazyRender: true,
  2616. width: '100%',
  2617. autoScroll: true,
  2618. ds: uploads_store,
  2619. cm: new Ext.grid.ColumnModel( fileUploadsColModel_ops ),
  2620. sm: new Ext.grid.RowSelectionModel( fileUploadsSelModel_ops ),
  2621. viewConfig: {
  2622. forceFit: true
  2623. },
  2624. bbar: [{
  2625. text: 'Clear',
  2626. width: '100%',
  2627. handler: function(){
  2628. muploader.splice();
  2629. uploads_store.removeAll();
  2630. }
  2631. }]
  2632. },{
  2633. xtype:'button',
  2634. id: 'umpalumpa',
  2635. width: '100%',
  2636. disabled: true,
  2637. text: 'Upload',
  2638. handler: function(){
  2639. if( muploader!= null ){
  2640. muploader.start();
  2641. };
  2642. }
  2643. }],
  2644. listeners:{
  2645. afterrender: function(){
  2646. muploader = new plupload.Uploader({
  2647. runtimes : 'html5,html4',
  2648. browse_button : Ext.getDom('pickfiles'), // you can pass in id...
  2649. //container: document.getElementById('upupu'), // ... or DOM Element itself
  2650. max_file_size : '1000mb',
  2651. chunk_size: '200kb',
  2652. max_retries: 3,
  2653. multi_selection: false,
  2654. max_file_count: 1,
  2655. // Fake server response here
  2656. url: '/lib/php/setup_toolkit/upload.php',
  2657. //url: "/echo/json",
  2658. //flash_swf_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/flash/Moxie.cdn.swf',
  2659. //silverlight_xap_url : 'http://rawgithub.com/moxiecode/moxie/master/bin/silverlight/Moxie.cdn.xap',
  2660. filters : [
  2661. //{title : "Image files", extensions : "jpg,gif,png"},
  2662. {title : "Archive files", extensions : "rar,zip,gz,bz2"}
  2663. ],
  2664. init: {
  2665. PostInit: function() {
  2666. //$('filelist').innerHTML = '';
  2667. //$('uploadfiles').onclick = function() {
  2668. // uploader.start();
  2669. // return false;
  2670. //};
  2671. },
  2672. FilesAdded: function( up, files ) {
  2673. Ext.getCmp('umpalumpa').enable();
  2674. plupload.each( files, function(file) {
  2675. uploads_store.loadData( [[ uploads_store_id, file.name, file.id, plupload.formatSize( file.size ), 0, 'N' ]], true );
  2676. uploads_store_id++;
  2677. Ext.getCmp('upload_grid').doLayout();
  2678. });
  2679. },
  2680. UploadProgress: function(up, file) {
  2681. var pb = Ext.getCmp( 'progress_'+file.id );
  2682. if( file.percent < 100 ){
  2683. pb.updateProgress( file.percent / 100, file.percent + '%', false );
  2684. } else {
  2685. pb.updateProgress( 1.0, 'Uploaded', false );
  2686. };
  2687. },
  2688. Error: function(up, err) {
  2689. Ext.Msg.show({
  2690. title:'Upload Status',
  2691. msg: "Error #" + err.code + ": " + err.message,
  2692. buttons: Ext.Msg.OK,
  2693. icon: Ext.MessageBox.ERROR
  2694. });
  2695. }
  2696. }
  2697. });
  2698. muploader.init();
  2699. }
  2700. }
  2701. }]
  2702. }]
  2703. });
  2704. muploader = null;
  2705. uploads_store.removeAll();
  2706. tPanel.doLayout();
  2707. archives_store.load();//{params:{start:0, limit:50, src: 'arch', fil: selecredActiveSourceFilter }});
  2708. updateTaskStatus();
  2709. tlInterval = window.setInterval( updateTaskStatus, 333 );
  2710. };
  2711. function loadSensorDetectionSettings( sensid ){
  2712. Ext.Ajax.request({
  2713. url: '/lib/controller/getSensorDetectionEditor.php',
  2714. params: {
  2715. UID: <?=$UserID;?>,
  2716. SID: '<?=$Session;?>',
  2717. SEN: sensid
  2718. },
  2719. success: function( response, opts ){
  2720. var data = Ext.decode( response.responseText );
  2721. var tComp = Ext.getCmp('main_content');
  2722. if( data.status == 'ok' ){
  2723. if( tComp!= null ){
  2724. var content = Ext.decode( data.content );
  2725. tComp.removeAll( true );
  2726. tComp.add( content );
  2727. tComp.doLayout();
  2728. };
  2729. } else {
  2730. if( tComp!= null ){
  2731. tComp.removeAll( true );
  2732. tComp.add( data );
  2733. tComp.doLayout();
  2734. };
  2735. };
  2736. },
  2737. failure: function(){
  2738. }
  2739. });
  2740. };
  2741. function initSettingsView(){
  2742. if( tlInterval!= null ){
  2743. window.clearInterval( tlInterval );
  2744. tlInterval = null;
  2745. timelineObj = null;
  2746. };
  2747. var tP = Ext.getCmp('left_side_menu');
  2748. //tP.doLayout();
  2749. //tP.setVisible( false );
  2750. tP.removeAll( true );
  2751. tP.add({
  2752. id: 'sme_inner',
  2753. layout:'accordion',
  2754. //height: PanelH,
  2755. frame: false,
  2756. border: false,
  2757. layoutConfig:{
  2758. animate: true//,
  2759. //activeOnTop: true
  2760. },
  2761. items:[]
  2762. });
  2763. tP.doLayout();
  2764. tP = Ext.getCmp('sme_inner');
  2765. <?php if( $CUser->Data['access'] > 3 ){ ?>
  2766. tP.add({
  2767. title: "<?=$Labels->GetLabel('_SYS_SETTINGS_');?>",
  2768. layout: 'vbox',
  2769. height: 120,
  2770. pack: 'center',
  2771. align : 'strech',
  2772. collapsed: ( contentView.l[1].v != 0 ),
  2773. items:[{
  2774. xtype: 'button',
  2775. width: '100%',
  2776. id:'sys_edit',
  2777. text: "<?=$Labels->GetLabel('_SRV_SETTINGS_');?>",
  2778. enableToggle: true,
  2779. pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 0 ),
  2780. allowDepress: false,
  2781. toggleGroup: 'sys_settings',
  2782. handler: function(){
  2783. changeContent( 2, 0, '' );
  2784. updateUserContent();
  2785. showSettingsServer();
  2786. }
  2787. }
  2788. <?php if( $CUser->Data['access'] > 4 ){ ?>
  2789. ,{
  2790. xtype: 'button',
  2791. width: '100%',
  2792. id:'map_edit',
  2793. text: "<?=$Labels->GetLabel('_IFR_STRUCT_');?>",
  2794. enableToggle: true,
  2795. pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 0 ),
  2796. allowDepress: false,
  2797. toggleGroup: 'sys_settings',
  2798. handler: function(){
  2799. changeContent( 2, 1, '' );
  2800. updateUserContent();
  2801. showSettingsInfrastructure();
  2802. }
  2803. },{
  2804. xtype: 'button',
  2805. width: '100%',
  2806. id:'video_set',
  2807. text: "<?=$Labels->GetLabel('_MEDIA_MNGMNT_');?>",
  2808. enableToggle: true,
  2809. pressed: ( contentView.l[2].v == 2 && contentView.l[1].v == 0 ),
  2810. allowDepress: false,
  2811. toggleGroup: 'sys_settings',
  2812. handler: function(){
  2813. changeContent( 2, 2, '' );
  2814. updateUserContent();
  2815. showSettingsMedia();
  2816. }
  2817. },{
  2818. xtype: 'button',
  2819. width: '100%',
  2820. id:'bus_set',
  2821. text: "<?=$Labels->GetLabel('_EVT_MNGMNT_');?>",
  2822. enableToggle: true,
  2823. pressed: ( contentView.l[2].v == 3 && contentView.l[1].v == 0 ),
  2824. allowDepress: false,
  2825. toggleGroup: 'sys_settings',
  2826. handler: function(){
  2827. changeContent( 2, 3, '' );
  2828. updateUserContent();
  2829. showEventBus();
  2830. }
  2831. },{
  2832. xtype: 'button',
  2833. width: '100%',
  2834. id:'app_set',
  2835. text: "<?=$Labels->GetLabel('_APPLICA_MNGMNT_');?>",
  2836. enableToggle: true,
  2837. pressed: ( contentView.l[2].v == 4 && contentView.l[1].v == 0 ),
  2838. allowDepress: false,
  2839. toggleGroup: 'sys_settings',
  2840. handler: function(){
  2841. changeContent( 2, 4, '' );
  2842. updateUserContent();
  2843. showSettingsApplication
  2844. }
  2845. }
  2846. <?php }; ?>
  2847. ]
  2848. });
  2849. <?php if( $CUser->Data['access'] > 4 ){ ?>
  2850. tP.add({
  2851. title: "<?=$Labels->GetLabel('_DET_SETTINGS_');?>",
  2852. layout: 'vbox',
  2853. height: 120,
  2854. pack: 'center',
  2855. align : 'strech',
  2856. collapsed: ( contentView.l[1].v != 1 ),
  2857. items:[<?php
  2858. if( intval( $AP_DATA['type'] ) == 1 ){
  2859. ?>
  2860. {
  2861. xtype: 'button',
  2862. width: '100%',
  2863. id:'go_home',
  2864. text: "<?=$Labels->GetLabel('_UPPER_SENSOR_');?>",
  2865. enableToggle: true,
  2866. pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 1 ),
  2867. allowDepress: false,
  2868. toggleGroup: 'det_settings',
  2869. handler: loadMetroControlUpper
  2870. },{
  2871. xtype: 'button',
  2872. width: '100%',
  2873. id:'go_monitor',
  2874. text: "<?=$Labels->GetLabel('_BOTTOM_SENSOR_');?>",
  2875. enableToggle: true,
  2876. pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 1 ),
  2877. allowDepress: false,
  2878. toggleGroup: 'det_settings',
  2879. handler: loadMetroControlBottom
  2880. },{
  2881. xtype: 'button',
  2882. width: '100%',
  2883. id:'go_archive',
  2884. text: "<?=$Labels->GetLabel('_FUSION_ENGINE_');?>",
  2885. enableToggle: true,
  2886. pressed: ( contentView.l[2].v == 2 && contentView.l[1].v == 1 ),
  2887. allowDepress: false,
  2888. toggleGroup: 'det_settings',
  2889. handler: loadMetroControlFusion
  2890. }<?php
  2891. } else {
  2892. $QS = "SELECT `name`, `aux_id` FROM `nodes` WHERE `type`>0 AND `type`<5";
  2893. $RR = array();//$DATABASE->Query( $QS );
  2894. if( count( $RR ) ){
  2895. foreach( $RR as $CR ){
  2896. ?>
  2897. {
  2898. xtype: 'button',
  2899. width: '100%',
  2900. text: '<?=$CR['name'];?>',
  2901. enableToggle: true,
  2902. pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 1 ),
  2903. allowDepress: false,
  2904. toggleGroup: 'det_settings',
  2905. handler: function(){
  2906. loadSensorDetectionSettings( <?=$CR['aux_id'];?> );
  2907. }
  2908. },
  2909. <?php
  2910. };
  2911. } else {
  2912. ?>
  2913. {
  2914. xtype: 'spacer',
  2915. html: "<?=$Labels->GetLabel('_NO_SENSORS_DEF_');?>",
  2916. height: 32
  2917. },
  2918. <?php
  2919. };
  2920. ?>
  2921. {
  2922. xtype: 'spacer',
  2923. height: 10
  2924. }<?php
  2925. };
  2926. ?>]
  2927. });
  2928. <?php };
  2929. }; ?>
  2930. tP.add({
  2931. title: "<?=$Labels->GetLabel('_PROF_SETTINGS_');?>",
  2932. items:[<?php
  2933. $ZIGA = array();
  2934. foreach( $Site_Languages as $SL ){
  2935. if( $SL['id'] == $CUser->Data['language'] ){
  2936. $ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', enableToggle: true, pressed : true, handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
  2937. } else {
  2938. $ZIGA[] = "{ xtype:'button', text:'{$SL['name']}', width: '100%', handler: function(){ window.location = '/?Lang={$SL['id']}'; } }";
  2939. };
  2940. };
  2941. echo implode(',',$ZIGA );
  2942. ?>]
  2943. });
  2944. <?php if( $CUser->Data['access'] > 5 ){ ?>
  2945. tP.add({
  2946. title: "<?=$Labels->GetLabel('_ADM_SETTINGS_');?>",
  2947. collapsed: ( contentView.l[1].v != 3 ),
  2948. items:[{
  2949. xtype: 'button',
  2950. width: '100%',
  2951. id:'adm_acc',
  2952. text: "<?=$Labels->GetLabel('_USERS_MNGMT_');?>",
  2953. enableToggle: true,
  2954. pressed: ( contentView.l[2].v == 0 && contentView.l[1].v == 3 ),
  2955. allowDepress: false,
  2956. toggleGroup: 'adm_settings',
  2957. handler: function( b, e ){
  2958. loadUserEditor();
  2959. }
  2960. },{
  2961. xtype: 'button',
  2962. width: '100%',
  2963. id:'adm_acclog',
  2964. text: "<?=$Labels->GetLabel('_ACC_LOG_');?>",
  2965. enableToggle: true,
  2966. pressed: ( contentView.l[2].v == 1 && contentView.l[1].v == 3 ),
  2967. allowDepress: false,
  2968. toggleGroup: 'adm_settings',
  2969. handler: function( b, e ){
  2970. loadAccessLog();
  2971. }
  2972. },{
  2973. xtype: 'button',
  2974. width: '100%',
  2975. id:'adm_servlog',
  2976. text: "<?=$Labels->GetLabel('_SERV_LOG_');?>",
  2977. enableToggle: true,
  2978. pressed: ( contentView.l[2].v == 2 && contentView.l[1].v == 3 ),
  2979. allowDepress: false,
  2980. toggleGroup: 'adm_settings',
  2981. handler: function( b, e ){
  2982. loadServerLog();
  2983. }
  2984. }]
  2985. });
  2986. <?php
  2987. };
  2988. ?>
  2989. tP.setVisible( true );
  2990. tP.doLayout();
  2991. switch( contentView.l[1].v ){
  2992. default:{
  2993. switch( contentView.l[2].v ){
  2994. default: showSettingsServer(); break;
  2995. <?php if( $CUser->Data['access'] > 5 ){ ?>
  2996. case 1: showSettingsInfrastructure(); break;
  2997. case 2: showSettingsMedia(); break;
  2998. case 3: showSettingsApplication(); break;
  2999. <?php }; ?>
  3000. //case 4: showSettingsUpgrade(); break;
  3001. };
  3002. };
  3003. case 1:{
  3004. switch( contentView.l[2].v ){
  3005. case 0: break;
  3006. };
  3007. break;
  3008. };
  3009. <?php if( $CUser->Data['access'] > 5 ){ ?>
  3010. case 3:{
  3011. switch( contentView.l[2].v ){
  3012. case 0: loadUserEditor(); break;
  3013. };
  3014. break;
  3015. };
  3016. <?php }; ?>
  3017. };
  3018. };