From 3d30a374f7d313e08b4ac92a06e9d9dece28b6bf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 10 Aug 2023 11:18:09 +0900 Subject: [PATCH] shoppingmallv2 init... --- app/Controllers/Admin/CategoryController.php | 33 ++++++++++--- app/Helpers/Product_helper.php | 2 +- app/Language/ko/Category.php | 4 +- app/Models/CategoryModel.php | 1 + app/Views/front/product/index.php | 16 +++---- app/Views/front/product/index_list.php | 46 ------------------- .../layouts/front/left_menu/leftmenu_11.php | 4 +- .../layouts/front/left_menu/leftmenu_12.php | 4 +- .../layouts/front/left_menu/leftmenu_14.php | 6 +-- .../layouts/front/left_menu/leftmenu_15.php | 6 +-- .../layouts/front/left_menu/leftmenu_17.php | 13 ++++++ .../layouts/front/left_menu/leftmenu_18.php | 13 ++++++ .../layouts/front/left_menu/leftmenu_20.php | 13 ++++++ .../layouts/front/left_menu/leftmenu_21.php | 13 ++++++ .../layouts/front/left_menu/leftmenu_3.php | 6 +-- .../layouts/front/left_menu/leftmenu_4.php | 6 +-- .../layouts/front/left_menu/leftmenu_5.php | 4 +- .../layouts/front/left_menu/leftmenu_6.php | 4 +- .../layouts/front/left_menu/leftmenu_8.php | 4 +- .../layouts/front/left_menu/leftmenu_9.php | 4 +- app/Views/layouts/front/top_menu.php | 10 +++- .../front/top_menu/top_menu_hosting.php | 13 ++++++ .../front/top_menu/top_menu_network.php | 2 +- .../front/top_menu/top_menu_service.php | 13 ++++++ .../front/top_menu/top_menu_support.php | 2 +- public/css/front/content.css | 2 + public/css/front/top_menu.css | 8 ++-- 27 files changed, 157 insertions(+), 95 deletions(-) delete mode 100644 app/Views/front/product/index_list.php create mode 100644 app/Views/layouts/front/left_menu/leftmenu_17.php create mode 100644 app/Views/layouts/front/left_menu/leftmenu_18.php create mode 100644 app/Views/layouts/front/left_menu/leftmenu_20.php create mode 100644 app/Views/layouts/front/left_menu/leftmenu_21.php create mode 100644 app/Views/layouts/front/top_menu/top_menu_hosting.php create mode 100644 app/Views/layouts/front/top_menu/top_menu_service.php diff --git a/app/Controllers/Admin/CategoryController.php b/app/Controllers/Admin/CategoryController.php index a3e7901..a599519 100644 --- a/app/Controllers/Admin/CategoryController.php +++ b/app/Controllers/Admin/CategoryController.php @@ -3,6 +3,7 @@ namespace App\Controllers\Admin; use App\Controllers\Trait\UpDownloadTrait; +use App\Entities\CategoryEntity; use App\Models\CategoryModel; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; @@ -65,20 +66,40 @@ class CategoryController extends AdminController return $this->_viewDatas['fieldDatas']; } - private function build_leftmenu() + private function write_leftmenu($old_category, array $categorys) { - foreach ($this->_model->getEntitys(['grpdepth' => 2, 'status' => DEFAULTS['STATUS']]) as $entity) { - $categorys = $this->_model->getSiblingEntitys($entity); + //신규 대분류인경우 기존 카테고리 메뉴 만들기 + // $categorys = array_reverse($categorys); //중분류의 경우 나중에 넣은것이 먼저되므로 reverse해서 처리 + foreach ($categorys as $category) { $viewDatas = [ 'className' => $this->_model->getClassName(), - 'category' => $entity, - 'parent_category' => array_shift($categorys), + 'category' => $category, + 'parent_category' => $old_category, 'sibling_categorys' => $categorys ]; $leftmenu = view($this->_viewPath . '/leftmenu_template', ['viewDatas' => $viewDatas]); - file_put_contents(APPPATH . 'Views' . "/layouts/front/left_menu/leftmenu_{$entity->getPrimaryKey()}.php", $leftmenu); + file_put_contents(APPPATH . 'Views' . "/layouts/front/left_menu/leftmenu_{$category->getPrimaryKey()}.php", $leftmenu); } } + private function build_leftmenu() + { + $old_category = null; + $categorys = array(); + foreach ($this->_model->getEntitys(['status' => DEFAULTS['STATUS']]) as $entity) { + if ($entity->getHierarchy_Depth() == 1) { + if (is_null($old_category)) { + $old_category = $entity; + } else if ($old_category->getPrimaryKey() != $entity->getPrimaryKey()) { + $this->write_leftmenu($old_category, $categorys); + $old_category = $entity; + $categorys = array(); + } + } else { + array_push($categorys, $entity); + } + } + $this->write_leftmenu($old_category, $categorys); + } //Insert관련 protected function insert_process() diff --git a/app/Helpers/Product_helper.php b/app/Helpers/Product_helper.php index aff6c6d..8a065ab 100644 --- a/app/Helpers/Product_helper.php +++ b/app/Helpers/Product_helper.php @@ -129,7 +129,7 @@ function getFieldIndex_Row_ProductHelper($field, $entity, array $viewDatas): str case 'name': return anchor( current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), - $value ? str_split($value, 66)[0] . "..." : "", + $value, ["target" => "_self"] ); break; diff --git a/app/Language/ko/Category.php b/app/Language/ko/Category.php index 47dd9a9..51d7fef 100644 --- a/app/Language/ko/Category.php +++ b/app/Language/ko/Category.php @@ -5,10 +5,10 @@ $roles = [ 'director' => '감독자', 'master' => "마스터", ]; return [ - 'title' => "범주 정보", + 'title' => "분류 정보", 'label' => [ 'uid' => "번호", - 'name' => "범주제목", + 'name' => "분류제목", 'linkurl' => "LinkURL", 'photo' => "이미지", 'isaccess' => "접속권한", diff --git a/app/Models/CategoryModel.php b/app/Models/CategoryModel.php index dc81303..1a4c9b6 100644 --- a/app/Models/CategoryModel.php +++ b/app/Models/CategoryModel.php @@ -58,6 +58,7 @@ class CategoryModel extends BaseHierarchyModel { //대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능) $old_title = ""; + $options = array(); foreach ($this->getEntitys($conditions) as $entity) { if ($entity->getHierarchy_Depth() == 1) { $options[$entity->getTitle()] = []; diff --git a/app/Views/front/product/index.php b/app/Views/front/product/index.php index e028a0e..509454f 100644 --- a/app/Views/front/product/index.php +++ b/app/Views/front/product/index.php @@ -4,7 +4,6 @@
head) ?>
- include('templates/front/index_head') ?> + include('templates/front/index_head') ?>
@@ -27,20 +25,20 @@ - +
- 판매가: + : - 원가:원 + :원 - - 할인가:원 + : - 조회수: + : diff --git a/app/Views/front/product/index_list.php b/app/Views/front/product/index_list.php deleted file mode 100644 index 0a8818b..0000000 --- a/app/Views/front/product/index_list.php +++ /dev/null @@ -1,46 +0,0 @@ -extend('layouts/front') ?> -section('content') ?> - -
-
head) ?>
-
- include('templates/front/index_head') ?> - -
- - - - - - - - - - - status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)"> - - - - - - - - -
번호
- -
-
-
tail) ?>
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/layouts/front/left_menu/leftmenu_11.php b/app/Views/layouts/front/left_menu/leftmenu_11.php index 45d1f26..2864377 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_11.php +++ b/app/Views/layouts/front/left_menu/leftmenu_11.php @@ -1,4 +1,4 @@ - +
-
개인정보
@@ -10,4 +10,4 @@ 사용자정보
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_12.php b/app/Views/layouts/front/left_menu/leftmenu_12.php index 7d9c325..105abf0 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_12.php +++ b/app/Views/layouts/front/left_menu/leftmenu_12.php @@ -1,4 +1,4 @@ - +
-
개인정보
@@ -10,4 +10,4 @@ 사용자정보
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_14.php b/app/Views/layouts/front/left_menu/leftmenu_14.php index ade6d56..3b85c56 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_14.php +++ b/app/Views/layouts/front/left_menu/leftmenu_14.php @@ -1,7 +1,7 @@ - +
-
-
사이트페이지
+
AboutUS
인사말 @@ -10,4 +10,4 @@ 회사소개
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_15.php b/app/Views/layouts/front/left_menu/leftmenu_15.php index dc54aef..374eb58 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_15.php +++ b/app/Views/layouts/front/left_menu/leftmenu_15.php @@ -1,7 +1,7 @@ - +
-
-
사이트페이지
+
AboutUS
인사말 @@ -10,4 +10,4 @@ 회사소개
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_17.php b/app/Views/layouts/front/left_menu/leftmenu_17.php new file mode 100644 index 0000000..1979e81 --- /dev/null +++ b/app/Views/layouts/front/left_menu/leftmenu_17.php @@ -0,0 +1,13 @@ + +
+
-
+
Hosting
+
+ + + + diff --git a/app/Views/layouts/front/left_menu/leftmenu_18.php b/app/Views/layouts/front/left_menu/leftmenu_18.php new file mode 100644 index 0000000..1b0ecfa --- /dev/null +++ b/app/Views/layouts/front/left_menu/leftmenu_18.php @@ -0,0 +1,13 @@ + +
+
-
+
Hosting
+
+ + + + diff --git a/app/Views/layouts/front/left_menu/leftmenu_20.php b/app/Views/layouts/front/left_menu/leftmenu_20.php new file mode 100644 index 0000000..b42e263 --- /dev/null +++ b/app/Views/layouts/front/left_menu/leftmenu_20.php @@ -0,0 +1,13 @@ + +
+
-
+
Service
+
+ + + + diff --git a/app/Views/layouts/front/left_menu/leftmenu_21.php b/app/Views/layouts/front/left_menu/leftmenu_21.php new file mode 100644 index 0000000..d765366 --- /dev/null +++ b/app/Views/layouts/front/left_menu/leftmenu_21.php @@ -0,0 +1,13 @@ + +
+
-
+
Service
+
+ + + + diff --git a/app/Views/layouts/front/left_menu/leftmenu_3.php b/app/Views/layouts/front/left_menu/leftmenu_3.php index 49aa1f5..bc1284b 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_3.php +++ b/app/Views/layouts/front/left_menu/leftmenu_3.php @@ -1,4 +1,4 @@ - +
-
Support
@@ -7,7 +7,7 @@ 공지사항
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_4.php b/app/Views/layouts/front/left_menu/leftmenu_4.php index 4818308..30ca7f8 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_4.php +++ b/app/Views/layouts/front/left_menu/leftmenu_4.php @@ -1,4 +1,4 @@ - +
-
Support
@@ -7,7 +7,7 @@ 공지사항
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_5.php b/app/Views/layouts/front/left_menu/leftmenu_5.php index e4f68a2..c51e5c0 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_5.php +++ b/app/Views/layouts/front/left_menu/leftmenu_5.php @@ -1,4 +1,4 @@ - +
-
네트워크
@@ -10,4 +10,4 @@ 판매
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_6.php b/app/Views/layouts/front/left_menu/leftmenu_6.php index c8616ce..8fd3f48 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_6.php +++ b/app/Views/layouts/front/left_menu/leftmenu_6.php @@ -1,4 +1,4 @@ - +
-
네트워크
@@ -10,4 +10,4 @@ 판매
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_8.php b/app/Views/layouts/front/left_menu/leftmenu_8.php index a6d9ee3..1f955ee 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_8.php +++ b/app/Views/layouts/front/left_menu/leftmenu_8.php @@ -1,4 +1,4 @@ - +
-
서버
@@ -10,4 +10,4 @@ 판매
- + diff --git a/app/Views/layouts/front/left_menu/leftmenu_9.php b/app/Views/layouts/front/left_menu/leftmenu_9.php index cb1820f..0261bb8 100644 --- a/app/Views/layouts/front/left_menu/leftmenu_9.php +++ b/app/Views/layouts/front/left_menu/leftmenu_9.php @@ -1,4 +1,4 @@ - +
-
서버
@@ -10,4 +10,4 @@ 판매
- + diff --git a/app/Views/layouts/front/top_menu.php b/app/Views/layouts/front/top_menu.php index 03e993f..2f14e4f 100644 --- a/app/Views/layouts/front/top_menu.php +++ b/app/Views/layouts/front/top_menu.php @@ -13,11 +13,19 @@ + + + + diff --git a/app/Views/layouts/front/top_menu/top_menu_service.php b/app/Views/layouts/front/top_menu/top_menu_service.php new file mode 100644 index 0000000..f766df2 --- /dev/null +++ b/app/Views/layouts/front/top_menu/top_menu_service.php @@ -0,0 +1,13 @@ + \ No newline at end of file diff --git a/app/Views/layouts/front/top_menu/top_menu_support.php b/app/Views/layouts/front/top_menu/top_menu_support.php index 612d55a..9d0e327 100644 --- a/app/Views/layouts/front/top_menu/top_menu_support.php +++ b/app/Views/layouts/front/top_menu/top_menu_support.php @@ -6,7 +6,7 @@ diff --git a/public/css/front/content.css b/public/css/front/content.css index 48e8f11..c69d97e 100644 --- a/public/css/front/content.css +++ b/public/css/front/content.css @@ -1,5 +1,7 @@ div#content{ + padding-top:40px; padding-left:30px; + margin-bottom:20px; /* border-left:1px solid silver; border-right:1px solid silver; */ } diff --git a/public/css/front/top_menu.css b/public/css/front/top_menu.css index 9af0fbb..8503f95 100644 --- a/public/css/front/top_menu.css +++ b/public/css/front/top_menu.css @@ -23,7 +23,7 @@ /* 메뉴바그룹 */ #top_menu div.dropdown-center ul.navbar-nav li.dropdown { - width:200px; + width:180px; text-align:center; /* border:1px solid red; */ } @@ -43,7 +43,7 @@ /* 메뉴바 */ #top_menu div.dropdown-center ul.navbar-nav li.dropdown ul.dropdown-menu li{ - width:200px; + width:180px; height:60px; padding-top:15px; /* border:1px solid red; */ @@ -53,7 +53,7 @@ font-weight:bold; text-align:center; text-decoration:none; - width:200px; + width:180px; } #top_menu div.dropdown-center ul.navbar-nav li.dropdown ul.dropdown-menu li a.active{ color:#efefef; @@ -62,7 +62,7 @@ } /* 메뉴바 over했을시*/ #top_menu div.dropdown-center ul.navbar-nav li.dropdown ul.dropdown-menu li:hover{ - width:200px; + width:180px; background-color:#26417D; /* border:1px solid red; */ }