<?php

/**
 * 前台 填写酒店订单信息 模块 Controller
 * ============================================================================
 * ZhunaCMS 住哪网酒店分销联盟程序php版　BY Tmac PHP MVC framework
 * $Author: zhangwentao $  <zwttmac@qq.com>
 * $Id: ebook.php 41 2011-12-01 06:58:03Z zhangwentao $
 * http://un.zhuna.cn；
 */
class ebookAction extends Action
{

    private $tmp_model;
    private $hotelinfo_model;
    private $common_model;

    /**
     * _init 方法 在执行任何Action前执行
     */
    public function _init()
    {
        $this->assign('action', $_GET['TMAC_ACTION']);
        $this->assign('method',$_GET['TMAC_CONTROLLER']);
        $this->hotelinfo_model = Tmac::model('hotelinfo');
        $this->common_model = Tmac::model('common');

        //footer里的相关设置
        $config_footer = $this->common_model->footer();
        $this->assign($config_footer);
    }

    /**
     * 资讯类别管理 首页
     */
    public function index()
    {
        $hotel_id = !empty($_GET['hid']) ? (int) $_GET['hid'] : 0;
        $pid = !empty($_GET['pid']) ? (int) $_GET['pid'] : 0;
        $uid = !empty($_GET['uid']) ? (int) $_GET['uid'] : 0;
        $rid = !empty($_GET['rid']) ? (int) $_GET['rid'] : 0;
        $tm1 = !empty($_GET['tm1']) ? $_GET['tm1'] : 0;
        $tm2 = !empty($_GET['tm2']) ? $_GET['tm2'] : 0;

        $info = $this->hotelinfo_model->getHotelInfo($hotel_id);        
        $array = array(
            'hotel_id'  =>  $hotel_id,
            'pid'       =>  $pid,
            'uid'       =>  $uid,
            'rid'       =>  $rid,
            'tm1'       =>  $tm1,
            'tm2'       =>  $tm2,
            'domain'    =>  $_SERVER['HTTP_HOST'],
            'info'      =>  $info
        );
        
        $this->assign($array);
        $this->V('ebook');
    }

}