<?php

use yii\helpers\Html;
use yii\widgets\Menu;
use yii\widgets\ActiveForm;

$this->title = 'DNS Settings';
$this->params['breadcrumbs'] = [
    'Mikrotik',
    'IP',
    $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-Dns']); ?>
            <?= $form->field($model, 'servers'); ?>
            <label class="control-label" for="dns-dybamicservers">Dynamic servers</label></br>
            <?php
            foreach ($model->dynamic_servers as $value) {
                echo '<input type="text" name="dynamic_servers" class="form-control" readonly="true" value=' . $value . "></br>";
            }
            ?>
            <?= $form->field($model, 'allow_remote_requests')->checkBox(); ?>
            <?= $form->field($model, 'max_udp_packet_size')->label('Max UDP Packet Size'); ?>
            <?= $form->field($model, 'query_server_timeout')->label('Query server Timeout'); ?>
            <?= $form->field($model, 'query_total_timeout')->label('Query total Timeout'); ?>
            <?= $form->field($model, 'cache_size')->label('Cache Size'); ?>
            <?= $form->field($model, 'cache_max_ttl')->label('Cache Max TTL'); ?>
            <?= $form->field($model, 'cache_used')->label('Cache Used')->textInput(['readonly' => true]); ?>
            <?= Html::submitButton('OK', ['class' => 'btn btn-primary', 'name' => 'create-button']) ?>
            <?php echo Html::a('<span class="btn-label">Static</span>', ['mikrotik/ip/dns/dnsstatic/index'], ['class' => 'btn btn-primary'])  ?>
            <?php echo Html::a('<span class="btn-label">Cache</span>', ['mikrotik/ip/dns/dnscache/index'], ['class' => 'btn btn-primary'])  ?>
        </div>
        <?php ActiveForm::end(); ?> 
    </div>
</div>
</div>