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.

159 lines
4.6 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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['CID'] );
  5. $QS = "SELECT * FROM `metro_stations` 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_unb_station',
  16. text: '{$Labels->GetLabel('_SMM_UNB_STATION_')}',
  17. handler: function(){
  18. Ext.Msg.show({
  19. title:'{$Labels->GetLabel('_UNBIND_STATION_')}?',
  20. msg: '{$Labels->GetLabel('_UNBIND_STATION_QUES_')}?',
  21. buttons: Ext.Msg.YESNO,
  22. fn: function(btn){
  23. if( btn == 'yes' ){
  24. SelectedModule = 0;
  25. doStationOperation( {$EID}, 4, SelectedLine, true );
  26. };
  27. },
  28. icon: Ext.MessageBox.QUESTION
  29. });
  30. }
  31. },{
  32. id: 'btn_del_station',
  33. text: '{$Labels->GetLabel('_SMM_DEL_STATION_')}',
  34. handler: function(){
  35. Ext.Msg.show({
  36. title:'{$Labels->GetLabel('_REMOVE_STATION_')}?',
  37. msg: '{$Labels->GetLabel('_REMOVE_STATION_QUES_')}?',
  38. buttons: Ext.Msg.YESNO,
  39. fn: function(btn){
  40. if( btn == 'yes' ){
  41. SelectedModule = 0;
  42. doStationOperation( {$EID}, 4, SelectedLine, true );
  43. };
  44. },
  45. icon: Ext.MessageBox.QUESTION
  46. });
  47. }
  48. }],
  49. items:[%%%ITEMS%%%]
  50. }
  51. JOJOKA;
  52. $ITEMS = array();
  53. $QS = "SELECT count(`id`) cnt FROM `metro_platforms` WHERE `station_id`={$EID}";
  54. $Rt = $DATABASE->Query( $QS, false );
  55. $PCO = $Rt[0]['cnt'];
  56. $NAME =$CR['name'] .'<br/>';
  57. $INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_LBL_PLATFORMS_').':</td><td>'.$PCO.'</td></tr><tr><td align="right">'.$Labels->GetLabel('_MODULES_').':</td><td>'."0" .'</td></tr></table>';
  58. $QS = "SELECT `ln`.`short`,`ln`.`color`,`ln`.`name` FROM `metro_lines` `ln` LEFT JOIN `metro_stations_2_lines` `sl` ON ( `ln`.`id`=`sl`.`line_id` ) WHERE `sl`.`station_id`={$EID} ORDER BY `ln`.`short`";
  59. $Rz = $DATABASE->Query( $QS, false );
  60. if( count( $Rz ) ){
  61. $LINES='<table><tr>';
  62. foreach( $Rz as $Z ) $LINES.="<td><div style=\"border-radius:16px;width:32px;height:32px;background-color:#{$Z['color']};color:#fff;font-size:16px;padding-left:10px;padding-top:6px;\">{$Z['short']}</div></td>";
  63. $LINES.='</tr></table>';
  64. } else {
  65. $LINES=$Labels->GetLabel('_NOBI_LINE_');
  66. };
  67. //$ITEMS[0]="{ xtype: 'spacer', height: 28 }";
  68. $ITEMS[0]="{ xtype:'panel', border: false, frame: false, html: '<table border=0 class=\"setEd_infoPanel\" id=\"SENSOR_N\"><tr><td valign=\"middle\" align=\"center\" style=\"padding-left:30px;font-size: 22px; font-weight: bold;\">{$NAME}</td></tr><tr><td>{$INFO}</td></tr><tr><td>{$LINES}</td></tr></table>'}";
  69. $ED =<<<kokakskhkajhskr
  70. {
  71. xtype: 'spacer',
  72. height: 20
  73. },{
  74. xtype: 'tabpanel',
  75. border: false,
  76. frame: false,
  77. height: PanelH - 190,
  78. activeTab: 0,
  79. items:[{
  80. xtype: 'panel',
  81. title: '{$Labels->GetLabel('_GENERAL_')}',
  82. items: [{
  83. xtype: 'form',
  84. id: 'st_general_map',
  85. height: PanelH - 190,
  86. labelWidth: 200,
  87. labelAlign: 'right',
  88. width: '100%',
  89. items:[{
  90. xtype: 'textfield',
  91. width: '70%',
  92. fieldLabel: '{$Labels->GetLabel('_STATION_NAME_')}',
  93. id: 'st_long_name',
  94. value: '{$CR['name']}',
  95. listeners:{
  96. change: function( a, c, b ){
  97. doStationOperation( {$CR['id']}, 6, c, true );
  98. }
  99. }
  100. },{
  101. xtype: 'textfield',
  102. width: '70%',
  103. fieldLabel: '{$Labels->GetLabel('_STATION_NAME_SHORT_')}',
  104. id: 'st_short_name',
  105. value: '{$CR['short']}',
  106. listeners:{
  107. change: function( a, c, b ){
  108. doStationOperation( {$CR['id']}, 7, c, true );
  109. }
  110. }
  111. }],
  112. listeners:{
  113. afterrender: function(){
  114. // inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
  115. }
  116. }
  117. }]
  118. },{
  119. xtype: 'panel',
  120. title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}',
  121. items: [{
  122. xtype: 'panel',
  123. id: 'schematic_map',
  124. height: PanelH - 190,
  125. listeners:{
  126. afterrender: function(){
  127. inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
  128. }
  129. }
  130. }]
  131. },{
  132. xtype: 'panel',
  133. title: '{$Labels->GetLabel('_SMM_GEO_LOCATION_')}',
  134. items: [{
  135. xtype: 'panel',
  136. id: 'gis_map',
  137. height: PanelH - 190,
  138. listeners:{
  139. afterrender: function(){
  140. inintGisEditor('gis_map',{$CR['lat']},{$CR['lon']});
  141. }
  142. }
  143. }]
  144. }],
  145. }
  146. kokakskhkajhskr;
  147. $ITEMS[1] = $ED;
  148. $CONTENT = implode(',',$ITEMS);
  149. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  150. echo $TTPL;
  151. } else {
  152. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  153. };
  154. } else {
  155. header('location: /');
  156. };
  157. ?>