<?php

use app\base\Common;
use yii\helpers\Html;
use kartik\grid\GridView;
use rmrevin\yii\fontawesome\FA;

/* @var $this yii\web\View */
/* @var $searchModel app\models\IpcSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', Common::getMenuname());
$this->params['breadcrumbs'][] = $this->title;
$this->params['menu'] = [
	['label' => FA::icon('plus fa-fw'), 'linkOptions' => ['class'=>'btn btn-default', 'title'=>'Create'], 'url' => ['create']],
];
?>
<div class="artbook-index">

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn',
			'contentOptions' => ['style' =>'width:70px;  min-width:70px;'],],

			// 'ipc_id',
			//'ipc_sid',
			//'ipc_loc',
			[
			'attribute' => 'ipc_pid',			
			'contentOptions' => ['style' =>'width:120px;  min-width:120px;'],
			],
			[
				'attribute' => 'ipc_q1',
				'label' => 'Client completes final incentive payout visit',
				'contentOptions' => ['style' =>'width:50px;  min-width:50px;'],
                'value' => function($data) {
                	$data->ipc_q1 = (string)$data->ipc_q1;
                    return (!empty($data->ipc_q1) || $data->ipc_q1 == '0') ? $data->yes_no[$data->ipc_q1] : '-';              
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$searchModel->yes_no, 
	            'filterInputOptions'=>['placeholder'=>''],
			],
			// 'status',
			// 'create_time:datetime',
			// 'create_user',
			// 'update_time:datetime',
			// 'update_user',
			// 'record_date',

            ['class' => 'app\behaviours\ActionColumns'],
        ],
    ]); ?>
</div>
