|
|
<?php require_once('../ajax_asm.php'); require_once('../php/argus/server.php'); require_once('../php/argus/templates.php'); ob_start(); $UID = intval( $CUser->Data['id'] ); $ACCESS = intval( $CUser->Data['access'] ); if( $UID > 1 ){ $STID = intval( $_POST['STT'] ); $QS = "SELECT * FROM `metro_stations` WHERE `id`={$STID}"; $SR = $DATABASE->Query( $QS, false ); if( count( $SR ) ){ $CR = $SR[0]; $QS = "SELECT count(`id`) cnt FROM `metro_platforms` WHERE `station_id`={$STID}"; $Rt = $DATABASE->Query( $QS, false ); $PCO = $Rt[0]['cnt']; $NAME =$CR['name'] .'<br/>'; $INFO = '<table width="100%" border=0><tr><td width="130px" align="right">'.$Labels->GetLabel('_LBL_PLATFORMS_').':</td><td>'.$PCO.'</td></tr></table>'; $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`"; $Rz = $DATABASE->Query( $QS, false ); if( count( $Rz ) ){ $LINES='<table><tr>'; 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>"; $LINES.='</tr></table>'; } else { $LINES=$Labels->GetLabel('_NOBI_LINE_'); }; $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>'}"; $PLAT_PARTS = array(); $PLAT_PARTS[] = createTopLabel( $CR['name'], $Labels->GetLabel('_LBL_PLATFORMS_').': '.$PCO, $LINES ); $MAIN_TPL = str_ireplace( '%%STATION%NAME%%', $CR['name'], $STATION_HISTORY_CTX ); $Data['status']='ok'; $PLAT_PARTS[]=<<<DATA_BOUNDARY{ xtype: 'panel', height: PanelH-213, html: '<div id="activity_ph"></div>', listeners:{ afterrender: function(){ ReportMask = new Ext.LoadMask(Ext.getCmp('main_content').getEl(), {msg:"{$Labels->GetLabel('_Please_Wait_')}..."}); ReportMask.show(); var jj = (PanelW - 230)/55; changeStyleSheet('amap-empty-day','{width: '+jj+'px; height: '+jj+'px;}'); changeStyleSheet('amap-week-day','{width: '+jj+'px; height: '+jj+'px;}'); changeStyleSheet('amap-week-name','{width: '+jj+'px; height: '+jj+'px;}'); Ext.Ajax.request({ url: '/lib/controller/getHistoryDates.php', params: { UID: {$UserID}, SID: '{$Session}', STATION: {$STID} }, success: function(response, opts ){ var data = Ext.decode( response.responseText ); var activityMap = new ActivityMap( data, { id: "dji-volume-map", parent: '#activity_ph', showTitle: false, showYears: true, width: 100, hue: 1, fit: true, compact: true, timeColumn: "t", valueColumn: "v" }); activityMap.render(); ReportMask.hide(); }, error: function(){ ReportMask.hide(); } }); } }}DATA_BOUNDARY; $TOP = str_ireplace('%%%PANELS%%%', implode( ",{ xtype:'spacer', height: 2 },",$PLAT_PARTS ), $MAIN_TPL ); $Data['pids'] = $PLAT_IDS; $Data['content']= $TOP; } else { $Data['status']='na'; } $Data['messages'] = ob_get_clean(); echo json_encode( $Data ); } else { header('location: /'); }; ?>
|