<?php

use yii\helpers\Html;
use yii\bootstrap4\ActiveForm;

/* @var $this yii\web\View */
/* @var $model frontend\modules\product\models\Product */
/* @var $form yii\bootstrap4\ActiveForm */
/* @var $companies array */
?>

<div class="product-form">

    <?php $form = ActiveForm::begin(); ?>

    <?= $form->field($model, 'title')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'article')->textInput(['maxlength' => true]) ?>

    <?= $form->field($model, 'company_id')->dropDownList($companies, ['id' => 'company_select', 'prompt' => 'Выберите компанию']) ?>

    <div class="form-group" id="category_select_container"></div>

    <?= $form->field($model, 'type')->dropDownList(\common\models\Product::getType()) ?>

    <?= $form->field($model, 'price')->textInput() ?>

    <?= $form->field($model, 'status')->dropDownList(\common\models\Product::getStatus(), ['prompt' => 'Выберите статус']) ?>

    <div class="form-group">
        <?= Html::submitButton('Сохранить', ['class' => 'btn btn-success']) ?>
    </div>

    <?php ActiveForm::end(); ?>

</div>
