<?php

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

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Template ID');
$this->params['breadcrumbs'][] = $this->title;
?>

<div class="panel panel-primary">
    <div class="panel-heading"><span class="glyphicon glyphicon-asterisk"></span><strong> <?= Html::encode($this->title) ?></strong></div>
    <div class="panel-body">

        <div class="auclots-index">

            <ul class="nav nav-tabs">
                <li role="presentation" class="active">
                    <?= Html::a(\Yii::t('app', 'Template ID'), ['auclots/index'], ['class' => 'presentation active']) ?>
                </li><li role="presentation">
                    <?= Html::a(\Yii::t('app', 'Lots ID'), ['/lots/index'], ['class' => 'presentation active']) ?>
                </li>
            </ul>
        <br>
            <p>
                <?= Html::a(Yii::t('app', 'Create ID'), ['create'], ['class' => 'btn btn-success']) ?>
            </p>

            <?= $this->render('_alert.php') ?>

            <?= GridView::widget([
                'dataProvider' => $dataProvider,
                'columns' => [
                    ['class' => 'yii\grid\SerialColumn'],

                    //'id',
                    'name',
                    'bidding_date',
                    'auction_date',
                    //'address',
                    //'payment_term',
                    // 'payment_order',
                    // 'member_require',
                    // 'term_procedure',
                    // 'requisites_id',

                    ['class' => 'yii\grid\ActionColumn',
                        'template' => '{view} {lots} {update} {delete}',
                        'buttons' => [
                            'lots' => function ($url,$model,$key) {
                                $new_url = '/lots/index?LotSearch[aukname]='.$model->name;
                                return Html::a('', $new_url,['title'=>Yii::t('app','ToLots ID'),'class' => 'glyphicon glyphicon-menu-hamburger']);
                            },
                        ],
                    ],
                ],
            ]); ?>

        </div>
    </div>
</div>
