<?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 = 'AP Access Rule';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'Wireless',
    $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-proxy']); ?>
                <?= $form->field($model, 'mac_address')->label('MAC Address');
                $interfaces['all'] = 'all' ?>
                <?= $form->field($model, 'interface')->dropDownList($interfaces); ?>
                <?= $form->field($model, 'signal_range')->label('Signal Strength Range'); ?>
                <?= $form->field($model, 'ap_tx_limit')->label('AP Tx Limit'); ?>
                <?= $form->field($model, 'client_tx_limit')->label('Client Tx Limit'); ?>
                <?= $form->field($model, 'authentication')->checkBox(); ?>
                <?= $form->field($model, 'forwarding')->checkBox(); ?>
                <?=
                $form->field($model, 'vlan_mode')->dropDownList(['default' => 'default', 'no-tag' => 'no tag',
                    'use-service-tag' => 'use service tag',
                    'use-tag' => 'use tag',
                ]);
                ?>
                <?=
                $form->field($model, 'private_algo')->dropDownList(['none' => 'none',
                    '104bit-wep' => '104bit-wep',
                    '40bit-wep' => '40bit-wep',
                    'aes-ccm' => 'aes-ccm',
                    'tkip' => 'tkip',
                ])->label('Private Key Algo.');
                ?>
                <?= $form->field($model, 'private_key')->label('Private Key'); ?>
                <?= $form->field($model, 'private_pre_shared_key')->label('Private Pre Shared Key'); ?>
                <?= $form->field($model, 'management_protection_key')->label('Management Protection Key'); ?>
                <?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>