From 834ce184d1cc536c6cd1afc7684e6bdc85841e3d Mon Sep 17 00:00:00 2001 From: Alexander Smirnov Date: Wed, 18 Sep 2024 11:49:25 +0300 Subject: [PATCH] =?utf8?q?[ERP-189]=20=D0=9F=D0=B5=D1=80=D0=B5=D0=BD=D0=BE?= =?utf8?q?=D1=81=20profile=20=D0=BD=D0=B0=20yii,=20=D0=B4=D0=BE=D0=B1?= =?utf8?q?=D0=B0=D0=B2=D0=BB=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=B0=D0=B9=D0=B4?= =?utf8?q?=D0=B8=20=D0=BF=D0=BE=D0=BB=D1=8C=D0=B7=D0=BE=D0=B2=D0=B0=D1=82?= =?utf8?q?=D0=B5=D0=BB=D1=8F=20=D0=B2=20=D0=BF=D1=80=D0=B0=D0=B2=D0=BE?= =?utf8?q?=D0=BC=20=D0=B2=D0=B5=D1=80=D1=85=D0=BD=D0=B5=D0=BC=20=D0=B2?= =?utf8?q?=D1=8B=D0=BF=D0=B0=D0=B4=D0=B0=D1=8E=D1=89=D0=B5=D0=BC=20=D0=BC?= =?utf8?q?=D0=B5=D0=BD=D1=8E?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- erp24/controllers/ProfileController.php | 7 ++- erp24/records/Admin.php | 2 +- erp24/views/layouts/header.php | 1 + erp24/views/profile/index.php | 60 ++++++++++++++++++++++++- 4 files changed, 66 insertions(+), 4 deletions(-) diff --git a/erp24/controllers/ProfileController.php b/erp24/controllers/ProfileController.php index 40ab455a..dd6ed4d7 100644 --- a/erp24/controllers/ProfileController.php +++ b/erp24/controllers/ProfileController.php @@ -2,9 +2,14 @@ namespace app\controllers; +use Yii; use yii\web\Controller; +use yii_app\records\Admin; class ProfileController extends Controller { - public function actionIndex() { return $this->render('index'); } + public function actionIndex() { + $model = Admin::findOne(Yii::$app->user->id); + return $this->render('index', compact('model')); + } } \ No newline at end of file diff --git a/erp24/records/Admin.php b/erp24/records/Admin.php index 9c04ccf9..6f6486f8 100755 --- a/erp24/records/Admin.php +++ b/erp24/records/Admin.php @@ -95,7 +95,7 @@ class Admin extends ActiveRecord implements IdentityInterface public function rules() { return [ - [['imageFile'], 'file', 'skipOnEmpty' => true, 'extensions' => 'jpg'], + [['imageFile'], 'file', 'skipOnEmpty' => true, 'extensions' => 'jpg,jpeg,png'], [['store_arrArr', 'store_arr_guidArr'], 'safe'], [['login_user'], 'unique'], diff --git a/erp24/views/layouts/header.php b/erp24/views/layouts/header.php index 84d68d2b..d54ea845 100755 --- a/erp24/views/layouts/header.php +++ b/erp24/views/layouts/header.php @@ -151,6 +151,7 @@ $this->registerCssFile('/css/timetable/style.css');
+
diff --git a/erp24/views/profile/index.php b/erp24/views/profile/index.php index 320cf29d..01cd910c 100644 --- a/erp24/views/profile/index.php +++ b/erp24/views/profile/index.php @@ -1,6 +1,62 @@ + +
+

Профайл

+ + ['enctype' => 'multipart/form-data']]) ?> + + field($model, 'id')->textInput()->label(false)); ?> + + field($model, 'name')->textInput()->label(false)); ?> + + field($model, 'name_full')->textInput()->label(false)); ?> + + adminGroup->name ?? '-'); ?> + + field($model, 'group_name')->textInput()->label(false)); ?> + + field($model, 'birthdate')->widget(DateTimePicker::class, [ + 'language' => 'ru', + 'template' => '{input}', + 'clientOptions' => [ + 'autoclose' => true, + 'format' => 'Y-m-d', + 'todayBtn' => true + ], + ])->label(false)); ?> + + field($model, 'pol')->dropDownList(["women"=>"женский", "men"=>"мужской"])->label(false)); ?> + + field($model, 'mobile')->textInput()->label(false)); ?> + + field($model, 'adress_fakt')->textInput()->label(false)); ?> + + field($model, 'login_user')->textInput()->label(false)); ?> + + field($model, 'pass_user')->textInput()->label(false)); ?> + + field($model, 'imageFile')->fileInput()->label(false) . ' ' . $model->avatarka); ?> + +
+ 'btn btn-success btn-lg']) ?> +
+ + + +
-- 2.39.5