<?php

namespace WpBookingProAdminWooPanel\app\views\orderpackages;

use WpBookingPro\Html\ToolBar;
use WpBookingPro\Mvc\Model\Model;
use WpBookingPro\Mvc\View\View;
use WpBookingPro\Factory as FactoryAlias;

class OrderpackagesView extends View
{
    public function display($tpl)
    {
        $input = FactoryAlias::getInput();
        switch ($tpl) {
            case "list":
                ToolBar::delete("orderpackages.delete_list");
                ToolBar::_clone("orderpackages.clone_list");
                $model = Model::getInstance("orderpackages");
                $this->list = $model->getList();
                $modelOrderStatus = Model::getInstance('orderstatuss');
                $this->list_order_status = $modelOrderStatus->getList();
                break;
            case "form":
                $model = Model::getInstance("orderpackage");
                ToolBar::setTitle('Orderpackage Details');
                ToolBar::cancel("orderpackages.cancel");
                ToolBar::back_to_list("orderpackages.back_to_list");
                $id = $input->getInt('id', 0);
                $this->item = $model->getItem($id);
                break;
        }
        return parent::display($tpl);
    }
}