<?php
/**
 * @var Tgbot $model
 */

use app\modules\tgbot\models\Tgbot;

$form = new \itguild\forms\ActiveForm();
$form->beginForm(isset($model) ? "/admin/tg-bot/edit/" . $model->id : "/admin/tg-bot");

$form->field(class: \itguild\forms\inputs\TextInput::class, name: "bot_id", params: [
    'class' => "form-control",
    'placeholder' => 'Bot ID',
    'value' => $model->bot_id ?? ''
])
    ->setLabel("Bot ID")
    ->render();

$form->field(class: \itguild\forms\inputs\TextInput::class, name: "dialog_id", params: [
    'class' => "form-control",
    'placeholder' => 'Dialog ID',
    'value' => $model->dialog_id ?? ''
])
    ->setLabel("Dialog ID")
    ->render();

$form->field(class: \itguild\forms\inputs\TextInput::class, name: "username", params: [
    'class' => "form-control",
    'placeholder' => 'Username',
    'value' => $model->username ?? ''
])
    ->setLabel("Username")
    ->render();

$form->field(class: \itguild\forms\inputs\TextInput::class, name: "first_name", params: [
    'class' => "form-control",
    'placeholder' => 'First name',
    'value' => $model->first_name ?? ''
])
    ->setLabel("First name")
    ->render();

$form->field(class: \itguild\forms\inputs\TextInput::class, name: "last_name", params: [
    'class' => "form-control",
    'placeholder' => 'Last name',
    'value' => $model->last_name ?? ''
])
    ->setLabel("Last name")
    ->render();


$form->field(\itguild\forms\inputs\Select::class, 'status', [
    'class' => "form-control",
    'value' => $model->status ?? ''
])
    ->setLabel("Статус")
    ->setOptions(Tgbot::getStatus())
    ->render();
?>
    <div class="row">
        <div class="col-sm-2">
        <?php
        $form->field(\itguild\forms\inputs\Button::class, name: "btn-submit", params: [
            'class' => "btn btn-primary ",
            'value' => 'Отправить',
            'typeInput' => 'submit'
        ])
            ->render();
        ?>
        </div>
        <div class="col-sm-2">
        <?php
        $form->field(\itguild\forms\inputs\Button::class, name: "btn-reset", params: [
            'class' => "btn btn-warning",
            'value' => 'Сбросить',
            'typeInput' => 'reset'
        ])
            ->render();
        ?>
        </div>
    </div>
<?php
$form->endForm();
