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.

90 lines
3.5 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <?php
  2. require_once('../ajax_asm.php');
  3. require_once('../php/argus/server.php');
  4. require_once('../php/argus/templates.php');
  5. ob_start();
  6. $UID = intval( $CUser->Data['id'] );
  7. $ACCESS = intval( $CUser->Data['access'] );
  8. if( $UID > 1 ){
  9. $STID = intval( $_POST['STT'] );
  10. $QS = "SELECT * FROM `metro_stations` WHERE `id`={$STID}";
  11. $SR = $DATABASE->Query( $QS, false );
  12. if( count( $SR ) ){
  13. $CR = $SR[0];
  14. $QS = "SELECT count(`id`) cnt FROM `metro_platforms` WHERE `station_id`={$STID}";
  15. $Rt = $DATABASE->Query( $QS, false );
  16. $PCO = $Rt[0]['cnt'];
  17. $NAME =$CR['name'] .'<br/>';
  18. $INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_LBL_PLATFORMS_').':</td><td>'.$PCO.'</td></tr></table>';
  19. $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`={$STID} ORDER BY `ln`.`short`";
  20. $Rz = $DATABASE->Query( $QS, false );
  21. if( count( $Rz ) ){
  22. $LINES='<table><tr>';
  23. 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>";
  24. $LINES.='</tr></table>';
  25. } else {
  26. $LINES=$Labels->GetLabel('_NOBI_LINE_');
  27. };
  28. $STATAG="{ 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 style=\"padding-left:30px;\">{$LINES}</td></tr></table>'}";
  29. $PLAT_PARTS = array();
  30. $PLAT_PARTS[] = createTopLabel( $CR['name'], $Labels->GetLabel('_LBL_PLATFORMS_').':&nbsp;'.$PCO, $LINES );
  31. $MAIN_TPL = str_ireplace( '%%STATION%NAME%%', $CR['name'], $STATION_HISTORY_CTX );
  32. $Data['status']='ok';
  33. $PLAT_PARTS[]=<<<DATA_BOUNDARY
  34. {
  35. xtype: 'panel',
  36. height: PanelH-213,
  37. html: '<div id="activity_ph"></div>',
  38. listeners:{
  39. afterrender: function(){
  40. ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"{$Labels->GetLabel('_Please_Wait_')}..."});
  41. ReportMask.show();
  42. var jj = (PanelW - 230)/55;
  43. changeStyleSheet('amap-empty-day','{width: '+jj+'px; height: '+jj+'px;}');
  44. changeStyleSheet('amap-week-day','{width: '+jj+'px; height: '+jj+'px;}');
  45. changeStyleSheet('amap-week-name','{width: '+jj+'px; height: '+jj+'px;}');
  46. Ext.Ajax.request({
  47. url: '/lib/controller/getHistoryDates.php',
  48. params: {
  49. UID: {$UserID},
  50. SID: '{$Session}',
  51. STATION: {$STID}
  52. },
  53. success: function(response, opts ){
  54. var data = Ext.decode( response.responseText );
  55. var activityMap = new ActivityMap( data, {
  56. id: "dji-volume-map",
  57. parent: '#activity_ph',
  58. showTitle: false,
  59. showYears: true,
  60. width: 100,
  61. hue: 1,
  62. fit: true,
  63. compact: true,
  64. timeColumn: "t",
  65. valueColumn: "v"
  66. });
  67. activityMap.render();
  68. ReportMask.hide();
  69. },
  70. error: function(){
  71. ReportMask.hide();
  72. }
  73. });
  74. }
  75. }
  76. }
  77. DATA_BOUNDARY;
  78. $TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 2 },",$PLAT_PARTS ), $MAIN_TPL );
  79. $Data['pids'] = $PLAT_IDS;
  80. $Data['content']= $TOP;
  81. } else {
  82. $Data['status']='na';
  83. }
  84. $Data['messages'] = ob_get_clean();
  85. echo json_encode( $Data );
  86. } else {
  87. header('location: /');
  88. };
  89. ?>