<?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 = 'CAPs Interface';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'CAPsMAN',
    $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/capsman/interface/general', ['master' => $master, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                        'active' => true
                    ],
                    [
                        'label' => 'Wireless',
                        'content' => $this->render('/mikrotik/capsman/interface/wireless', ['config' => $config, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Channel',
                        'content' => $this->render('/mikrotik/capsman/interface/channel', ['channel' => $channel, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Datapath',
                        'content' => $this->render('/mikrotik/capsman/interface/datapath', ['datapath' => $datapath, 'bridge' => $bridge, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
                    [
                        'label' => 'Security',
                        'content' => $this->render('/mikrotik/capsman/interface/security', ['security' => $security, 'cert' => $cert, 'model' => $model, 'menu' => $menu, 'form' => $form]),
                    ],
            ]]);
            if ($action == 'update') {

                echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            } else {
                echo Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            }

            ActiveForm::end();
            ?>

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



