<?php
namespace WpBookingHotelFrontend\app\views\hotellocator;
use WpBookingHotel\Mvc\Model\Model;
use WpBookingHotel\Mvc\View\View;
use WpBookingHotel\Factory;

class HotellocatorView extends View
{
    public function display($tpl){

        $modelHotel = Model::getInstance('hotel');
        $modelHotels=Model::getInstance('hotels');
        $this->list=$modelHotels->get_list_hotel_loc();

        $modelCountries = Model::getInstance('countries');
        $this->list_countries = $modelCountries->getList_location();

        $modelLocations=Model::getInstance('locations');
        $this->list_locations=$modelLocations->getList();

        $modelRoomtypes = Model::getInstance('roomtype');
        $this->list_roomtype = $modelRoomtypes->getList();
        $this->form = $modelHotels->getFilterFormHotel();
        $appConfig = Factory::getAppConfig();
        $symbol = $appConfig->get('currencies_in_list', '');
        $currencyModel = Model::getInstance('currency');
        if (isset($_SESSION["currency"])){
            $currency = $_SESSION["currency"];
            $this->symbol = $currencyModel->format_currency($currency);
        }else{
            $this->symbol = $currencyModel->format_currency($symbol);
        }

        $this->total_item = $modelHotels->getTotalRecord();
        $listService = Model::getInstance('service');
        $this->list_services = $listService->getList();

        $modelAmenitie=Model::getInstance('amenities');
        $this->list_amenitie=$modelAmenitie->getList();

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