fitness-web/backend/views/product/_search.php
Roland Schneider 09cd4660b8 add csrf , product and account_state changes
csrf - previous settings were not working on dev1
product - allow sale  , if count > stock
prodcut - admin - allow search by name
account_state - auto sum up money from notes

add csrf , product and account_state changes

csrf - previous settings were not working on dev1
product - allow sale  , if count > stock
prodcut - admin - allow search by name
account_state - auto sum up money from notes
2015-11-29 15:04:09 +01:00

65 lines
1.6 KiB
PHP

<?php
use yii\helpers\Html;
use yii\widgets\ActiveForm;
use common\models\Product;
use common\models\ProductCategory;
use yii\helpers\ArrayHelper;
use common\models\Account;
/* @var $this yii\web\View */
/* @var $model backend\models\ProductSearch */
/* @var $form yii\widgets\ActiveForm */
?>
<?php
function mkOptions($options){
$o = $options;
$o[''] = Yii::t('common/product','All' ) ;
return $o;
}
$statusOptions = ['' => "Mind"] + ( Product::statuses() );
$productCategories = ['' => "Mind"] + ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') ;
$accounts = ['' => "Mind"] + ( ArrayHelper::map( Account::read(null) ,'id_account','name'));
?>
<div class="product-search">
<?php $form = ActiveForm::begin([
'action' => ['index'],
'method' => 'get',
]); ?>
<div class="row">
<div class="col-md-4">
<?= $form->field($model, 'id_product_category')->dropDownList($productCategories) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'id_account')->dropDownList($accounts) ?>
</div>
<div class="col-md-4">
<?php echo $form->field($model, 'status')->dropDownList($statusOptions) ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'name') ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'barcode') ?>
</div>
<div class="col-md-4">
<?= $form->field($model, 'product_number') ?>
</div>
</div>
<div class="form-group">
<?= Html::submitButton(Yii::t('common/product', 'Search'), ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
</div>