コード例 #1
0
ファイル: _upform.php プロジェクト: wuwenhan/huoqiwang
?>

    <?php 
echo $form->field($model, 'email')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'idcard')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'real_name')->textInput(['maxlength' => true]);
?>

    <?php 
echo $form->field($model, 'status')->dropDownList(UcenterMember::getArrayStatus());
?>

    <?php 
echo $form->field($model, 'lock')->dropDownList(UcenterMember::getTypeStatus());
?>

    <div class="form-group field-ucentermember-type">
        <label class="control-label" for="ucentermember-type">类型</label>
        <input type="hidden" name="UcenterMember[type]" value="">
        <select id="ucentermember-type" class="form-control" name="UcenterMember[type][]" multiple="multiple" size="4" style="font-size:14px;">
            <?php 
foreach ($allcat as $k => $v) {
    ?>
            <option value="<?php 
    echo $v['id'];
コード例 #2
0
ファイル: index.php プロジェクト: wuwenhan/huoqiwang


    <?php 
echo GridView::widget(['dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'columns' => [['class' => 'yii\\grid\\SerialColumn'], 'id', 'username', 'phone', 'email:email', 'idcard', 'real_name', ['attribute' => 'status', 'format' => 'html', 'value' => function ($model) {
    if ($model->status === $model::STATUS_ACTIVE) {
        $class = 'label-success';
    } elseif ($model->status === $model::STATUS_REAL) {
        $class = 'label-success';
    } elseif ($model->status === $model::STATUS_BIND) {
        $class = 'label-success';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->statusLabel . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'status', common\models\UcenterMember::getArrayStatus(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'Please Filter')])], ['attribute' => 'lock', 'format' => 'html', 'value' => function ($model) {
    if ($model->lock === $model::TYPE_UNLOCK) {
        $class = 'label-success';
    } elseif ($model->lock === $model::TYPE_LOCK) {
        $class = 'label-warning';
    } else {
        $class = 'label-danger';
    }
    return '<span class="label ' . $class . '">' . $model->typeLabel . '</span>';
}, 'filter' => Html::activeDropDownList($searchModel, 'lock', common\models\UcenterMember::getTypeStatus(), ['class' => 'form-control', 'prompt' => Yii::t('app', 'Please Filter')])], ['attribute' => 'created_at', 'format' => ['date', 'php:Y-m-d H:i:s']], ['class' => 'yii\\grid\\ActionColumn', 'header' => '操作', 'buttons' => ['delete' => function ($url, $model, $key) {
    return Html::a('<span class="glyphicon glyphicon-trash"></span>', $url, ['title' => '删除', 'data' => ['confirm' => '你确定要删除吗?', 'method' => 'post']]);
}]]]]);
?>

</div>