<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use rmrevin\yii\fontawesome\FA;
use yii\widgets\Pjax;
/* @var $this yii\web\View */
/* @var $searchModel app\models\ScreeningSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = Yii::t('app', 'Screenings');
$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="screening-index">

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

			// 'mem_scrn_id',
			//'mem_scrn_survey',			
			// 'mem_scrn_q1',
			// 'mem_scrn_q2',
			// 'mem_scrn_q3',
			// 'mem_scrn_q4',
			// 'mem_scrn_q5',
			// 'mem_scrn_q6',
			// 'mem_scrn_q7',
			// 'mem_scrn_q8',
			// 'mem_scrn_q9',
			// 'mem_scrn_q10',
			// 'mem_scrn_q11',
			// 'mem_scrn_q12',
			// 'mem_scrn_q13',
			// 'mem_scrn_q14',
			// 'mem_scrn_q15',
			// 'mem_scrn_q16',
			// 'mem_scrn_q17',
			// 'mem_scrn_q18',
			// 'mem_scrn_q19',
			// 'mem_scrn_q20',
			// 'mem_scrn_q21',
			// 'mem_scrn_q22',
			// 'mem_scrn_q23',
			// 'mem_scrn_q24',
			[
				'attribute' => 'mem_scrn_part_id',	
				'contentOptions' => ['style' =>'width:150px;  min-width:150px;'],               
              
			],
			[
				'attribute' => 'mem_scrn_q24',
				'label' => 'Eligible Status',
				'contentOptions' => ['style' =>'width:150px;  min-width:150px;'],
                'value' => function($data) {
                	$data->mem_scrn_q24 = (string)$data->mem_scrn_q24;
                    return (!empty($data->mem_scrn_q24) || $data->mem_scrn_q24 == '0') ? $data->q24[$data->mem_scrn_q24] : '-';              
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$searchModel->q24, 
	            'filterInputOptions'=>['placeholder'=>''],
			],
			
			[
				'attribute' => 'mem_scrn_q25',
				'label' => 'Enrollment Status',
				'contentOptions' => ['style' =>'width:150px;  min-width:150px;'],
                'value' => function($data) {
                	$data->mem_scrn_q25 = (string)$data->mem_scrn_q25;
                    return (!empty($data->mem_scrn_q25) || $data->mem_scrn_q25 == '0') ? $data->q25[$data->mem_scrn_q25] : '-';              
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$searchModel->q25, 
	            'filterInputOptions'=>['placeholder'=>''],
			],
			// 'mem_scrn_q26',
			// 'mem_scrn_q27',
					
			[
				'attribute' => 'mem_scrn_q26',
				'label' => 'Rescreening Status',
				'contentOptions' => ['style' =>'width:150px;  min-width:150px;'],
                'value' => function($data) {
                	$data->mem_scrn_q26 = (string)$data->mem_scrn_q26;
                    return (!empty($data->mem_scrn_q26) || $data->mem_scrn_q26 == '0') ? $data->q26[$data->mem_scrn_q26] : '-';              
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$searchModel->q26, 
	            'filterInputOptions'=>['placeholder'=>''],
			],
			
			[
				'attribute' => 'mem_scrn_q27',
				'label' => 'Incentives Status',
				'contentOptions' => ['style' =>'width:150px;  min-width:150px;'],
                'value' => function($data) {
                	$data->mem_scrn_q27 = (string)$data->mem_scrn_q27;
                    return (!empty($data->mem_scrn_q27) || $data->mem_scrn_q27 == '0') ? $data->q27[$data->mem_scrn_q27] : '-';              
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$searchModel->q27, 
	            'filterInputOptions'=>['placeholder'=>''],
			],
			
			// 'status',
			// 'create_time:datetime',
			// 'create_user',
			// 'update_time:datetime',
			// 'update_user',
			[
					'attribute' => 'record_date',
					'format' => 'date',
					'contentOptions' => ['style' =>'width:220px;  min-width:100px;'],
					// 'contentOptions' => ['class' => 'col-md-1'],
		            'filterType'=>GridView::FILTER_DATE,
		            'filterWidgetOptions' => ['pluginOptions' => ['autoclose' => true, 'startDate' => '01-01-1900', 'endDate' => '0', 'format' => strtolower(Yii::$app->formatter->dateFormat), 'orientation' => 'bottom']],
				],

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