<?php

use yii\helpers\Html;
use yii\grid\GridView;
use yii\helpers\Url;

/* @var $this yii\web\View */
/* @var $searchModel backend\models\ProductSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('common/product', 'Products');
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="product-index">

    <h1><?php echo "Termék eladás statisztika" ?></h1>
    <?php  echo $this->render('_search_statistics', ['model' => $searchModel]); ?>

	<?php 
		$params = [];
		$params[ Html::getInputName($searchModel, 'output')] = "xls";
		echo  Html::a("XLS", Url::current($params), ['class' => 'btn btn-primary'] );
	
	?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'columns' => [
              [
    			'attribute' =>	'product_name',
    			'label' =>	'Terméknév',
			],
              [
    			'attribute' =>	'product_number',
    			'label' =>	'Termékszám',
			],
              [
    			'attribute' =>	'product_barcode',
    			'label' =>	'Vonalkód',
			],
              [
    			'attribute' =>	'father_account_name',
    			'label' =>	'Termék kassza',
			],
//               [
//     			'attribute' =>	'account_name',
//     			'label' =>	'Fizetési kassza',
// 			],
              [
    			'attribute' =>	'product_sale_price',
    			'label' =>	'Eladási ár',
			 ],
              [
    			'attribute' =>	'transfer_count',
    			'label' =>	'Eladott mennyiség',
			 ],
              [
    			'attribute' =>	'transfer_money',
    			'label' =>	'Eladás összege',
			 ],
             
        ],
    ]); ?>

</div>
