<?php

namespace WpBookingHotelAdmin\app\views\emailaccount;

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

class EmailaccountView extends View
{
    public function display($tpl)
    {
        $modelsms = Model::getInstance("emailaccount");
        $input = FactoryAlias::getInput();
        switch ($tpl) {
            case "list":
                ToolBar::add("emailaccount.add");
                ToolBar::delete("emailaccount.delete_list");
                ToolBar::_clone("emailaccount.clone_list");
                $model = Model::getInstance("emailaccount");
                $this->list = $model->getList();
                break;
            case "form":
                ToolBar::setTitle('Edit Emailaccount');
                ToolBar::apply("emailaccount.apply");
                ToolBar::save("emailaccount.save_v1");
                ToolBar::cancel("emailaccount.cancel");
                ToolBar::back_to_list("emailaccount.back_to_list");
                $id = $input->getInt('id', 0);
                $this->item = $modelsms->getItem($id);
                $this->form = $modelsms->getForm();
                break;
        }
        return parent::display($tpl);
    }
}