<script type="text/javascript" src="https://data.chinahighlights.com/js/train/StationInfo.js"></script>
<div style="width:90%;margin:30px auto;">
	<div class="panel panel-primary" style="width:60%;margin:0 auto;">
      <div class="panel-heading">
        <h3 class="panel-title"><?php echo $train_date;?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo $checi;?>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo isset($elecnumber)?$elecnumber:"";?></h3>
      </div>
      <div class="panel-body">
      	<?php if((int)$status>1):?>
	      	<p style="display:inline-block"><?php echo $from_station_name;?><span class="from_station_en"> </span><br><span class="start_time"></span></p><span class="glyphicon glyphicon-arrow-right"> </span><p style="display:inline-block"> <?php echo $to_station_name;?><span class="to_station_en"> </span><br><span class="arrive_time"></span></p>
	      	<?php foreach ($passengers as $v):?>
	      		<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	      		<p><?php echo @$v->tst_realname."({$v->tst_identitytype})&nbsp;&nbsp;&nbsp;&nbsp;{$v->tst_seatstype}&nbsp;&nbsp;{$v->tst_seatdetail}&nbsp;&nbsp;&nbsp;&nbsp;票价：￥{$v->tst_ticketprice}";?></p>
	      	<?php endforeach;?>
	    	<?php if((int)$status === 4):?>
	    	<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	    	<p>出票成功</p>	
	    	<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	    	<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">前往退票 <span class="glyphicon glyphicon-forward"></span></a></p>
	    	<?php endif;?>

	    	<?php if((int)$status === 6):?>
	    	<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	    	<p>正在处理退票</p>
	    	<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">查看详情 <span class="glyphicon glyphicon-forward"></span></a></p>
	    	<?php endif;?>

	    	<?php if((int)$status === 7 || (int)$status==8):?>
	    	<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	    	<p><?php echo $msg;?></p>
	    	<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">查看详情 <span class="glyphicon glyphicon-forward"></span></a></p>
	    	<?php endif;?>
			
			<?php if((int)$status === 10 || (int)$status === 11):?>
			<p style="border-top:1px dashed #000; height:1px;margin-top:10px;" ></p>
	    	<p><?php echo $msg;?></p>
	    	<p style="text-align:center;"><a href="refund?order=<?php echo $ordernumber?>" style="padding:5px 15px;" class="btn btn-warning btn-sm">查看详情 <span class="glyphicon glyphicon-forward"></span></a></p>
	    	<?php endif;?>
	    <?php else:?>
	    	<p><?php echo $msg;?></p>  	
	    <?php endif;?>  	

		<?php if ($channel == "lanhai"){ ?>
			<p style="text-align:center;"><a href="lanhaiMsg?order=<?php echo $ordernumber?>&type=orderticket" style="padding:5px 15px;" class="btn btn-warning btn-sm" target="_blank">出票详细信息 <span class="glyphicon glyphicon-forward"></span></a>
				&nbsp;&nbsp;&nbsp;&nbsp;
				<a href="lanhaiMsg?order=<?php echo $ordernumber?>&type=returnticket" style="padding:5px 15px;" class="btn btn-warning btn-sm" target="_blank">退票详细信息 <span class="glyphicon glyphicon-forward"></span></a>
		    </p>
		<?php } ?>
      </div>
  	</div>
</div>   	
<script>
var StationInfoArr = StationInfo.split("@");
var StationNameArr = new Array();
var code_name = new Array();
var station_cn_en = new Array();
var form_data = {};
for (var i = 0; i < StationInfoArr.length; ++i) {
	StationNameArr.push(StationInfoArr[i].split("|"));
	code_name[StationNameArr[i][1]] = [StationNameArr[i][2]];
	station_cn_en[StationNameArr[i][3]] = StationNameArr[i][2];
}
console.log(station_cn_en);
$(function(){
	var from_station_en = code_name['<?php echo $from_station_code?>'];
	var to_station_en = code_name['<?php echo $to_station_code?>'];
	var start_date = '<?php echo $train_date?>';
	var start_time = '<?php echo $start_time?>';
	var arrive_time = '<?php echo $arrive_time?>';

	//console.log(code_name);
	$('.from_station_en').html('('+from_station_en+') ');
	$('.to_station_en').html('('+to_station_en+')');
	$('.start_time').html('('+start_date+' '+start_time+')');
	$('.arrive_time').html('('+start_date+' '+arrive_time+')');
});	
</script>

