<?php

use yii\helpers\Url;
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\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>Enrolled 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>Enrolled Participant List</b>','type' => GridView::TYPE_PRIMARY,'beforeOptions'=>['class'=>'grid_panel_remove'],'afterOptions'=>['class'=>'grid_panel_remove']], 
		'toolbar' => false,	
    	'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            [
                'attribute' => 'mem_scrn_part_id',
                'header' => 'Client ID',
                
            ],
			[
				'attribute' => 'regdate',
				'header' => 'Registration Date',
				'format' => 'date',
				
			],  
			[
				'attribute' => 'record_date',
				'header' => 'Screened Date',
				'format' => 'date',
			], 
			
			[
                'attribute' => 'mem_scrn_q24',
                'header' => 'Not Linked',			
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q25==1 && ($model->mem_scrn_q16 =='' || $model->mem_scrn_q16 == null) && ($model->mem_scrn_q19 =='' || $model->mem_scrn_q19 == null))
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		
			
			[
                'attribute' => 'mem_scrn_q24',
                'header' => 'Only On Pre-ART',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q25==1 && $model->mem_scrn_q16 !='' && ($model->mem_scrn_q19 =='' || $model->mem_scrn_q19 == null))
                        {

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		

           			
		 [
                'attribute' => 'mem_scrn_q25',
                'header' => 'On ART',
				
				
				'value'=> function ($model) {
                        if($model->mem_scrn_q25=1 && $model->mem_scrn_q19 !='')
                        {

                            return 'Y';

                        } 
						else
                        {

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