diff --git a/frontend/controllers/CabinetController.php b/frontend/controllers/CabinetController.php index 6a2c808..f3d52ba 100644 --- a/frontend/controllers/CabinetController.php +++ b/frontend/controllers/CabinetController.php @@ -50,9 +50,15 @@ if(!$userPassport = $user->userPassport) { $userPassport = new UserPassport(); } + + $table = IntellectualProperty::find()->where([ + 'user_id' => \Yii::$app->user->identity->id, + ])->all(); + return $this->render('index', [ 'userData' => $userData, 'userPassport' => $userPassport, + 'table' => $table, ]); } @@ -121,6 +127,8 @@ $intProperty = new IntellectualProperty(); + $intProperty->user_id = \Yii::$app->user->identity->id; + if($intProperty->load($request->post()) && $intProperty->save()) { return [ 'success' => true, diff --git a/frontend/views/cabinet/index.php b/frontend/views/cabinet/index.php index f045dae..7517e52 100644 --- a/frontend/views/cabinet/index.php +++ b/frontend/views/cabinet/index.php @@ -4,6 +4,7 @@ * @var UserData $userData * @var UserPassport $userPassport * @var yii\web\View $this + * @var IntellectualProperty[] $table */ use frontend\models\UserData; @@ -11,6 +12,7 @@ use frontend\models\IntellectualProperty; use yii\helpers\Html; use yii\widgets\ActiveForm; + use yii\widgets\Pjax; $this->title = 'My Yii Application'; ?> @@ -44,6 +46,11 @@ ) ?>
+ 'int-prop-greed', + ]); + ?> @@ -55,148 +62,28 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + +

п/п
Нараховано К-ть відтворень
title ?>registration_date ?>genre ?>author_role ?>percent ?>calculated ?>play_count ?>
+
diff --git a/frontend/web/js/script.js b/frontend/web/js/script.js index c39fbf7..b0af5f5 100644 --- a/frontend/web/js/script.js +++ b/frontend/web/js/script.js @@ -262,6 +262,7 @@ $(document).ready(function(){ } $('#add-composition-modal').modal('hide'); showStatus(data.message, type); + $.pjax.reload('#int-prop-greed'); document.getElementById('add-int-prop-form').reset(); }); -- libgit2 0.21.4