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.

96 lines
3.0 KiB

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. 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: 'tabpanel',
  51. border: false,
  52. frame: false,
  53. height: PanelH - 190,
  54. activeTab: 0,
  55. items:[{
  56. xtype: 'panel',
  57. title: '{$Labels->GetLabel('_SMM_SCH_LOCATION_')}',
  58. items: [{
  59. xtype: 'panel',
  60. id: 'schematic_map',
  61. height: PanelH - 190,
  62. listeners:{
  63. afterrender: function(){
  64. inintSchematicEditor('schematic_map',{$CR['y']},{$CR['x']});
  65. }
  66. }
  67. }]
  68. },{
  69. xtype: 'panel',
  70. title: '{$Labels->GetLabel('_SMM_GEO_LOCATION_')}',
  71. items: [{
  72. xtype: 'panel',
  73. id: 'gis_map',
  74. height: PanelH - 190,
  75. listeners:{
  76. afterrender: function(){
  77. inintGisEditor('gis_map',{$CR['lat']},{$CR['lon']});
  78. }
  79. }
  80. }]
  81. }],
  82. }
  83. kokakskhkajhskr;
  84. $ITEMS[1] = $ED;
  85. $CONTENT = implode(',',$ITEMS);
  86. $TTPL = str_ireplace( '%%%ITEMS%%%', $CONTENT, $TTPL );
  87. echo $TTPL;
  88. } else {
  89. echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
  90. };
  91. } else {
  92. header('location: /');
  93. };
  94. ?>