<?php
/**
 * Created by PhpStorm.
 * User: Steven
 * Date: 2017/3/15
 * Time: 9:30
 *
 */
require_once dirname(__FILE__) . '/../init.php';
require dirname(dirname(__DIR__)) . '/Ctrip/Api/Mapping.php';
require dirname(dirname(__DIR__)) . '/Ctrip/Common/Page.class.php';
DI()->loader->addDirs('Ctrip');
$api = new PhalApi();

$map = new Api_Mapping();
$res = $map->GetHotelInfo();
$resZz = $map->getZzHotelInfo();
if ($res['RequestResponse']['RequestResult']['ResultCode'] != 0) {

}
$res = $res['RequestResponse']['RequestResult']['Response']['GetHotelInfoResponse'];
?>
<html>
<body>
<div style="float: left;width:80%;margin-left: 50px;">
    <table border="1" style="border-collapse:collapse;border-spacing:0px;" ><span
                style="font-size:24px;color:#006600;"></span>
        <caption align="top" style="font-weight: 600;font-size: 24px;">Ctrip酒店信息</caption>
        <tr>
            <th>酒店编码</th>
            <th>酒店名称</th>
            <th>酒店地址</th>
            <th>Mapping</th>
        </tr>
        <?php
        foreach ($resZz as $key => $value) {
            echo "<tr>";
            echo "<td>{$value['hotel_id']}</td><td>{$value['hotel_name']}</td><td>{$value['hotel_address']}</td>";
            echo "<td><select>";
            echo "<option value='-1'>请选择需要Mapping的酒店</option>";
            foreach ($resZz as $k => $v){
                echo "<option style='background-color: #55ccdd' value='{$v['hotel_id']}'>{$v['hotel_name']}&nbsp&nbsp&nbsp●●●{$v['hotel_address']}</option>";
            }
            echo "</select></td>";
            echo "</tr>";
        }
        ?>
    </table>
</div>
</body>
</html>

<?php

?>
