<?php

namespace WpBookingEventAdmin\app\views\orderpackages;

use WpBookingEvent\Html\ToolBar;
use WpBookingEvent\Mvc\Model\Model;
use WpBookingEvent\Mvc\View\View;
use WpBookingEvent\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);
    }
}