| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475 |
- <?php
- use yii\widgets\ActiveForm;
- use common\helpers\Url;
- use common\enums\GenderEnum;
- use common\helpers\Html;
- ?>
- <?php $form = ActiveForm::begin(); ?>
- <div class="row">
- <div class="col-lg-12">
- <div class="box">
- <div class="box-header with-border">
- <h3 class="box-title">个人信息</h3>
- </div>
- <?php $form = ActiveForm::begin([
- 'id' => 'pwd',
- 'fieldConfig' => [
- 'template' => "<div class='row'><div class='col-sm-2 text-right'>{label}</div><div class='col-sm-10'>{input}\n{hint}\n{error}</div></div>",
- ]
- ]); ?>
- <div class="box-body">
- <?= $form->field($model, 'username')->textInput([
- 'disabled' => true
- ]); ?>
- <?= $form->field($model, 'realname')->textInput() ?>
- <?= $form->field($model, 'head_portrait')->widget(\common\widgets\cropper\Cropper::class, []); ?>
- <?= $form->field($model, 'gender')->radioList(GenderEnum::getMap()) ?>
- <?= $form->field($model, 'mobile')->textInput() ?>
- <?= $form->field($model, 'email')->textInput() ?>
- <?= $form->field($model, 'birthday')->widget('kartik\date\DatePicker', [
- 'language' => 'zh-CN',
- 'layout' => '{picker}{input}',
- 'pluginOptions' => [
- 'format' => 'yyyy-mm-dd',
- 'todayHighlight' => true,// 今日高亮
- 'autoclose' => true,// 选择后自动关闭
- 'todayBtn' => true,// 今日按钮显示
- ],
- 'options' => [
- 'class' => 'form-control no_bor',
- ]
- ]); ?>
- <?= \common\widgets\linkage\Linkage::widget([
- 'form' => $form,
- 'model' => $model,
- // 'template' => 'short',
- ]); ?>
- <?= $form->field($model, 'address')->textarea() ?>
- <?= $form->field($model, 'status')->radioList(\common\enums\StatusEnum::getMap()) ?>
- </div>
- <div class="box-footer text-center">
- <button class="btn btn-primary" type="submit">保存</button>
- </div>
- <?php ActiveForm::end(); ?>
- </div>
- </div>
- </div>
- <?php ActiveForm::end(); ?>
- <script type="text/javascript">
- // 提交表单时候触发
- function sendForm() {
- var status = "<?= Yii::$app->user->id == $model->id ? true : false;?>";
- if (status) {
- var src = $('input[name="Manager[head_portrait]"]').val();
- if (src) {
- $('.head_portrait', window.parent.document).attr('src', src);
- }
- }
- }
- </script>
|