<?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 Network';
$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, 'address')->label('Addresses'); ?>
                <?= $form->field($model, 'gateway')->label('Gateway'); ?>
                <?= $form->field($model, 'netmask')->label('Netmask'); ?>
                <?= $form->field($model, 'dns_server')->label('DNS Server'); ?>
                <?= $form->field($model, 'domain'); ?>
                <?= $form->field($model, 'wins_server')->label('WINS Server'); ?>
                <?= $form->field($model, 'ntp_server')->label('NTP Server'); ?>
                <?= $form->field($model, 'caps_manager')->label('CAPS Managers'); ?>
                <?= $form->field($model, 'next_server')->label('Next Server'); ?>
                <?= $form->field($model, 'boot_file_name')->label('Boot File Name'); ?>
                <?= $form->field($model, 'dhcp_option')->dropDownList($items, ['prompt' => 'Choose...', 'multiple' => 'multiple']) ?>
                <?php
                if (isset($action) and ( $action == 'update')) {
                    echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'update-button']);
                } else {
                    echo 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>