From b73541b6f789fd8819bd4b2aa137ce7ef55446d9 Mon Sep 17 00:00:00 2001 From: yarik Date: Tue, 27 Dec 2016 18:14:18 +0200 Subject: [PATCH] Property --- frontend/controllers/CabinetController.php | 32 +++++++++++++++++++++++++++++--- frontend/models/IntellectualProperty.php | 14 +++++++------- frontend/views/cabinet/index.php | 1280 -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- frontend/views/cabinet/list.php | 188 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/views/cabinet/sales.php | 325 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ frontend/web/css/cabinet-style.css | 4 ++-- 6 files changed, 551 insertions(+), 1292 deletions(-) create mode 100644 frontend/views/cabinet/list.php create mode 100644 frontend/views/cabinet/sales.php diff --git a/frontend/controllers/CabinetController.php b/frontend/controllers/CabinetController.php index 08ce1db..c3f07f8 100644 --- a/frontend/controllers/CabinetController.php +++ b/frontend/controllers/CabinetController.php @@ -2,11 +2,13 @@ namespace frontend\controllers; use common\models\User; + use frontend\models\IntellectualProperty; use frontend\models\UserData; use frontend\models\UserPassport; use yii\filters\VerbFilter; use yii\web\Controller; - + use yii\web\NotFoundHttpException; + /** * Cabinet controller */ @@ -55,9 +57,24 @@ ]); } - public function actionSales() + public function actionSales($id = null) { - + if($id) { + $property = $this->findProperty($id); + } else { + $property = new IntellectualProperty(); + } + if($property->load(\Yii::$app->request->post()) && $property->save()) { + $response = \Yii::$app->response; + $response->format = $response::FORMAT_JSON; + return [ + 'success' => true, + 'message' => 'Данные успешно сохранены', + ]; + } + return $this->render('sales', [ + 'property' => $property, + ]); } public function actionPersonal() @@ -111,4 +128,13 @@ ]; } } + + public function findProperty($id) + { + $model = IntellectualProperty::findOne($id); + if(empty($model)) { + throw new NotFoundHttpException(); + } + return $model; + } } diff --git a/frontend/models/IntellectualProperty.php b/frontend/models/IntellectualProperty.php index 381b6cc..f14a4c3 100644 --- a/frontend/models/IntellectualProperty.php +++ b/frontend/models/IntellectualProperty.php @@ -51,13 +51,13 @@ class IntellectualProperty extends \yii\db\ActiveRecord return [ 'id' => 'ID', 'user_id' => 'User ID', - 'title' => 'Title', - 'creation_date' => 'Creation Date', - 'code' => 'Code', - 'genre' => 'Genre', - 'registration_date' => 'Registration Date', - 'contract' => 'Contract', - 'type' => 'Type', + 'title' => 'Назва', + 'creation_date' => 'Дата створення', + 'code' => 'Шифр', + 'genre' => 'Жанр', + 'registration_date' => 'Дата реєстрації', + 'contract' => 'Договір', + 'type' => 'Тип', ]; } diff --git a/frontend/views/cabinet/index.php b/frontend/views/cabinet/index.php index 2f7cdfe..e264176 100644 --- a/frontend/views/cabinet/index.php +++ b/frontend/views/cabinet/index.php @@ -213,1286 +213,6 @@
Додадково
-
-
-
Продаж ОІВ
-
-
-
- - -
-
- - -
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
-
-
- - -
-
- - -
-
- -
- -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Творча рольПІБДоля %КодIPIТовариство
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
- -
-
-
-
-
-
Список ОІВ
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
НазваДата створенняШифрЖанрДата реєстраціїДоговірТип
Нью-Йорк03.03.200301P22112016пісня22.11.2016договірмала форма
-
-
-
-
Мої надходження
diff --git a/frontend/views/cabinet/list.php b/frontend/views/cabinet/list.php new file mode 100644 index 0000000..59f5a97 --- /dev/null +++ b/frontend/views/cabinet/list.php @@ -0,0 +1,188 @@ + +
+
+
Список ОІВ
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
НазваДата створенняШифрЖанрДата реєстраціїДоговірТип
Нью-Йорк03.03.200301P22112016пісня22.11.2016договірмала форма
+
+
+
diff --git a/frontend/views/cabinet/sales.php b/frontend/views/cabinet/sales.php new file mode 100644 index 0000000..cde7eb5 --- /dev/null +++ b/frontend/views/cabinet/sales.php @@ -0,0 +1,325 @@ + +
+
+ [ + 'class' => 'pjax_container forms-cabinet forms-3', + ], + ] + ); + ?> +
Продаж ОІВ
+ 'property-form', + 'action' => \Yii::$app->request->url, + ] + ); + ?> +
+ field( + $property, + 'title', + [ + 'options' => [ + 'class' => 'input-wrapp-757', + 'style' => 'margin-right: 40px;', + ], + ] + ) + ->textarea( + [ + 'cols' => 30, + 'rows' => 10, + ] + ); + echo $form->field( + $property, + 'creation_date', + [ + 'options' => [ + 'class' => 'input-wrapp-130', + ], + ] + ) + ->textInput( + [ + 'class' => '_datepicer', + ] + ); + ?> +
+ field( + $property, + 'code', + [ + 'options' => [ + 'class' => 'input-wrapp-320', + ], + ] + ) + ->textInput(); + ?> +
+
+ field( + $property, + 'genre', + [ + 'options' => [ + 'class' => 'input-wrapp-320', + ], + ] + ) + ->textInput(); + ?> +
+
+ field( + $property, + 'registration_date', + [ + 'options' => [ + 'class' => 'input-wrapp-320', + ], + ] + ) + ->textInput( + [ + 'class' => '_datepicer', + ] + ); + ?> +
+
+ field( + $property, + 'contract', + [ + 'options' => [ + 'class' => 'input-wrapp-320', + 'style' => 'margin-right: 40px;', + ], + ] + ) + ->textInput(); + echo $form->field( + $property, + 'type', + [ + 'options' => [ + 'class' => 'input-wrapp-320', + ], + ] + ) + ->textInput(); + ?> +
+ +
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Творча рольПІБДоля %КодIPIТовариство
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+ +
+ +
+
diff --git a/frontend/web/css/cabinet-style.css b/frontend/web/css/cabinet-style.css index d15e394..903f479 100644 --- a/frontend/web/css/cabinet-style.css +++ b/frontend/web/css/cabinet-style.css @@ -84,7 +84,7 @@ ul.list-cab li .act_bg { } ul.list-cab li.active-li .act_bg {display: block} -.cab_content_list {display: none;padding-bottom: 30px;} +.cab_content_list {padding-bottom: 30px;} .cab_content_list.active-cab {display: block;} /****form****/ @@ -677,7 +677,7 @@ ul.list-cab li.active-li ul li a { color: #fff; } ul.list-cab li.active-li ul li.active-li-drop a {color: #008fd1;} -.cab_content_list-dropdown {display: none;width: 100%;float: left;} +.cab_content_list-dropdown {width: 100%;float: left;} .cab_content_list-dropdown.active-cab-dropdown {display: block;} ul.list-cab li.active-li ul li span { -- libgit2 0.21.4