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

@@ -7,23 +7,26 @@ use yii\grid\GridView;
/* @var $searchModel backend\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = Yii::t('common/ticket_type', 'Products');
$this->title = Yii::t('common/product', 'Products');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-index">
<h1><?= Html::encode($this->title) ?></h1>
<?php // echo $this->render('_search', ['model' => $searchModel]); ?>
<?php echo $this->render('_search', ['model' => $searchModel]); ?>
<p>
<?= Html::a(Yii::t('common/ticket_type', 'Create Product'), ['create'], ['class' => 'btn btn-success']) ?>
<?= Html::a(Yii::t('common/product', 'Create Product'), ['create'], ['class' => 'btn btn-success']) ?>
</p>
<?= GridView::widget([
'dataProvider' => $dataProvider,
'columns' => [
[
'attribute' => 'id_product_type',
'attribute' => 'name',
],
[
'attribute' => 'id_product_category',
'value' => 'productCategoryName',
],
[
@@ -32,15 +35,16 @@ $this->params['breadcrumbs'][] = $this->title;
],
'product_number',
'barcode',
'purchase_price',
'sale_price',
'profit_margins',
'status',
'description',
'created_at:datetime',
'updated_at:datetime',
[
'attribute' => 'status',
'value' => 'statusHuman',
],
['class' => 'yii\grid\ActionColumn'],
['class' => 'yii\grid\ActionColumn',
'template' => '{view} {update}'
],
],
]); ?>