<?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\widgets\Menu;
use yii\widgets\ActiveForm;

$this->title = 'CAPs Channel';
$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
                $form = ActiveForm::begin(['id' => 'form-ac']);
                ?>
                <?= $form->field($model, 'name')->label('Name'); ?>
                <?= $form->field($model, 'frequency'); ?>
                <?= $form->field($model, 'width'); ?>
                <?=
                $form->field($model, 'band')->dropDownList(['' => '',
                    '2ghz-b' => '2ghz-b',
                    '2ghz-b/g' => '2ghz-b/g',
                    '2ghz-b/g/n' => '2ghz-b/g/n',
                    '2ghz-onlyg' => '2ghz-onlyg',
                    '2ghz-onlyn' => '2ghz-onlyn',
                    '5ghz-a' => '5ghz-a',
                    '5ghz-a/n' => '5ghz-a/n',
                    '5ghz-onlyn' => '5ghz-onlyn',
                    '5ghz-a/n/ac' => '5ghz-a/n/ac',
                    '5ghz-only-ac' => '5ghz-only-ac',
                ]);
                ?>
                <?=
                $form->field($model, 'extension_channel')->dropDownList(['' => '',
                    'Ce' => 'Ce',
                    'Ceee' => 'Ceee',
                    'disabled' => 'disabled',
                    'eC' => 'eC',
                    'eCee' => 'eCee',
                    'eeCe' => 'eeCe',
                    'eeeC' => 'eeeC',
                ]);
                ?>
                <?= $form->field($model, 'tx_power')->label('TX Power'); ?>
                <?php
                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']);
                }
                ?></div>
            <?php ActiveForm::end();
            ?> 
    </div>
</div>
</div>
