<?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>Participant Current Hivlinkage Status </b>','type' => GridView::TYPE_PRIMARY,'beforeOptions'=>['class'=>'grid_panel_remove'],'afterOptions'=>['class'=>'grid_panel_remove']], 
		'toolbar' => false,	
    	'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
            [
                'attribute' => 'hiv_linkage_part_id',
                'header' => 'Client ID',
                
            ],		
			
			[
                'attribute' => 'hiv_linkage_q2a',
                'header' => 'Not Linked',			
				
				'value'=> function ($model) {
                        if($model->hiv_linkage_q2a==0)
                        {

                            return 'Y';

                        } 
						else
                        {

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

                            return 'Y';

                        } 
						else
                        {

                            return '-';
						}
                       
                      },
				
            ],		

           			
		 [
                'attribute' => 'hiv_linkage_q5',
                'header' => 'On ART',
				
				
				'value'=> function ($model) {
                        if($model->hiv_linkage_q5 !='')
                        {

                            return 'Y';

                        } 
						else
                        {

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