<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_EmployeeView")) {
    /**
     * Class WpBookingPro_EmployeeView
     */
    class WpBookingPro_EmployeeView extends WooBookingView
    {
        /**
         * @var
         */
        public $list;
        /**
         * @var
         */
        public $filterForm;

        /**
         * @param null $tpl
         * @return false|string
         * @throws Exception
         */
        public function display($tpl = null)
        {
            switch ($tpl) {
                case "config_list":
                    $modelBlock = WoobookingModel::getInstance('block');
                    $this->form = $modelBlock->getFormConfigBlock('service', $tpl);
                    break;
                case "form":
                    $id = $input->getInt('id', 0);
                    $this->item = $modelEvent->getItem($id);
                    $this->form = $modelEvent->getForm();
                    break;
                case "config_training":
                    break;
                case "list":
                default:
                    $input = Factory::getInput();
                    $modeEmployee = WoobookingModel::getInstance('employees');
                    $this->list = $modeEmployee->getList();
                    break;
            }
            return parent::display($tpl);
        }
    }
}