<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use yii\helpers\ArrayHelper;
use kartik\widgets\DatePicker;

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

<?php 
$ticketTypeOptions =  ['' => 'Mind'] +	  ArrayHelper::map($model->ticketTypes, 'id_ticket_type', 'name');
$accountOptions =  ['' => 'Mind'] +	  ArrayHelper::map($model->accounts, 'id_account', 'name');
$userOptions =  ['' => 'Mind'] +	  ArrayHelper::map($model->users, 'id', 'username');

?>

<div class="ticket-search">

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


	<div class='row'>
		<div class='col-md-4'>
		    <?= $form->field($model, 'id_user')->dropDownList($userOptions) ?>
		</div>
		<div class='col-md-4'>
		    <?= $form->field($model, 'id_ticket_type')->dropDownList($ticketTypeOptions) ?>
		</div>
		<div class='col-md-4'>
		    <?= $form->field($model, 'id_account')->dropDownList($accountOptions) ?>
		</div>
	</div>
	
	<div class="row">
		<div class="col-md-4">
		    <?= $form->field($model, 'start')->widget(DatePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd'
				    ]
				])  ?>
		</div>
		<div class="col-md-4">
		    <?= $form->field($model, 'end') ->widget(DatePicker::classname(), [
    			 'pluginOptions' => [
				        'autoclose'=>true,
				        'format' => 'yyyy.mm.dd'
				    ]
				])  ?>
		</div>
	</div>
	<div class='row'>
		<div class='col-md-4'>
	 		<?php  echo $form->field($model, 'valid_in_interval')->checkbox(  )  ?>
		</div>
		<div class='col-md-4'>
	 		<?php  echo $form->field($model, 'created_in_interval')->checkbox(  )  ?>
		</div>
		<div class='col-md-4'>
	 		<?php  echo $form->field($model, 'expire_in_interval')->checkbox(  )  ?>
		</div>
	</div>

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

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

</div>
