<?php

use yii\bootstrap\Alert;

if (Yii::$app->session->getFlash('message') != null) {
    echo Alert::widget([
        'options' => [
            'class' => 'alert-info',
        ],
        'body' => Yii::$app->session->getFlash('message'),
    ]);
}

use yii\helpers\Html;
use yii\helpers\Url;
use yii\grid\GridView;
use yii\widgets\Menu;
use yii\bootstrap\Tabs;
use yii\widgets\ActiveForm;
use yii\bootstrap\Button;

$this->title = 'Interface ' . $model->name;
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'Interfaces',
    $this->title,
];
?>
<div class="site-plugins">
    <div class="row">
        <div class="col-lg-3">
            <?php
            echo Menu::widget($menu);
            ?> 
        </div>
        <div class="col-md-9">
            <h1 style="margin-top: 0px"><?= Html::encode($this->title) ?></h1>
<?php ?>


            <?php $form = ActiveForm::begin(['id' => 'contact-form']); ?>
            <?=
            Tabs::widget([
                'items' => [
                    [
                        'label' => 'General',
                        'content' => $this->render('/mikrotik/interfaces/ethernet/general', ['eth' => $eth, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                        'active' => true
                    ],
                    [
                        'label' => 'Ethernet',
                        'content' => $this->render('/mikrotik/interfaces/ethernet/ethernet', ['model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Overall stats',
                        'content' => $this->render('/mikrotik/interfaces/ethernet/overall', ['model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Rx Stats',
                        'content' => $this->render('/mikrotik/interfaces/ethernet/rx', ['model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Tx Stats',
                        'content' => $this->render('/mikrotik/interfaces/ethernet/tx', ['model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
            ]]);

            if ($model->disabled == 'true') {
                $action_e = 'enable';
            } else {
                $action_e = 'disable';
            }
            echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            echo ' ';
            echo Html::a('' . ucfirst($action_e) . '', [$action_e, 'id' => $model->id], ['class' => 'btn btn-primary']);

            ActiveForm::end();
            ?>



        </div>
    </div>
</div>



