<?php
namespace WpBookingHotelFrontend\app\views\hotel;
use WpBookingHotel\Mvc\Model\Model;
use WpBookingHotel\Mvc\View\View;
use WpBookingHotel\Factory as FactoryAlias;

class HotelView extends View
{
    public function display($tpl){
        $appConfig = FactoryAlias::getAppConfig();
        $based = $appConfig->get('currencies_in_list','');
        $currencyModel = Model::getInstance('currency');
        $symbol = $currencyModel->format_currency($based);
        $this->currency = reset($symbol);
        $input = FactoryAlias::getInput();
        $hotel_id = $input->getInt('hotel_id',0);
        $modelHotel = Model::getInstance('hotel');
        $modelCoupon = Model::getInstance('coupon');
        $this->listcounpon = $modelCoupon->getList();
        $modelReview = Model::getInstance('review');
        $this->item = $modelHotel->getItem($hotel_id);
        $this->hotel = $modelHotel->getItem($hotel_id);
        $this->form = $modelHotel->getForm();
        $this->form_review = $modelReview->getForm();

        return parent::display($tpl);
    }
}