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.

178 lines
5.2 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. if( $CUser->Data['id'] > 1 ){
  4. $EID = intval( $_POST['LID'] );
  5. $QS = "SELECT * FROM `metro_lines` WHERE `id`={$EID}";
  6. $Result = $DATABASE->Query( $QS, false );
  7. if( count( $Result ) ){
  8. $CR = $Result[0];
  9. $TTPL=<<<JOJOKA
  10. {
  11. xtype: 'panel',
  12. border: false,
  13. frame: false,
  14. tbar:[{
  15. id: 'btn_del_line',
  16. text: "{$Labels->GetLabel( '_SMM_DEL_LINE_' )}",
  17. handler: function(){
  18. Ext.Msg.show({
  19. title:'{$Labels->GetLabel('_REMOVE_LINE_')}',
  20. msg: '{$Labels->GetLabel('_REMOVE_LINE_QUES_')}',
  21. buttons: Ext.Msg.YESNO,
  22. fn: function(btn){
  23. if( btn == 'yes' ){
  24. SelectedLine = 0;
  25. doLineOperation( {$CR['id']}, 2, {$CR['id']}, true );
  26. };
  27. },
  28. icon: Ext.MessageBox.QUESTION
  29. });
  30. }
  31. }],
  32. items:[%%%ITEMS%%%]
  33. }
  34. JOJOKA;
  35. $QS="SELECT count(`station_id`) cnt FROM `metro_stations_2_lines` WHERE line_id={$EID}";
  36. $RR=$DATABASE->Query( $QS );
  37. if( count( $RR ) ){
  38. $SCO = intval( $RR[0]['cnt'] );
  39. } else {
  40. $SCO = 0;
  41. };
  42. $ENANO=($CR['status']=='E')?1:0;
  43. $ITEMS = array();
  44. switch( $CR['type'] ){
  45. case 1:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_BRT_'); break;
  46. case 2:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_LRT_'); break;
  47. case 3:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_MRT_'); break;
  48. case 4:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_CRT_'); break;
  49. case 5:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_LCR_'); break;
  50. case 6:$NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_LNT_HSR_'); break;
  51. default: $NAME =$CR['name'] .'<br/>'.$Labels->GetLabel('_UNDEF_TYPE_'); break;
  52. };
  53. $INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_STATIONS_').':</td><td>'.$SCO.'</td></tr><tr><td align="right">'.$Labels->GetLabel('_MODULES_').':</td><td>'."0" .'</td></tr></table>';
  54. $CL=( $CR['type'] < 2 )?'line_type_64_ground':'line_type_64_rail';
  55. $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table width=\"100%\" border=0 class=\"setEd_infoPanel\" id=\"SENSOR_".(($ENANO)?'A':'N')."\"><tr><td width=\"100px\"><div class=\"{$CL}\" style=\"background-color:#{$CR['color']};\">{$CR['short']}</div></td><td valign=\"middle\" style=\"font-weight: bold;\">{$NAME}</td></tr><tr><td colspan=2>{$INFO}</td></tr></table><br/>'}";
  56. $ED =<<<kokakskhkajhskr
  57. {
  58. xtype: 'form',
  59. labelWidth: 200,
  60. border: false,
  61. frame: false,
  62. labelAlign: 'right',
  63. height: PanelH - 283,
  64. items:[{
  65. xtype: 'combo',
  66. id: 'line_le',
  67. fieldLabel: "{$Labels->GetLabel('_LINE_STATUS_')}",
  68. lazyRender: true,
  69. mode: 'local',
  70. forceSelection: true,
  71. triggerAction: 'all',
  72. editable: false,
  73. disableKeyFilter: true,
  74. store: new Ext.data.ArrayStore({
  75. fields: ['mode','mode_txt'],
  76. data: [
  77. [0,'{$Labels->GetLabel('__DISABLED__')}'],
  78. [1,'{$Labels->GetLabel('___ENABLED__')}']
  79. ]
  80. }),
  81. valueField: 'mode',
  82. displayField: 'mode_txt',
  83. value: {$ENANO},
  84. width: 200,
  85. listeners:{
  86. select: function( a, c, b ){
  87. doLineOperation( {$CR['id']}, 7, b, true );
  88. }
  89. }
  90. },{
  91. xtype: 'combo',
  92. id: 'line_type',
  93. fieldLabel: "{$Labels->GetLabel('_LINE_TYPE_')}",
  94. lazyRender: true,
  95. mode: 'local',
  96. forceSelection: true,
  97. triggerAction: 'all',
  98. editable: false,
  99. disableKeyFilter: true,
  100. store: new Ext.data.ArrayStore({
  101. fields: ['mode','mode_txt'],
  102. data: [
  103. [0,'{$Labels->GetLabel('_UNDEF_TYPE_')}'],
  104. [1,'{$Labels->GetLabel('_LNT_BRT_')}'],
  105. [2,'{$Labels->GetLabel('_LNT_LRT_')}'],
  106. [3,'{$Labels->GetLabel('_LNT_MRT_')}'],
  107. [4,'{$Labels->GetLabel('_LNT_CRT_')}'],
  108. [5,'{$Labels->GetLabel('_LNT_LCR_')}'],
  109. [6,'{$Labels->GetLabel('_LNT_HSR_')}']
  110. ]
  111. }),
  112. valueField: 'mode',
  113. displayField: 'mode_txt',
  114. value: {$CR['type']},
  115. width: 200,
  116. listeners:{
  117. select: function( a, c, b ){
  118. doLineOperation( {$CR['id']}, 6, b, true );
  119. }
  120. }
  121. },{
  122. xtype: 'textfield',
  123. id: 'line_name',
  124. value: '{$CR['name']}',
  125. fieldLabel: "{$Labels->GetLabel('_LINE_NAME_')}",
  126. },{
  127. xtype: 'textfield',
  128. id: 'line_short',
  129. value: '{$CR['short']}',
  130. fieldLabel: "{$Labels->GetLabel('_LINE_SHORT_')}",
  131. },{
  132. xtype: 'textfield',
  133. id: 'line_color_picker',
  134. value: '#{$CR['color']}',
  135. fieldLabel: "{$Labels->GetLabel('_LINE_LBL_COLOR_')}",
  136. listeners:{
  137. render: function( t ){
  138. var j = t.getEl();
  139. document.getElementById( j.id ).setAttribute("data-coloris","");
  140. document.getElementById( j.id ).setAttribute("class","x-form-text x-form-field coloris instance1");
  141. //debugger;
  142. Coloris.setInstance('.instance1', {
  143. theme: 'pill',
  144. themeMode: 'dark',
  145. formatToggle: false,
  146. closeButton: true,
  147. clearButton: false,
  148. swatches: [
  149. '#0072bc',
  150. '#e3131b',
  151. '#57a835',
  152. '#a05da5',
  153. '#f7b618',
  154. '#ea6bb1'
  155. ],
  156. onChange: function( w, c, e ){
  157. doLineOperation( {$CR['id']}, 5, c.value, true );
  158. }
  159. });
  160. }
  161. }
  162. }]
  163. }
  164. kokakskhkajhskr;
  165. $ITEMS[1] = $ED;
  166. $CONTENT = implode(',',$ITEMS);
  167. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  168. echo $TTPL;
  169. } else {
  170. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  171. };
  172. } else {
  173. header('location: /');
  174. };
  175. ?>