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

        /**
         * @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 "profile":
                    $modelAccount = WoobookingModel::getInstance('account');
                    $this->user = $modelAccount->getUser();
                    break;
                case "config_training":
                    break;
                case "list":
                default:
                    $input = Factory::getInput();
                    $modeAccount = WoobookingModel::getInstance('accounts');
                    $this->list = $modeAccount->getList();
                    break;
            }
            return parent::display($tpl);
        }
    }
}