<?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 = 'Update DHCP Server Alert';
$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
            if ($model->disabled == 'true') {
                $action = 'enable';
            } else {
                $action = 'disable';
            }

            $form = ActiveForm::begin(['id' => 'form-dhcpServer']);
            ?>
            <?= $form->field($model, 'interface')->dropDownList($items, ['options' => [ $x => ['selected ' => true]]]) ?>
            <?= $form->field($model, 'valid_server')->label('Valid Servers'); ?>
            <?= $form->field($model, 'alert_timeout')->label('Alert Timeout'); ?>
            <?= $form->field($model, 'on_alert')->textarea()->label('On Alert'); ?>
        <?= Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']) ?>
        <?php echo Html::a('' . ucfirst($action) . '', [$action, 'id' => $model->id], ['class' => 'btn btn-primary']); ?> 
        </div>
<?php ActiveForm::end(); ?> 
    </div>
</div>
</div>