<?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 = 'Bridge Port ' . $model->bridge;
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'Bridge',
    $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-Settings']); ?>
                <?= $form->field($model, 'interface')->dropDownList($interfaces); ?>
                <?= $form->field($model, 'bridge')->dropDownList($bridge); ?>
                <?= $form->field($model, 'priority'); ?>
                <?= $form->field($model, 'path_cost')->label('Path Cost'); ?>
                <?= $form->field($model, 'horizon'); ?>
                <?=
                $form->field($model, 'edge')->dropDownList(['auto' => 'auto',
                    'no' => 'no',
                    'no-discover' => 'no-discover',
                    'yes' => 'yes',
                    'yes-discover' => 'yes-discover',
                ]);
                ?>
                <?=
                $form->field($model, 'point_to_point')->dropDownList(['auto' => 'auto',
                    'no' => 'no',
                    'yes' => 'yes',
                ]);
                ?>
                <?=
                $form->field($model, 'external_fdb')->dropDownList(['auto' => 'auto',
                    'no' => 'no',
                    'yes' => 'yes',
                ]);
                ?>

            <?= $form->field($model, 'auto_isolate')->checkBox(); ?>

            <?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('<spanclass="btn-label">' . ucfirst($action_e) . '</span>', [$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>