Example #1
0
            <div class="spacer60"></div>

            


            

    
			<?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'layout' => "{items}\n{pager}", 'columns' => [['class' => 'yii\\grid\\CheckboxColumn', 'headerOptions' => ['width' => '30']], ['headerOptions' => ['width' => '100'], 'header' => $model->generateSegmentFilterDropdown($list_type_id), 'label' => 'Availability', 'format' => 'raw', 'value' => function ($data) use($model) {
    return Person::checkAvailability($data->id, $model->id);
}, 'visible' => $list_type_id == 1 ? 1 : 0], ['headerOptions' => ['width' => '100'], 'header' => '<div class="text-center">Client<br />Approved</div>', 'format' => 'raw', 'visible' => $list_type_id == 1 ? 1 : 0, 'value' => function ($data) use($model) {
    if (Person::isClientApproved($data->id, $model->id) == 'approved') {
        return '<div class="text-center"><div class="btn btn-xs btn-success"><span class="glyphicon glyphicon-ok"></span></div></div>';
    }
    if (Person::isClientApproved($data->id, $model->id) == 'denied') {
        return '<div class="text-center"><div class="btn btn-xs btn-danger"><span class="glyphicon glyphicon-remove"></span></div></div>';
    }
    return false;
}], ['headerOptions' => ['width' => '130'], 'label' => 'Confirmed', 'format' => 'raw', 'value' => function ($data) use($model) {
    return Person::checkConfirmed($data->id, $model->id);
}, 'visible' => $list_type_id == 2 ? 2 : 0], ['headerOptions' => ['width' => '20'], 'format' => 'raw', 'value' => function ($data) {
    return $data->generateThumb();
}], ['headerOptions' => ['width' => '140'], 'attribute' => 'fname'], 'lname', ['attribute' => 'Gender', 'format' => 'raw', 'value' => function ($model) {
    return ucfirst($model->gender);
}], ['headerOptions' => ['width' => '150'], 'header' => $model->generateRoleFilterDropdown($list_type_id), 'contentOptions' => ['class' => 'text-center'], 'label' => 'Role', 'format' => 'raw', 'value' => function ($data) use($model) {
    return $model->generateRoleDropdown($data->id, $model->id);
}], ['class' => 'yii\\grid\\ActionColumn', 'headerOptions' => ['width' => '100'], 'template' => '{view} {delete}', 'buttons' => ['view' => function ($url, $model) {
    return '<a class="btn btn-primary btn-xs" href="/person/' . $model->id . '">View User</a>';
}, 'delete' => function ($url, $user_model, $key) use($model, $list_type_id) {
    return Html::a('<span class="glyphicon glyphicon-remove"></span>', '/project/listremove/' . $model->id . '/' . $list_type_id . '/' . $user_model->id, []);