示例#1
0
文件: index.php 项目: Akelcehg/psycho
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <!--<p>
        <?php 
/*= Html::a(Yii::t('app', 'Create Diplomas'), ['create'], ['class' => 'btn btn-success']) */
?>
    </p>-->


    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['header' => 'Психолог', 'value' => function ($model, $key, $index, $widget) {
    return $model['diplomaOwner']['firstname'] . ' ' . $model['diplomaOwner']['lastname'];
}], ['header' => 'Одобрен', 'value' => function ($model, $key, $index, $widget) {
    if ($model['is_approved']) {
        return 'Одобрен';
    }
    return 'Не одобрен';
}], ['header' => 'Фото', 'format' => 'raw', 'value' => function ($model, $key, $index, $widget) {
    $url = '../' . Image::getPsychologistDiploma($model['psychologist_id']);
    return '<a class="btn btn-default" href="' . $url . '" target="_blank">Фото</a>';
}], ['header' => 'Одобрить', 'format' => 'raw', 'value' => function ($model, $key, $index, $widget) {
    $url = Url::base() . '/admin/diplomas/approve?id=' . $model["id"];
    return '<a class="btn btn-info" href="' . $url . '" data-confirm="Подтвердить диплом ?" data-method="post">Подтвердить</a>';
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>