<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;
use kartik\grid\GridView;

$this->title = 'Screening Compare Report';
$this->params['breadcrumbs'][] = $this->title;

         if($model->reptype==1 || $model->reptype==3 ){				
				$createtimeheader="HIV Linkage <br> Create Time";
				$updatetimeheader="HIV Linkage <br> Update Time";
				$recorddateheader="HIV Linkage <br> Record Date";
			}
		elseif($model->reptype==2 || $model->reptype==4 ){				
		        $createtimeheader="HIV Visit <br> Create Time";
				$updatetimeheader="HIV Visit <br> Update Time";
				$recorddateheader="HIV Visit <br> Record Date";
			}
	   elseif($model->reptype==5 ){				
		        $createtimeheader="ART Book <br> Create Time";
				$updatetimeheader="ART Book <br> Update Time";
				$recorddateheader="ART Book <br> Record Date";
			}
		else {				
		        $createtimeheader="Attendance <br> Create Time";
				$updatetimeheader="Attendance<br> Update Time";
				$recorddateheader="Attendance <br> Visit Date";
			}
				
		 	
?>


<div class="attandance-form">
    <h1><?= Html::encode($this->title) ?></h1>
    <div class="panel panel-default">
        <div class="panel-heading">
            
        </div>
        <div class="panel-body">
            <div class="row">
                <div class="col-lg-12">
                    <?php
                        $form = ActiveForm::begin(['enableAjaxValidation' => false, 'action' => ['index'], 'method' => 'get', 'options' => ['class' => 'form-horizontal']]);
                        $template = [
                            'labelOptions' => ['class' => 'form-label'],
                            'template' => '<div class="col-sm-5">{label}{hint}</div><div class="col-sm-4">{input}{error}</div>',
                        ];
                        
                    ?>
                    <?= $form->field($model, 'reptype', $template)->dropDownList($model->type2, ['prompt' => $model->getAttributeLabel("reptype")]) ?>
                 
                    <div class="form-group">
                        <div class="col-sm-offset-5 col-sm-7">
                            <?= Html::submitButton(Yii::t('app', 'Go'), ['class' =>'btn btn-success']) ?>
                           
                        </div>
                    </div>
					<div class="row">					
     
    </div>
                    <?php ActiveForm::end(); ?>
					<?php if(isset($dataProvider)) : ?>
                        <?= GridView::widget([
                            'dataProvider' => $dataProvider,
                            'layout' => '<div class="box"><div class="box-header with-border"><b>/b></div><div class="box-body">{items}</div><div class="box-footer clearfix"></div></div>',    
                            'formatter' => ['class' => 'yii\i18n\Formatter','nullDisplay' => '-', 'dateFormat' => 'dd-MM-Y','datetimeFormat' => 'dd-MM-Y H:mm:ss'], 						
                            'options'=>['style' => 'white-space:nowrap;'],                         
                            'panel' => ['type' => GridView::TYPE_PRIMARY,'heading' => "<b>$title</b>",'footer'=>false],
							//'summary' => '',
                                 'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
			 
			 [
				'attribute' => 'pid',
				'header' => 'Client ID',				
			],
			[
				'attribute' => 'Scr.create_time',	 
	            'format'=>'datetime',
				'header' => 'Screening <br> Create Time',				
			],
			
			[
				'attribute' =>  'Scr.update_time',
	             'format'=>'datetime',
				'header' => 'Screening <br> Update Time',				
			],
			
			[
				'attribute' => 'Scr.record_date',	
                'format'=>'date',
				'header' => 'Screening <br> Record Date',				
			],
			[
				'attribute' => 'Hiv.create_time',			 
			    'format'=>'datetime',
				'header' => $createtimeheader,				
			],
			[
				'attribute' => 'Hiv.update_time',			 
			    'format'=>'datetime',
				'header' => $updatetimeheader,				
			],
			[
				'attribute' =>  'Hiv.record_date',
				'format'=>'date',
				'header' => $recorddateheader,				
			],
			 
		            
        ],                          
                        ]); ?>
                    <?php endif; ?>
                </div>
                <!-- /.col-lg-6 (nested) -->
            </div>
            <!-- /.row (nested) -->
        </div>
        <!-- /.panel-body -->
    </div>
    <!-- /.panel -->
</div>