<div style="width:90%;margin:30px auto;">
	<div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">翰特订单号&nbsp;<a style="margin-left:50px;" target='_blank' href="<?php echo site_url('apps/train/index/ht_order_list');?>">订单列表>></a></h3>
      </div>
      <div class="panel-body">
 	     <form style="width: 300px;float: left;" action="" method="post">
 	     	<input type="text" name="ht_order" value="<?php echo isset($cols_id)?$cols_id:""; ?>">
 	     	<button type="submit" id="sub" class="btn btn-warning btn-sm"><span class="glyphicon glyphicon-download-alt"></span> 获取信息</button>	
 	     </form>
 	     <p style="margin: 0 0 10px; width: 200px; float: left; line-height: 30px;">外联：<span><?php if(!empty($wl)){echo $wl[0]->OPI_Name;}?></span></p>
      </div>
    </div>
    <div class="panel panel-primary">
      <div class="panel-heading">
        <h3 class="panel-title">火车订单信息</h3>
      </div>
		<div class="panel-body">
			<?php if(!empty($info)):?>
			<?php $num=1; foreach($info as $v):?>
			    <table class="table table-bordered table-hover"  style="text-align:center;">
				<thead>
					<tr>
						<th style="text-align:center;">序号</th>
						<th style="text-align:center;">车次</th>
						<th style="text-align:center;">座位</th>
						<th style="text-align:center;">出发城市</th>
						<th style="text-align:center;">抵达城市</th>
						<th style="text-align:center;">发车日期</th>
						<th style="text-align:center;">发车时间</th>
						<th style="text-align:center;">抵达时间</th>
						<th style="text-align:center;">票价</th>
						<th style="text-align:center;">是否提交过</th>
						<th style="text-align:center;">操作</th>
					</tr>
				</thead>
				<tbody>
				
					<tr>
						<td><?php echo $num++;?></td>
						<td><?php echo $v->train[0]->FlightsNo;?></td>
						<td><?php echo $v->train[0]->Cabin;?></td>
						<td><?php echo $v->train[0]->DepartureCity;?></td>
						<td><?php echo $v->train[0]->ArrivalCity;?></td>
						<td><?php echo $v->train[0]->DepartureDate;?></td>
						<td><?php echo $v->train[0]->DepartureTime;?></td>
						<td><?php echo $v->train[0]->ArrivalTime;?></td>
						<td><?php echo $v->train[0]->adultcost;?></td>
						<td><?php echo !empty($v->status)?"<span style='color:red;'>是</span>":"否";?></td>
						<td><a class="pay_api" href="javascript:;" data-order="<?php echo $v->train[0]->FOI_COLD_SN;?>" >订票</a></td>
					</tr>
					<tr>
						<td colspan="11">
							<table class="table table-condensed table-bordered">
								<thead>
									<tr>
										<th style="text-align:center;">姓名</th>
										<th style="text-align:center;">护照</th>
										<th style="text-align:center;">年龄类型</th>
									</tr>
								</thead>
								<tbody>
									<?php foreach($v->people as $p): ?>
									<tr>
										<td><?php echo $p->BPE_FirstName." ".$p->BPE_MiddleName." ".$p->BPE_LastName;?></td>
										<td><?php echo $p->BPE_Passport;?></td>
										<td><?php echo $p->BPE_GuestType==1?"成人":($p->BPE_GuestType==2?"儿童":"婴儿");?></td>
									</tr>
									<?php endforeach;?>
									<tr id="back_<?php echo $v->train[0]->FOI_COLD_SN;?>" style="display:none;">
										<td colspan="3">
											处理结果：<span style="color:red;"></span>
										</td>
									</tr>
								</tbody>
							</table>
							
						</td>
					</tr>
					

				</tbody>
			</table>
		<?php endforeach;endif;?>	
		</div>
    </div>
</div>
 
<script>
	var url="<?php echo site_url('apps/train/index/submit_juhe_order?').'order=';?>";
	var order_ul="<?php echo site_url('apps/train/index/order?').'order=';?>";//订单详情页面
	$(".pay_api").click(function(){
		// alert(url+$(this).attr("data-order"));
		var THIS=$(this);
		var order=$(this).attr("data-order");
		$.get(
			url+$(this).attr("data-order"),
	        
	        function(data){
	        	// alert("#back_"+order);
	        	if(data.status==1){
	        		THIS.parent().html("<a href='"+order_ul+data.order+"' target='_blank'>详情</a>");
	        	}
	            $("#back_"+order+" span").html(data.mes);
	            $("#back_"+order).show();
	        },
        	'json'
        );
        
		return false;
	});
</script>