diff --git a/backend/web/js/fieldWidget.js b/backend/web/js/fieldWidget.js index 6423bdf..a409e2d 100755 --- a/backend/web/js/fieldWidget.js +++ b/backend/web/js/fieldWidget.js @@ -6,14 +6,4 @@ $(document).ready(function(){ }); - - $('.add_field').click(function(){ - var block = $('.fields_video_result'); - var sub_block = '
'+ - ''+ - ''+ - '
'; - block.append(sub_block); - - }); }); \ No newline at end of file diff --git a/common/config/main-local.php b/common/config/main-local.php index f47e800..5403ca3 100755 --- a/common/config/main-local.php +++ b/common/config/main-local.php @@ -3,9 +3,9 @@ return [ 'components' => [ 'db' => [ 'class' => 'yii\db\Connection', - 'dsn' => 'pgsql:host=195.248.225.149;port=5432;dbname=mfp', - 'username' => 'test33', - 'password' => 'E4q2N7i9', + 'dsn' => 'pgsql:host=127.0.0.1;port=5432;dbname=mfp_local', + 'username' => 'postges', + 'password' => '', 'schemaMap' => [ 'pgsql'=> [ 'class'=>'yii\db\pgsql\Schema', diff --git a/common/models/UserInfo.php b/common/models/UserInfo.php index ef6f63e..20bbae6 100755 --- a/common/models/UserInfo.php +++ b/common/models/UserInfo.php @@ -63,7 +63,7 @@ class UserInfo extends \yii\db\ActiveRecord return [ [['user_id', 'view_count', 'contract', 'estimate', 'purchase', 'delivery'], 'integer'], [['date_visit'], 'safe'], - [['experience', 'soft', 'guarantee', 'about', 'city', 'country', 'image', 'poster'], 'string'], + [['experience', 'soft', 'guarantee', 'about', 'city', 'country', 'image', 'poster', 'social_vk', 'social_fb', 'social_in', 'social_t'], 'string'], [['prepayment'], 'number'], [['rank', 'location'], 'string', 'max' => 50], diff --git a/common/widgets/views/phone_field.php b/common/widgets/views/phone_field.php index 45bb223..fc63597 100644 --- a/common/widgets/views/phone_field.php +++ b/common/widgets/views/phone_field.php @@ -1,11 +1,11 @@
- Образование + Телефон -

Добавить поле

+

Добавить поле

'form-group','id'=>isset($model[$i]['parent_key']) ? $model[$i]['parent_key'] : 0 ])?> - - + + @@ -24,15 +24,16 @@ use yii\helpers\Html;
+ + diff --git a/frontend/controllers/AccountsController.php b/frontend/controllers/AccountsController.php index 81efe34..e2fc84d 100755 --- a/frontend/controllers/AccountsController.php +++ b/frontend/controllers/AccountsController.php @@ -150,13 +150,16 @@ class AccountsController extends Controller public function actionContacts() { - if(!empty(\Yii::$app->request->post())) { - Fields::saveFieldData( Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(),'ru'); - } $user_info = UserInfo::find()->where(['user_id' => \Yii::$app->user->getId()])->one(); if(empty($user_info)) { $user_info = new UserInfo(['user_id' => \Yii::$app->user->getId()]); } + if(!empty(\Yii::$app->request->post())) { + Fields::saveFieldData( Yii::$app->request->post('Fields'), \Yii::$app->user->identity->id, User::className(),'ru'); + $user_info->load(\Yii::$app->request->post()); + $user_info->save(); + $user_info; + } return $this->render('contacts', ['user_info' => $user_info]); } diff --git a/frontend/views/accounts/contacts.php b/frontend/views/accounts/contacts.php index 306bae0..3c14981 100755 --- a/frontend/views/accounts/contacts.php +++ b/frontend/views/accounts/contacts.php @@ -1,27 +1,47 @@ title = 'Мой профиль'; $this->params['breadcrumbs'][] = $this->title; $user = \Yii::$app->user->identity; ?> -

title ?>

+

title ?>

+

Будут видны всем

-'phone', - 'item_id'=> $user->id, - 'model'=>'common\models\User', - 'language'=>'ru' -]); ?> + 'phone', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> +field ($user_info, 'social_vk') + ->label ('Vk.com') + ->textInput () ?> +field ($user_info, 'social_fb') + ->label ('FaceBook.com') + ->textInput () ?> +field ($user_info, 'social_in') + ->label ('LinkedIn.com') + ->textInput () ?> +field ($user_info, 'social_t') + ->label ('Twitter.com') + ->textInput () ?> + 'site', 'item_id' => $user->id, 'model' => 'common\models\User', 'language' => 'ru', + ] +); ?> end(); + echo Html::submitButton ('submit'); + $form->end (); ?> diff --git a/frontend/web/js/fieldWidget.js b/frontend/web/js/fieldWidget.js index b10e495..2583d7f 100755 --- a/frontend/web/js/fieldWidget.js +++ b/frontend/web/js/fieldWidget.js @@ -1,18 +1,6 @@ $(document).ready(function(){ $('body').on('click', '.delete-field-item', function(){ - console.log('sfddf'); $(this).parent('.form-group').remove(); }); - - - $('.add_field').click(function(){ - var block = $('.fields_video_result'); - var sub_block = '
'+ - ''+ - ''+ - '
'; - block.append(sub_block); - - }); }); -- libgit2 0.21.4