<?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 = 'DHCP Server Lease';
$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-Dhcpserveleases']);
            ?>
            <label class="control-label" for="dhcpserverleases-address">Address</label>
            <input type="text" class="form-control" name="Dhcpserverleases[address]" list="adr"/>
            <datalist id="adr">
                <?php
                foreach ($pool as $value) {
                    echo "<option value=$value>$value</option>";
                }
                ?>
            </datalist>
            <?php //echo $form->field($model, 'address')->dropDownList($pool);  ?>
            <?= $form->field($model, 'mac_address')->label('MAC Address'); ?>
            <?php //echo $form->field($model, 'use_src_mac')->checkBox(); ?>
            <?= $form->field($model, 'client_id')->label('Client ID'); ?>
            <?= $form->field($model, 'lease_time')->label('Lease Time'); ?>
            <?= $form->field($model, 'block_access')->checkBox(); ?>
            <?= $form->field($model, 'always_broadcast')->checkBox(); ?>
            <?= $form->field($model, 'dhcp_option')->dropDownList($items_option, ['safe', 'prompt' => 'Choose...', 'multiple' => 'multiple'])->label('DHCP Options') ?>
            <?php //echo $form->field($model, 'rate_limit')->label('Rate Limit'); ?>
            <?= $form->field($model, 'address_lists')->label('Address List'); ?>
<?= Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']) ?>
        <?php // Html::a('' . ucfirst($action) . '', [$action, 'id' => $model->id], ['class' => 'btn btn-primary']);   ?> 

        </div>
<?php ActiveForm::end(); ?> 
    </div>
</div>
</div>