<?php

namespace TourOperatorProAdmin\app\views\orderpackages;

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

class OrderpackagesView extends View
{
    public function display($tpl)
    {

        $modelOrderpackage = Model::getInstance("orderpackage");
        $input = FactoryAlias::getInput();
        switch ($tpl) {
            case "list":
                ToolBar::add("orderpackage.add");
                ToolBar::delete("orderpackage.delete_list");
                ToolBar::_clone("orderpackage.clone_list");
                $model = Model::getInstance("orderpackages");
                $this->list = $model->getList();
                break;
            case "form":
                ToolBar::setTitle('Edit Activity');
                ToolBar::apply("orderpackage.apply");
                ToolBar::save("orderpackage.save");
                ToolBar::cancel("orderpackage.cancel");
                ToolBar::back_to_list("orderpackage.back_to_list");
                $id = $input->getInt('id', 0);
                $this->item = $modelOrderpackage->getItem($id);
                $this->form = $modelOrderpackage->getForm();
                break;
        }
        return parent::display($tpl);
    }
}