<?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 = 'SNTP Client';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'System',
    $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-ac']);
                ?>

            <?= $form->field($model, 'enabled')->checkBox(); ?>
            <?= $form->field($model, 'primary_ntp')->label('Primary NTP'); ?>
            <?= $form->field($model, 'secondary_ntp')->label('Secondary NTP'); ?>
            <?= $form->field($model, 'server_dns_names')->label('Server DNS Names'); ?>
            <?= $form->field($model, 'mode')->label('Mode')->textInput(['readonly' => true]); ?>
            <?= $form->field($model, 'poll_interval')->textInput(['readonly' => true]); ?>
            <?= $form->field($model, 'active_server')->textInput(['readonly' => true]); ?>
            <?= $form->field($model, 'last_bad_packet_from')->textInput(['readonly' => true]); ?>
            <?= $form->field($model, 'last_bad_packet_before')->textInput(['readonly' => true]); ?>
            <?= $form->field($model, 'last_bad_packet_reason')->textInput(['readonly' => true]); ?>
            <?php
            echo Html::submitButton('OK', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            ?>
        </div>
        <?php ActiveForm::end();
        ?> 
    </div>
</div>
</div>
