Commit 8af1342727613fdb6c32ca43f0d54bd5edaff504

Authored by Yarik
1 parent f202ab2b

For leha commit.

Showing 310 changed files with 12969 additions and 4286 deletions   Show diff stats

Too many changes.

To preserve performance only 100 of 310 files are displayed.

backend/controllers/ArticleController.php
... ... @@ -94,7 +94,7 @@
94 94 }
95 95 return $this->render('create', [
96 96 'model' => $model,
97   - 'model_langs' => $model->model_langs,
  97 + 'modelLangs' => $model->modelLangs,
98 98 ]);
99 99 }
100 100  
... ... @@ -121,7 +121,7 @@
121 121 }
122 122 return $this->render('update', [
123 123 'model' => $model,
124   - 'model_langs' => $model->model_langs,
  124 + 'modelLangs' => $model->modelLangs,
125 125 ]);
126 126 }
127 127  
... ...
backend/controllers/BannerController.php
... ... @@ -89,13 +89,13 @@
89 89 if($model->save() && $model->transactionStatus) {
90 90 return $this->redirect([
91 91 'view',
92   - 'id' => $model->banner_id,
  92 + 'id' => $model->id,
93 93 ]);
94 94 }
95 95 }
96 96 return $this->render('create', [
97 97 'model' => $model,
98   - 'model_langs' => $model->model_langs,
  98 + 'modelLangs' => $model->modelLangs,
99 99 ]);
100 100 }
101 101  
... ... @@ -116,13 +116,13 @@
116 116 if($model->save() && $model->transactionStatus) {
117 117 return $this->redirect([
118 118 'view',
119   - 'id' => $model->banner_id,
  119 + 'id' => $model->id,
120 120 ]);
121 121 }
122 122 }
123 123 return $this->render('update', [
124 124 'model' => $model,
125   - 'model_langs' => $model->model_langs,
  125 + 'modelLangs' => $model->modelLangs,
126 126 ]);
127 127 }
128 128  
... ...
backend/controllers/BgController.php
... ... @@ -95,7 +95,7 @@
95 95 }
96 96 return $this->render('create', [
97 97 'model' => $model,
98   - 'model_langs' => $model->model_langs,
  98 + 'modelLangs' => $model->modelLangs,
99 99 ]);
100 100 }
101 101  
... ... @@ -123,7 +123,7 @@
123 123 }
124 124 return $this->render('update', [
125 125 'model' => $model,
126   - 'model_langs' => $model->model_langs,
  126 + 'modelLangs' => $model->modelLangs,
127 127 ]);
128 128 }
129 129  
... ...
backend/controllers/BrandController.php
... ... @@ -98,13 +98,13 @@
98 98 if($model->save() && $model->transactionStatus) {
99 99 return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect([
100 100 'view',
101   - 'id' => $model->brand_id,
  101 + 'id' => $model->id,
102 102 ]) : $this->redirect(array_merge([ 'create' ], Yii::$app->request->queryParams));
103 103 }
104 104 }
105 105 return $this->render('create', [
106 106 'model' => $model,
107   - 'model_langs' => $model->model_langs,
  107 + 'modelLangs' => $model->modelLangs,
108 108 ]);
109 109 }
110 110  
... ... @@ -126,13 +126,13 @@
126 126 if($model->save() && $model->transactionStatus) {
127 127 return $this->redirect([
128 128 'view',
129   - 'id' => $model->brand_id,
  129 + 'id' => $model->id,
130 130 ]);
131 131 }
132 132 }
133 133 return $this->render('update', [
134 134 'model' => $model,
135   - 'model_langs' => $model->model_langs,
  135 + 'modelLangs' => $model->modelLangs,
136 136 ]);
137 137 }
138 138  
... ... @@ -163,7 +163,7 @@
163 163 */
164 164 protected function findModel($id)
165 165 {
166   - if(( $model = Brand::find()->with('lang')->where(['brand_id' => $id])->one() ) !== NULL) {
  166 + if(( $model = Brand::find()->with('lang')->where(['id' => $id])->one() ) !== NULL) {
167 167 return $model;
168 168 } else {
169 169 throw new NotFoundHttpException('The requested page does not exist.');
... ...
backend/controllers/CategoryController.php
... ... @@ -93,7 +93,7 @@
93 93 if($model->save() && $model->transactionStatus) {
94 94 return is_null(Yii::$app->request->post('create_and_new')) ? $this->redirect([
95 95 'view',
96   - 'id' => $model->category_id,
  96 + 'id' => $model->id,
97 97 ]) : $this->redirect(array_merge([ 'create' ], Yii::$app->request->queryParams));
98 98 }
99 99 }
... ... @@ -102,9 +102,9 @@
102 102 }
103 103 return $this->render('create', [
104 104 'model' => $model,
105   - 'model_langs' => $model->model_langs,
  105 + 'modelLangs' => $model->modelLangs,
106 106 'categories' => ArtboxTreeHelper::treeMap(Category::find()
107   - ->getTree(), 'category_id', 'category_id', '.'),
  107 + ->getTree(), 'id', 'id', '.'),
108 108 ]);
109 109 }
110 110  
... ... @@ -125,15 +125,15 @@
125 125 if($model->save() && $model->transactionStatus) {
126 126 return $this->redirect([
127 127 'view',
128   - 'id' => $model->category_id,
  128 + 'id' => $model->id,
129 129 ]);
130 130 }
131 131 }
132 132 return $this->render('update', [
133 133 'model' => $model,
134   - 'model_langs' => $model->model_langs,
  134 + 'modelLangs' => $model->modelLangs,
135 135 'categories' => ArtboxTreeHelper::treeMap(Category::find()
136   - ->getTree(), 'category_id', 'category_id', '.'),
  136 + ->getTree(), 'id', 'id', '.'),
137 137 ]);
138 138 }
139 139  
... ... @@ -165,7 +165,7 @@
165 165 protected function findModel($id)
166 166 {
167 167 if(( $model = Category::find()
168   - ->where([ 'category_id' => $id ])
  168 + ->where([ 'id' => $id ])
169 169 ->with('lang')
170 170 ->one() ) !== NULL
171 171 ) {
... ...
backend/controllers/DeliveryController.php
... ... @@ -84,7 +84,7 @@
84 84 }
85 85 return $this->render('create', [
86 86 'model' => $model,
87   - 'model_langs' => $model->model_langs,
  87 + 'modelLangs' => $model->modelLangs,
88 88 'parent_items' => $parent_items,
89 89 ]);
90 90 }
... ... @@ -117,7 +117,7 @@
117 117 }
118 118 return $this->render('update', [
119 119 'model' => $model,
120   - 'model_langs' => $model->model_langs,
  120 + 'modelLangs' => $model->modelLangs,
121 121 'parent_items' => $parent_items,
122 122 ]);
123 123 }
... ...
backend/controllers/EventController.php
... ... @@ -91,13 +91,13 @@
91 91 if($model->save() && $model->transactionStatus) {
92 92 return $this->redirect([
93 93 'view',
94   - 'id' => $model->event_id,
  94 + 'id' => $model->id,
95 95 ]);
96 96 }
97 97 }
98 98 return $this->render('create', [
99 99 'model' => $model,
100   - 'model_langs' => $model->model_langs,
  100 + 'modelLangs' => $model->modelLangs,
101 101 ]);
102 102 }
103 103  
... ... @@ -121,13 +121,13 @@
121 121 if($model->save() && $model->transactionStatus) {
122 122 return $this->redirect([
123 123 'view',
124   - 'id' => $model->event_id,
  124 + 'id' => $model->id,
125 125 ]);
126 126 }
127 127 }
128 128 return $this->render('update', [
129 129 'model' => $model,
130   - 'model_langs' => $model->model_langs,
  130 + 'modelLangs' => $model->modelLangs,
131 131 ]);
132 132 }
133 133  
... ...
backend/controllers/LabelController.php
... ... @@ -80,7 +80,7 @@
80 80 }
81 81 return $this->render('create', [
82 82 'model' => $model,
83   - 'model_langs' => $model->model_langs,
  83 + 'modelLangs' => $model->modelLangs,
84 84 ]);
85 85  
86 86 }
... ... @@ -109,7 +109,7 @@
109 109 }
110 110 return $this->render('update', [
111 111 'model' => $model,
112   - 'model_langs' => $model->model_langs,
  112 + 'modelLangs' => $model->modelLangs,
113 113 ]);
114 114  
115 115 }
... ...
backend/controllers/OrderController.php 0 โ†’ 100755
  1 +<?php
  2 +
  3 + namespace backend\controllers;
  4 +
  5 + use backend\models\orderearch;
  6 + use Yii;
  7 + use yii\web\Controller;
  8 + use yii\filters\VerbFilter;
  9 + use yii\data\ActiveDataProvider;
  10 + use yii\web\HttpException;
  11 + use common\models\order;
  12 + use backend\models\orderProduct;
  13 + use common\modules\product\models\ProductVariant;
  14 + use yii\web\NotFoundHttpException;
  15 + use developeruz\db_rbac\behaviors\AccessBehavior;
  16 +
  17 + class orderController extends Controller
  18 + {
  19 + /**
  20 + * @inheritdoc
  21 + */
  22 + public function behaviors()
  23 + {
  24 + return [
  25 + 'access' => [
  26 + 'class' => AccessBehavior::className(),
  27 + 'rules' => [
  28 + 'site' => [
  29 + [
  30 + 'actions' => [
  31 + 'login',
  32 + 'error',
  33 + ],
  34 + 'allow' => true,
  35 + ],
  36 + ],
  37 + ],
  38 + ],
  39 + 'verbs' => [
  40 + 'class' => VerbFilter::className(),
  41 + 'actions' => [
  42 + 'delete' => [ 'POST' ],
  43 + ],
  44 + ],
  45 + ];
  46 + }
  47 +
  48 + public function actionIndex()
  49 + {
  50 + $searchModel = new orderearch();
  51 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  52 +
  53 + return $this->render(
  54 + 'index',
  55 + [
  56 + 'dataProvider' => $dataProvider,
  57 + 'searchModel' => $searchModel,
  58 + ]
  59 + );
  60 + }
  61 +
  62 + public function actionShow($id)
  63 + {
  64 +
  65 + $model = $this->findModel((int) $id);
  66 + $dataProvider = new ActiveDataProvider(
  67 + [
  68 + 'query' => orderProduct::find()
  69 + ->where([ 'order_id' => (int) $id ]),
  70 + 'pagination' => [
  71 + 'pageSize' => 20,
  72 + ],
  73 + ]
  74 + );
  75 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  76 + return $this->redirect([ 'index' ]);
  77 + } else {
  78 + $model_orderproduct = new orderProduct();
  79 +
  80 + return $this->renderAjax(
  81 + 'show',
  82 + [
  83 + 'model' => $model,
  84 + 'model_orderproduct' => $model_orderproduct,
  85 + 'dataProvider' => $dataProvider,
  86 + ]
  87 + );
  88 + }
  89 + }
  90 +
  91 + public function actionLabelupdate()
  92 + {
  93 + $model = order::findOne($_POST[ 'order_id' ]);
  94 + $model->label = $_POST[ 'label_id' ];
  95 + $model->save();
  96 + }
  97 +
  98 + public function actionPayupdate()
  99 + {
  100 + $model = order::findOne($_POST[ 'order_id' ]);
  101 + $model->pay = $_POST[ 'pay_id' ];
  102 + $model->save();
  103 + }
  104 +
  105 + public function actionDelete()
  106 + {
  107 + $model = order::findOne($_GET[ 'id' ]);
  108 + $model->delete();
  109 + return Yii::$app->response->redirect([ '/order/index' ]);
  110 + }
  111 +
  112 + public function actionAdd()
  113 + {
  114 + $model = new orderProduct();
  115 + if ($model->load(Yii::$app->request->post())) {
  116 +
  117 + if (!$modelMod = ProductVariant::find()
  118 + ->with([ 'product' ])
  119 + ->where([ 'sku' => $model->sku ])
  120 + ->one()
  121 + ) {
  122 + throw new HttpException(404, 'ะ”ะฐะฝะฝะพะณะพ ะฐั€ั‚ะธะบะปั ะฝะต ััƒั‰ะตัั‚ะฒัƒะตั‚!');
  123 + }
  124 + $model->product_name = $modelMod->product->name;
  125 + $model->name = $modelMod->name;
  126 + $model->sku = $modelMod->sku;
  127 + $model->price = $modelMod->price;
  128 + $model->sum_cost = $model->count * $modelMod->price;
  129 + $model->product_variant_id = $modelMod->id;
  130 + $model->save();
  131 + //return Yii::$app->response->redirect(['/admin/order/show','id'=>$_GET['order_id']]);
  132 + }
  133 +
  134 + //return $this->render('add',['model'=>$model]);
  135 + }
  136 +
  137 + public function actionCreate()
  138 + {
  139 + $model = new order();
  140 +
  141 + if ($model->load(Yii::$app->request->post()) && $model->save()) {
  142 + return $this->redirect([ 'index' ]);
  143 + } else {
  144 + return $this->render(
  145 + 'create',
  146 + [
  147 + 'model' => $model,
  148 + ]
  149 + );
  150 + }
  151 + }
  152 +
  153 + public function actionDeleteProduct()
  154 + {
  155 + $model = orderProduct::findOne($_GET[ 'id' ]);
  156 + $model->delete();
  157 + return Yii::$app->response->redirect(
  158 + [
  159 + '/admin/order/show',
  160 + 'id' => $_GET[ 'order_id' ],
  161 + ]
  162 + );
  163 + }
  164 +
  165 + protected function findModel($id)
  166 + {
  167 + if (( $model = order::findOne($id) ) !== null) {
  168 + return $model;
  169 + } else {
  170 + throw new NotFoundHttpException('The requested page does not exist.');
  171 + }
  172 + }
  173 + }
... ...
backend/controllers/OrdersController.php deleted
1   -<?php
2   -
3   -namespace backend\controllers;
4   -
5   -use backend\models\OrdersSearch;
6   -use Yii;
7   -use yii\web\Controller;
8   -use yii\filters\VerbFilter;
9   -use yii\data\ActiveDataProvider;
10   -use yii\web\HttpException;
11   -use common\models\Orders;
12   -use backend\models\OrdersProducts;
13   -use common\modules\product\models\ProductVariant;
14   -use yii\web\NotFoundHttpException;
15   -use developeruz\db_rbac\behaviors\AccessBehavior;
16   -
17   -class OrdersController extends Controller
18   -{
19   - /**
20   - * @inheritdoc
21   - */
22   - public function behaviors()
23   - {
24   - return [
25   - 'access'=>[
26   - 'class' => AccessBehavior::className(),
27   - 'rules' =>
28   - ['site' =>
29   - [
30   - [
31   - 'actions' => ['login', 'error'],
32   - 'allow' => true,
33   - ]
34   - ]
35   - ]
36   - ],
37   - 'verbs' => [
38   - 'class' => VerbFilter::className(),
39   - 'actions' => [
40   - 'delete' => ['POST'],
41   - ],
42   - ],
43   - ];
44   - }
45   -
46   - public function actionIndex()
47   - {
48   - $searchModel = new OrdersSearch();
49   - $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
50   -
51   - return $this->render('index', [
52   - 'dataProvider'=>$dataProvider,
53   - 'searchModel'=>$searchModel,
54   - ]);
55   - }
56   -
57   - public function actionShow($id)
58   - {
59   -
60   - $model = $this->findModel((int)$id);
61   - $dataProvider = new ActiveDataProvider([
62   - 'query' => OrdersProducts::find()->where(['order_id'=>(int)$id]),
63   - 'pagination' => [
64   - 'pageSize' => 20,
65   - ],
66   - ]);
67   - if ($model->load(Yii::$app->request->post()) && $model->save()) {
68   - return $this->redirect(['index']);
69   - } else {
70   - $model_orderproducts = new OrdersProducts;
71   -
72   -
73   - return $this->renderAjax('show', [
74   - 'model' => $model,
75   - 'model_orderproducts'=>$model_orderproducts,
76   - 'dataProvider' => $dataProvider,
77   - ]);
78   - }
79   - }
80   -
81   - public function actionLabelupdate(){
82   - $model = Orders::findOne($_POST['order_id']);
83   - $model->label = $_POST['label_id'];
84   - $model->save();
85   - }
86   -
87   - public function actionPayupdate(){
88   - $model = Orders::findOne($_POST['order_id']);
89   - $model->pay = $_POST['pay_id'];
90   - $model->save();
91   - }
92   -
93   - public function actionDelete(){
94   - $model = Orders::findOne($_GET['id']);
95   - $model->delete();
96   - return Yii::$app->response->redirect(['/orders/index']);
97   - }
98   -
99   -
100   - public function actionAdd(){
101   - $model = new OrdersProducts;
102   - if ($model->load(Yii::$app->request->post())) {
103   -
104   - if(!$modelMod = ProductVariant::find()->with(['product'])->where(['sku'=>$model->sku])->one())
105   - throw new HttpException(404, 'ะ”ะฐะฝะฝะพะณะพ ะฐั€ั‚ะธะบะปั ะฝะต ััƒั‰ะตัั‚ะฒัƒะตั‚!');
106   - $model->product_name = $modelMod->product->name;
107   - $model->name = $modelMod->name;
108   - $model->sku = $modelMod->sku;
109   - $model->price = $modelMod->price;
110   - $model->sum_cost = $model->count*$modelMod->price;
111   - $model->mod_id = $modelMod->id;
112   - $model->save();
113   - //return Yii::$app->response->redirect(['/admin/orders/show','id'=>$_GET['order_id']]);
114   - }
115   -
116   - //return $this->render('add',['model'=>$model]);
117   - }
118   -
119   - public function actionCreate(){
120   - $model = new Orders();
121   -
122   - if ($model->load(Yii::$app->request->post()) && $model->save()) {
123   - return $this->redirect(['index']);
124   - } else {
125   - return $this->render('create', [
126   - 'model' => $model,
127   - ]);
128   - }
129   - }
130   -
131   - public function actionDelete_product(){
132   - $model = OrdersProducts::findOne($_GET['id']);
133   - $model->delete();
134   - return Yii::$app->response->redirect(['/admin/orders/show','id'=>$_GET['order_id']]);
135   - }
136   -
137   - protected function findModel($id)
138   - {
139   - if (($model = Orders::findOne($id)) !== null) {
140   - return $model;
141   - } else {
142   - throw new NotFoundHttpException('The requested page does not exist.');
143   - }
144   - }
145   -}
backend/controllers/PageController.php
... ... @@ -94,7 +94,7 @@
94 94 }
95 95 return $this->render('create', [
96 96 'model' => $model,
97   - 'model_langs' => $model->model_langs,
  97 + 'modelLangs' => $model->modelLangs,
98 98 ]);
99 99 }
100 100  
... ... @@ -122,7 +122,7 @@
122 122 }
123 123 return $this->render('update', [
124 124 'model' => $model,
125   - 'model_langs' => $model->model_langs,
  125 + 'modelLangs' => $model->modelLangs,
126 126 ]);
127 127 }
128 128  
... ...
backend/controllers/SeoCategoryController.php
... ... @@ -79,7 +79,7 @@
79 79 }
80 80 return $this->render('create', [
81 81 'model' => $model,
82   - 'model_langs' => $model->model_langs,
  82 + 'modelLangs' => $model->modelLangs,
83 83 ]);
84 84 }
85 85  
... ... @@ -106,7 +106,7 @@
106 106 }
107 107 return $this->render('update', [
108 108 'model' => $model,
109   - 'model_langs' => $model->model_langs,
  109 + 'modelLangs' => $model->modelLangs,
110 110 ]);
111 111 }
112 112  
... ...
backend/controllers/SeoController.php
... ... @@ -93,7 +93,7 @@
93 93 }
94 94 return $this->render('create', [
95 95 'model' => $model,
96   - 'model_langs' => $model->model_langs,
  96 + 'modelLangs' => $model->modelLangs,
97 97 ]);
98 98 }
99 99  
... ... @@ -120,7 +120,7 @@
120 120 }
121 121 return $this->render('update', [
122 122 'model' => $model,
123   - 'model_langs' => $model->model_langs,
  123 + 'modelLangs' => $model->modelLangs,
124 124 ]);
125 125 }
126 126  
... ...
backend/controllers/SeoDynamicController.php
... ... @@ -106,7 +106,7 @@
106 106 }
107 107 return $this->render('create', [
108 108 'model' => $model,
109   - 'model_langs' => $model->model_langs,
  109 + 'modelLangs' => $model->modelLangs,
110 110 'seo_category' => $seo_category,
111 111 ]);
112 112 }
... ... @@ -136,7 +136,7 @@
136 136 }
137 137 return $this->render('update', [
138 138 'model' => $model,
139   - 'model_langs' => $model->model_langs,
  139 + 'modelLangs' => $model->modelLangs,
140 140 'seo_category' => $seo_category,
141 141 ]);
142 142 }
... ...
backend/controllers/ServiceController.php
... ... @@ -94,7 +94,7 @@
94 94 }
95 95 return $this->render('create', [
96 96 'model' => $model,
97   - 'model_langs' => $model->model_langs,
  97 + 'modelLangs' => $model->modelLangs,
98 98 ]);
99 99 }
100 100  
... ... @@ -122,7 +122,7 @@
122 122 }
123 123 return $this->render('update', [
124 124 'model' => $model,
125   - 'model_langs' => $model->model_langs,
  125 + 'modelLangs' => $model->modelLangs,
126 126 ]);
127 127 }
128 128  
... ...
backend/controllers/SiteController.php
1 1 <?php
2   -namespace backend\controllers;
3   -use common\modules\product\models\ProductImage;
4   -use common\modules\product\models\Brand;
5   -use common\modules\product\models\Category;
6   -use common\modules\product\models\Product;
7   -use common\modules\product\models\ProductVariant;
8   -use Yii;
9   -use yii\helpers\Url;
10   -use yii\web\Controller;
11   -use backend\models\LoginForm;
12   -use yii\filters\VerbFilter;
13   -/**
14   - * Site controller
15   - */
16   -class SiteController extends Controller
17   -{
18   -
19   -
  2 + namespace backend\controllers;
  3 +
  4 + use common\modules\product\models\ProductImage;
  5 + use Yii;
  6 + use yii\helpers\Url;
  7 + use yii\web\Controller;
  8 + use backend\models\LoginForm;
  9 + use yii\filters\VerbFilter;
  10 +
20 11 /**
21   - * @inheritdoc
  12 + * Site controller
22 13 */
23   - public function behaviors()
  14 + class SiteController extends Controller
24 15 {
25   - return [
26   - 'verbs' => [
27   - 'class' => VerbFilter::className(),
28   - 'actions' => [
  16 +
  17 + /**
  18 + * @inheritdoc
  19 + */
  20 + public function behaviors()
  21 + {
  22 + return [
  23 + 'verbs' => [
  24 + 'class' => VerbFilter::className(),
  25 + 'actions' => [],
29 26 ],
30   - ],
31   - ];
32   - }
33   -
34   - /**
35   - * @inheritdoc
36   - */
37   - public function actions()
38   - {
39   - return [
40   - 'error' => [
41   - 'class' => 'yii\web\ErrorAction',
42   - ],
43   - ];
44   - }
45   -
46   -
47   - public function actionImages(){
48   - $files = ProductImage::find()->all();
49   - foreach($files as $file_object){
50   - $file = $file_object->image;
51   - $file_array = explode('/',$file);
52   - if(is_array($file_array) && count($file_array) >3){
53   - $count = count($file_array);
54   - $file_name = $file_array[$count-2]."_".$file_array[$count-1];
55   - print_r($file_name);
56   - $save_image = Yii::getAlias('@productsDir') . "/" . $file_name;
57   - copy($file, $save_image);
58   - $file_object->image = $file_name;
59   - $file_object->save();
60   - }
61   -
  27 + ];
62 28 }
63   -
64   -
65   - }
66   -
67   - public function actionIndex()
68   - {
69   - return $this->render('index');
70   - }
71   -
72   - public function actionLogin()
73   - {
74   - $this->layout = '/none';
75   -
76   - if (!\Yii::$app->user->isGuest) {
77   - return $this->goHome();
  29 +
  30 + /**
  31 + * @inheritdoc
  32 + */
  33 + public function actions()
  34 + {
  35 + return [
  36 + 'error' => [
  37 + 'class' => 'yii\web\ErrorAction',
  38 + ],
  39 + ];
78 40 }
79   -
80   - $model = new LoginForm();
81   - if ($model->load(Yii::$app->request->post()) && $model->login()) {
82   - return $this->redirect(Url::to('/admin/site/index'));
83   - } else {
84   - return $this->render('login', [
85   - 'model' => $model,
86   - ]);
  41 +
  42 + public function actionImages()
  43 + {
  44 + $files = ProductImage::find()
  45 + ->all();
  46 + foreach($files as $file_object) {
  47 + $file = $file_object->image;
  48 + $file_array = explode('/', $file);
  49 + if(is_array($file_array) && count($file_array) > 3) {
  50 + $count = count($file_array);
  51 + $file_name = $file_array[ $count - 2 ] . "_" . $file_array[ $count - 1 ];
  52 + print_r($file_name);
  53 + $save_image = Yii::getAlias('@productsDir') . "/" . $file_name;
  54 + copy($file, $save_image);
  55 + $file_object->image = $file_name;
  56 + $file_object->save();
  57 + }
  58 +
  59 + }
  60 +
87 61 }
88   - }
89   -
90   - public function actionLogout()
91   - {
92   - Yii::$app->user->logout();
93   -
94   - return $this->goHome();
95   - }
96   -
97   - public function actionGo() {
98   - $new_products = $linked_products = 0;
99   -
100   - // ะพั‚ะบั€ั‹ะฒะฐะตะผ ั„ะฐะนะป ะธ ะฟะตั€ะตะฑะธั€ะฐะตะผ
101   - $filename = Yii::getAlias('@uploadDir') .'/'. Yii::getAlias('@uploadFileProducts');
102   - if (!is_file($filename)) {
103   - var_dump("File $filename not found");
104   - return Controller::EXIT_CODE_ERROR;
  62 +
  63 + public function actionIndex()
  64 + {
  65 + return $this->render('index');
105 66 }
106   - var_dump("File $filename loaded\n");
107   -
108   - $db = yii::$app->db;
109   -
110   - if (($handle = fopen ($filename, 'r')) !== FALSE)
  67 +
  68 + public function actionLogin()
111 69 {
112   - $j = 0;
113   -
114   - while (($data = fgetcsv ($handle, 10000, ";")) !== FALSE)
115   - {
116   - $j++;
117   -
118   - foreach ($data as &$value)
119   - {
120   - //$value = mb_convert_encoding ($value, "UTF-8", mb_detect_encoding ($value));
121   - $value = iconv ('windows-1251', "UTF-8//TRANSLIT//IGNORE", $value);
122   - $value = trim ($value);
123   - }
124   -
125   - // ะฑัƒะดะตั‚ ะฒัะตะณะดะฐ 19 ัะปะตะผะตะฝั‚ะพะฒ
126   - for ($i = 0; $i <= 18; $i++)
127   - {
128   - if (! isset ($data[$i]))
129   - {
130   - $data[$i] = null;
131   - }
132   - }
133   -
134   - // 1 ะ“ั€ัƒะฟะฟะฐ (ะบะฐั‚ะตะณะพั€ะธั)
135   - $catalog_name = $data[0];
136   - if (empty ($catalog_name))
137   - {
138   - CONTINUE;
139   - }
140   -
141   - // 2 ะ‘ั€ะตะฝะด
142   - $brand_name = $data[1];
143   - if (empty ($brand_name))
144   - {
145   - CONTINUE;
146   - }
147   -
148   - // 3 ะะฐะทะฒะฐะฝะธะต ั‚ะพะฒะฐั€ะฐ
149   - $product_name = $data[2];
150   - if (empty ($product_name))
151   - {
152   - CONTINUE;
153   - }
154   -
155   - // 4 ะžะฟะธัะฐะฝะธะต ะฃะบั€
156   - $product_body_uk = $data[3];
157   -
158   - // 5 ะžะฟะธัะฐะฝะธะต ะ ัƒั
159   - $product_body_ru = $data[4];
160   -
161   - // 6 ะคะธะปัŒั‚ั€ (ั‡ะตั€ะตะท ะทะฐะฟัั‚ัƒัŽ)
162   - $filters = explode (',', $data[5]);
163   -
164   - // 7 ะ”ะพะฟ ั„ะธะปัŒั‚ั€ ั‡ะตั€ะตะท ะทะฐะฟัั‚ัƒัŽ
165   - $filters_extra = explode (',', $data[6]);
166   -
167   - // 8 ะŸะพะป ั‡ะตั€ะตะทะทะฐะฟัั‚ัƒัŽ (ะผัƒะถัะบะพะน, ะถะตะฝัะบะธะน, ะดะตั‚ัะบะธะน, ัƒะฝะธัะตะบั)
168   - $gender = explode (',', $data[7]);
169   -
170   - // 9 ะ“ะพะด
171   - $years = explode (',', $data[8]);
172   -
173   - // 10 ะฆะตะฝะฐ ัั‚ะฐั€ะฐั
174   - $product_cost_old = $data[9];
175   -
176   - // 11 ะฆะตะฝะฐ
177   - $produc_cost = $data[10];
178   -
179   - // 12 ะะบั†ะธั
180   - $product_akciya = (bool)$data[11];
181   -
182   - // 13 ะกะพะฟัƒะด. ะขะพะฒ.
183   - $similar = explode (',', $data[12]);
184   -
185   - // 14 ะะพะฒะธะฝะบะธ
186   - $product_new = (bool)$data[13];
187   -
188   - // 15 ะขะพะฟ ะฟั€ะพะดะฐะถ
189   - $product_top = (bool)$data[14];
190   -
191   - // 16 ะกะตั‚ะบะฐ ะฅะฐั€ะฐะบั‚ะตั€ะธัั‚ะธะบ
192   - $feature = explode ('=', $data[15]);
193   -
194   - // 17 ะ’ะ˜ะ”ะ•ะž ะšะžะ”
195   - $product_video = $data[16];
196   -
197   - // 18 ะ“ะฐะปะปะตั€ะตั ั„ะพั‚ะพ
198   - $fotos = explode (',', $data[17]);
199   -
200   - // 19 ะจั‚ั€ะธั… ะบะพะด ั‚ะพะฒะฐั€ะฐ.
201   - // ั€ะฐััˆะธั„ั€ะพะฒะฐะป - ัั‚ะพ ะผะพะดะธั„ะธะบะฐั†ะธะธ ั‚ะพะฒะฐั€ะฐ!
202   -
203   - $product_image = explode ('=', $data[18]);
204   - $product_image = @$product_image[3];
205   -
206   - if ( ($_product = Product::find()->filterWhere(['ilike', 'name', trim($product_name)])->one()) === null ) {
207   - $_product = new Product();
208   - }
209   -
210   - // ==== Set category ====
211   - if ( ($category = Category::find()->filterWhere(['ilike', 'name', trim($catalog_name)])->one()) !== null ) {
212   - $_product->categories = [$category->category_id];
213   - } else {
214   - // Create category
215   - $category = new Category();
216   - $category->name = trim($catalog_name);
217   - $category->save();
218   - $_product->categories = [$category->category_id];
219   - }
220   -
221   - // ===== Set brand ====
222   - if ( $brand_name ) {
223   - if ( ($brand = Brand::find()->filterWhere(['ilike', 'name', trim($brand_name)])->one()) !== null ) {
224   - $_product->brand_id = $brand->brand_id;
225   - } else {
226   - // Create brand
227   - $brand = new Brand();
228   - $brand->name = trim($brand_name);
229   - $brand->save();
230   - $_product->brand_id = $brand->brand_id;
231   - }
232   - }
233   -
234   - $_product->name = $product_name;
235   - $_product->video = $product_video;
236   - $_product->description = $product_body_ru;
237   - $_product->top = $product_top;
238   - $_product->akciya = $product_akciya;
239   - $_product->new = $product_new;
240   -
241   -
242   - $_product->save();
243   -
244   -
245   - // @todo Set image
246   - /*// ะบะฐั€ั‚ะธะฝะบะธ
247   - if (is_file ($dir.'/mod/' . $product_image))
248   - {
249   - $resizeObj = new resize ($dir.'/mod/' . $product_image);
250   - $resizeObj->resizeImage (135, 200, 'auto');
251   - $resizeObj->saveImage ($dir.'/products/ico/' . $product_image, 100);
252   - $resizeObj->resizeImage (370, 370, 'auto');
253   - $resizeObj->saveImage ($dir.'/products/big/' . $product_image, 100);
254   - }*/
255   -
256   - // ==== mods ====
257   -
258   - // (ั‚ะธะฟะฐ ัˆั‚ั€ะธั… ะบะพะด ั‚ะพะฒะฐั€ะฐ)
259   -
260   - // ะฝัƒะถะฝะพ ะดะปั ะฟั€ะพัั‚ะฐะฒะปะตะฝะธั ั…ะฐั€ะฐะบั‚ะตั€ะธัั‚ะธะบ ะพั‚ะฝะพััั‰ะธั…ัั ะบ ะผะพะดะธั„ะธะบะฐั†ะธัะผ
261   - $MOD_ARRAY = [];
262   -
263   - for ($i = 18; $i < count ($data); $i ++)
264   - {
265   - if (! empty ($data[$i]))
266   - {
267   - $mod_arr = explode ('=', $data[$i]);
268   - $mod_art = $mod_arr[0];
269   - $mod_size = $mod_arr[1];
270   - $mod_color = $mod_arr[2];
271   - $mod_image = $mod_arr[3];
272   - $mod_cost = $produc_cost;
273   - $mod_old_cost = $product_cost_old;
274   -
275   - // Check product variant
276   - if ( ($_productVariant = ProductVariant::find()->andWhere(['ilike', 'sku', $mod_art])->andWhere(['product_id' => $_product->product_id])->one()) === null ) {
277   - $_productVariant = new ProductVariant();
278   - $_productVariant->product_id = $_product->product_id;
279   - }
280   -
281   - $_productVariant->sku = $mod_art;
282   - $_productVariant->price = $mod_cost;
283   - $_productVariant->price_old = $mod_old_cost;
284   -
285   - $_productVariant->save();
286   -
287   - $MOD_ARRAY[] = $_productVariant->product_variant_id;
288   -
289   -
290   - $dir = Yii::getAlias('@productsDir').'/';
291   - if (is_file ($dir . $mod_image))
292   - {
293   - $resizeObj = new resize ($dir . $mod_image);
294   - $resizeObj->resizeImage (40, 40, 'crop');
295   - $resizeObj->saveImage ($dir.'ico/' . $mod_image, 100);
296   - $resizeObj->resizeImage (370, 370, 'auto');
297   - $resizeObj->saveImage ($dir.'/big/' . $mod_image, 100);
298   - }
299   - }
300   - }
301   -
302   - /*// ==== fotos ====
303   -
304   - foreach ($fotos as $foto)
305   - {
306   - $fields = [
307   - 'product_id' => $product_id,
308   - 'image' => $foto
309   - ];
310   -
311   - $modelFotos = Fotos::find ()
312   - ->where ('image=:image', [
313   - ':image' => $foto
314   - ])
315   - ->one ();
316   -
317   - if (empty ($modelFotos->id))
318   - {
319   - $db->createCommand ()
320   - ->insert ('products_fotos', $fields)
321   - ->execute ();
322   - }
323   - else
324   - {
325   - $db->createCommand ()
326   - ->update ('products_fotos', $fields, 'id = ' . $modelFotos->id)
327   - ->execute ();
328   - }
329   -
330   - if (is_file ($dir.'/fotos/' . $foto))
331   - {
332   - $resizeObj = new resize ($dir.'/fotos/' . $foto);
333   - $resizeObj->resizeImage (100, 100, 'crop');
334   - $resizeObj->saveImage ($dir.'/fotos/ico/' . $foto, 100);
335   - $resizeObj->resizeImage (400, 400, 'crop');
336   - $resizeObj->saveImage ($dir.'/fotos/big/' . $foto, 100);
337   - }
338   - }*/
339   -
340   - // ========================
341   - // ==== ะฅะะ ะะšะขะ•ะ ะ˜ะกะขะ˜ะšะ˜ ====
342   - // ========================
343   -
344   - // ะตัั‚ัŒ ะพะฑั‰ะธะต ั…ะฐั€ะฐะบั‚ะตั€ะธัั‚ะธะบะธ, ะบะพั‚ะพั€ั‹ะต ะพั‚ะฝะพััั‚ัั product_id, ั‚ะฐะบะธะต ะบะฐะบ brand, gender...
345   - // ะตัั‚ัŒ ั…ะฐั€ะฐะบั‚ะตั€ะธัั‚ะธะบะธ, ะบะพั‚ะพั€ั‹ะต ะพั‚ะฝะพััั‚ัั mod_id, ั‚ะฐะบะธะต ะบะฐะบ ั†ะฒะตั‚, ั€ะฐะทะผะตั€...
346   -
347   - // ==== gender ====
348   -
349   - /*if (! empty ($gender))
350   - {
351   - $bookGender = Book::find ()
352   - ->where ('book_alias=:book', [
353   - ':book' => 'gender'
354   - ])
355   - ->one ();
356   -
357   - foreach ($gender as $filter)
358   - {
359   - if (! empty ($filter))
360   - {
361   - $bookGenderValue = BookValue::find ()
362   - ->where ('
363   - book_id=:book
364   - AND book_value_title=:value
365   - AND book_value_alias=:alias
366   - ', [
367   - ':book' => $bookGender->book_id,
368   - ':value' => $filter,
369   - ':alias' => Translite::rusencode ($filter),
370   - ]
371   - )
372   - ->one();
373   -
374   - if (! isset ($bookGenderValue->book_value_id) || empty ($bookGenderValue->book_value_id))
375   - {
376   - $db->createCommand ()
377   - ->insert (BookValue::tableName (), [
378   - 'book_id' => $bookGender->book_id,
379   - 'book_value_title' => $filter,
380   - 'book_value_alias' => Translite::rusencode ($filter),
381   - ])
382   - ->execute ();
383   -
384   - $book_value_id = Yii::$app->db->lastInsertID;
385   - }
386   - else
387   - {
388   - $book_value_id = $bookGenderValue->book_value_id;
389   - }
390   -
391   - // + products_value
392   - $db->createCommand ('
393   - INSERT IGNORE products_value
394   - SET
395   - product_id = '.(int)$product_id.',
396   - book_value_id = '.(int)$book_value_id.'
397   - ')
398   - ->execute ();
399   - }
400   - }
401   - }
402   -
403   - // ะตัั‚ัŒ ั…ะฐั€ะฐะบั‚ะตั€ะธัั‚ะธะบะธ, ะบะพั‚ะพั€ั‹ะต ะพั‚ะฝะพััั‚ัั mod_id, ั‚ะฐะบะธะต ะบะฐะบ ั†ะฒะตั‚, ั€ะฐะทะผะตั€...
404   -
405   - // ==== destination ====
406   -
407   - if (! empty ($filters))
408   - {
409   - $bookDestination = Book::find ()
410   - ->where ('book_alias=:book', [
411   - ':book' => 'destination'
412   - ])
413   - ->one ();
414   -
415   - foreach ($filters as $filter)
416   - {
417   - if (! empty ($filter))
418   - {
419   - $bookDestinationValue = BookValue::find ()
420   - ->where ('
421   - book_id=:book
422   - AND book_value_title=:value
423   - AND book_value_alias=:alias
424   - ', [
425   - ':book' => $bookDestination->book_id,
426   - ':value' => $filter,
427   - ':alias' => Translite::rusencode ($filter),
428   - ]
429   - )
430   - ->one();
431   -
432   - if (! isset ($bookDestinationValue->book_value_id) || empty ($bookDestinationValue->book_value_id))
433   - {
434   - $db->createCommand ()
435   - ->insert (BookValue::tableName (), [
436   - 'book_id' => $bookDestination->book_id,
437   - 'book_value_title' => $filter,
438   - 'book_value_alias' => Translite::rusencode ($filter),
439   - ])
440   - ->execute ();
441   -
442   - $book_value_id = Yii::$app->db->lastInsertID;
443   - }
444   - else
445   - {
446   - $book_value_id = $bookDestinationValue->book_value_id;
447   - }
448   -
449   - if (! empty ($MOD_ARRAY))
450   - {
451   - foreach ($MOD_ARRAY as $id)
452   - {
453   - // + products_value
454   - $db->createCommand ('
455   - INSERT IGNORE mod_value
456   - SET
457   - mod_id = '.(int)$id.',
458   - book_value_id = '.(int)$book_value_id.'
459   - ')
460   - ->execute ();
461   - }
462   - }
463   - }
464   - }
465   - }
466   -
467   - // ==== special ====
468   -
469   - if (! empty ($filters_extra))
470   - {
471   - $bookSpecial = Book::find ()
472   - ->where ('book_alias=:book', [
473   - ':book' => 'special'
474   - ])
475   - ->one ();
476   -
477   - foreach ($filters_extra as $filter)
478   - {
479   - if (! empty ($filter))
480   - {
481   - $bookSpecialValue = BookValue::find ()
482   - ->where ('
483   - book_id=:book
484   - AND book_value_title=:value
485   - AND book_value_alias=:alias
486   - ', [
487   - ':book' => $bookSpecial->book_id,
488   - ':value' => $filter,
489   - ':alias' => Translite::rusencode ($filter),
490   - ]
491   - )
492   - ->one();
493   -
494   - if (! isset ($bookSpecialValue->book_value_id) || empty ($bookSpecialValue->book_value_id))
495   - {
496   - $db->createCommand ()
497   - ->insert (BookValue::tableName (), [
498   - 'book_id' => $bookSpecial->book_id,
499   - 'book_value_title' => $filter,
500   - 'book_value_alias' => Translite::rusencode ($filter),
501   - ])
502   - ->execute ();
503   -
504   - $book_value_id = Yii::$app->db->lastInsertID;
505   - }
506   - else
507   - {
508   - $book_value_id = $bookSpecialValue->book_value_id;
509   - }
510   -
511   - if (! empty ($MOD_ARRAY))
512   - {
513   - foreach ($MOD_ARRAY as $id)
514   - {
515   - // + products_value
516   - $db->createCommand ('
517   - INSERT IGNORE mod_value
518   - SET
519   - mod_id = '.(int)$id.',
520   - book_value_id = '.(int)$book_value_id.'
521   - ')
522   - ->execute ();
523   - }
524   - }
525   - }
526   - }
527   - }
528   -
529   - // ==== year ====
530   -
531   - if (! empty ($years))
532   - {
533   - $bookYear = Book::find ()
534   - ->where ('book_alias=:book', [
535   - ':book' => 'year'
536   - ])
537   - ->one ();
538   -
539   - foreach ($years as $filter)
540   - {
541   - if (! empty ($filter))
542   - {
543   - $bookYearValue = BookValue::find ()
544   - ->where ('
545   - book_id=:book
546   - AND book_value_title=:value
547   - AND book_value_alias=:alias
548   - ', [
549   - ':book' => $bookYear->book_id,
550   - ':value' => $filter,
551   - ':alias' => Translite::rusencode ($filter),
552   - ]
553   - )
554   - ->one();
555   -
556   - if (! isset ($bookYearValue->book_value_id) || empty ($bookYearValue->book_value_id))
557   - {
558   - $db->createCommand ()
559   - ->insert (BookValue::tableName (), [
560   - 'book_id' => $bookYear->book_id,
561   - 'book_value_title' => $filter,
562   - 'book_value_alias' => Translite::rusencode ($filter),
563   - ])
564   - ->execute ();
565   -
566   - $book_value_id = Yii::$app->db->lastInsertID;
567   - }
568   - else
569   - {
570   - $book_value_id = $bookYearValue->book_value_id;
571   - }
572   -
573   - if (! empty ($MOD_ARRAY))
574   - {
575   - foreach ($MOD_ARRAY as $id)
576   - {
577   - // + products_value
578   - $db->createCommand ('
579   - INSERT IGNORE mod_value
580   - SET
581   - mod_id = '.(int)$id.',
582   - book_value_id = '.(int)$book_value_id.'
583   - ')
584   - ->execute ();
585   - }
586   - }
587   - }
588   - }
589   - }
590   -
591   - // ==== $feature ====
592   -
593   - if (! empty ($feature))
594   - {
595   - foreach ($feature as $string)
596   - {
597   - $string = str_replace([':', '.'], '', $string);
598   -
599   - if (! empty ($string))
600   - {
601   - list ($book_title, $value_title) = explode ('*', $string);
602   -
603   - $book_title = trim ($book_title);
604   - $value_title = trim ($value_title);
605   -
606   - if (empty ($book_title) || empty ($value_title))
607   - {
608   - CONTINUE;
609   - }
610   -
611   - $bookFeature = Book::find ()
612   - ->where ('book_title=:book', [
613   - ':book' => $book_title
614   - ])
615   - ->one ();
616   -
617   - if (! isset ($bookFeature->book_id) || empty ($bookFeature->book_id))
618   - {
619   - $db->createCommand ()
620   - ->insert (Book::tableName (), [
621   - 'book_title' => $book_title,
622   - 'book_alias' => Translite::rusencode ($book_title),
623   - ])
624   - ->execute ();
625   -
626   - $book_id = Yii::$app->db->lastInsertID;
627   - }
628   - else
629   - {
630   - $book_id = $bookFeature->book_id;
631   - }
632   -
633   - $bookFeatureValue = BookValue::find ()
634   - ->where ('
635   - book_id=:book
636   - AND book_value_title=:value
637   - AND book_value_alias=:alias
638   - ', [
639   - ':book' => $book_id,
640   - ':value' => $value_title,
641   - ':alias' => Translite::rusencode ($value_title),
642   - ]
643   - )
644   - ->one();
645   -
646   - if (! isset ($bookFeatureValue->book_value_id) || empty ($bookFeatureValue->book_value_id))
647   - {
648   - $db->createCommand ()
649   - ->insert (BookValue::tableName (), [
650   - 'book_id' => $book_id,
651   - 'book_value_title' => $value_title,
652   - 'book_value_alias' => Translite::rusencode ($value_title),
653   - ])
654   - ->execute ();
655   -
656   - $book_value_id = Yii::$app->db->lastInsertID;
657   - }
658   - else
659   - {
660   - $book_value_id = $bookFeatureValue->book_value_id;
661   - }
662   -
663   - if (! empty ($MOD_ARRAY))
664   - {
665   - foreach ($MOD_ARRAY as $id)
666   - {
667   - // + products_value
668   - $db->createCommand ('
669   - INSERT IGNORE mod_value
670   - SET
671   - mod_id = '.(int)$id.',
672   - book_value_id = '.(int)$book_value_id.'
673   - ')
674   - ->execute ();
675   - }
676   - }
677   - }
678   - }
679   - }*/
680   -
681   - // ==== IMPORTANT ====
682   -
683   - // ะทะฐะฟะธััƒะตะผ ID ะพะฑั€ะฐะฑะพั‚ะฐะฝะฝะพะน ะทะฐะฟะธัะธ
684   -
685   - $_product->save();
686   - var_dump("$j: Product {$_product->name} saved\n");
687   - if ($j > 100) {
688   - var_dump("Dev OK");
689   - exit;
690   - }
  70 + $this->layout = '/none';
  71 +
  72 + if(!\Yii::$app->user->isGuest) {
  73 + return $this->goHome();
691 74 }
692   -
693   - fclose ($handle);
  75 +
  76 + $model = new LoginForm();
  77 + if($model->load(Yii::$app->request->post()) && $model->login()) {
  78 + return $this->redirect(Url::to('/admin/site/index'));
  79 + } else {
  80 + return $this->render('login', [
  81 + 'model' => $model,
  82 + ]);
  83 + }
  84 + }
  85 +
  86 + public function actionLogout()
  87 + {
  88 + Yii::$app->user->logout();
  89 +
  90 + return $this->goHome();
694 91 }
  92 +
695 93 }
696   -}
... ...
backend/controllers/SliderImageController.php
... ... @@ -108,7 +108,7 @@
108 108 return $this->render('create', [
109 109 'slider_id' => $slider_id,
110 110 'model' => $model,
111   - 'model_langs' => $model->model_langs,
  111 + 'modelLangs' => $model->modelLangs,
112 112 'slider' => $slider,
113 113 ]);
114 114 }
... ... @@ -139,7 +139,7 @@
139 139 $slider = Slider::findOne($slider_id);
140 140 return $this->render('update', [
141 141 'model' => $model,
142   - 'model_langs' => $model->model_langs,
  142 + 'modelLangs' => $model->modelLangs,
143 143 'slider_id' => $slider_id,
144 144 'slider' => $slider,
145 145 ]);
... ...
backend/controllers/UserController.php
1 1 <?php
2   -
3   -namespace backend\controllers;
4   -
5   -use Yii;
6   -use backend\models\User;
7   -use backend\models\UserSearch;
8   -use yii\filters\AccessControl;
9   -use yii\web\Controller;
10   -use yii\web\NotFoundHttpException;
11   -use yii\filters\VerbFilter;
12   -use yii\web\Response;
13   -use yii\widgets\ActiveForm;
14   -
15   -/**
16   - * UserController implements the CRUD actions for User model.
17   - */
18   -class UserController extends Controller
19   -{
  2 +
  3 + namespace backend\controllers;
  4 +
  5 + use Yii;
  6 + use backend\models\User;
  7 + use backend\models\UserSearch;
  8 + use yii\filters\AccessControl;
  9 + use yii\web\Controller;
  10 + use yii\web\NotFoundHttpException;
  11 + use yii\filters\VerbFilter;
  12 + use yii\web\Response;
  13 + use yii\widgets\ActiveForm;
  14 +
20 15 /**
21   - * @inheritdoc
  16 + * UserController implements the CRUD actions for User model.
22 17 */
23   - public function behaviors()
  18 + class UserController extends Controller
24 19 {
25   -
26   -
27   - return [
28   - 'verbs' => [
29   - 'class' => VerbFilter::className(),
30   - 'actions' => [
31   - 'delete' => ['POST'],
32   - ],
33   - ],
34   - 'access' => [
35   - 'class' => AccessControl::className(),
36   - 'rules' => [
37   - [
38   - 'allow' => true,
39   -// 'actions' => ['login', 'signup'],
40   - 'roles' => ['admin'],
  20 + /**
  21 + * @inheritdoc
  22 + */
  23 + public function behaviors()
  24 + {
  25 +
  26 + return [
  27 + 'verbs' => [
  28 + 'class' => VerbFilter::className(),
  29 + 'actions' => [
  30 + 'delete' => [ 'POST' ],
41 31 ],
42   - [
43   -// 'allow' => true,
44   -// 'actions' => ['logout'],
45   -// 'roles' => ['@'],
  32 + ],
  33 + 'access' => [
  34 + 'class' => AccessControl::className(),
  35 + 'rules' => [
  36 + [
  37 + 'allow' => true,
  38 + // 'actions' => ['login', 'signup'],
  39 + 'roles' => [ 'admin' ],
  40 + ],
  41 + [
  42 + // 'allow' => true,
  43 + // 'actions' => ['logout'],
  44 + // 'roles' => ['@'],
  45 + ],
46 46 ],
47 47 ],
48   - ],
49   - ];
50   - }
51   -
52   - /**
53   - * Lists all User models.
54   - * @return mixed
55   - */
56   - public function actionIndex()
57   - {
58   - $searchModel = new UserSearch();
59   - $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
60   -
61   - return $this->render('index', [
62   - 'searchModel' => $searchModel,
63   - 'dataProvider' => $dataProvider,
64   - ]);
65   - }
66   -
67   - /**
68   - * Displays a single User model.
69   - * @param integer $id
70   - * @return mixed
71   - */
72   - public function actionView($id)
73   - {
74   - return $this->render('view', [
75   - 'model' => $this->findModel($id),
76   - ]);
77   - }
78   -
79   - /**
80   - * Creates a new User model.
81   - * If creation is successful, the browser will be redirected to the 'view' page.
82   - * @return mixed
83   - */
84   - public function actionCreate()
85   - {
86   - $model = new User();
87   - if (Yii::$app->request->isAjax) {
88   - Yii::$app->response->format = Response::FORMAT_JSON;
89   - $model->load(Yii::$app->request->post());
90   - return ActiveForm::validate($model);
91   - }else if ($model->load(Yii::$app->request->post()) && $model->validate()) {
92   - $model->save();
93   -
94   - foreach($model->role as $k => $role){
95   - $auth = Yii::$app->authManager;
96   - $authorRole = $auth->getRole($role);
97   - $auth->assign($authorRole, $model->id);
  48 + ];
  49 + }
  50 +
  51 + /**
  52 + * Lists all User models.
  53 + *
  54 + * @return mixed
  55 + */
  56 + public function actionIndex()
  57 + {
  58 + $searchModel = new UserSearch();
  59 + $dataProvider = $searchModel->search(Yii::$app->request->queryParams);
  60 +
  61 + return $this->render(
  62 + 'index',
  63 + [
  64 + 'searchModel' => $searchModel,
  65 + 'dataProvider' => $dataProvider,
  66 + ]
  67 + );
  68 + }
  69 +
  70 + /**
  71 + * Displays a single User model.
  72 + *
  73 + * @param integer $id
  74 + *
  75 + * @return mixed
  76 + */
  77 + public function actionView($id)
  78 + {
  79 + return $this->render(
  80 + 'view',
  81 + [
  82 + 'model' => $this->findModel($id),
  83 + ]
  84 + );
  85 + }
  86 +
  87 + /**
  88 + * Creates a new User model.
  89 + * If creation is successful, the browser will be redirected to the 'view' page.
  90 + *
  91 + * @return mixed
  92 + */
  93 + public function actionCreate()
  94 + {
  95 + $model = new User();
  96 + if (Yii::$app->request->isAjax) {
  97 + Yii::$app->response->format = Response::FORMAT_JSON;
  98 + $model->load(Yii::$app->request->post());
  99 + return ActiveForm::validate($model);
  100 + } elseif ($model->load(Yii::$app->request->post()) && $model->validate()) {
  101 + $model->save();
  102 +
  103 + foreach ($model->role as $k => $role) {
  104 + $auth = Yii::$app->authManager;
  105 + $authorRole = $auth->getRole($role);
  106 + $auth->assign($authorRole, $model->id);
  107 + }
  108 +
  109 + return $this->redirect(
  110 + [
  111 + 'view',
  112 + 'id' => $model->id,
  113 + ]
  114 + );
  115 + } else {
  116 + return $this->render(
  117 + 'create',
  118 + [
  119 + 'model' => $model,
  120 + ]
  121 + );
98 122 }
99   -
100   - return $this->redirect(['view', 'id' => $model->id]);
101   - } else {
102   - return $this->render('create', [
103   - 'model' => $model,
104   - ]);
105 123 }
106   - }
107   -
108   - /**
109   - * Updates an existing User model.
110   - * If update is successful, the browser will be redirected to the 'view' page.
111   - * @param integer $id
112   - * @return mixed
113   - */
114   - public function actionUpdate($id)
115   - {
116   - $model = $this->findModel($id);
117   - if (Yii::$app->request->isAjax) {
118   - Yii::$app->response->format = Response::FORMAT_JSON;
119   - $model->load(Yii::$app->request->post());
120   - return ActiveForm::validate($model);
121   - }else if ($model->load(Yii::$app->request->post()) && $model->validate()) {
122   -
123   - $model->save();
124   -
125   - return $this->redirect(['view', 'id' => $model->id]);
126   - } else {
127   - return $this->render('create', [
128   - 'model' => $model,
129   - ]);
  124 +
  125 + /**
  126 + * Updates an existing User model.
  127 + * If update is successful, the browser will be redirected to the 'view' page.
  128 + *
  129 + * @param integer $id
  130 + *
  131 + * @return mixed
  132 + */
  133 + public function actionUpdate($id)
  134 + {
  135 + $model = $this->findModel($id);
  136 + if (Yii::$app->request->isAjax) {
  137 + Yii::$app->response->format = Response::FORMAT_JSON;
  138 + $model->load(Yii::$app->request->post());
  139 + return ActiveForm::validate($model);
  140 + } elseif ($model->load(Yii::$app->request->post()) && $model->validate()) {
  141 +
  142 + $model->save();
  143 +
  144 + return $this->redirect(
  145 + [
  146 + 'view',
  147 + 'id' => $model->id,
  148 + ]
  149 + );
  150 + } else {
  151 + return $this->render(
  152 + 'create',
  153 + [
  154 + 'model' => $model,
  155 + ]
  156 + );
  157 + }
130 158 }
131   - }
132   -
133   - /**
134   - * Deletes an existing User model.
135   - * If deletion is successful, the browser will be redirected to the 'index' page.
136   - * @param integer $id
137   - * @return mixed
138   - */
139   - public function actionDelete($id)
140   - {
141   - $this->findModel($id)->delete();
142   -
143   - return $this->redirect(['index']);
144   - }
145   -
146   - /**
147   - * Finds the User model based on its primary key value.
148   - * If the model is not found, a 404 HTTP exception will be thrown.
149   - * @param integer $id
150   - * @return User the loaded model
151   - * @throws NotFoundHttpException if the model cannot be found
152   - */
153   - protected function findModel($id)
154   - {
155   - if (($model = User::findOne($id)) !== null) {
156   - return $model;
157   - } else {
158   - throw new NotFoundHttpException('The requested page does not exist.');
  159 +
  160 + /**
  161 + * Deletes an existing User model.
  162 + * If deletion is successful, the browser will be redirected to the 'index' page.
  163 + *
  164 + * @param integer $id
  165 + *
  166 + * @return mixed
  167 + */
  168 + public function actionDelete($id)
  169 + {
  170 + $this->findModel($id)
  171 + ->delete();
  172 +
  173 + return $this->redirect([ 'index' ]);
  174 + }
  175 +
  176 + /**
  177 + * Finds the User model based on its primary key value.
  178 + * If the model is not found, a 404 HTTP exception will be thrown.
  179 + *
  180 + * @param integer $id
  181 + *
  182 + * @return User the loaded model
  183 + * @throws NotFoundHttpException if the model cannot be found
  184 + */
  185 + protected function findModel($id)
  186 + {
  187 + if (( $model = User::findOne($id) ) !== null) {
  188 + return $model;
  189 + } else {
  190 + throw new NotFoundHttpException('The requested page does not exist.');
  191 + }
159 192 }
160 193 }
161   -}
... ...
backend/models/Label.php
... ... @@ -10,22 +10,23 @@
10 10 /**
11 11 * Class Label
12 12 * * From language behavior *
13   - * @property OrdersLabelLang $lang
14   - * @property OrdersLabelLang[] $langs
15   - * @property OrdersLabelLang $object_lang
16   - * @property string $ownerKey
17   - * @property string $langKey
18   - * @property OrdersLabelLang[] $model_langs
19   - * @property bool $transactionStatus
20   - * @property integer $id
21   - * @property string $label
  13 + *
  14 + * @property orderLabelLang $lang
  15 + * @property orderLabelLang[] $langs
  16 + * @property orderLabelLang $objectLang
  17 + * @property string $ownerKey
  18 + * @property string $langKey
  19 + * @property orderLabelLang[] $modelLangs
  20 + * @property bool $transactionStatus
  21 + * @property integer $id
  22 + * @property string $label
22 23 * @method string getOwnerKey()
23 24 * @method void setOwnerKey( string $value )
24 25 * @method string getLangKey()
25 26 * @method void setLangKey( string $value )
26 27 * @method ActiveQuery getLangs()
27 28 * @method ActiveQuery getLang( integer $language_id )
28   - * @method OrdersLabelLang[] generateLangs()
  29 + * @method orderLabelLang[] generateLangs()
29 30 * @method void loadLangs( Request $request )
30 31 * @method bool linkLangs()
31 32 * @method bool saveLangs()
... ... @@ -47,17 +48,17 @@
47 48  
48 49 public static function tableName()
49 50 {
50   - return 'orders_label';
  51 + return 'order_label';
51 52 }
52 53  
53 54 public function behaviors()
54 55 {
55 56 return [
56 57 'language' => [
57   - 'class' => LanguageBehavior::className(),
58   - 'object_lang' => OrdersLabelLang::className(),
59   - 'ownerKey' => 'id',
60   - 'langKey' => 'orders_label_id',
  58 + 'class' => LanguageBehavior::className(),
  59 + 'objectLang' => orderLabelLang::className(),
  60 + 'ownerKey' => 'id',
  61 + 'langKey' => 'order_label_id',
61 62 ],
62 63 ];
63 64 }
... ...
backend/models/LabelSearch.php
... ... @@ -14,7 +14,7 @@
14 14 /**
15 15 * @var string
16 16 */
17   - public $name;
  17 + public $title;
18 18  
19 19 /**
20 20 * @inheritdoc
... ... @@ -29,7 +29,7 @@
29 29 [
30 30 [
31 31 'label',
32   - 'name',
  32 + 'title',
33 33 ],
34 34 'safe',
35 35 ],
... ... @@ -59,43 +59,51 @@
59 59  
60 60 // add conditions that should always apply here
61 61  
62   - $dataProvider = new ActiveDataProvider([
63   - 'query' => $query,
64   - 'sort' => [
65   - 'attributes' => [
66   - 'id',
67   - 'label',
68   - 'name' => [
69   - 'asc' => [ 'orders_label_lang.name' => SORT_ASC ],
70   - 'desc' => [ 'orders_label_lang.name' => SORT_DESC ],
  62 + $dataProvider = new ActiveDataProvider(
  63 + [
  64 + 'query' => $query,
  65 + 'sort' => [
  66 + 'attributes' => [
  67 + 'id',
  68 + 'label',
  69 + 'title' => [
  70 + 'asc' => [ 'order_label_lang.title' => SORT_ASC ],
  71 + 'desc' => [ 'order_label_lang.title' => SORT_DESC ],
  72 + ],
71 73 ],
72 74 ],
73   - ],
74   - ]);
  75 + ]
  76 + );
75 77  
76 78 $this->load($params);
77 79  
78   - if(!$this->validate()) {
  80 + if (!$this->validate()) {
79 81 // uncomment the following line if you do not want to return any records when validation fails
80 82 // $query->where('0=1');
81 83 return $dataProvider;
82 84 }
83 85  
84 86 // grid filtering conditions
85   - $query->andFilterWhere([
86   - 'id' => $this->id,
87   - ]);
  87 + $query->andFilterWhere(
  88 + [
  89 + 'id' => $this->id,
  90 + ]
  91 + );
88 92  
89   - $query->andFilterWhere([
90   - 'like',
91   - 'label',
92   - $this->label,
93   - ])
94   - ->andFilterWhere([
95   - 'like',
96   - 'orders_label_lang.name',
97   - $this->name,
98   - ]);
  93 + $query->andFilterWhere(
  94 + [
  95 + 'like',
  96 + 'label',
  97 + $this->label,
  98 + ]
  99 + )
  100 + ->andFilterWhere(
  101 + [
  102 + 'like',
  103 + 'order_label_lang.title',
  104 + $this->title,
  105 + ]
  106 + );
99 107  
100 108 return $dataProvider;
101 109 }
... ...
backend/models/LoginForm.php
... ... @@ -14,7 +14,7 @@ class LoginForm extends Model
14 14 public $password;
15 15 public $rememberMe = true;
16 16  
17   - private $_user;
  17 + private $user;
18 18  
19 19  
20 20 /**
... ... @@ -70,11 +70,11 @@ class LoginForm extends Model
70 70 */
71 71 protected function getUser()
72 72 {
73   - if ($this->_user === null) {
74   - $this->_user = User::findByUsername($this->username);
  73 + if ($this->user === null) {
  74 + $this->user = User::findByUsername($this->username);
75 75 }
76 76  
77   - return $this->_user;
  77 + return $this->user;
78 78 }
79 79  
80 80 /**
... ...
backend/models/Orders.php renamed to backend/models/Order.php
... ... @@ -4,14 +4,14 @@
4 4  
5 5 use common\models\Customer;
6 6  
7   - class Orders extends \yii\db\ActiveRecord
  7 + class order extends \yii\db\ActiveRecord
8 8 {
9 9  
10 10 public $labels;
11 11  
12 12 public static function tableName()
13 13 {
14   - return 'orders';
  14 + return 'order';
15 15 }
16 16  
17 17 public function rules()
... ...
backend/models/OrdersLabelLang.php renamed to backend/models/OrderLabelLang.php
... ... @@ -7,20 +7,21 @@
7 7 use yii\db\ActiveRecord;
8 8  
9 9 /**
10   - * This is the model class for table "orders_label_lang".
11   - * @property integer $orders_label_id
  10 + * This is the model class for table "order_label_lang".
  11 + *
  12 + * @property integer $order_label_id
12 13 * @property integer $language_id
13   - * @property string $name
  14 + * @property string $title
14 15 * @property Language $language
15 16 * @property Label $label
16 17 */
17   - class OrdersLabelLang extends ActiveRecord
  18 + class orderLabelLang extends ActiveRecord
18 19 {
19 20  
20 21 public static function primaryKey()
21 22 {
22 23 return [
23   - 'orders_label_id',
  24 + 'order_label_id',
24 25 'language_id',
25 26 ];
26 27 }
... ... @@ -30,7 +31,7 @@
30 31 */
31 32 public static function tableName()
32 33 {
33   - return 'orders_label_lang';
  34 + return 'order_label_lang';
34 35 }
35 36  
36 37 /**
... ... @@ -40,39 +41,39 @@
40 41 {
41 42 return [
42 43 [
43   - [ 'name' ],
  44 + [ 'title' ],
44 45 'required',
45 46 ],
46 47 [
47   - [ 'name' ],
  48 + [ 'title' ],
48 49 'string',
49 50 'max' => 255,
50 51 ],
51 52 [
52 53 [
53   - 'orders_label_id',
  54 + 'order_label_id',
54 55 'language_id',
55 56 ],
56 57 'unique',
57 58 'targetAttribute' => [
58   - 'orders_label_id',
  59 + 'order_label_id',
59 60 'language_id',
60 61 ],
61   - 'message' => 'The combination of Orders Label ID and Language ID has already been taken.',
  62 + 'message' => 'The combination of order Label ID and Language ID has already been taken.',
62 63 ],
63 64 [
64 65 [ 'language_id' ],
65 66 'exist',
66 67 'skipOnError' => true,
67 68 'targetClass' => Language::className(),
68   - 'targetAttribute' => [ 'language_id' => 'language_id' ],
  69 + 'targetAttribute' => [ 'language_id' => 'id' ],
69 70 ],
70 71 [
71   - [ 'orders_label_id' ],
  72 + [ 'order_label_id' ],
72 73 'exist',
73 74 'skipOnError' => true,
74 75 'targetClass' => Label::className(),
75   - 'targetAttribute' => [ 'orders_label_id' => 'id' ],
  76 + 'targetAttribute' => [ 'order_label_id' => 'id' ],
76 77 ],
77 78 ];
78 79 }
... ... @@ -83,9 +84,9 @@
83 84 public function attributeLabels()
84 85 {
85 86 return [
86   - 'orders_label_id' => Yii::t('app', 'Orders Label ID'),
87   - 'language_id' => Yii::t('app', 'Language ID'),
88   - 'name' => Yii::t('app', 'Name'),
  87 + 'order_label_id' => Yii::t('app', 'order Label ID'),
  88 + 'language_id' => Yii::t('app', 'Language ID'),
  89 + 'title' => Yii::t('app', 'Name'),
89 90 ];
90 91 }
91 92  
... ... @@ -94,7 +95,7 @@
94 95 */
95 96 public function getLanguage()
96 97 {
97   - return $this->hasOne(Language::className(), [ 'language_id' => 'language_id' ]);
  98 + return $this->hasOne(Language::className(), [ 'id' => 'language_id' ]);
98 99 }
99 100  
100 101 /**
... ... @@ -102,6 +103,6 @@
102 103 */
103 104 public function getLabel()
104 105 {
105   - return $this->hasOne(Label::className(), [ 'id' => 'orders_label_id' ]);
  106 + return $this->hasOne(Label::className(), [ 'id' => 'order_label_id' ]);
106 107 }
107 108 }
... ...
backend/models/OrdersProducts.php renamed to backend/models/OrderProducts.php
... ... @@ -3,13 +3,14 @@
3 3 namespace backend\models;
4 4  
5 5 use common\modules\product\models\ProductVariant;
  6 + use yii\db\ActiveRecord;
6 7  
7   - class OrdersProducts extends \yii\db\ActiveRecord
  8 + class orderProduct extends ActiveRecord
8 9 {
9 10  
10 11 public static function tableName()
11 12 {
12   - return 'orders_products';
  13 + return 'order_product';
13 14 }
14 15  
15 16 public function rules()
... ... @@ -40,6 +41,6 @@
40 41  
41 42 public function getMod()
42 43 {
43   - return $this->hasOne(ProductVariant::className(), [ 'product_variant_id' => 'mod_id' ]);
  44 + return $this->hasOne(ProductVariant::className(), [ 'product_variant_id' => 'product_variant_id' ]);
44 45 }
45 46 }
46 47 \ No newline at end of file
... ...
backend/models/OrdersSearch.php renamed to backend/models/OrderSearch.php
... ... @@ -6,9 +6,9 @@ use yii\base\Model;
6 6 use yii\data\ActiveDataProvider;
7 7  
8 8 /**
9   - * OrdersSearch represents the model behind the search form about `backend\models\Orders`.
  9 + * orderSearch represents the model behind the search form about `backend\models\order`.
10 10 */
11   -class OrdersSearch extends Orders
  11 +class orderearch extends order
12 12 {
13 13 /**
14 14 * @inheritdoc
... ... @@ -40,7 +40,7 @@ class OrdersSearch extends Orders
40 40 */
41 41 public function search($params)
42 42 {
43   - $query = Orders::find();
  43 + $query = order::find();
44 44  
45 45 // add conditions that should always apply here
46 46  
... ...
backend/views/article/_form.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var Article $model
13   - * @var ArticleLang[] $model_langs
  13 + * @var ArticleLang[] $modelLangs
14 14 * @var ActiveForm $form
15 15 */
16 16 ?>
... ... @@ -51,7 +51,7 @@
51 51  
52 52 <?php
53 53 echo LanguageForm::widget([
54   - 'model_langs' => $model_langs,
  54 + 'modelLangs' => $modelLangs,
55 55 'formView' => '@backend/views/article/_form_language',
56 56 'form' => $form,
57 57 ]);
... ...
backend/views/article/_form_language.php
... ... @@ -13,11 +13,11 @@
13 13 * @var View $this
14 14 */
15 15 ?>
16   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  16 +<?= $form->field($model_lang, '[' . $language->id . ']title')
17 17 ->textInput([ 'maxlength' => true ]); ?>
18   -<?= $form->field($model_lang, '[' . $language->language_id . ']alias')
  18 +<?= $form->field($model_lang, '[' . $language->id . ']alias')
19 19 ->textInput([ 'maxlength' => true ]); ?>
20   -<?= $form->field($model_lang, '[' . $language->language_id . ']body')
  20 +<?= $form->field($model_lang, '[' . $language->id . ']body')
21 21 ->widget(CKEditor::className(), [
22 22 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
23 23 'preset' => 'full',
... ... @@ -27,7 +27,7 @@
27 27 ]),
28 28 ]) ?>
29 29  
30   -<?= $form->field($model_lang, '[' . $language->language_id . ']body_preview')
  30 +<?= $form->field($model_lang, '[' . $language->id . ']body_preview')
31 31 ->widget(CKEditor::className(), [
32 32 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
33 33 'preset' => 'full',
... ... @@ -37,17 +37,17 @@
37 37 ]),
38 38 ]) ?>
39 39  
40   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_title')
  40 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
41 41 ->textInput([ 'maxlength' => true ]) ?>
42 42  
43   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_keywords')
  43 +<?= $form->field($model_lang, '[' . $language->id . ']meta_keywords')
44 44 ->textInput([ 'maxlength' => true ]) ?>
45 45  
46   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_description')
  46 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
47 47 ->textInput([ 'maxlength' => true ]) ?>
48 48  
49   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  49 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
50 50 ->textarea([ 'rows' => 6 ]) ?>
51 51  
52   -<?= $form->field($model_lang, '[' . $language->language_id . ']h1')
  52 +<?= $form->field($model_lang, '[' . $language->id . ']h1')
53 53 ->textInput([ 'maxlength' => true ]) ?>
... ...
backend/views/article/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\ArticlesSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="articles-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'id') ?>
19   -
20   - <?= $form->field($model, 'date') ?>
21   -
22   - <?= $form->field($model, 'title') ?>
23   -
24   - <?= $form->field($model, 'body') ?>
25   -
26   - <?= $form->field($model, 'image') ?>
27   -
28   - <?php // echo $form->field($model, 'translit') ?>
29   -
30   - <?php // echo $form->field($model, 'meta_title') ?>
31   -
32   - <?php // echo $form->field($model, 'meta_keywords') ?>
33   -
34   - <?php // echo $form->field($model, 'meta_description') ?>
35   -
36   - <?php // echo $form->field($model, 'seo_text') ?>
37   -
38   - <?php // echo $form->field($model, 'h1') ?>
39   -
40   - <div class="form-group">
41   - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
42   - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
43   - </div>
44   -
45   - <?php ActiveForm::end(); ?>
46   -
47   -</div>
backend/views/article/create.php
... ... @@ -7,7 +7,7 @@
7 7 /**
8 8 * @var View $this
9 9 * @var Article $model
10   - * @var ArticleLang[] $model_langs
  10 + * @var ArticleLang[] $modelLangs
11 11 */
12 12 $this->title = \Yii::t('app', 'Create Article');
13 13 $this->params[ 'breadcrumbs' ][] = [
... ... @@ -22,7 +22,7 @@
22 22  
23 23 <?= $this->render('_form', [
24 24 'model' => $model,
25   - 'model_langs' => $model_langs,
  25 + 'modelLangs' => $modelLangs,
26 26 ]) ?>
27 27  
28 28 </div>
... ...
backend/views/article/update.php
... ... @@ -7,7 +7,7 @@
7 7 /**
8 8 * @var View $this
9 9 * @var Article $model
10   - * @var ArticleLang[] $model_langs
  10 + * @var ArticleLang[] $modelLangs
11 11 */
12 12 $this->title = \Yii::t('app', 'Update Article') . ': ' . $model->lang->title;
13 13 $this->params[ 'breadcrumbs' ][] = [
... ... @@ -29,7 +29,7 @@
29 29  
30 30 <?= $this->render('_form', [
31 31 'model' => $model,
32   - 'model_langs' => $model_langs,
  32 + 'modelLangs' => $modelLangs,
33 33 ]) ?>
34 34  
35 35 </div>
... ...
backend/views/banner/_form.php
... ... @@ -12,7 +12,7 @@
12 12 * @var View $this
13 13 * @var Banner $model
14 14 * @var ActiveForm $form
15   - * @var BannerLang[] $model_langs
  15 + * @var BannerLang[] $modelLangs
16 16 */
17 17 ?>
18 18  
... ... @@ -42,7 +42,7 @@
42 42 ] )) ?>
43 43  
44 44 <?= LanguageForm::widget([
45   - 'model_langs' => $model_langs,
  45 + 'modelLangs' => $modelLangs,
46 46 'formView' => '@backend/views/banner/_form_language',
47 47 'form' => $form,
48 48 ]) ?>
... ...
backend/views/banner/_form_language.php
... ... @@ -11,12 +11,12 @@
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16   -<?= $form->field($model_lang, '[' . $language->language_id . ']alt')
  16 +<?= $form->field($model_lang, '[' . $language->id . ']alt')
17 17 ->textInput([ 'maxlength' => true ]); ?>
18 18  
19   -<?= $form->field($model_lang, '['.$language->language_id.']image')->widget(\kartik\file\FileInput::className(), [
  19 +<?= $form->field($model_lang, '['.$language->id.']image')->widget(\kartik\file\FileInput::className(), [
20 20 'model' => $model_lang,
21 21 'attribute' => 'image',
22 22 'options' => [
... ...
backend/views/banner/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\BannerSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="banner-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'banner_id') ?>
19   -
20   -
21   - <?= $form->field($model, 'image') ?>
22   -
23   - <?= $form->field($model, 'alt') ?>
24   -
25   - <?= $form->field($model, 'title') ?>
26   -
27   - <?php // echo $form->field($model, 'url') ?>
28   -
29   - <?php // echo $form->field($model, 'status') ?>
30   -
31   - <div class="form-group">
32   - <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
33   - <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
34   - </div>
35   -
36   - <?php ActiveForm::end(); ?>
37   -
38   -</div>
backend/views/banner/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Banner $model
11   - * @var BannerLang[] $model_langs
  11 + * @var BannerLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Create Banner');
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <?= $this->render('_form', [
26 26 'model' => $model,
27   - 'model_langs' => $model_langs,
  27 + 'modelLangs' => $modelLangs,
28 28 ]) ?>
29 29  
30 30 </div>
... ...
backend/views/banner/index.php
... ... @@ -23,7 +23,7 @@
23 23 'dataProvider' => $dataProvider,
24 24 'filterModel' => $searchModel,
25 25 'columns' => [
26   - 'banner_id',
  26 + 'id',
27 27 [
28 28 'attribute' => 'url',
29 29 'content' => function($model) {
... ...
backend/views/banner/update.php
... ... @@ -8,21 +8,21 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Banner $model
11   - * @var BannerLang[] $model_langs
  11 + * @var BannerLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Update {modelClass}: ', [
15 15 'modelClass' => 'Banner',
16   - ]) . $model->banner_id;
  16 + ]) . $model->id;
17 17 $this->params[ 'breadcrumbs' ][] = [
18 18 'label' => Yii::t('app', 'Banners'),
19 19 'url' => [ 'index' ],
20 20 ];
21 21 $this->params[ 'breadcrumbs' ][] = [
22   - 'label' => $model->banner_id,
  22 + 'label' => $model->id,
23 23 'url' => [
24 24 'view',
25   - 'id' => $model->banner_id,
  25 + 'id' => $model->id,
26 26 ],
27 27 ];
28 28 $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update');
... ... @@ -33,7 +33,7 @@
33 33  
34 34 <?= $this->render('_form', [
35 35 'model' => $model,
36   - 'model_langs' => $model_langs,
  36 + 'modelLangs' => $modelLangs,
37 37 ]) ?>
38 38  
39 39 </div>
... ...
backend/views/banner/view.php
... ... @@ -21,11 +21,11 @@
21 21 <p>
22 22 <?= Html::a(Yii::t('app', 'Update'), [
23 23 'update',
24   - 'id' => $model->banner_id,
  24 + 'id' => $model->id,
25 25 ], [ 'class' => 'btn btn-primary' ]) ?>
26 26 <?= Html::a(Yii::t('app', 'Delete'), [
27 27 'delete',
28   - 'id' => $model->banner_id,
  28 + 'id' => $model->id,
29 29 ], [
30 30 'class' => 'btn btn-danger',
31 31 'data' => [
... ... @@ -38,7 +38,7 @@
38 38 <?= DetailView::widget([
39 39 'model' => $model,
40 40 'attributes' => [
41   - 'banner_id',
  41 + 'id',
42 42 [
43 43 'attribute' => 'url',
44 44 'value' => Html::a($model->url, \Yii::$app->urlManagerFrontend->createUrl($model->url)),
... ...
backend/views/bg/_form.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var Bg $model
13   - * @var BgLang[] $model_langs
  13 + * @var BgLang[] $modelLangs
14 14 * @var ActiveForm $form
15 15 */
16 16 ?>
... ... @@ -50,7 +50,7 @@
50 50 ]); ?>
51 51  
52 52 <?= LanguageForm::widget([
53   - 'model_langs' => $model_langs,
  53 + 'modelLangs' => $modelLangs,
54 54 'form' => $form,
55 55 'formView' => '@backend/views/bg/_form_language',
56 56 ]) ?>
... ...
backend/views/bg/_form_language.php
... ... @@ -11,5 +11,5 @@
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16 16 \ No newline at end of file
... ...
backend/views/bg/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\BgSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="bg-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'id') ?>
19   -
20   - <?= $form->field($model, 'title') ?>
21   -
22   - <?= $form->field($model, 'url') ?>
23   -
24   - <?= $form->field($model, 'image') ?>
25   -
26   - <div class="form-group">
27   - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
28   - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
29   - </div>
30   -
31   - <?php ActiveForm::end(); ?>
32   -
33   -</div>
backend/views/bg/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Bg $model
11   - * @var BgLang[] $model_langs
  11 + * @var BgLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = \Yii::t('app', 'Create Bg');
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <?= $this->render('_form', [
26 26 'model' => $model,
27   - 'model_langs' => $model_langs,
  27 + 'modelLangs' => $modelLangs,
28 28 ]) ?>
29 29  
30 30 </div>
... ...
backend/views/bg/update.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Bg $model
11   - * @var BgLang[] $model_langs
  11 + * @var BgLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = \Yii::t('app', 'Update Bg: ') . $model->lang->title;
... ... @@ -31,7 +31,7 @@
31 31  
32 32 <?= $this->render('_form', [
33 33 'model' => $model,
34   - 'model_langs' => $model_langs,
  34 + 'modelLangs' => $modelLangs,
35 35 ]) ?>
36 36  
37 37 </div>
... ...
backend/views/brand/_form.php
... ... @@ -11,7 +11,7 @@
11 11 * @var View $this
12 12 * @var Brand $model
13 13 * @var ActiveForm $form
14   - * @var BrandLang[] $model_langs
  14 + * @var BrandLang[] $modelLangs
15 15 */
16 16 ?>
17 17  
... ... @@ -46,7 +46,7 @@
46 46 <?= $form->field($model, 'in_menu')->dropDownList([\Yii::t('product', 'No'), \Yii::t('product', 'Yes')]); ?>
47 47  
48 48 <?= LanguageForm::widget([
49   - 'model_langs' => $model_langs,
  49 + 'modelLangs' => $modelLangs,
50 50 'formView' => '@backend/views/brand/_form_language',
51 51 'form' => $form,
52 52 ]) ?>
... ...
backend/views/brand/_form_language.php
... ... @@ -11,20 +11,20 @@
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16 16  
17   -<?= $form->field($model_lang, '[' . $language->language_id . ']alias')
  17 +<?= $form->field($model_lang, '[' . $language->id . ']alias')
18 18 ->textInput([ 'maxlength' => true ]); ?>
19 19  
20   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_title')
  20 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
21 21 ->textInput([ 'maxlength' => true ]) ?>
22 22  
23   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_robots')
  23 +<?= $form->field($model_lang, '[' . $language->id . ']meta_robots')
24 24 ->textInput([ 'maxlength' => true ]) ?>
25 25  
26   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_desc')
  26 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
27 27 ->textInput([ 'maxlength' => true ]) ?>
28 28  
29   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  29 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
30 30 ->textarea([ 'rows' => 6 ]) ?>
... ...
backend/views/brand/_search.php deleted
1   -<?php
2   -
3   - use yii\helpers\Html;
4   - use yii\widgets\ActiveForm;
5   -
6   - /**
7   - * @var $this yii\web\View
8   - * @var $model common\modules\product\models\BrandSearch
9   - * @var $form yii\widgets\ActiveForm
10   - */
11   -?>
12   -
13   -<div class="brand-search">
14   -
15   - <?php $form = ActiveForm::begin([
16   - 'action' => [ 'index' ],
17   - 'method' => 'get',
18   - ]); ?>
19   -
20   - <?= $form->field($model, 'brand_id') ?>
21   -
22   - <?= $form->field($model, 'alias') ?>
23   -
24   - <?= $form->field($model, 'image') ?>
25   -
26   - <?= $form->field($model, 'meta_title') ?>
27   -
28   - <div class="form-group">
29   - <?= Html::submitButton(Yii::t('product', 'Search'), [ 'class' => 'btn btn-primary' ]) ?>
30   - <?= Html::resetButton(Yii::t('product', 'Reset'), [ 'class' => 'btn btn-default' ]) ?>
31   - </div>
32   -
33   - <?php ActiveForm::end(); ?>
34   -
35   -</div>
backend/views/brand/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Brand $model
11   - * @var BrandLang[] $model_langs
  11 + * @var BrandLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('product', 'Create Brand');
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <?= $this->render('_form', [
26 26 'model' => $model,
27   - 'model_langs' => $model_langs,
  27 + 'modelLangs' => $modelLangs,
28 28 ]) ?>
29 29  
30 30 </div>
... ...
backend/views/brand/index.php
... ... @@ -27,10 +27,10 @@
27 27 'dataProvider' => $dataProvider,
28 28 'filterModel' => $searchModel,
29 29 'columns' => [
30   - 'brand_id',
  30 + 'id',
31 31 [
32   - 'attribute' => 'brand_name',
33   - 'value' => 'lang.name',
  32 + 'attribute' => 'brandName',
  33 + 'value' => 'lang.title',
34 34 ],
35 35 'imageUrl:image',
36 36 [
... ...
backend/views/brand/update.php
... ... @@ -8,21 +8,21 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Brand $model
11   - * @var BrandLang[] $model_langs
  11 + * @var BrandLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('product', 'Update {modelClass}: ', [
15 15 'modelClass' => 'Brand',
16   - ]) . ' ' . $model->lang->name;
  16 + ]) . ' ' . $model->lang->title;
17 17 $this->params[ 'breadcrumbs' ][] = [
18 18 'label' => Yii::t('product', 'Brands'),
19 19 'url' => [ 'index' ],
20 20 ];
21 21 $this->params[ 'breadcrumbs' ][] = [
22   - 'label' => $model->lang->name,
  22 + 'label' => $model->lang->title,
23 23 'url' => [
24 24 'view',
25   - 'id' => $model->brand_id,
  25 + 'id' => $model->id,
26 26 ],
27 27 ];
28 28 $this->params[ 'breadcrumbs' ][] = Yii::t('product', 'Update');
... ... @@ -33,7 +33,7 @@
33 33  
34 34 <?= $this->render('_form', [
35 35 'model' => $model,
36   - 'model_langs' => $model_langs,
  36 + 'modelLangs' => $modelLangs,
37 37 ]) ?>
38 38  
39 39 </div>
... ...
backend/views/brand/view.php
... ... @@ -10,7 +10,7 @@
10 10 * @var Brand $model
11 11 */
12 12  
13   - $this->title = $model->lang->name;
  13 + $this->title = $model->lang->title;
14 14 $this->params[ 'breadcrumbs' ][] = [
15 15 'label' => Yii::t('product', 'Brands'),
16 16 'url' => [ 'index' ],
... ... @@ -24,11 +24,11 @@
24 24 <p>
25 25 <?= Html::a(Yii::t('product', 'Update'), [
26 26 'update',
27   - 'id' => $model->brand_id,
  27 + 'id' => $model->id,
28 28 ], [ 'class' => 'btn btn-primary' ]) ?>
29 29 <?= Html::a(Yii::t('product', 'Delete'), [
30 30 'delete',
31   - 'id' => $model->brand_id,
  31 + 'id' => $model->id,
32 32 ], [
33 33 'class' => 'btn btn-danger',
34 34 'data' => [
... ... @@ -41,8 +41,8 @@
41 41 <?= DetailView::widget([
42 42 'model' => $model,
43 43 'attributes' => [
44   - 'brand_id',
45   - 'lang.name',
  44 + 'id',
  45 + 'lang.title',
46 46 'lang.alias',
47 47 [
48 48 'attribute' => 'in_menu',
... ... @@ -54,7 +54,7 @@
54 54 'imageUrl:image',
55 55 'lang.meta_title',
56 56 'lang.meta_robots',
57   - 'lang.meta_desc',
  57 + 'lang.meta_description',
58 58 'lang.seo_text',
59 59 ],
60 60 ]) ?>
... ...
backend/views/category/_form.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var Category $model
13   - * @var CategoryLang[] $model_langs
  13 + * @var CategoryLang[] $modelLangs
14 14 * @var string[] $categories
15 15 * @var ActiveForm $form
16 16 */
... ... @@ -27,7 +27,7 @@
27 27 ->dropDownList($categories, [
28 28 'prompt' => Yii::t('rubrication', 'Root category'),
29 29 'options' => [
30   - $model->category_id => [ 'disabled' => true ],
  30 + $model->id => [ 'disabled' => true ],
31 31 ],
32 32 ])
33 33 ->label(Yii::t('product', 'Parent category')) ?>
... ... @@ -55,7 +55,7 @@
55 55 ->hint('ะ”ะปั ะบะพั€ั€ะตะบั‚ะฝะพะณะพ ะพั‚ะพะฑั€ะฐะถะตะฝะธั ะฝะฐ ัะฐะนั‚ะต, ั€ะฐะทะผะตั€ ะธะทะพะฑั€ะฐะถะตะฝะธั ะดะพะปะถะตะฝ ะฑั‹ั‚ัŒ 262x144 ะปะธะฑะพ ัะพะฑะปัŽะดะฐั‚ัŒ ัะพะพั‚ะฝะพัˆะตะฝะธะต ัั‚ะพั€ะพะฝ ะฟั€ะธะผะตั€ะฝะพ 2:1'); ?>
56 56  
57 57 <?= LanguageForm::widget([
58   - 'model_langs' => $model_langs,
  58 + 'modelLangs' => $modelLangs,
59 59 'formView' => '@backend/views/category/_form_language',
60 60 'form' => $form,
61 61 ]) ?>
... ...
backend/views/category/_form_language.php
... ... @@ -11,23 +11,23 @@
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16 16  
17   -<?= $form->field($model_lang, '[' . $language->language_id . ']alias')
  17 +<?= $form->field($model_lang, '[' . $language->id . ']alias')
18 18 ->textInput([ 'maxlength' => true ]); ?>
19 19  
20   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_title')
  20 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
21 21 ->textInput([ 'maxlength' => true ]) ?>
22 22  
23   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_robots')
  23 +<?= $form->field($model_lang, '[' . $language->id . ']meta_robots')
24 24 ->textInput([ 'maxlength' => true ]) ?>
25 25  
26   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_desc')
  26 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
27 27 ->textInput([ 'maxlength' => true ]) ?>
28 28  
29   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  29 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
30 30 ->textarea([ 'rows' => 6 ]) ?>
31 31  
32   -<?= $form->field($model_lang, '[' . $language->language_id . ']h1')
  32 +<?= $form->field($model_lang, '[' . $language->id . ']h1')
33 33 ->textInput([ 'maxlength' => true ]) ?>
34 34 \ No newline at end of file
... ...
backend/views/category/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\modules\product\models\CategorySearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="category-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'category_id') ?>
19   -
20   - <?= $form->field($model, 'parent_id') ?>
21   -
22   - <?= $form->field($model, 'path') ?>
23   -
24   - <?= $form->field($model, 'depth') ?>
25   -
26   - <?= $form->field($model, 'image') ?>
27   -
28   - <div class="form-group">
29   - <?= Html::submitButton(Yii::t('product', 'Search'), ['class' => 'btn btn-primary']) ?>
30   - <?= Html::resetButton(Yii::t('product', 'Reset'), ['class' => 'btn btn-default']) ?>
31   - </div>
32   -
33   - <?php ActiveForm::end(); ?>
34   -
35   -</div>
backend/views/category/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Category $model
11   - * @var CategoryLang[] $model_langs
  11 + * @var CategoryLang[] $modelLangs
12 12 * @var string[] $categories
13 13 */
14 14  
... ... @@ -25,7 +25,7 @@
25 25  
26 26 <?= $this->render('_form', [
27 27 'model' => $model,
28   - 'model_langs' => $model_langs,
  28 + 'modelLangs' => $modelLangs,
29 29 'categories' => $categories,
30 30 ]) ?>
31 31  
... ...
backend/views/category/index.php
... ... @@ -24,9 +24,9 @@
24 24 'filterModel' => $searchModel,
25 25 'columns' => [
26 26 [ 'class' => 'yii\grid\SerialColumn' ],
27   - 'category_id',
  27 + 'id',
28 28 [
29   - 'attribute' => 'category_name',
  29 + 'attribute' => 'brandName',
30 30 'content' => function($data) {
31 31 /**
32 32 * @var Category $data
... ... @@ -34,9 +34,9 @@
34 34 $op = [];
35 35 foreach($data->getParents()->with('lang')
36 36 ->all() as $parent) {
37   - $op[] = $parent->lang->name;
  37 + $op[] = $parent->lang->title;
38 38 }
39   - $op[] = $data->lang->name;
  39 + $op[] = $data->lang->title;
40 40 return implode('&nbsp;&rarr;&nbsp;', $op);
41 41 },
42 42 ],
... ...
backend/views/category/update.php
... ... @@ -8,22 +8,22 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Category $model
11   - * @var CategoryLang[] $model_langs
  11 + * @var CategoryLang[] $modelLangs
12 12 * @var string[] $categories
13 13 */
14 14  
15 15 $this->title = Yii::t('product', 'Update {modelClass}: ', [
16 16 'modelClass' => 'Category',
17   - ]) . ' ' . $model->lang->name;
  17 + ]) . ' ' . $model->lang->title;
18 18 $this->params[ 'breadcrumbs' ][] = [
19 19 'label' => Yii::t('product', 'Categories'),
20 20 'url' => [ 'index' ],
21 21 ];
22 22 $this->params[ 'breadcrumbs' ][] = [
23   - 'label' => $model->lang->name,
  23 + 'label' => $model->lang->title,
24 24 'url' => [
25 25 'view',
26   - 'id' => $model->category_id,
  26 + 'id' => $model->id,
27 27 ],
28 28 ];
29 29 $this->params[ 'breadcrumbs' ][] = Yii::t('product', 'Update');
... ... @@ -34,7 +34,7 @@
34 34  
35 35 <?= $this->render('_form', [
36 36 'model' => $model,
37   - 'model_langs' => $model_langs,
  37 + 'modelLangs' => $modelLangs,
38 38 'categories' => $categories,
39 39 ]) ?>
40 40  
... ...
backend/views/category/view.php
... ... @@ -11,7 +11,7 @@
11 11 * @var Category[] $tree
12 12 */
13 13  
14   - $this->title = $model->lang->name;
  14 + $this->title = $model->lang->title;
15 15 $this->params[ 'breadcrumbs' ][] = [
16 16 'label' => Yii::t('product', 'Categories'),
17 17 'url' => [ 'index' ],
... ... @@ -19,9 +19,9 @@
19 19 $this->params[ 'breadcrumbs' ][] = $this->title;
20 20 $tree_links = [];
21 21 foreach($tree as $item) {
22   - $tree_links[] = Html::a($item->lang->name, [
  22 + $tree_links[] = Html::a($item->lang->title, [
23 23 'view',
24   - 'id' => $item->category_id,
  24 + 'id' => $item->id,
25 25 ]);
26 26 }
27 27 if(empty($tree_links)) {
... ... @@ -37,11 +37,11 @@
37 37 <p>
38 38 <?= Html::a(Yii::t('product', 'Update'), [
39 39 'update',
40   - 'id' => $model->category_id,
  40 + 'id' => $model->id,
41 41 ], [ 'class' => 'btn btn-primary' ]) ?>
42 42 <?= Html::a(Yii::t('product', 'Delete'), [
43 43 'delete',
44   - 'id' => $model->category_id,
  44 + 'id' => $model->id,
45 45 ], [
46 46 'class' => 'btn btn-danger',
47 47 'data' => [
... ... @@ -52,7 +52,7 @@
52 52 <?= Html::a(Yii::t('product', 'Create Category'), [ 'category/create' ], [ 'class' => 'btn btn-success' ]) ?>
53 53 <?php
54 54 if(!empty( $model->parent_id )) {
55   - echo Html::a(Yii::t('product', 'Create category By {name}', [ 'name' => $model->parent->lang->name ]), [ 'category/create?parent=' . $model->parent->category_id ], [ 'class' => 'btn btn-success' ]);
  55 + echo Html::a(Yii::t('product', 'Create category By {title}', [ 'title' => $model->parent->lang->title ]), [ 'category/create?parent=' . $model->parent->id ], [ 'class' => 'btn btn-success' ]);
56 56 }
57 57 ?>
58 58 </p>
... ... @@ -60,7 +60,7 @@
60 60 <?= DetailView::widget([
61 61 'model' => $model,
62 62 'attributes' => [
63   - 'category_id',
  63 + 'id',
64 64 [
65 65 'label' => \Yii::t('product', 'Category tree'),
66 66 'value' => $tree_string,
... ... @@ -70,7 +70,7 @@
70 70 'lang.alias',
71 71 'lang.meta_title',
72 72 'lang.meta_robots',
73   - 'lang.meta_desc',
  73 + 'lang.meta_description',
74 74 'lang.seo_text',
75 75 'lang.h1',
76 76 ],
... ...
backend/views/delivery/_form.php
1 1 <?php
2 2  
3   - use common\models\OrdersDeliveryLang;
  3 + use common\models\orderDeliveryLang;
4 4 use yii\helpers\Html;
5 5 use yii\widgets\ActiveForm;
6 6 use common\modules\language\widgets\LanguageForm;
... ... @@ -9,7 +9,7 @@
9 9 * @var yii\web\View $this
10 10 * @var common\models\Delivery $model
11 11 * @var yii\widgets\ActiveForm $form
12   - * @var OrdersDeliveryLang[] $model_langs
  12 + * @var orderDeliveryLang[] $modelLangs
13 13 */
14 14 ?>
15 15  
... ... @@ -29,7 +29,7 @@
29 29 ->textInput() ?>
30 30  
31 31 <?= LanguageForm::widget([
32   - 'model_langs' => $model_langs,
  32 + 'modelLangs' => $modelLangs,
33 33 'formView' => '@backend/views/delivery/_form_language',
34 34 'form' => $form,
35 35 ]) ?>
... ...
backend/views/delivery/_form_language.php
1 1 <?php
2   - use common\models\OrdersDeliveryLang;
  2 + use common\models\orderDeliveryLang;
3 3 use common\modules\language\models\Language;
4 4 use yii\web\View;
5 5 use yii\widgets\ActiveForm;
6 6  
7 7 /**
8   - * @var OrdersDeliveryLang $model_lang
  8 + * @var orderDeliveryLang $model_lang
9 9 * @var Language $language
10 10 * @var ActiveForm $form
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16 16  
17   -<?= $form->field($model_lang, '[' . $language->language_id . ']text')
  17 +<?= $form->field($model_lang, '[' . $language->id . ']text')
18 18 ->textarea(); ?>
... ...
backend/views/delivery/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\DeliverySearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="delivery-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'id') ?>
19   -
20   - <?= $form->field($model, 'parent_id') ?>
21   -
22   - <?= $form->field($model, 'value') ?>
23   -
24   - <?= $form->field($model, 'sort') ?>
25   -
26   - <div class="form-group">
27   - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
28   - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
29   - </div>
30   -
31   - <?php ActiveForm::end(); ?>
32   -
33   -</div>
backend/views/delivery/create.php
1 1 <?php
2 2  
3 3 use common\models\Delivery;
4   - use common\models\OrdersDeliveryLang;
  4 + use common\models\orderDeliveryLang;
5 5 use yii\helpers\Html;
6 6 use yii\web\View;
7 7  
8 8 /**
9 9 * @var View $this
10 10 * @var Delivery $model
11   - * @var OrdersDeliveryLang[] $model_langs
  11 + * @var orderDeliveryLang[] $modelLangs
12 12 * @var array $parent_items
13 13 */
14 14  
... ... @@ -25,7 +25,7 @@
25 25  
26 26 <?= $this->render('_form', [
27 27 'model' => $model,
28   - 'model_langs' => $model_langs,
  28 + 'modelLangs' => $modelLangs,
29 29 'parent_items' => $parent_items,
30 30 ]) ?>
31 31  
... ...
backend/views/delivery/index.php
... ... @@ -33,7 +33,7 @@
33 33 'value' => 'lang.title',
34 34 ],
35 35 [
36   - 'attribute' => 'parent_title',
  36 + 'attribute' => 'parentTitle',
37 37 'value' => 'parent.lang.title',
38 38 ],
39 39 'value',
... ...
backend/views/delivery/update.php
1 1 <?php
2 2  
3   - use common\models\OrdersDeliveryLang;
  3 + use common\models\orderDeliveryLang;
4 4 use yii\helpers\Html;
5 5 use common\models\Delivery;
6 6 use yii\web\View;
... ... @@ -9,7 +9,7 @@
9 9 * @var View $this
10 10 * @var Delivery $model
11 11 * @var array $parent_items
12   - * @var OrdersDeliveryLang[] $model_langs
  12 + * @var orderDeliveryLang[] $modelLangs
13 13 */
14 14  
15 15 $this->title = 'Update Delivery: ' . $model->lang->title;
... ... @@ -32,7 +32,7 @@
32 32  
33 33 <?= $this->render('_form', [
34 34 'model' => $model,
35   - 'model_langs' => $model_langs,
  35 + 'modelLangs' => $modelLangs,
36 36 'parent_items' => $parent_items,
37 37 ]) ?>
38 38  
... ...
backend/views/event/_form.php
... ... @@ -13,7 +13,7 @@
13 13 /**
14 14 * @var View $this
15 15 * @var Event $model
16   - * @var EventLang[] $model_langs
  16 + * @var EventLang[] $modelLangs
17 17 * @var ActiveForm $form
18 18 */
19 19 ?>
... ... @@ -56,7 +56,7 @@
56 56 ]); ?>
57 57  
58 58 <?= LanguageForm::widget([
59   - 'model_langs' => $model_langs,
  59 + 'modelLangs' => $modelLangs,
60 60 'formView' => '@backend/views/event/_form_language',
61 61 'form' => $form,
62 62 ]) ?>
... ...
backend/views/event/_form_language.php
... ... @@ -13,13 +13,13 @@
13 13 * @var View $this
14 14 */
15 15 ?>
16   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  16 +<?= $form->field($model_lang, '[' . $language->id . ']title')
17 17 ->textInput([ 'maxlength' => true ]); ?>
18 18  
19   -<?= $form->field($model_lang, '[' . $language->language_id . ']alias')
  19 +<?= $form->field($model_lang, '[' . $language->id . ']alias')
20 20 ->textInput([ 'maxlength' => true ]); ?>
21 21  
22   -<?= $form->field($model_lang, '[' . $language->language_id . ']body')
  22 +<?= $form->field($model_lang, '[' . $language->id . ']body')
23 23 ->widget(CKEditor::className(), [
24 24 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
25 25 'preset' => 'full',
... ... @@ -29,14 +29,14 @@
29 29 ]),
30 30 ]) ?>
31 31  
32   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_title')
  32 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
33 33 ->textInput([ 'maxlength' => true ]) ?>
34 34  
35   -<?= $form->field($model_lang, '[' . $language->language_id . ']description')
  35 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
36 36 ->textInput([ 'maxlength' => true ]) ?>
37 37  
38   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  38 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
39 39 ->textarea([ 'rows' => 6 ]) ?>
40 40  
41   -<?= $form->field($model_lang, '[' . $language->language_id . ']h1')
  41 +<?= $form->field($model_lang, '[' . $language->id . ']h1')
42 42 ->textInput([ 'maxlength' => true ]) ?>
43 43 \ No newline at end of file
... ...
backend/views/event/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\EventSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="event-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'event_id') ?>
19   -
20   - <?= $form->field($model, 'name') ?>
21   -
22   - <?= $form->field($model, 'alias') ?>
23   -
24   - <?= $form->field($model, 'body') ?>
25   -
26   - <?= $form->field($model, 'image') ?>
27   -
28   - <?php // echo $form->field($model, 'meta_title') ?>
29   -
30   - <?php // echo $form->field($model, 'description') ?>
31   -
32   - <?php // echo $form->field($model, 'h1') ?>
33   -
34   - <?php // echo $form->field($model, 'seo_text') ?>
35   -
36   - <?php // echo $form->field($model, 'created_at') ?>
37   -
38   - <?php // echo $form->field($model, 'updated_at') ?>
39   -
40   - <?php // echo $form->field($model, 'end_at') ?>
41   -
42   - <div class="form-group">
43   - <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
44   - <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
45   - </div>
46   -
47   - <?php ActiveForm::end(); ?>
48   -
49   -</div>
backend/views/event/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Event $model
11   - * @var EventLang[] $model_langs
  11 + * @var EventLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Create Event');
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <?= $this->render('_form', [
26 26 'model' => $model,
27   - 'model_langs' => $model_langs,
  27 + 'modelLangs' => $modelLangs,
28 28 ]) ?>
29 29  
30 30 </div>
... ...
backend/views/event/index.php
... ... @@ -24,7 +24,7 @@
24 24 'filterModel' => $searchModel,
25 25 'columns' => [
26 26 [ 'class' => 'yii\grid\SerialColumn' ],
27   - 'event_id',
  27 + 'id',
28 28 'imageUrl:image',
29 29 [ 'class' => 'yii\grid\ActionColumn' ],
30 30 ],
... ...
backend/views/event/update.php
... ... @@ -8,21 +8,21 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Event $model
11   - * @var EventLang[] $model_langs
  11 + * @var EventLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Update {modelClass}: ', [
15 15 'modelClass' => 'Event',
16   - ]) . $model->event_id;
  16 + ]) . $model->id;
17 17 $this->params[ 'breadcrumbs' ][] = [
18 18 'label' => Yii::t('app', 'Events'),
19 19 'url' => [ 'index' ],
20 20 ];
21 21 $this->params[ 'breadcrumbs' ][] = [
22   - 'label' => $model->event_id,
  22 + 'label' => $model->id,
23 23 'url' => [
24 24 'view',
25   - 'id' => $model->event_id,
  25 + 'id' => $model->id,
26 26 ],
27 27 ];
28 28 $this->params[ 'breadcrumbs' ][] = Yii::t('app', 'Update');
... ... @@ -33,7 +33,7 @@
33 33  
34 34 <?= $this->render('_form', [
35 35 'model' => $model,
36   - 'model_langs' => $model_langs,
  36 + 'modelLangs' => $modelLangs,
37 37 ]) ?>
38 38  
39 39 </div>
... ...
backend/views/event/view.php
... ... @@ -6,7 +6,7 @@
6 6 /* @var $this yii\web\View */
7 7 /* @var $model common\models\Event */
8 8  
9   - $this->title = $model->event_id;
  9 + $this->title = $model->id;
10 10 $this->params[ 'breadcrumbs' ][] = [
11 11 'label' => Yii::t('app', 'Events'),
12 12 'url' => [ 'index' ],
... ... @@ -20,11 +20,11 @@
20 20 <p>
21 21 <?= Html::a(Yii::t('app', 'Update'), [
22 22 'update',
23   - 'id' => $model->event_id,
  23 + 'id' => $model->id,
24 24 ], [ 'class' => 'btn btn-primary' ]) ?>
25 25 <?= Html::a(Yii::t('app', 'Delete'), [
26 26 'delete',
27   - 'id' => $model->event_id,
  27 + 'id' => $model->id,
28 28 ], [
29 29 'class' => 'btn btn-danger',
30 30 'data' => [
... ... @@ -37,7 +37,7 @@
37 37 <?= DetailView::widget([
38 38 'model' => $model,
39 39 'attributes' => [
40   - 'event_id',
  40 + 'id',
41 41 'imageUrl:image',
42 42 ],
43 43 ]) ?>
... ...
backend/views/feedback/index.php
... ... @@ -4,30 +4,33 @@
4 4 use yii\data\ActiveDataProvider;
5 5 use yii\grid\GridView;
6 6 use yii\web\View;
  7 +
7 8 /**
8 9 * @var ActiveDataProvider $dataProvider
9 10 * @var FeedbackSearch $searchModel
10 11 * @var View $this
11 12 */
12 13 $this->title = 'Feedback';
13   - $this->params['breadcrumbs'][] = $this->title;
  14 + $this->params[ 'breadcrumbs' ][] = $this->title;
14 15 ?>
15 16 <div class="feedback-index">
16 17  
17 18 <h1><?= Html::encode($this->title) ?></h1>
18   - <?= GridView::widget([
19   - 'dataProvider' => $dataProvider,
20   - 'filterModel' => $searchModel,
21   - 'columns' => [
22   - ['class' => 'yii\grid\SerialColumn'],
23   - 'feedback_id',
24   - 'name',
25   - 'phone',
26   - 'date_add:date',
27   - [
28   - 'class' => 'yii\grid\ActionColumn',
29   - 'template' => '{delete}',
  19 + <?= GridView::widget(
  20 + [
  21 + 'dataProvider' => $dataProvider,
  22 + 'filterModel' => $searchModel,
  23 + 'columns' => [
  24 + [ 'class' => 'yii\grid\SerialColumn' ],
  25 + 'id',
  26 + 'name',
  27 + 'phone',
  28 + 'created_at:date',
  29 + [
  30 + 'class' => 'yii\grid\ActionColumn',
  31 + 'template' => '{delete}',
  32 + ],
30 33 ],
31   - ],
32   - ]); ?>
  34 + ]
  35 + ); ?>
33 36 </div>
34 37 \ No newline at end of file
... ...
backend/views/label/_form.php
1 1 <?php
2 2  
3 3 use backend\models\Label;
4   - use backend\models\OrdersLabelLang;
  4 + use backend\models\orderLabelLang;
5 5 use common\modules\language\widgets\LanguageForm;
6 6 use yii\helpers\Html;
7 7 use yii\web\View;
... ... @@ -11,7 +11,7 @@
11 11 * @var View $this
12 12 * @var Label $model
13 13 * @var ActiveForm $form
14   - * @var OrdersLabelLang[] $model_langs
  14 + * @var orderLabelLang[] $modelLangs
15 15 */
16 16 ?>
17 17  
... ... @@ -22,7 +22,7 @@
22 22 <?= $form->field($model, 'label')->textInput(['maxlength' => true]) ?>
23 23  
24 24 <?= LanguageForm::widget([
25   - 'model_langs' => $model_langs,
  25 + 'modelLangs' => $modelLangs,
26 26 'formView' => '@backend/views/label/_form_language',
27 27 'form' => $form,
28 28 ]) ?>
... ...
backend/views/label/_form_language.php
1 1 <?php
2   - use common\models\OrdersDeliveryLang;
  2 + use common\models\orderDeliveryLang;
3 3 use common\modules\language\models\Language;
4 4 use yii\web\View;
5 5 use yii\widgets\ActiveForm;
6 6  
7 7 /**
8   - * @var OrdersDeliveryLang[] $model_lang
  8 + * @var orderDeliveryLang[] $model_lang
9 9 * @var Language $language
10 10 * @var ActiveForm $form
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
... ...
backend/views/label/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model backend\models\LabelSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="label-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'id') ?>
19   -
20   - <?= $form->field($model, 'label') ?>
21   -
22   - <div class="form-group">
23   - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
24   - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
25   - </div>
26   -
27   - <?php ActiveForm::end(); ?>
28   -
29   -</div>
backend/views/label/create.php
1 1 <?php
2 2  
3 3 use backend\models\Label;
4   - use backend\models\OrdersLabelLang;
  4 + use backend\models\orderLabelLang;
5 5 use yii\helpers\Html;
6 6 use yii\web\View;
7 7  
8 8 /**
9 9 * @var View $this
10 10 * @var Label $model
11   - * @var OrdersLabelLang[] $model_langs
  11 + * @var orderLabelLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = 'Create Label';
... ... @@ -21,7 +21,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
21 21  
22 22 <?= $this->render('_form', [
23 23 'model' => $model,
24   - 'model_langs' => $model_langs,
  24 + 'modelLangs' => $modelLangs,
25 25 ]) ?>
26 26  
27 27 </div>
... ...
backend/views/label/index.php
... ... @@ -30,8 +30,8 @@
30 30 'id',
31 31 'label',
32 32 [
33   - 'attribute' => 'name',
34   - 'value' => 'lang.name',
  33 + 'attribute' => 'title',
  34 + 'value' => 'lang.title',
35 35 ],
36 36 [ 'class' => 'yii\grid\ActionColumn' ],
37 37 ],
... ...
backend/views/label/update.php
1 1 <?php
2 2  
3 3 use backend\models\Label;
4   - use backend\models\OrdersLabelLang;
  4 + use backend\models\orderLabelLang;
5 5 use yii\helpers\Html;
6 6 use yii\web\View;
7 7  
8 8 /**
9 9 * @var View $this
10 10 * @var Label $model
11   - * @var OrdersLabelLang[] $model_langs
  11 + * @var orderLabelLang[] $modelLangs
12 12 */
13 13  
14   - $this->title = 'Update Label: ' . $model->lang->name;
  14 + $this->title = 'Update Label: ' . $model->lang->title;
15 15 $this->params[ 'breadcrumbs' ][] = [
16 16 'label' => 'Labels',
17 17 'url' => [ 'index' ],
18 18 ];
19 19 $this->params[ 'breadcrumbs' ][] = [
20   - 'label' => $model->lang->name,
  20 + 'label' => $model->lang->title,
21 21 'url' => [
22 22 'view',
23 23 'id' => $model->id,
... ... @@ -31,7 +31,7 @@
31 31  
32 32 <?= $this->render('_form', [
33 33 'model' => $model,
34   - 'model_langs' => $model_langs,
  34 + 'modelLangs' => $modelLangs,
35 35 ]) ?>
36 36  
37 37 </div>
... ...
backend/views/label/view.php
... ... @@ -10,7 +10,7 @@
10 10 * @var Label $model
11 11 */
12 12  
13   - $this->title = $model->lang->name;
  13 + $this->title = $model->lang->title;
14 14 $this->params[ 'breadcrumbs' ][] = [
15 15 'label' => 'Labels',
16 16 'url' => [ 'index' ],
... ... @@ -45,7 +45,7 @@
45 45 'label',
46 46 [
47 47 'label' => 'Name',
48   - 'value' => $model->lang->name,
  48 + 'value' => $model->lang->title,
49 49 ],
50 50 ],
51 51 ]) ?>
... ...
backend/views/layouts/main-sidebar.php
... ... @@ -9,9 +9,9 @@ use yii\widgets\Menu;
9 9 $items = [
10 10 [
11 11 'label' => 'ะ—ะฐะบะฐะทั‹',
12   - 'url' => ['/orders/index'],
  12 + 'url' => ['/order/index'],
13 13 'template'=>'<a href="{url}"> <i class="glyphicon glyphicon-shopping-cart"></i> <span>{label}</span></a>',
14   - 'options' => ['class'=>\Yii::$app->user->can('orders') ? '' :'hide'],
  14 + 'options' => ['class'=>\Yii::$app->user->can('order') ? '' :'hide'],
15 15 ],
16 16 [
17 17 'label' => 'eCommerce',
... ...
backend/views/orders/_form.php renamed to backend/views/order/_form.php
... ... @@ -9,7 +9,7 @@ use yii\bootstrap\Modal;
9 9 use kartik\date\DatePicker;
10 10  
11 11 /* @var $this yii\web\View */
12   -/* @var $model common\models\Slider */
  12 +/* @var $model common\models\order */
13 13 /* @var $form yii\widgets\ActiveForm */
14 14 ?>
15 15  
... ... @@ -20,7 +20,6 @@ use kartik\date\DatePicker;
20 20  
21 21 <?= $form->field($model, 'name') ?>
22 22  
23   -
24 23 <?= $form->field($model, 'phone') ?>
25 24  
26 25 <?= $form->field($model, 'phone2') ?>
... ...
backend/views/orders/add.php renamed to backend/views/order/add.php
backend/views/orders/create.php renamed to backend/views/order/create.php
... ... @@ -9,7 +9,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = [&#39;label&#39; =&gt; &#39;Pages&#39;, &#39;url&#39; =&gt; [&#39;index&#39;]];
9 9 $this->params['breadcrumbs'][] = $this->title;
10 10 ?>
11 11  
12   -<div class="orders-create">
  12 +<div class="order-create">
13 13 <h1><?= Html::encode($this->title) ?></h1>
14 14  
15 15 <?= $this->render('_form', [
... ...
backend/views/orders/index.php renamed to backend/views/order/index.php
... ... @@ -12,7 +12,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
12 12 ?>
13 13 <h1>ะ—ะฐะบะฐะทั‹</h1>
14 14 <p>
15   - <?= Html::a('Add Orders', ['create'], ['class' => 'btn btn-success']) ?>
  15 + <?= Html::a('Add order', ['create'], ['class' => 'btn btn-success']) ?>
16 16 </p>
17 17 <?php \yii\widgets\Pjax::begin( [
18 18  
... ... @@ -59,7 +59,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
59 59 // [
60 60 // 'prompt' => 'ะะตั‚',
61 61 // 'onchange' => "$.ajax({
62   -// url: \"/admin/orders/labelupdate\",
  62 +// url: \"/admin/order/labelupdate\",
63 63 // type: \"post\",
64 64 // data: { order_id: $model->id, label_id : this.value},
65 65 // });"
... ... @@ -78,7 +78,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
78 78 // return Html::activeDropDownList($model, 'pay',[0 => 'ะะตั‚',1=>'ะ”ะฐ'],
79 79 // [
80 80 // 'onchange' => "$.ajax({
81   -// url: \"/admin/orders/payupdate\",
  81 +// url: \"/admin/order/payupdate\",
82 82 // type: \"post\",
83 83 // data: { order_id: $model->id, pay_id : this.value},
84 84 // });"
... ...
backend/views/orders/show.php renamed to backend/views/order/show.php
1 1 <?php
2   -use yii\helpers\Html;
3   -use yii\grid\GridView;
4   -use yii\bootstrap\ActiveForm;
5   -use yii\helpers\ArrayHelper;
6   -use common\models\Delivery;
7   -use yii\bootstrap\Modal;
8   -use kartik\date\DatePicker;
9   -
10   -
11   -// $this->title = 'ะ—ะฐะบะฐะท โ„–'.$model->id;
12   -// $this->params['breadcrumbs'][] = $this->title;
  2 + use yii\helpers\Html;
  3 + use yii\grid\GridView;
  4 + use yii\bootstrap\ActiveForm;
  5 + use yii\helpers\ArrayHelper;
  6 + use common\models\Delivery;
  7 + use yii\bootstrap\Modal;
  8 + use kartik\date\DatePicker;
  9 +
  10 + // $this->title = 'ะ—ะฐะบะฐะท โ„–'.$model->id;
  11 + // $this->params['breadcrumbs'][] = $this->title;
13 12 ?>
14 13 <div class="show_style">
15   -
16   -
17   -
18   -
19   -<?php if(!empty($_GET['success'])):?>
20   -<div class="alert alert-success">
21   - ะ—ะฐะบะฐะท ัƒัะฟะตัˆะฝะพ ัะพั…ั€ะฐะฝะตะฝ!
22   -</div>
23   -<?php endif;?>
24   -
25   - <?php $form = ActiveForm::begin([
26   - 'id' => 'reg-form',
27   - 'layout' => 'horizontal',
28   - 'options' => ['enctype' => 'multipart/form-data'],
29   - 'fieldConfig' => [
30   - //'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
31   - //'labelOptions' => ['class' => 'col-lg-2 control-label'],
32   - ],
33   - 'action' => [
34   - 'orders/show',
35   - 'id' => $model->id
  14 +
  15 +
  16 + <?php if (!empty( $_GET[ 'success' ] )): ?>
  17 + <div class="alert alert-success">
  18 + ะ—ะฐะบะฐะท ัƒัะฟะตัˆะฝะพ ัะพั…ั€ะฐะฝะตะฝ!
  19 + </div>
  20 + <?php endif; ?>
  21 +
  22 + <?php $form = ActiveForm::begin(
  23 + [
  24 + 'id' => 'reg-form',
  25 + 'layout' => 'horizontal',
  26 + 'options' => [ 'enctype' => 'multipart/form-data' ],
  27 + 'fieldConfig' => [
  28 + //'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
  29 + //'labelOptions' => ['class' => 'col-lg-2 control-label'],
  30 + ],
  31 + 'action' => [
  32 + 'order/show',
  33 + 'id' => $model->id,
  34 + ],
36 35 ]
37   - ]); ?>
38   -
39   -<div class="row">
40   -<div class="row">
41   - <div class="col-sm-12">
42   - <h5>ะ—ะฐะบะฐะท โ„–<?=$model->id?></h5>
43   - <label class="control-label col-sm-3">ะ”ะฐั‚ะฐ</label>
44   - <?=$model->date_time?>
45   - </div>
46   -
47   - <?php /* echo $form->field($model, 'date_dedline')
  36 + ); ?>
  37 +
  38 + <div class="row">
  39 + <div class="row">
  40 + <div class="col-sm-12">
  41 + <h5>ะ—ะฐะบะฐะท โ„–<?= $model->id ?></h5>
  42 + <label class="control-label col-sm-3">ะ”ะฐั‚ะฐ</label>
  43 + <?= $model->date_time ?>
  44 + </div>
  45 +
  46 + <?php /* echo $form->field($model, 'date_dedline')
48 47 ->widget(DatePicker::className(), [
49 48 'pluginOptions' => [
50 49 'format' => 'dd-mm-yyyy',
51 50 'todayHighlight' => true
52   - ]]); */?>
53   -</div>
54   - <div class="col-sm-6">
55   -<?= $form->field($model, 'name') ?>
56   -
57   -
58   -<?= $form->field($model, 'phone') ?>
59   -
60   -<?php /* echo $form->field($model, 'phone2'); */ ?>
61   -
62   -<?= $form->field($model, 'email') ?>
63   -
64   -<?php /* echo $form->field($model, 'numbercard'); */ ?>
65   -
66   -<?php /* echo $form->field($model, 'body')->textArea(['rows' => '3']); */?>
67   -</div>
68   -<div class="col-sm-6">
69   - <?php /* echo $form->field($model, 'delivery')->dropDownList(ArrayHelper::map(Delivery::find()->asArray()->all(), 'id', 'title')); */ ?>
70   -
71   - <?php /* echo $form->field($model, 'declaration'); */ ?>
72   -
73   - <?php /* echo $form->field($model, 'stock'); */ ?>
74   -
75   - <?php /* echo $form->field($model, 'consignment'); */ ?>
76   -
77   -<?php /* echo $form->field($model, 'payment')->dropDownList(['ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐะปะธั‡ะฝั‹ะผะธ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐะปะธั‡ะฝั‹ะผะธ','ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐ ะบะฐั€ั‚ัƒ ะŸั€ะธะฒะฐั‚ ะ‘ะฐะฝะบะฐ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐ ะบะฐั€ั‚ัƒ ะŸั€ะธะฒะฐั‚ ะ‘ะฐะฝะบะฐ','ะžะฟะปะฐั‚ะธั‚ัŒ ะฟะพ ะฑะตะทะฝะฐะปะธั‡ะฝะพะผัƒ ั€ะฐัั‡ะตั‚ัƒ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฟะพ ะฑะตะทะฝะฐะปะธั‡ะฝะพะผัƒ ั€ะฐัั‡ะตั‚ัƒ','ะžะฟะปะฐั‚ะธั‚ัŒ ะŸั€ะฐะฒะตะบั-ั‚ะตะปะตะณั€ะฐั„'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะŸั€ะฐะฒะตะบั-ั‚ะตะปะตะณั€ะฐั„','ะะฐะปะพะถะตะฝะฝั‹ะผ ะฟะปะฐั‚ะตะถะพะผ'=>'ะะฐะปะพะถะตะฝะฝั‹ะผ ะฟะปะฐั‚ะตะถะพะผ'],['prompt'=>'...']); */ ?>
78   -
79   -<?php /* echo $form->field($model, 'insurance'); */ ?>
80   -
81   -<?php /* echo $form->field($model, 'amount_imposed'); */ ?>
82   -
83   -<?php /* echo $form->field($model, 'shipping_by'); */ ?>
84   -
85   -<?php /* echo $form->field($model, 'city');
  51 + ]]); */ ?>
  52 + </div>
  53 + <div class="col-sm-6">
  54 + <?= $form->field($model, 'name') ?>
  55 +
  56 +
  57 + <?= $form->field($model, 'phone') ?>
  58 +
  59 + <?php /* echo $form->field($model, 'phone2'); */ ?>
  60 +
  61 + <?= $form->field($model, 'email') ?>
  62 +
  63 + <?php /* echo $form->field($model, 'numbercard'); */ ?>
  64 +
  65 + <?php /* echo $form->field($model, 'body')->textArea(['rows' => '3']); */ ?>
  66 + </div>
  67 + <div class="col-sm-6">
  68 + <?php /* echo $form->field($model, 'delivery')->dropDownList(ArrayHelper::map(Delivery::find()->asArray()->all(), 'id', 'title')); */ ?>
  69 +
  70 + <?php /* echo $form->field($model, 'declaration'); */ ?>
  71 +
  72 + <?php /* echo $form->field($model, 'stock'); */ ?>
  73 +
  74 + <?php /* echo $form->field($model, 'consignment'); */ ?>
  75 +
  76 + <?php /* echo $form->field($model, 'payment')->dropDownList(['ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐะปะธั‡ะฝั‹ะผะธ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐะปะธั‡ะฝั‹ะผะธ','ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐ ะบะฐั€ั‚ัƒ ะŸั€ะธะฒะฐั‚ ะ‘ะฐะฝะบะฐ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฝะฐ ะบะฐั€ั‚ัƒ ะŸั€ะธะฒะฐั‚ ะ‘ะฐะฝะบะฐ','ะžะฟะปะฐั‚ะธั‚ัŒ ะฟะพ ะฑะตะทะฝะฐะปะธั‡ะฝะพะผัƒ ั€ะฐัั‡ะตั‚ัƒ'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะฟะพ ะฑะตะทะฝะฐะปะธั‡ะฝะพะผัƒ ั€ะฐัั‡ะตั‚ัƒ','ะžะฟะปะฐั‚ะธั‚ัŒ ะŸั€ะฐะฒะตะบั-ั‚ะตะปะตะณั€ะฐั„'=>'ะžะฟะปะฐั‚ะธั‚ัŒ ะŸั€ะฐะฒะตะบั-ั‚ะตะปะตะณั€ะฐั„','ะะฐะปะพะถะตะฝะฝั‹ะผ ะฟะปะฐั‚ะตะถะพะผ'=>'ะะฐะปะพะถะตะฝะฝั‹ะผ ะฟะปะฐั‚ะตะถะพะผ'],['prompt'=>'...']); */ ?>
  77 +
  78 + <?php /* echo $form->field($model, 'insurance'); */ ?>
  79 +
  80 + <?php /* echo $form->field($model, 'amount_imposed'); */ ?>
  81 +
  82 + <?php /* echo $form->field($model, 'shipping_by'); */ ?>
  83 +
  84 + <?php /* echo $form->field($model, 'city');
86 85  
87 86 echo $form->field($model, 'adress');
88 87  
... ... @@ -90,108 +89,139 @@ echo $form-&gt;field($model, &#39;adress&#39;);
90 89 echo $form->field($model, 'total');
91 90  
92 91 echo $form->field($model, 'status')->dropDownList(['ะะตั‚'=>'ะะตั‚','ะžะฑั€ะฐะฑะพั‚ะฐะฝ'=>'ะžะฑั€ะฐะฑะพั‚ะฐะฝ','ะะฐ ะบะพะผะฟะปะตะบั‚ะฐั†ะธะธ'=>'ะะฐ ะบะพะผะฟะปะตะบั‚ะฐั†ะธะธ','ะฃะบะพะผะฟะปะตะบั‚ะพะฒะฐะฝ'=>'ะฃะบะพะผะฟะปะตะบั‚ะพะฒะฐะฝ','ะ”ะพัั‚ะฐะฒะบะฐ'=>'ะ”ะพัั‚ะฐะฒะบะฐ','ะ’ั‹ะฟะพะปะฝะตะฝ'=>'ะ’ั‹ะฟะพะปะฝะตะฝ','ะ ะตะทะตั€ะฒ ะพะฟะปะฐั‡ะตะฝ'=>'ะ ะตะทะตั€ะฒ ะพะฟะปะฐั‡ะตะฝ','ะ ะตะทะตั€ะฒ ะฝะตะพะฟะปะฐั‡ะตะฝ'=>'ะ ะตะทะตั€ะฒ ะฝะตะพะฟะปะฐั‡ะตะฝ'],['prompt'=>'...']); */ ?>
93   -
94   -<?= $form->field($model, 'comment')->textArea(['rows' => '3']) ?>
95   -</div>
96   -</div>
  92 +
  93 + <?= $form->field($model, 'comment')
  94 + ->textArea([ 'rows' => '3' ]) ?>
  95 + </div>
  96 + </div>
97 97 <div class="both"></div>
98   -
99   -<hr />
100   -&nbsp;
101   -
102   -
103   -<?= GridView::widget([
104   - 'dataProvider' => $dataProvider,
105   - 'columns' => [
106   - [
107   - 'attribute' => 'id',
108   - 'value'=>'id',
109   - 'contentOptions'=>['style'=>'width: 70px;']
110   - ],
111   - [
112   - 'attribute' => 'sku',
113   - 'value'=>'sku',
114   - 'contentOptions'=>['style'=>'width: 50px;']
115   - ],
116   - [
117   - 'attribute' => 'product_name',
118   - 'value'=>'product_name',
119   - 'contentOptions'=>['style'=>'max-width: 300px;']
120   - ],
121   -// [
122   -// 'attribute' => 'size',
123   -// 'value'=>'mod.size',
124   -// 'contentOptions'=>['style'=>'width: 100px;']
125   -// ],
126   -// [
127   -// 'attribute' => 'size',
128   -// 'value'=>'mod.color',
129   -// 'contentOptions'=>['style'=>'width: 100px;']
130   -// ],
131   - [
132   - 'attribute' => 'price',
133   - 'value'=>'price',
134   - 'contentOptions'=>['style'=>'width: 100px;']
135   - ],
136   - [
137   - 'attribute' => 'count',
138   - 'value'=>'count',
139   - 'contentOptions'=>['style'=>'width: 30px;']
140   - ],
141   - [
142   - 'attribute' => 'sum_cost',
143   - 'value'=>'sum_cost',
144   - 'contentOptions'=>['style'=>'width: 100px;']
145   - ],
  98 +
  99 + <hr/>
  100 + &nbsp;
  101 +
  102 +
  103 + <?= GridView::widget(
146 104 [
147   - 'class' => 'yii\grid\ActionColumn',
148   - 'template' => '{delete}',
149   - 'contentOptions'=>['style'=>'width: 20px;'],
150   - 'buttons' => [
151   - 'delete' => function ($url, $model) {
152   - return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/admin/orders/delete_product','id'=>$model->id,'order_id'=>$_GET['id']],
153   - [
154   - 'title' => "ะฃะดะฐะปะธั‚ัŒ",'data-confirm'=>'ะฃะดะฐะปะธั‚ัŒ?',
155   - ]);
156   - }
  105 + 'dataProvider' => $dataProvider,
  106 + 'columns' => [
  107 + [
  108 + 'attribute' => 'id',
  109 + 'value' => 'id',
  110 + 'contentOptions' => [ 'style' => 'width: 70px;' ],
  111 + ],
  112 + [
  113 + 'attribute' => 'sku',
  114 + 'value' => 'sku',
  115 + 'contentOptions' => [ 'style' => 'width: 50px;' ],
  116 + ],
  117 + [
  118 + 'attribute' => 'product_name',
  119 + 'value' => 'product_name',
  120 + 'contentOptions' => [ 'style' => 'max-width: 300px;' ],
  121 + ],
  122 + // [
  123 + // 'attribute' => 'size',
  124 + // 'value'=>'mod.size',
  125 + // 'contentOptions'=>['style'=>'width: 100px;']
  126 + // ],
  127 + // [
  128 + // 'attribute' => 'size',
  129 + // 'value'=>'mod.color',
  130 + // 'contentOptions'=>['style'=>'width: 100px;']
  131 + // ],
  132 + [
  133 + 'attribute' => 'price',
  134 + 'value' => 'price',
  135 + 'contentOptions' => [ 'style' => 'width: 100px;' ],
  136 + ],
  137 + [
  138 + 'attribute' => 'count',
  139 + 'value' => 'count',
  140 + 'contentOptions' => [ 'style' => 'width: 30px;' ],
  141 + ],
  142 + [
  143 + 'attribute' => 'sum_cost',
  144 + 'value' => 'sum_cost',
  145 + 'contentOptions' => [ 'style' => 'width: 100px;' ],
  146 + ],
  147 + [
  148 + 'class' => 'yii\grid\ActionColumn',
  149 + 'template' => '{delete}',
  150 + 'contentOptions' => [ 'style' => 'width: 20px;' ],
  151 + 'buttons' => [
  152 + 'delete' => function ($url, $model) {
  153 + return Html::a(
  154 + '<span class="glyphicon glyphicon-trash"></span>',
  155 + [
  156 + '/admin/order/delete_product',
  157 + 'id' => $model->id,
  158 + 'order_id' => $_GET[ 'id' ],
  159 + ],
  160 + [
  161 + 'title' => "ะฃะดะฐะปะธั‚ัŒ",
  162 + 'data-confirm' => 'ะฃะดะฐะปะธั‚ัŒ?',
  163 + ]
  164 + );
  165 + },
  166 + ],
  167 + ],
  168 +
157 169 ],
158   - ],
159   -
160   - ],
161   -]) ?>
162   -<div class="form-group">
163   - <?= Html::submitButton(' ะกะพั…ั€ะฐะฝะธั‚ัŒ ', ['class' => 'btn btn-primary btn-lg btn-block', 'name' => 'login-button']) ?>
  170 + ]
  171 + ) ?>
  172 + <div class="form-group">
  173 + <?= Html::submitButton(
  174 + ' ะกะพั…ั€ะฐะฝะธั‚ัŒ ',
  175 + [
  176 + 'class' => 'btn btn-primary btn-lg btn-block',
  177 + 'name' => 'login-button',
  178 + ]
  179 + ) ?>
164 180 </div>
165   -
  181 +
166 182 <?php ActiveForm::end(); ?>
167   -
168   - <div class="row">
169   - <div class="col-sm-6">
170   - <h1>ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€ ะฒ ะทะฐะบะฐะท</h1>
171   -
172   - <?php $form = ActiveForm::begin([
173   - 'enableClientScript' => false,
174   - 'id' => 'add_mod',
175   - 'options' => ['class' => 'form-vertical','enctype' => 'multipart/form-data'],
176   - 'fieldConfig' => [
177   - //'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
178   - //'labelOptions' => ['class' => 'col-lg-2 control-label'],
179   - ],
180   - ]); ?>
181   -
182   - <?= $form->field($model_orderproducts, 'sku') ?>
183   -
184   - <?= $form->field($model_orderproducts, 'count') ?>
185   -
186   - <?= $form->field($model_orderproducts, 'order_id')->hiddenInput(['value'=>$model->id])->label(false); ?>
187   -
188   - <div class="form-group">
189   - <?= Html::submitButton(' ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€ ', ['class' => 'btn btn-primary', 'name' => 'login-button']) ?>
190   - </div>
191   - <?php ActiveForm::end(); ?>
192   - </div></div>
193   -
  183 +
  184 + <div class="row">
  185 + <div class="col-sm-6">
  186 + <h1>ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€ ะฒ ะทะฐะบะฐะท</h1>
  187 +
  188 + <?php $form = ActiveForm::begin(
  189 + [
  190 + 'enableClientScript' => false,
  191 + 'id' => 'add_mod',
  192 + 'options' => [
  193 + 'class' => 'form-vertical',
  194 + 'enctype' => 'multipart/form-data',
  195 + ],
  196 + 'fieldConfig' => [
  197 + //'template' => "{label}\n<div class=\"col-lg-5\">{input}</div>\n<div class=\"col-lg-8\">{error}</div>",
  198 + //'labelOptions' => ['class' => 'col-lg-2 control-label'],
  199 + ],
  200 + ]
  201 + ); ?>
  202 +
  203 + <?= $form->field($model_orderproduct, 'sku') ?>
  204 +
  205 + <?= $form->field($model_orderproduct, 'count') ?>
  206 +
  207 + <?= $form->field($model_orderproduct, 'order_id')
  208 + ->hiddenInput([ 'value' => $model->id ])
  209 + ->label(false); ?>
  210 +
  211 + <div class="form-group">
  212 + <?= Html::submitButton(
  213 + ' ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€ ',
  214 + [
  215 + 'class' => 'btn btn-primary',
  216 + 'name' => 'login-button',
  217 + ]
  218 + ) ?>
  219 + </div>
  220 + <?php ActiveForm::end(); ?>
  221 + </div>
194 222 </div>
195 223  
  224 +</div>
  225 +
196 226  
197 227  
... ...
backend/views/orders/update.php renamed to backend/views/order/update.php
... ... @@ -84,7 +84,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
84 84  
85 85 <?php ActiveForm::end(); ?>
86 86 <hr />
87   -<?= Html::a('ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€', ['/admin/orders/add','order_id'=>$model->id], ['class'=>'btn btn-success']) ?>
  87 +<?= Html::a('ะ”ะพะฑะฐะฒะธั‚ัŒ ั‚ะพะฒะฐั€', ['/admin/order/add','order_id'=>$model->id], ['class'=>'btn btn-success']) ?>
88 88 <?= GridView::widget([
89 89 'dataProvider' => $dataProvider,
90 90 'columns' => [
... ... @@ -129,7 +129,7 @@ $this-&gt;params[&#39;breadcrumbs&#39;][] = $this-&gt;title;
129 129 'contentOptions'=>['style'=>'width: 20px;'],
130 130 'buttons' => [
131 131 'delete' => function ($url, $model) {
132   - return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/admin/orders/delete_product','id'=>$model->id,'order_id'=>$_GET['id']],
  132 + return Html::a('<span class="glyphicon glyphicon-trash"></span>', ['/admin/order/delete_product','id'=>$model->id,'order_id'=>$_GET['id']],
133 133 [
134 134 'title' => "ะฃะดะฐะปะธั‚ัŒ",'data-confirm'=>'ะฃะดะฐะปะธั‚ัŒ?',
135 135 ]);
... ...
backend/views/page/_form.php
... ... @@ -11,7 +11,7 @@
11 11 * @var View $this
12 12 * @var Page $model
13 13 * @var ActiveForm $form
14   - * @var PageLang[] $model_langs
  14 + * @var PageLang[] $modelLangs
15 15 */
16 16 ?>
17 17  
... ... @@ -20,7 +20,7 @@
20 20 <?php $form = ActiveForm::begin(); ?>
21 21  
22 22 <?= LanguageForm::widget([
23   - 'model_langs' => $model_langs,
  23 + 'modelLangs' => $modelLangs,
24 24 'formView' => '@backend/views/page/_form_language',
25 25 'form' => $form,
26 26 ]) ?>
... ...
backend/views/page/_form_language.php
... ... @@ -13,11 +13,11 @@
13 13 * @var View $this
14 14 */
15 15 ?>
16   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  16 +<?= $form->field($model_lang, '[' . $language->id . ']title')
17 17 ->textInput([ 'maxlength' => true ]); ?>
18   -<?= $form->field($model_lang, '[' . $language->language_id . ']alias')
  18 +<?= $form->field($model_lang, '[' . $language->id . ']alias')
19 19 ->textInput([ 'maxlength' => true ]); ?>
20   -<?= $form->field($model_lang, '[' . $language->language_id . ']body')
  20 +<?= $form->field($model_lang, '[' . $language->id . ']body')
21 21 ->widget(CKEditor::className(), [
22 22 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
23 23 'preset' => 'full',
... ... @@ -27,17 +27,17 @@
27 27 ]),
28 28 ]) ?>
29 29  
30   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_title')
  30 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
31 31 ->textInput([ 'maxlength' => true ]) ?>
32 32  
33   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_keywords')
  33 +<?= $form->field($model_lang, '[' . $language->id . ']meta_keywords')
34 34 ->textInput([ 'maxlength' => true ]) ?>
35 35  
36   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta_description')
  36 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
37 37 ->textInput([ 'maxlength' => true ]) ?>
38 38  
39   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  39 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
40 40 ->textarea([ 'rows' => 6 ]) ?>
41 41  
42   -<?= $form->field($model_lang, '[' . $language->language_id . ']h1')
  42 +<?= $form->field($model_lang, '[' . $language->id . ']h1')
43 43 ->textInput([ 'maxlength' => true ]) ?>
... ...
backend/views/page/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\PageSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="page-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'id') ?>
19   -
20   - <?= $form->field($model, 'translit') ?>
21   -
22   - <?= $form->field($model, 'title') ?>
23   -
24   - <?= $form->field($model, 'body') ?>
25   -
26   - <?= $form->field($model, 'meta_title') ?>
27   -
28   - <?php // echo $form->field($model, 'meta_keywords') ?>
29   -
30   - <?php // echo $form->field($model, 'meta_description') ?>
31   -
32   - <?php // echo $form->field($model, 'seo_text') ?>
33   -
34   - <?php // echo $form->field($model, 'h1') ?>
35   -
36   - <div class="form-group">
37   - <?= Html::submitButton('Search', ['class' => 'btn btn-primary']) ?>
38   - <?= Html::resetButton('Reset', ['class' => 'btn btn-default']) ?>
39   - </div>
40   -
41   - <?php ActiveForm::end(); ?>
42   -
43   -</div>
backend/views/page/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Page $model
11   - * @var PageLang[] $model_langs
  11 + * @var PageLang[] $modelLangs
12 12 */
13 13 $this->title = \Yii::t('app', 'Create Page');
14 14 $this->params[ 'breadcrumbs' ][] = [
... ... @@ -23,7 +23,7 @@
23 23  
24 24 <?= $this->render('_form', [
25 25 'model' => $model,
26   - 'model_langs' => $model_langs,
  26 + 'modelLangs' => $modelLangs,
27 27 ]) ?>
28 28  
29 29 </div>
... ...
backend/views/page/update.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var Page $model
11   - * @var PageLang[] $model_langs
  11 + * @var PageLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = \Yii::t('app', 'Update Page') . ': ' . $model->lang->title;
... ... @@ -31,7 +31,7 @@
31 31  
32 32 <?= $this->render('_form', [
33 33 'model' => $model,
34   - 'model_langs' => $model_langs,
  34 + 'modelLangs' => $modelLangs,
35 35 ]) ?>
36 36  
37 37 </div>
... ...
backend/views/seo-category/_form.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var SeoCategory $model
13   - * @var SeoCategoryLang[] $model_langs
  13 + * @var SeoCategoryLang[] $modelLangs
14 14 * @var ActiveForm $form
15 15 */
16 16 ?>
... ... @@ -26,7 +26,7 @@
26 26 ->textInput() ?>
27 27  
28 28 <?= LanguageForm::widget([
29   - 'model_langs' => $model_langs,
  29 + 'modelLangs' => $modelLangs,
30 30 'formView' => '@backend/views/seo-category/_form_language',
31 31 'form' => $form,
32 32 ]) ?>
... ...
backend/views/seo-category/_form_language.php
... ... @@ -11,5 +11,5 @@
11 11 * @var View $this
12 12 */
13 13 ?>
14   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  14 +<?= $form->field($model_lang, '[' . $language->id . ']title')
15 15 ->textInput([ 'maxlength' => true ]); ?>
16 16 \ No newline at end of file
... ...
backend/views/seo-category/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\SeoCategorySearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="seo-category-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'seo_category_id') ?>
19   -
20   - <?= $form->field($model, 'name') ?>
21   -
22   - <?= $form->field($model, 'controller') ?>
23   -
24   - <?= $form->field($model, 'status') ?>
25   -
26   - <div class="form-group">
27   - <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
28   - <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
29   - </div>
30   -
31   - <?php ActiveForm::end(); ?>
32   -
33   -</div>
backend/views/seo-category/create.php
... ... @@ -8,7 +8,7 @@
8 8 /**
9 9 * @var View $this
10 10 * @var SeoCategory $model
11   - * @var SeoCategoryLang[] $model_langs
  11 + * @var SeoCategoryLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Create Seo Category');
... ... @@ -24,7 +24,7 @@
24 24  
25 25 <?= $this->render('_form', [
26 26 'model' => $model,
27   - 'model_langs' => $model_langs,
  27 + 'modelLangs' => $modelLangs,
28 28 ]) ?>
29 29  
30 30 </div>
... ...
backend/views/seo-category/index.php
... ... @@ -27,8 +27,8 @@
27 27 'seo_category_id',
28 28 'controller',
29 29 [
30   - 'attribute' => 'name',
31   - 'value' => 'lang.name',
  30 + 'attribute' => 'title',
  31 + 'value' => 'lang.title',
32 32 ],
33 33 'status',
34 34 [
... ...
backend/views/seo-category/update.php
... ... @@ -8,18 +8,18 @@
8 8 /**
9 9 * @var View $this
10 10 * @var SeoCategory $model
11   - * @var SeoCategoryLang[] $model_langs
  11 + * @var SeoCategoryLang[] $modelLangs
12 12 */
13 13  
14 14 $this->title = Yii::t('app', 'Update {modelClass}: ', [
15 15 'modelClass' => 'Seo Category',
16   - ]) . $model->lang->name;
  16 + ]) . $model->lang->title;
17 17 $this->params[ 'breadcrumbs' ][] = [
18 18 'label' => Yii::t('app', 'Seo Categories'),
19 19 'url' => [ 'index' ],
20 20 ];
21 21 $this->params[ 'breadcrumbs' ][] = [
22   - 'label' => $model->lang->name,
  22 + 'label' => $model->lang->title,
23 23 'url' => [
24 24 'view',
25 25 'id' => $model->seo_category_id,
... ... @@ -33,7 +33,7 @@
33 33  
34 34 <?= $this->render('_form', [
35 35 'model' => $model,
36   - 'model_langs' => $model_langs,
  36 + 'modelLangs' => $modelLangs,
37 37 ]) ?>
38 38  
39 39 </div>
... ...
backend/views/seo-dynamic/_form.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var SeoDynamic $model
13   - * @var SeoDynamicLang[] $model_langs
  13 + * @var SeoDynamicLang[] $modelLangs
14 14 * @var int $seo_category_id
15 15 * @var ActiveForm $form
16 16 */
... ... @@ -37,7 +37,7 @@
37 37 ->textInput() ?>
38 38  
39 39 <?= LanguageForm::widget([
40   - 'model_langs' => $model_langs,
  40 + 'modelLangs' => $modelLangs,
41 41 'formView' => '@backend/views/seo-dynamic/_form_language',
42 42 'form' => $form,
43 43 ]) ?>
... ...
backend/views/seo-dynamic/_form_language.php
... ... @@ -13,11 +13,11 @@
13 13 * @var View $this
14 14 */
15 15 ?>
16   -<?= $form->field($model_lang, '[' . $language->language_id . ']name')
  16 +<?= $form->field($model_lang, '[' . $language->id . ']title')
17 17 ->textInput([ 'maxlength' => true ]); ?>
18   -<?= $form->field($model_lang, '[' . $language->language_id . ']title')
  18 +<?= $form->field($model_lang, '[' . $language->id . ']meta_title')
19 19 ->textInput(); ?>
20   -<?= $form->field($model_lang, '[' . $language->language_id . ']description')
  20 +<?= $form->field($model_lang, '[' . $language->id . ']meta_description')
21 21 ->widget(CKEditor::className(), [
22 22 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
23 23 'preset' => 'full',
... ... @@ -27,7 +27,7 @@
27 27 ]),
28 28 ]) ?>
29 29  
30   -<?= $form->field($model_lang, '[' . $language->language_id . ']seo_text')
  30 +<?= $form->field($model_lang, '[' . $language->id . ']seo_text')
31 31 ->widget(CKEditor::className(), [
32 32 'editorOptions' => ElFinder::ckeditorOptions('elfinder', [
33 33 'preset' => 'full',
... ... @@ -36,10 +36,10 @@
36 36 ->createUrl('file/uploader/images-upload'),
37 37 ]),
38 38 ]) ?>
39   -<?= $form->field($model_lang, '[' . $language->language_id . ']key')
  39 +<?= $form->field($model_lang, '[' . $language->id . ']key')
40 40 ->textInput([ 'maxlength' => true ]) ?>
41   -<?= $form->field($model_lang, '[' . $language->language_id . ']h1')
  41 +<?= $form->field($model_lang, '[' . $language->id . ']h1')
42 42 ->textInput([ 'maxlength' => true ]) ?>
43 43  
44   -<?= $form->field($model_lang, '[' . $language->language_id . ']meta')
  44 +<?= $form->field($model_lang, '[' . $language->id . ']meta')
45 45 ->textInput([ 'maxlength' => true ]) ?>
46 46 \ No newline at end of file
... ...
backend/views/seo-dynamic/_search.php deleted
1   -<?php
2   -
3   -use yii\helpers\Html;
4   -use yii\widgets\ActiveForm;
5   -
6   -/* @var $this yii\web\View */
7   -/* @var $model common\models\SeoDynamicSearch */
8   -/* @var $form yii\widgets\ActiveForm */
9   -?>
10   -
11   -<div class="seo-dynamic-search">
12   -
13   - <?php $form = ActiveForm::begin([
14   - 'action' => ['index'],
15   - 'method' => 'get',
16   - ]); ?>
17   -
18   - <?= $form->field($model, 'seo_dynamic_id') ?>
19   -
20   - <?= $form->field($model, 'seo_category_id') ?>
21   -
22   - <?= $form->field($model, 'name') ?>
23   -
24   - <?= $form->field($model, 'action') ?>
25   -
26   - <?= $form->field($model, 'fields') ?>
27   -
28   - <?php // echo $form->field($model, 'title') ?>
29   -
30   - <?php // echo $form->field($model, 'h1') ?>
31   -
32   - <?php // echo $form->field($model, 'description') ?>
33   -
34   - <?php // echo $form->field($model, 'seo_text') ?>
35   -
36   - <?php // echo $form->field($model, 'status') ?>
37   -
38   - <div class="form-group">
39   - <?= Html::submitButton(Yii::t('app', 'Search'), ['class' => 'btn btn-primary']) ?>
40   - <?= Html::resetButton(Yii::t('app', 'Reset'), ['class' => 'btn btn-default']) ?>
41   - </div>
42   -
43   - <?php ActiveForm::end(); ?>
44   -
45   -</div>
backend/views/seo-dynamic/create.php
... ... @@ -10,7 +10,7 @@
10 10 /**
11 11 * @var View $this
12 12 * @var SeoDynamic $model
13   - * @var SeoDynamicLang[] $model_langs
  13 + * @var SeoDynamicLang[] $modelLangs
14 14 * @var SeoCategory $seo_category
15 15 */
16 16  
... ... @@ -20,7 +20,7 @@
20 20 'url' => [ '/seo-category/index' ],
21 21 ];
22 22 $this->params[ 'breadcrumbs' ][] = [
23   - 'label' => $seo_category->lang->name,
  23 + 'label' => $seo_category->lang->title,
24 24 'url' => [
25 25 'index',
26 26 'seo_category_id' => $seo_category->seo_category_id,
... ... @@ -34,7 +34,7 @@
34 34  
35 35 <?= $this->render('_form', [
36 36 'model' => $model,
37   - 'model_langs' => $model_langs,
  37 + 'modelLangs' => $modelLangs,
38 38 ]) ?>
39 39  
40 40 </div>
... ...
backend/views/seo-dynamic/index.php
... ... @@ -12,7 +12,7 @@
12 12 * @var SeoCategory $seo_category
13 13 */
14 14 $this->title = Yii::t('app', 'Seo Dynamics for {seo_category}', [
15   - 'seo_category' => $seo_category->lang->name,
  15 + 'seo_category' => $seo_category->lang->title,
16 16 ]);
17 17 $this->params[ 'breadcrumbs' ][] = [
18 18 'label' => \Yii::t('app', 'Seo Categories'),
... ... @@ -37,8 +37,8 @@
37 37 [ 'class' => 'yii\grid\SerialColumn' ],
38 38 'seo_dynamic_id',
39 39 [
40   - 'attribute' => 'name',
41   - 'value' => 'lang.name',
  40 + 'attribute' => 'title',
  41 + 'value' => 'lang.title',
42 42 ],
43 43 'action',
44 44 'fields',
... ...