<?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 Security Configuration';
$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, 'authentication_types')->dropDownList(['' => '',
                    'wpa-psk' => 'wpa-psk',
                    'wpa2-psk' => 'wpa2-psk',
                    'wpa-eap' => 'wpa-eap',
                    'wpa2-eap' => 'wpa2-eap',
                        ], ['multiple' => true]);
                ?>
                <?=
                $form->field($model, 'encryption')->dropDownList(['' => '',
                    'aes-ccm' => 'aes-ccm',
                    'tkip' => 'tkip',
                        ], ['multiple' => true]);
                ?>
                <?=
                $form->field($model, 'group_encryption')->dropDownList(['' => '',
                    'aes-ccm' => 'aes-ccm',
                    'tkip' => 'tkip',
                ]);
                ?>
                <?= $form->field($model, 'passphrase')->passwordInput(); ?>
                <?=
                $form->field($model, 'eap_methods')->dropDownList(['' => '',
                    'eap-tls' => 'eap-tls',
                    'passthrough' => 'passthrough',
                        ], ['multiple' => true]);
                ?>
                <?=
                $form->field($model, 'tls_mode')->dropDownList(['' => '',
                    'verify-certificate' => 'verify-certificate',
                    'no-certificates' => 'no-certificates',
                    'dont-verify-certificate' => 'dont-verify-certificate',
                ]);
                $keys['none'] = 'none';
                ?>
                <?= $form->field($model, 'tls_certificate')->dropDownList($keys); ?>
                <?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>
