<?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 = 'IPsec Proposal';
$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 $form = ActiveForm::begin(['id' => 'form-Proposal']); ?>
                <?= $form->field($model, 'name')->label('Name'); ?>
                <?=
                $form->field($model, 'auth_algorithms')->dropDownList(['sha1' => 'sha1',
                    'md5' => 'md5',
                    'null' => 'null',
                    'sha256' => 'sha256',
                    'sha512' => 'sha512',
                        ], ['multiple' => true]);
                ?>
                <?=
                $form->field($model, 'enc_algorithms')->dropDownList(['null' => 'null',
                    'des' => 'des',
                    '3des' => '3des',
                    'aes-128-cbc' => 'aes-128-cbc',
                    'aes-128-cbc' => 'aes-128-cbc',
                    'aes-128gcm' => 'aes-128gcm',
                    'aes-192-cbc' => 'aes-192-cbc',
                    'aes-192-ctr' => 'aes-192-ctr',
                    'aes-192-gcm' => 'aes-192-gcm',
                    'aes-256-cbc' => 'aes-256-cbc',
                    'aes-256-ctr' => 'aes-256-ctr',
                    'aes-256-gcm' => 'aes-256-gcm',
                    'blowfish' => 'blowfish',
                    'camellia-128' => 'camellia-128',
                    'camellia-192' => 'camellia-192',
                    'camellia-256' => 'camellia-256',
                    'twofish' => 'twofish',
                        ], ['multiple' => true]);
                ?>
                <?= $form->field($model, 'lifetime')->label('Lifetime'); ?>
                <?=
                $form->field($model, 'pfs_group')->dropDownList(['ec2n155' => 'ec2n155',
                    'ec2n185' => 'ec2n185',
                    'modp1024' => 'modp1024',
                    'modp1536' => 'modp1536',
                    'modp2048' => 'modp2048',
                    'modp3072' => 'modp3072',
                    'modp4096' => 'modp4096',
                    'modp6144' => 'modp6144',
                    'modp768' => 'modp768',
                    'none' => 'none',
                ]);
                ?>
                <?php
                if ($action == 'update') {
                    if ($model->disabled == 'true') {
                        $action_e = 'enable';
                    } else {
                        $action_e = 'disable';
                    }
                    echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']);
                    echo ' ';
                    echo Html::a('' . ucfirst($action_e) . '', [$action_e, 'id' => $model->id], ['class' => 'btn btn-primary']);
                } else {
                    echo Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']);
                }
                ?>
        </div>
        <?php ActiveForm::end();
        ?> 
    </div>
</div>
</div>

