<?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 = 'New DHCP Server';
$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-dhcpServer']);
            ?>
            <?= $form->field($model, 'name')->label('Name'); ?>
            <?= $form->field($model, 'interface')->dropDownList($items); ?>
            <?= $form->field($model, 'relay')->label('Relay'); ?>
            <?= $form->field($model, 'lease_time')->label('Lease Time'); ?>
            <?= $form->field($model, 'address_pool')->dropDownList($pool, ['options' => [ 'static-only' => ['selected ' => true]]]) ?>
            <?= $form->field($model, 'src_address')->label('Src.Address'); ?>
            <?= $form->field($model, 'delay_threshold')->label('Delay Threshold'); ?>
            <?= $form->field($model, 'authoritative')->dropDownList(['after-2sec-delay' => 'after 2sec delay', 'after-10sec-delay' => 'after 10sec delay', 'yes' => 'yes', 'no' => 'no']); ?>
            <?= $form->field($model, 'bootp_support')->dropDownList(['static' => 'static', 'dynamic' => 'dynamic', 'none' => 'none']); ?>
            <?= $form->field($model, 'lease_script')->textarea()->label('Lease Script'); ?>
            <?= $form->field($model, 'add_arp')->checkBox(); ?>
            <?= $form->field($model, 'always_broadcast')->checkBox(); ?>
            <?= $form->field($model, 'use_radius')->checkBox(); ?>
        <?= Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']) ?>
        <?php //echo Html::a('' . ucfirst($action) . '', [$action, 'id' => $model->ids], ['class' => 'btn btn-primary']);   ?> 
        </div>
<?php ActiveForm::end(); ?> 
    </div>
</div>
</div>