<?php
defined('_WPBOOKINGPRO_EXEC') or die;
if(!class_exists("WpBookingPro_OrderView")) {
    /**
     * Class WpBookingPro_OrderView
     */
    class WpBookingPro_OrderView 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();
                    $modeOrder = WoobookingModel::getInstance('orders');
                    $this->list = $modeOrder->getList();
                    $modelPackageOrders=WoobookingModel::getInstance('packageOrders');
                    $this->list_package_order=$modelPackageOrders->getList();
                    break;
            }
            return parent::display($tpl);
        }
    }
}