From 5b5bfa854a18444faa2eb88718294f96976a1563 Mon Sep 17 00:00:00 2001 From: Vitaliy Date: Tue, 22 Dec 2015 09:24:15 +0200 Subject: [PATCH] VItaliy 22.12.2015 select details --- frontend/controllers/DetailController.php | 17 ++++++++++++++--- frontend/controllers/GoodsController.php | 9 +++++++-- frontend/views/detail/details_view.php | 39 +++++++++++++++++++++++++++++++++++++++ frontend/views/goods/index.php | 19 +++++++++++++++++-- frontend/views/goods/one_item.php | 4 +++- frontend/web/js/jquery.tablesorter.min.js | 4 ++++ frontend/web/js/main.js | 31 +++++++++++++++++++++++++++++++ 7 files changed, 115 insertions(+), 8 deletions(-) create mode 100644 frontend/views/detail/details_view.php create mode 100644 frontend/web/js/jquery.tablesorter.min.js diff --git a/frontend/controllers/DetailController.php b/frontend/controllers/DetailController.php index 5c56e1a..e928624 100644 --- a/frontend/controllers/DetailController.php +++ b/frontend/controllers/DetailController.php @@ -1,7 +1,12 @@ render('index'); } - public function actionStep() + public function actionGetDetailsForItem() { - return $this->render('step'); + $data = (new Details)->getTehdocData('1204403'); + + + return $this->renderPartial('details_view',[ + 'data' => $data + + ]); } diff --git a/frontend/controllers/GoodsController.php b/frontend/controllers/GoodsController.php index 99c7645..07f5114 100644 --- a/frontend/controllers/GoodsController.php +++ b/frontend/controllers/GoodsController.php @@ -21,13 +21,18 @@ class GoodsController extends Controller { public function actionIndex( $name , $id ) { + $arr_name = explode('_',$name); $brand = $arr_name[0]; $article = $arr_name[1]; +// $arr = ['GoodsViewSearch' => ['name' => $article, +// 'brand' => $brand]]; + + $arr = ['GoodsViewSearch' => ['name' => '0092S40090', + 'brand' => 'BOSCH']]; + - $arr = ['GoodsViewSearch' => ['name' => $article, - 'brand' => $brand]]; Yii::$app->session->setFlash('price_currency_id', 1); Yii::$app->session->setFlash('price_margin_id', 1); diff --git a/frontend/views/detail/details_view.php b/frontend/views/detail/details_view.php new file mode 100644 index 0000000..ba04f52 --- /dev/null +++ b/frontend/views/detail/details_view.php @@ -0,0 +1,39 @@ + + + + + + + + + + + + + + + + $item):?> + + + + + + + + + + + + + +
МаркаМодельМодификацияГод выпускаОбъем двигателя, литровkWЛ.силыКод двигателя
+ . + -. + ,
+ + \ No newline at end of file diff --git a/frontend/views/goods/index.php b/frontend/views/goods/index.php index 6a7fc56..807d519 100644 --- a/frontend/views/goods/index.php +++ b/frontend/views/goods/index.php @@ -10,6 +10,7 @@ $sort = new Sort([ ], ]); $this->registerCssFile('/css/BC2_catalog_zapchasti.css'); +$this->registerJsFile('/js/jquery.tablesorter.min.js'); $this->params['breadcrumbs'][] = $this->title; \yii\widgets\Pjax::begin(); ?> @@ -147,6 +148,7 @@ $this->params['breadcrumbs'][] = $this->title; + \ No newline at end of file +?> + + \ No newline at end of file diff --git a/frontend/views/goods/one_item.php b/frontend/views/goods/one_item.php index 584b9ad..08dc67b 100644 --- a/frontend/views/goods/one_item.php +++ b/frontend/views/goods/one_item.php @@ -23,7 +23,7 @@ if ( empty($article_arr[$index - 1]) || $article_arr[$index - 1] != $key ) description?> - + endBlock(); ?> @@ -82,6 +82,8 @@ if ( empty($article_arr[$index - 1]) || $article_arr[$index - 1] != $key ) + +