<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use rmrevin\yii\fontawesome\FA;
use yii\widgets\Pjax;
use app\base\Common;
use app\models\Appointment;

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

//$this->title = Yii::t('app', 'Appointments');

$AModel=new Appointment();

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

    <h1><?= Html::encode($this->title) ?></h1>
    <?php // echo $this->render('_search', ['model' => $searchModel]); ?>
  <?= GridView::widget([
        'dataProvider' => $dataProvider,
         'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],
			'beneficiary_name',			
			'mobile_number',
			[
				'attribute' => 'dose',
				'label' => 'Dose', 
				//'contentOptions' => ['style' =>'width:150px;  min-width:200px;'],
                'value' => function($data) {
                    return $data->getDose();
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$AModel->dosedum, 
	            'filterInputOptions'=>['placeholder'=>''],
				
			],
			 			
			[
					'attribute' => 'vaccination_appointment_date',
				    'label' => 'Appointment Date',
					'format' => 'date',
				//	'contentOptions' => ['style' =>'width:250px;  min-width:250px;'],
					'filterType'=>GridView::FILTER_DATE,
		            'filterWidgetOptions' => ['pluginOptions' => ['autoclose' => true, 'startDate' => '01-01-1900', 'endDate' => '0', 'format' => strtolower(Yii::$app->formatter->dateFormat), 'orientation' => 'bottom']],
					
			],
			[
				'attribute' => 'appointment_status',
				'label' => 'Appointment Status', 
				//'contentOptions' => ['style' =>'width:200px;  min-width:200px;'],
                'value' => function($data) {
                    return $data->getApstatus();
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$AModel->ap_status, 
	            'filterInputOptions'=>['placeholder'=>''],
				
			],	
			
			[
					'attribute' => 'record_date',
				    'label' => 'Record Date',
					'format' => 'date',
				//	'contentOptions' => ['style' =>'width:250px;  min-width:250px;'],
					'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>
