<?php

use yii\helpers\Html;
use common\widgets\GridView;

/* @var $this yii\web\View */
/* @var $searchModel frontend\models\AccountsSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */

$this->title = 'Accounts';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="accounts-index">


    <?= GridView::widget([
        'title' => $this->title,
        'dataProvider' => $dataProvider,
        'filterModel' => $searchModel,
        'search' => $this->render('_search', ['model' => $searchModel]),
        'columns' => [
            ['class' => 'yii\grid\SerialColumn'],

            'accountid',
            'account_name',
            'jobcount',
            'status',

            'address1',
            'address2',
            'town',
            // 'County',
            // 'Post_Code',
            // 'Telephone_no',
            // 'Fax_no',
            // 'Contact',
            // 'Email:email',

			['class' => 'common\widgets\ActionColumn',
            'template' => '{view} {update} {delete} {undelete}',
  			'buttons' => [
  				'undelete' => function ($url, $model, $key) { return $model->deleted == true ? Html::a('<i class="fa fa-undo"></i>', $url) : '';},
  				'update' => function ($url, $model, $key) {return Html::a('<i class="fa fa-pencil"></i>', $url);},
  				'view' => function ($url, $model, $key) {return Html::a('<i class="fa fa-eye"></i>', $url);},
  				'delete' => function ($url, $model, $key) {return Html::a('<i class="fa fa-trash"></i>', $url, ['data-method' => 'POST']);},
				 ],
            ],
        ],
    ]); ?>

</div>
