<?php

use yii\helpers\Html;
use kartik\grid\GridView;
use rmrevin\yii\fontawesome\FA;
use yii\helpers\ArrayHelper;
use app\models\District;
use app\models\Artcentre;

$SModel=new Artcentre();

/* @var $this yii\web\View */
/* @var $dataProvider yii\data\ActiveDataProvider */

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

    <h1><?= Html::encode($this->title) ?></h1>
    <?= GridView::widget([
        'dataProvider' => $dataProvider,
		'filterModel' => $searchModel,
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],           
                   
		   [
				'attribute' => 'district',
				'label' => 'District',			
                'value' => function($data) {
                    return $data->getDistrictmaster($data->district);
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>ArrayHelper::map(District::find()->where(['status' =>1])->orderBy('district')->asArray()->all(), 'district', 'district'), 
	            'filterInputOptions'=>['placeholder'=>''],	
                'contentOptions' => ['style' =>'width:200px;  min-width:150px;'],					
		   ],
		   
		   'artcname',
			
			[
			'attribute' => 'artccode',
			 'contentOptions' => ['style' =>'width:125px;  min-width:125px;'],			
			],
			
            [
				'attribute' => 'status',
				'label' => 'Status',
                'contentOptions' => ['style' =>'width:100px;  min-width:100px;'],				 
                        			   
                'value' => function($data) {
                    return $data->getStatusdum();
                },
	            'filterType'=>GridView::FILTER_SELECT2,
	            'filter'=>$SModel->statusdum, 
	            'filterInputOptions'=>['placeholder'=>''],
				
			],	
        
            ['class' => 'app\behaviours\ActionColumns'],
        ],
    ]); ?>
</div>
