<?php
namespace WpBookingProFrontend\app\views\service;
use WpBookingPro\Mvc\Model\Model;
use WpBookingPro\Mvc\View\View;
use WpBookingPro\Factory as FactoryAlias;

class ServiceView extends View
{
    public function display($tpl){
        $input = FactoryAlias::getInput();
        $service_id = $input->getInt('service_id',0);
        $modelService=Model::getInstance('service');
        $modelReview = Model::getInstance('review');
        $this->item=$modelService->getItem($service_id);
        $this->list_event=$modelService->getEventByServiceId($service_id);
        $this->form = $modelService->getForm();
        $this->form_review = $modelReview->getForm();
        if(is_user_logged_in()) {
            $modelUser = Model::getInstance('user');
            $this->user = $modelUser->getUserInfo();
        }

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