<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', 'username', ['attribute' => 'level_id', 'value' => app\models\Level::getOneLevelNameById($model->level_id)], ['attribute' => 'email_auth', 'value' => $model->email_auth ? '是' : '否'], ['attribute' => 'phone_auth', 'value' => $model->phone_auth ? '是' : '否'], ['attribute' => 'status', 'value' => app\models\Users::getStatusName($model->status)], 'mobile_phone', 'email:email', 'lesson', 'credit', 'score', 'create_time', 'update_time', 'update_user']]); ?> <h2>基本信息</h2> <?php if (!empty($modelInfo)) { ?> <?php echo DetailView::widget(['model' => $modelInfo, 'attributes' => [['attribute' => 'sex', 'value' => app\models\UsersInfo::getSexName($modelInfo->sex)], 'birthday', ['attribute' => 'credentials_type', 'value' => '身份证'], 'credentials_number', 'account_location', 'telephone', 'height', 'weight', ['attribute' => 'disease_history', 'value' => app\models\UsersInfo::getDiseaseHistoryName($modelInfo->disease_history)], 'contact_address', 'contact_postcode', 'company_name', 'company_address', 'company_postcode', 'company_contact_phone', ['attribute' => 'clothes_size', 'value' => app\models\UsersInfo::getSizeName($modelInfo->clothes_size)], ['attribute' => 't_shirt_size', 'value' => app\models\UsersInfo::getSizeName($modelInfo->t_shirt_size)], ['attribute' => 'shorts_size', 'value' => app\models\UsersInfo::getSizeName($modelInfo->shorts_size)], ['attribute' => 'language', 'value' => app\models\UsersInfo::getLanguageName($modelInfo->language)], ['attribute' => 'spoken_language', 'value' => app\models\UsersInfo::getAbilityName($modelInfo->spoken_language)], ['attribute' => 'write_language', 'value' => app\models\UsersInfo::getAbilityName($modelInfo->write_language)], ['attribute' => 'photo', 'format' => 'html', 'value' => $modelInfo->photo ? '<img src="/upload/images/users_info/photo/' . $modelInfo->photo . '">' : '无'], ['attribute' => 'credentials_photo', 'format' => 'html', 'value' => $modelInfo->credentials_photo ? '<img src="/upload/images/users_info/credentials_photo/' . $modelInfo->credentials_photo . '">' : '无']]]); ?> <?php } else { ?> 没有基本信息 <?php }
use yii\helpers\Html; use yii\grid\GridView; /* @var $this yii\web\View */ /* @var $searchModel app\models\UsersSearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title = '暂停学员'; $this->params['breadcrumbs'][] = $this->title; ?> <div class="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'], 'username', ['attribute' => 'email_auth', 'value' => function ($searchModel) { return $searchModel->email_auth ? '是' : '否'; }], ['attribute' => 'phone_auth', 'value' => function ($searchModel) { return $searchModel->phone_auth ? '是' : '否'; }], ['attribute' => 'status', 'value' => function ($searchModel) { return app\models\Users::getStatusName($searchModel->status); }], 'create_time', 'update_time', 'update_user', ['class' => 'yii\\grid\\ActionColumn']]]); ?> </div>
use yii\helpers\Html; use yii\widgets\DetailView; /* @var $this yii\web\View */ /* @var $model app\models\Teachers */ $this->title = $model->name; $this->params['breadcrumbs'][] = ['label' => '讲师管理', 'url' => ['index']]; $this->params['breadcrumbs'][] = $this->title; ?> <div class="teachers-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', 'name', ['attribute' => 'sex', 'label' => '性别', 'value' => app\models\Teachers::getSexName($model->sex)], 'age', ['attribute' => 'level', 'label' => '级别', 'value' => app\models\TeachersLevel::getNameById($model->level)], ['attribute' => 'status', 'value' => app\models\Users::getStatusName($model->status)], 'phone', 'email', 'lesson', ['attribute' => 'photo', 'format' => 'html', 'value' => $model->photo ? '<img src="/upload/images/teachers/photo/' . $model->photo . '">' : '无'], 'score', 'register_district', 'certificate_number', 'create_time', 'create_user', 'update_time', 'update_user']]); ?> </div>