<thead>
    <tr><th>车次</th><th>出发地->目的地</th><th>时间</th><th>历时</th><th>商务座</th><th>特等座</th><th>一等座</th><th>二等座</th><th>高级软卧</th><th>软卧</th><th>硬卧</th><th>软座</th><th>硬座</th><th>无座</th><th>预定</th></tr>
</thead>
<tbody>
    <?php
    foreach ($result["list"] as $v) {
        switch ($v["arrive_days"]) {
            case '0':
                $arrive_days = "当天到达";
                break;
            case '1':
                $arrive_days = "次日达到";
                break;
            case '2':
                $arrive_days = "两日到达";
                break;
            case '3':
                $arrive_days = "三日到达";
                break;
            case '4':
                $arrive_days = "四日到达";
                break;
            case '5':
                $arrive_days = "五日到达";
                break;
            case '6':
                $arrive_days = "六日到达";
                break;
            case '7':
                $arrive_days = "七日到达";
                break;
            default:
                $arrive_days = "超过七天到达";
                break;
        }
        $zwxx = ""; //座位信息
        if (is_numeric($v['swz_num'])) {
            $zwxx.="&swz_num=" . $v['swz_num'];
            $zwxx.="&swz_price=" . $v['swz_price'];
        }
        if (is_numeric($v['tdz_num'])) {
            $zwxx.="&tdz_num=" . $v['tdz_num'];
            $zwxx.="&tdz_price=" . $v['tdz_price'];
        }
        if (is_numeric($v['ydz_num'])) {
            $zwxx.="&ydz_num=" . $v['ydz_num'];
            $zwxx.="&ydz_price=" . $v['ydz_price'];
        }
        if (is_numeric($v['edz_num'])) {
            $zwxx.="&edz_num=" . $v['edz_num'];
            $zwxx.="&edz_price=" . $v['edz_price'];
        }
        if (is_numeric($v['gjrw_num'])) {
            $zwxx.="&gjrw_num=" . $v['gjrw_num'];
            $zwxx.="&gjrw_price=" . $v['gjrw_price'];
        }
        if (is_numeric($v['rw_num'])) {
            $zwxx.="&rw_num=" . $v['rw_num'];
            $zwxx.="&rw_price=" . $v['rw_price'];
        }
        if (is_numeric($v['yw_num'])) {
            $zwxx.="&yw_num=" . $v['yw_num'];
            $zwxx.="&yw_price=" . $v['yw_price'];
        }
        if (is_numeric($v['rz_num'])) {
            $zwxx.="&rz_num=" . $v['rz_num'];
            $zwxx.="&rz_price=" . $v['rz_price'];
        }
        if (is_numeric($v['yz_num'])) {
            $zwxx.="&yz_num=" . $v['yz_num'];
            $zwxx.="&yz_price=" . $v['yz_price'];
        }
        if (is_numeric($v['wz_num'])) {
            $zwxx.="&wz_num=" . $v['wz_num'];
            $zwxx.="&wz_price=" . $v['wz_price'];
        }
        ?>
        <tr>
            <td  rowspan="2" style="vertical-align:middle;"><?php echo $v['train_code']; ?></td>
            <td  rowspan="2" style="vertical-align:middle;"><?php echo $v['from_station_name']; ?>-><?php echo $v['to_station_name']; ?></td>
            <td  rowspan="2" style="vertical-align:middle;"><?php echo $v['start_time']; ?>~<?php echo $v['arrive_time']; ?></td>
            <td  style="vertical-align:middle;"><?php echo $v['run_time']; ?></td>
            <td><?php echo $v['swz_num']; ?></td>
            <td><?php echo $v['tdz_num']; ?></td>
            <td><?php echo $v['ydz_num']; ?></td>
            <td><?php echo $v['edz_num']; ?></td> 
            <td><?php echo $v['gjrw_num']; ?></td>
            <td><?php echo $v['rw_num']; ?></td>
            <td><?php echo $v['yw_num']; ?></td>
            <td><?php echo $v['rz_num']; ?></td>
            <td><?php echo $v['yz_num']; ?></td>
            <td><?php echo $v['wz_num']; ?></td>
            <td  rowspan="2" style="vertical-align:middle;"><a target="_blank"  class="btn btn-primary btn-sm" href="<?php echo site_url("/apps/train/index/booking?from_station_code={$v['from_station_code']}&from_station_name={$v['from_station_name']}&to_station_code={$v['to_station_code']}&to_station_name={$v['to_station_name']}&train_code={$v['train_code']}&date={$date}&start_time={$v['start_time']}&arrive_time={$v['arrive_time']}{$zwxx}"); ?>">预定</a></td>                                
        </tr>
        <tr>
            <td><?php echo $arrive_days; ?></td>
            <td style="color:red;">￥<?php echo $v['swz_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['tdz_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['ydz_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['edz_price']; ?></td> 
            <td style="color:red;">￥<?php echo $v['gjrw_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['rw_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['yw_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['rz_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['yz_price']; ?></td>
            <td style="color:red;">￥<?php echo $v['wz_price']; ?></td>

        </tr>
    <?php } ?>
</tbody>    