<?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 = 'Queue';
$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-proxy']); ?>

            <?= $form->field($model, 'name')->label('Name'); ?>
            <?php
            $parent['global'] = 'global';
            foreach ($trees as $value) {
                $parent[$value] = $value;
            }
            ?>
            <?= $form->field($model, 'parent')->dropDownList($parent); ?>
            <?= $form->field($model, 'packet_mark')->label('Packet Mark'); ?>
            <?= $form->field($model, 'queue')->dropDownList($type)->label('Queue Type'); ?>
            <?= $form->field($model, 'priority')->label('Priority'); ?>
            <?= $form->field($model, 'bucket_size')->label('Bucket Size'); ?>
            <?= $form->field($model, 'limit_at')->label('Limit At'); ?>
            <?= $form->field($model, 'max_limit')->label('Max Limit'); ?>
            <?= $form->field($model, 'burst_limit')->label('Burst Limit'); ?>
            <?= $form->field($model, 'burst_threshold')->label('Burst Threshold'); ?>
            <?= $form->field($model, 'burst_time')->label('Burst Time'); ?>
            <?php
            if ($action == 'update') {
                if ($model->disabled == 'true') {
                    $action_e = 'enable';
                } else {
                    $action_e = 'disable';
                }
                echo Html::submitButton('Update', ['class' => 'btn btn-primary', 'name' => 'create-button']);
                echo' ';
                echo Html::a('<spanclass="btn-label">' . ucfirst($action_e) . '</span>', [$action_e, 'id' => $model->id], ['class' => 'btn btn-primary']);
            } else {
                echo Html::submitButton('Create', ['class' => 'btn btn-primary', 'name' => 'create-button']);
            }
            ?></div>
        <?php ActiveForm::end();
        ?> 
    </div>
</div>
</div>



