<?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;
use yii\bootstrap\Nav;

$this->title = ucfirst($often) . ' Traffic and system resource usage';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    $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']); ?>

            <?php
            echo Nav::widget([
                'options' => ['class' => 'navbar-nav navbar-right'],
                'items' => [
                    ['label' => 'Change time interval', 'items' => [
                            ['label' => 'daily', 'url' => \yii\helpers\Url::toRoute(['mikrotik/graphs?type=daily',])],
                            ['label' => 'weekly', 'url' => \yii\helpers\Url::toRoute(['mikrotik/graphs?type=weekly',])],
                            ['label' => 'monthly', 'url' => \yii\helpers\Url::toRoute(['mikrotik/graphs?type=monthly',])],
                            ['label' => 'yearly', 'url' => \yii\helpers\Url::toRoute(['mikrotik/graphs?type=yearly',])],
                        ]]
            ]]);
            echo Tabs::widget([
                'items' => [

                    [
                        'label' => 'Traffic',
                        'content' => $this->render('/mikrotik/graphs/interface', ['often' => $often, 'int' => $int, 'menu' => $menu, 'form' => $form]),
                        'active' => true
                    ],
                    [
                        'label' => 'Queues',
                        'content' => $this->render('/mikrotik/graphs/queue', ['often' => $often, 'que' => $que, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'System resource',
                        'content' => $this->render('/mikrotik/graphs/system', ['often' => $often, 'menu' => $menu, 'form' => $form]),
                    ],
            ]]);


            ActiveForm::end();
            ?>



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



