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.

123 lines
3.5 KiB

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. doStationOperation( {$EID}, 4, SelectedLine, true );
  19. }
  20. },{
  21. id: 'btn_del_station',
  22. text: '{$Labels->GetLabel('_SMM_DEL_STATION_')}',
  23. handler: function(){}
  24. }],
  25. items:[%%%ITEMS%%%]
  26. }
  27. JOJOKA;
  28. $ITEMS = array();
  29. $QS = "SELECT count(`id`) cnt FROM `metro_platforms` WHERE `station_id`={$EID}";
  30. $Rt = $DATABASE->Query( $QS, false );
  31. $PCO = $Rt[0]['cnt'];
  32. $NAME =$CR['name'] .'<br/>';
  33. $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>';
  34. $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`";
  35. $Rz = $DATABASE->Query( $QS, false );
  36. if( count( $Rz ) ){
  37. $LINES='<table><tr>';
  38. 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>";
  39. $LINES.='</tr></table>';
  40. } else {
  41. $LINES=$Labels->GetLabel('_NOBI_LINE_');
  42. };
  43. //$ITEMS[0]="{ xtype: 'spacer', height: 28 }";
  44. $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>'}";
  45. $ED =<<<kokakskhkajhskr
  46. {
  47. xtype: 'spacer',
  48. height: 20
  49. },{
  50. xtype: 'panel',
  51. border: false,
  52. html: '<p><center>{$Labels->GetLabel('_ADD_OP_SETTINGS_')}</center></p>'
  53. },{
  54. xtype: 'spacer',
  55. height: 20
  56. },{
  57. xtype: 'tabpanel',
  58. border: false,
  59. frame: false,
  60. height: PanelH - 283,
  61. activeTab: 0,
  62. items:[{
  63. xtype: 'panel',
  64. title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}',
  65. items: [{
  66. xtype: 'compositefield',
  67. labelWidth: 120,
  68. items: [
  69. {
  70. xtype : 'textfield',
  71. fieldLabel: 'lat',
  72. width : 200
  73. },
  74. {
  75. xtype : 'textfield',
  76. fieldLabel: 'lon',
  77. flex : 1
  78. },
  79. {
  80. xtype : 'textfield',
  81. fieldLabel: 'Last',
  82. flex : 1
  83. }
  84. ]
  85. },{
  86. xtype: 'panel',
  87. id: 'schematic_map',
  88. height: PanelH - 283,
  89. listeners:{
  90. afterrender: function(){
  91. inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
  92. }
  93. }
  94. }]
  95. },{
  96. xtype: 'panel',
  97. title: '{$Labels->GetLabel('_SMM_GEO_LOCATION_')}',
  98. items: [{
  99. xtype: 'panel',
  100. id: 'gis_map',
  101. height: PanelH - 283,
  102. listeners:{
  103. afterrender: function(){
  104. inintGisEditor('gis_map',{$CR['lat']},{$CR['lon']});
  105. }
  106. }
  107. }]
  108. }],
  109. }
  110. kokakskhkajhskr;
  111. $ITEMS[1] = $ED;
  112. $CONTENT = implode(',',$ITEMS);
  113. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  114. echo $TTPL;
  115. } else {
  116. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  117. };
  118. } else {
  119. header('location: /');
  120. };
  121. ?>