Esempio n. 1
0
<?php

use yii\helpers\Html;
use yii\helpers\ArrayHelper;
// use yii\grid\GridView;
use kartik\grid\GridView;
use yii\widgets\Pjax;
use app\models\PetrolVecfil013;
/* @var $this yii\web\View */
/* @var $searchModel app\models\Petrol_Vecfil012Search */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = 'Карты в системе Petrol+';
$gridColumns = [['class' => 'kartik\\grid\\SerialColumn', 'contentOptions' => ['class' => 'kartik-sheet-style'], 'header' => '', 'headerOptions' => ['class' => 'kartik-sheet-style']], ['attribute' => 'CARD_NUMBER', 'vAlign' => 'middle', 'hAlign' => 'left'], ['attribute' => 'HOLDER_CARD', 'vAlign' => 'middle', 'hAlign' => 'left'], ['value' => 'DESCRIPTION_CONDITION', 'attribute' => 'ID_CONDITION', 'filterType' => GridView::FILTER_SELECT2, 'filter' => ArrayHelper::map(PetrolVecfil013::find()->all(), 'ID', 'DESCRIPTION'), 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true]], 'filterInputOptions' => ['placeholder' => 'Состояние']], ['class' => 'kartik\\grid\\ActionColumn', 'template' => '{view}{info}']];
?>
<div class="petrol-vecfil012-index">


        <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => $gridColumns, 'responsive' => true, 'headerRowOptions' => ['class' => 'kartik-sheet-style'], 'filterRowOptions' => ['class' => 'kartik-sheet-style'], 'pjax' => true, 'panel' => ['heading' => '<h3 class="panel-title"><i class="glyphicon glyphicon-folder-open"></i>' . '&nbsp;&nbsp' . Html::encode($this->title) . '</h3>', 'type' => 'primary'], 'toolbar' => ['{export}', '{toggleData}']]);
?>

</div>
Esempio n. 2
0
 public function getcondition()
 {
     return $this->hasMany(PetrolVecfil013::className(), ['ID' => 'ID_CONDITION']);
 }