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

@@ -6,8 +6,8 @@ use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model common\models\Product */
$this->title = $model->id_product;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/ticket_type', 'Products'), 'url' => ['index']];
$this->title = $model->name ;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/product', 'Products'), 'url' => ['index']];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-view">
@@ -15,31 +15,27 @@ $this->params['breadcrumbs'][] = $this->title;
<h1><?= Html::encode($this->title) ?></h1>
<p>
<?= Html::a(Yii::t('common/ticket_type', 'Update'), ['update', 'id' => $model->id_product], ['class' => 'btn btn-primary']) ?>
<?= Html::a(Yii::t('common/ticket_type', 'Delete'), ['delete', 'id' => $model->id_product], [
'class' => 'btn btn-danger',
'data' => [
'confirm' => Yii::t('common/ticket_type', 'Are you sure you want to delete this item?'),
'method' => 'post',
],
]) ?>
<?= Html::a(Yii::t('common/product', 'Update'), ['update', 'id' => $model->id_product], ['class' => 'btn btn-primary']) ?>
</p>
<?= DetailView::widget([
'model' => $model,
'attributes' => [
'id_product',
'id_product_type',
'id_account',
'productCategoryName',
'accountName',
'product_number',
'barcode',
'purchase_price',
'sale_price',
'profit_margins',
'status',
'description',
'created_at',
'updated_at',
'statusHuman',
[
'attribute' => 'description',
'value' => nl2br($model->description),
'format' => 'raw'
],
'created_at:datetime',
'updated_at:datetime',
],
]) ?>