<?php

use yii\helpers\Html;
use yii\widgets\DetailView;
use yii\grid\GridView;
use yii\base\Widget;

/* @var $this yii\web\View */
/* @var $model common\models\Inventory */

$this->title = $model->id_inventory;
$this->params['breadcrumbs'][] = ['label' => Yii::t('common/inventory', 'Leltár lista'), 'url' => ['index']];
$this->params['breadcrumbs'][] = "Leltár";
?>
<div class="inventory-view">

    <h1><?= Html::encode("Leltár") ?></h1>


    <?= DetailView::widget([
        'model' => $model,
        'attributes' => [
            'id_inventory',
            'name',
            ['attribute'=>'id_user',
            'value'=>$model->userName
    ],
            'created_at:datetime',
        ],
    ]) ?>
    
    

</div>

 <p>
        <?= Html::a(Yii::t('common/inventory', 'Új termék'), ['inventory-item/create','id' =>$model->id_inventory], ['class' => 'btn btn-success']) ?>
 </p>
 
 <?php 
 
 echo GridView::widget( [
 		'dataProvider' => $dataProvider,
 		'columns' =>[
 			[ 
 				'attribute' => 'item_created_at',
 				'label' => 'Létrehozva',
				'format' => 'datetime' 					
 			],
 			[ 
 				'attribute' => 'item_name',
 				'label' => 'Név',
 					
 			],
 			[ 
 				'attribute' => 'user_username',
 				'label' => 'Felhasználó',
 					
 			],
 			[ 
 				'attribute' => 'item_count_prev',
 				'label' => 'Előzö leltár (db)'
 					
 			],
 			[ 
 				'attribute' => 'item_count_in',
 				'label' => 'Beszerzett mennyiség (db)'
 					
 			],
 			[ 
 				'attribute' => 'item_count_sold',
 				'label' => 'Eladott mennyiség (db)',
 					
 			],
 			[ 
 				'attribute' => 'item_count',
 				'label' => 'Leltározott mennyiség (db)',
 					
 			],
 			[ 
 				'attribute' => 'item_difference',
 				'label' => 'Különbség (db)',
 					
 			],
 		]
 		
 ]);
 ?>

