<?php
namespace TourOperatorProFrontend\app\views\tours;
use TourOperatorPro\Factory;
use TourOperatorPro\Mvc\Model\Model;
use TourOperatorPro\Mvc\View\View;

class ToursView extends View
{
    public function display($tpl){
        $modelTours=Model::getInstance('tours');
        $modelTour=Model::getInstance('tour');
        $modelCurrencies = Model::getInstance('currencies');

        $this->list=$modelTours->getList();
        $this->list_country = $modelTours->getList_destination();
        $this->list_tourtype= $modelTours->getList_tourtype();
        $this->formfield = $modelTour->getForm();

        $this->list = $modelTours->getList();
        $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->listCurrencies = $modelCurrencies->getList();

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