<?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 Datapath 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']);
                $items[''] = '';
                ?>
                <?= $form->field($model, 'name')->label('Name'); ?>
                <?= $form->field($model, 'bridge')->dropDownList($items); ?>
                <?= $form->field($model, 'bridge_cost')->label('Bridge Cost'); ?>
                <?= $form->field($model, 'bridge_horizon')->label('Bridge Horizon'); ?>
                <?= $form->field($model, 'local_forwarding')->checkBox(); ?>
                <?= $form->field($model, 'client_to_client_forwarding')->checkBox(); ?>
                <?=
                $form->field($model, 'vlan_mode')->dropDownList(['' => '',
                    'use-service-tag' => 'use-service-tag',
                    'use-tag' => 'use-tag',
                    'no-tag' => 'no-tag',
                ]);
                ?>
                <?= $form->field($model, 'vlan_id')->label('VLAN ID'); ?>
                <?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>
