fitness-web/backend/views/card/_search.php

61 lines
1.1 KiB
PHP

<?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>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/card', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>