コード例 #1
0
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '完成度管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="train-users-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'activity_id', 'value' => function ($searchModel) {
    return app\models\Activity::getOneActivityNameById($searchModel->activity_id);
}], ['attribute' => 'user_id', 'value' => function ($searchModel) {
    return app\models\Users::getOneUserNameById($searchModel->user_id);
}], ['label' => '完成', 'value' => function ($searchModel) {
    return app\models\ActivityProcess::getCount($searchModel->activity_id, $searchModel->user_id, app\models\ActivityProcess::FINISH);
}], ['label' => '未完成', 'value' => function ($searchModel) {
    return app\models\ActivityProcess::getCount($searchModel->activity_id, $searchModel->user_id, app\models\ActivityProcess::NO_FINISH);
}], ['label' => '操作', 'format' => 'html', 'value' => function ($searchModel) {
    $url = Html::a('更新完成度信息', ['Admin/activity-process/', 'ActivityProcessSearch[user_id]' => $searchModel->user_id, 'ActivityProcessSearch[activity_id]' => $searchModel->activity_id]);
    return $url;
}]]]);
?>

</div>
コード例 #2
0
ファイル: index.php プロジェクト: hanxiao84322/coach_system
<?php

use yii\helpers\Html;
use yii\grid\GridView;
/* @var $this yii\web\View */
/* @var $searchModel app\models\AttendanceSearch */
/* @var $dataProvider yii\data\ActiveDataProvider */
$this->title = '完成度管理';
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="attendance-index">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>
    <?php 
// echo $this->render('_search', ['model' => $searchModel]);
?>

    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], ['attribute' => 'day', 'value' => function ($searchModel) {
    return date('Y-m-d', strtotime($searchModel->day));
}], ['attribute' => 'status', 'value' => function ($searchModel) {
    return app\models\ActivityProcess::getStatusName($searchModel->status);
}], ['class' => 'yii\\grid\\ActionColumn']]]);
?>

</div>
コード例 #3
0
ファイル: view.php プロジェクト: hanxiao84322/coach_system
use yii\helpers\Html;
use yii\widgets\DetailView;
/* @var $this yii\web\View */
/* @var $model app\models\Attendance */
$this->title = $model->day;
$this->params['breadcrumbs'][] = ['label' => '完成度管理', 'url' => ['index', 'ActivityProcessSearch[train_id]' => $model->activity_id, 'ActivityProcessSearch[user_id]' => $model->user_id]];
$this->params['breadcrumbs'][] = $this->title;
?>
<div class="attendance-view">

    <h1><?php 
echo Html::encode($this->title);
?>
</h1>

    <p>
        <?php 
echo Html::a('更新', ['update', 'id' => $model->id], ['class' => 'btn btn-primary']);
?>
        <?php 
echo Html::a('删除', ['delete', 'id' => $model->id], ['class' => 'btn btn-danger', 'data' => ['confirm' => '确认删除吗?', 'method' => 'post']]);
?>
    </p>

    <?php 
echo DetailView::widget(['model' => $model, 'attributes' => ['id', 'day', ['attribute' => 'status', 'format' => 'html', 'value' => app\models\ActivityProcess::getStatusName($model->status)]]]);
?>

</div>