<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Card;

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

function mkOptions($options){

	$all = ['' => Yii::t('common/product','All' ) ];

	$o =  $all + $options;

	return $o;
}


$typeOptions = mkOptions(Card::types());
$statusOptions = mkOptions(Card::statuses());


?>
<div class="card-search">

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


	<div class='row'>
		<div class='col-md-3'>
		    <?= $form->field($model, 'number') ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'status')->dropDownList($statusOptions) ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'type')->dropDownList($typeOptions) ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'searchCustomerName')->textInput() ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'rfid_key')->textInput() ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'searchKeyNumber')->textInput()->label("Kulcs") ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'usage')->dropDownList(['' => 'Mind' , '1' => 'Használt', '2' => 'Üres'  ])->label("Használat") ?>
		</div>
		<div class='col-md-3'>
		    <?= $form->field($model, 'key_assigned')->dropDownList(['' => 'Mind' , '1' => 'Kulcs hozzárendelve', '2' => 'Kulcs nélkül'  ])->label("Kulcs hozzárendelés") ?>
		</div>
	</div>	
	



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

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

</div>
