add product
This commit is contained in:
@@ -2,12 +2,30 @@
|
||||
|
||||
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 = mkOptions( Product::statuses() );
|
||||
|
||||
$productCategories = mkOptions( ArrayHelper::map( ProductCategory::read(null) ,'id_product_category','name') );
|
||||
|
||||
$accounts = mkOptions( ArrayHelper::map( Account::readAccounts(null) ,'id_account','name'));
|
||||
|
||||
?>
|
||||
<div class="product-search">
|
||||
|
||||
<?php $form = ActiveForm::begin([
|
||||
@@ -15,33 +33,29 @@ use yii\widgets\ActiveForm;
|
||||
'method' => 'get',
|
||||
]); ?>
|
||||
|
||||
<?= $form->field($model, 'id_product') ?>
|
||||
|
||||
<?= $form->field($model, 'id_product_type') ?>
|
||||
|
||||
<?= $form->field($model, 'id_account') ?>
|
||||
|
||||
<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, 'product_number') ?>
|
||||
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<?= $form->field($model, 'barcode') ?>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php // echo $form->field($model, 'purchase_price') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'sale_price') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'profit_margins') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'status') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'description') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'created_at') ?>
|
||||
|
||||
<?php // echo $form->field($model, 'updated_at') ?>
|
||||
|
||||
<div class="form-group">
|
||||
<?= Html::submitButton(Yii::t('common/ticket_type', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
<?= Html::resetButton(Yii::t('common/ticket_type', 'Reset'), ['class' => 'btn btn-default']) ?>
|
||||
<?= Html::submitButton(Yii::t('common/product', 'Search'), ['class' => 'btn btn-primary']) ?>
|
||||
</div>
|
||||
|
||||
<?php ActiveForm::end(); ?>
|
||||
|
||||
Reference in New Issue
Block a user