<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\widgets\DatePicker;
use frontend\components\HtmlHelper;
use common\models\Transfer;
use kartik\widgets\DateTimePicker;

/* @var $this yii\web\View */
/* @var $model common\models\TransferSearch */
/* @var $form yii\widgets\ActiveForm */
?>

<?php 
	$accountOptions =   ['' =>'Mind']+ HtmlHelper::mkAccountOptions(  $model->accounts );
	$userOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions($model->users,'id','username');
	$productOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions($model->productOptions,'id_product','name');
	$productCategoryOptions = ['' => 'Mind'] +  HtmlHelper::mkOptions($model->productCategories,'id_product_category','name');
	$transferStatusOptions = ['' => 'Mind'] + Transfer::statuses();
?>

<div class="transfer-search">

    <?php $form = ActiveForm::begin([
        'action' => ['sale'],
        'method' => 'get',
    ]); ?>

    
     <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'start')->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])  ?>
				
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'end') ->widget(DateTimePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd hh:ii'
				    ]
				])  ?>
		</div>
	</div>
     <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'id_account')->dropDownList($accountOptions)  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
		</div>
	</div>
     <div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'category')->dropDownList($productCategoryOptions)  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'id_product')->dropDownList($productOptions)  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'status')->dropDownList($transferStatusOptions)  ?>
		</div>
	</div>

    <div class="form-group">
        <?= Html::submitButton(Yii::t('frontend/transfer', 'Search'), ['class' => 'btn btn-primary']) ?>
    </div>


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

</div>
