add product

This commit is contained in:
2015-09-24 22:14:09 +02:00
parent fcc18d79f6
commit a2b835225a
15 changed files with 229 additions and 80 deletions

View File

@@ -11,13 +11,18 @@ use yii\helpers\ArrayHelper;
?>
<?php
$account_options = ArrayHelper::map($accounts, 'id_account', 'name');
$product_category_options = ArrayHelper::map($categories, 'id_product_category', 'name');
?>
<div class="product-form">
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'name')->textInput(['maxlength' => true]) ?>
<?= $form->field($model, 'id_account')->dropDownList($account_options) ?>
<?= $form->field($model, 'id_product_category')->dropDownList($product_category_options) ?>
<?= $form->field($model, 'product_number')->textInput(['maxlength' => true]) ?>
@@ -31,10 +36,10 @@ $account_options = ArrayHelper::map($accounts, 'id_account', 'name');
<?= $form->field($model, 'status')->checkbox( ['value' => 10, 'label' => Yii::t('common/product', "Active") ]) ?>
<?= $form->field($model, 'description')->textarea(['maxlength' => true])->hint( Yii::t( 'common/prodcut', "Max 255 character")) ?>
<?= $form->field($model, 'description')->textarea(['maxlength' => true])->hint( Yii::t( 'common/product', "Max 255 character")) ?>
<div class="form-group">
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/ticket_type', 'Create') : Yii::t('common/ticket_type', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
<?= Html::submitButton($model->isNewRecord ? Yii::t('common/product', 'Create') : Yii::t('common/product', 'Update'), ['class' => $model->isNewRecord ? 'btn btn-success' : 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>