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

        /**
         * @param null $tpl
         * @return false|string
         * @throws Exception
         */
        public function display($tpl = null)
        {
            $modelEvent = $this->getModel('db_appointments');
            $input = Factory::getInput();
            switch ($tpl) {
                case "item":
                    $id = 2;
                    $this->item = $modelEvent->getItem($id);
                    $this->form = $modelEvent->getForm();
                    break;
                case "form":
                    $this->form = $modelEvent->getForm();
                    break;
                    break;
                case "list":
                default:
                    $this->list = $modelEvent->getList();
                    break;
            }
            return parent::display($tpl);
        }
    }
}