<?php

use yii\helpers\Url;
use yii\helpers\Html;
use kartik\grid\GridView;
use rmrevin\yii\fontawesome\FA;
use yii\widgets\Pjax;
use yii\db\Query;

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

?>
<div class="attandance-index">

   <?= GridView::widget([
        'dataProvider' => $dataProvider,
		 'formatter' => ['class' => 'yii\i18n\Formatter','nullDisplay' => '-', 'dateFormat' => 'dd-MM-Y'],
        'layout' => '<div class="box"><div class="box-header with-border"><b>Screening Participant List</b>{summary}</div><div class="box-body">{items}</div><div class="box-footer clearfix">{pager}</div></div>',
		'options'=>['style' => 'white-space:nowrap;'],                         
        'panel' => ['heading' => '<b>Screening Participant List</b>','type' => GridView::TYPE_PRIMARY,'beforeOptions'=>['class'=>'grid_panel_remove'],'afterOptions'=>['class'=>'grid_panel_remove']], 
		'toolbar' => false,	
		'summary'=>'',
		'rowOptions' => function ($model) {
         return ($model->getDuplicateScrIDs($model->mem_scrn_part_id)==$model->create_time ? ['class' => 'hiddenclass'] : '' );	
       },
    	// 'filterModel' => $searchModel,
        // 'showOnEmpty' => true,
        // 'emptyCell' => '-',
        'columns' => [
           // ['class' => 'yii\grid\SerialColumn'],
            [
                'attribute' => 'mem_scrn_part_id',
                'header' => 'Client ID',
                
            ],
			[
				'attribute' => 'regdate',
				'header' => 'Registration Date',
				'format' => 'date',
				
			],  
			[
				'attribute' => 'create_time',
				//'contentOptions' => ['style' =>'display:none;'],
				'header' => 'Screened date ',
				'format' => 'date',
			], 
			
			/*[
				'attribute' => 'record_date',
				'header' => 'Screened Date',
				'format' => 'date',
			], 
           */       
            
            [
                'attribute' => 'mem_scrn_q24',
                'header' => 'Eligible',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q24 == 1)
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
[
                'attribute' => 'mem_scrn_q24',
                'header' => 'Not Eligible',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q24 == 2)
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
           			
		 [
                'attribute' => 'mem_scrn_q25',
                'header' => 'Consented and Enrolled',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q25 == 1)
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
[
                'attribute' => 'mem_scrn_q25',
                'header' => 'Not Enrolled',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q25 == 2)
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
			
			[
                'attribute' => 'mem_scrn_q28',
                'header' => 'Eligible for Incentive',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q28 == 1)
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
        ],
    ]); ?>
</div>