<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_CartView")) {
    /**
     * Class WpBookingPro_CartView
     */
    class WpBookingPro_CartView 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);
        }
    }
}