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.

120 lines
3.7 KiB

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('_SMM_SCH_LOCATION_')}',
  82. items: [{
  83. xtype: 'panel',
  84. id: 'schematic_map',
  85. height: PanelH - 190,
  86. listeners:{
  87. afterrender: function(){
  88. inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
  89. }
  90. }
  91. }]
  92. },{
  93. xtype: 'panel',
  94. title: '{$Labels->GetLabel('_SMM_GEO_LOCATION_')}',
  95. items: [{
  96. xtype: 'panel',
  97. id: 'gis_map',
  98. height: PanelH - 190,
  99. listeners:{
  100. afterrender: function(){
  101. inintGisEditor('gis_map',{$CR['lat']},{$CR['lon']});
  102. }
  103. }
  104. }]
  105. }],
  106. }
  107. kokakskhkajhskr;
  108. $ITEMS[1] = $ED;
  109. $CONTENT = implode(',',$ITEMS);
  110. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  111. echo $TTPL;
  112. } else {
  113. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  114. };
  115. } else {
  116. header('location: /');
  117. };
  118. ?>