diff --git a/app/Backend/BaseBackend.php b/app/Backend/BaseBackend.php deleted file mode 100644 index 498c041..0000000 --- a/app/Backend/BaseBackend.php +++ /dev/null @@ -1,151 +0,0 @@ -_className = $className; - $this->_session = \Config\Services::session(); - } - - final public function getClassName() - { - return $this->_className; - } - - //User모델 - final public function getUserModel(): UserModel - { - return is_null($this->_userModel) ? new UserModel() : $this->_userModel; - } - //Entity값 가져오기 - final public function getEntity($uid) - { - return $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]); - } - - //transaction관련 - final public function transStart($isTest = false) - { - $this->_model->transStart($isTest); - } - final public function transComplete() - { - $this->_model->transComplete(); - } - final public function transRollback() - { - $this->_model->transRollback(); - } - - //초기화 - final public function getFields(string $action) - { - return $this->_model->getFields($action); - } - //TitleField - final public function getTitleField() - { - return $this->_model->getTitleField(); - } - //Field별 Form Rule용 - final public function getFieldRules(array $fields, string $action) - { - return $this->_model->getFieldRules($fields, $action); - } - //Field별 Form Filter용 - final public function getFieldFilters() - { - return $this->_model->getFieldFilters(); - } - //Field별 Form BatchFilter용 - final public function getFieldBatchFilters() - { - return $this->_model->getFieldBatchFilters(); - } - //Field별 Form Option용 - public function getFieldFormOption(string $field): array - { - switch ($field) { - case 'user_uid': - $options = $this->_user_uids = $this->_user_uids ?: $this->getUserModel()->getFieldFormOptions(['status' => 'use']); - break; - default: - $options = lang($this->_className . '.' . strtoupper($field)); - break; - } - if (!is_array($options)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true)); - } - return $options; - } - //Field별 Form Option용 - final public function getFieldFormOptions(array $fields): array - { - $fieldFormOptions = array(); - foreach ($fields as $field) { - if (!is_string($field)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true)); - } - $fieldFormOptions[$field] = $this->getFieldFormOption($field); - } - return $fieldFormOptions; - } - - //Insert관련 - public function insert(array $fieldDatas): BaseEntity - { - return $this->_model->create($fieldDatas); - } - //Update관련 - public function update($entity, array $fieldDatas) - { - return $this->_model->modify($entity, $fieldDatas); - } - //Delete 관련 - public function delete($entity) - { - if (!$this->_model->delete($entity->getPrimaryKey())) { - log_message("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery()); - log_message("error", implode("\n", $this->_model->errors())); - throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true)); - } - } - //View 관련 - public function view($entity) - { - return $entity; - } - - public function setCondition(array $filterFields, $word, $start, $end, $order_field, $order_value) - { - foreach ($filterFields as $field => $value) { - $this->_model->where($field, $value); - } - if (!is_null($word)) { - $this->_model->setIndexWordFilter($word); - } - if (!is_null($start) && !is_null($end)) { - $this->_model->setIndexDateFilter($start, $end); - } - $this->_model->setIndexOrderBy($order_field, $order_value); - } - final public function getTotalCount() - { - return $this->_model->countAllResults(); - } - final public function getFindEntitys(int $page = 0, int $per_page = 0) - { - return $per_page ? $this->_model->findAll($per_page, $page * $per_page - $per_page) : $this->_model->findAll(); - } -} diff --git a/app/Backend/BaseHierarchyBackend.php b/app/Backend/BaseHierarchyBackend.php deleted file mode 100644 index d10d640..0000000 --- a/app/Backend/BaseHierarchyBackend.php +++ /dev/null @@ -1,21 +0,0 @@ -_model->getContentField(); - } - //Reply관련 - public function reply($entity, array $fieldDatas) - { - return $this->_model->reply($entity, $fieldDatas); - } -} diff --git a/app/Backend/BoardBackend.php b/app/Backend/BoardBackend.php deleted file mode 100644 index 0cc30ba..0000000 --- a/app/Backend/BoardBackend.php +++ /dev/null @@ -1,47 +0,0 @@ -_model = new BoardModel(); - } - //BoardConfig모델 - final public function getBoardConfigModel(): BoardConfigModel - { - return is_null($this->_boardConfigModel) ? new BoardConfigModel() : $this->_boardConfigModel; - } - - //Field별 Form Option용 - public function getFieldFormOption(string $field): array - { - switch ($field) { - case 'board_config_uid': - $options = $this->_board_config_uids = $this->_board_config_uids ?: $this->getBoardConfigModel()->getFieldFormOptions(['status' => 'use']); - break; - default: - return parent::getFieldFormOption($field); - break; - } - if (!is_array($options)) { - throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true)); - } - return $options; - } - - //View관련 - public function view($entity) - { - //view_cnt에 추가하기위함 - $this->_model->increaseViewCount($entity->getPrimaryKey()); - return parent::view($entity); - } -} diff --git a/app/Backend/BoardConfigBackend.php b/app/Backend/BoardConfigBackend.php deleted file mode 100644 index 70428b6..0000000 --- a/app/Backend/BoardConfigBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new BoardConfigModel(); - } -} diff --git a/app/Backend/UserBackend.php b/app/Backend/UserBackend.php deleted file mode 100644 index 3618566..0000000 --- a/app/Backend/UserBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new UserModel(); - } -} diff --git a/app/Backend/UserSNSBackend.php b/app/Backend/UserSNSBackend.php deleted file mode 100644 index cb8da34..0000000 --- a/app/Backend/UserSNSBackend.php +++ /dev/null @@ -1,14 +0,0 @@ -_model = new UserSNSModel(); - } -} diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 1f05cb0..9a142d2 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -39,9 +39,9 @@ $routes->get('/login', 'AuthController::login'); $routes->post('/signup', 'AuthController::signup/local'); $routes->get('/signup/(:alpha)', 'AuthController::signup/$1'); $routes->get('/logout', 'AuthController::logout'); -$routes->group('cart', ['namespace' => 'App\Controllers'], static function ($routes) { - $routes->post('addCart', 'CartController::addCart'); - $routes->get('cancelCart/(:uuid)', 'CartController::cancelCart/$1'); +$routes->group('ecommerce', ['namespace' => 'App\Controllers'], static function ($routes) { + $routes->post('addCart', 'EcommerceController::addCart'); + $routes->get('cancelCart/(:uuid)', 'EcommerceController::cancelCart/$1'); });; $routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) { }); @@ -95,6 +95,39 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob', 'BoardController::batchjob'); $routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2'); }); + $routes->group('category', static function ($routes) { + $routes->get('', 'CategoryController::index'); + $routes->get('excel', 'CategoryController::excel/$1'); + $routes->get('insert', 'CategoryController::insert_form'); + $routes->post('insert', 'CategoryController::insert'); + $routes->get('update/(:num)', 'CategoryController::update_form/$1'); + $routes->post('update/(:num)', 'CategoryController::update/$1'); + $routes->get('view/(:num)', 'CategoryController::view/$1'); + $routes->get('reply/(:num)', 'CategoryController::reply_form/$1'); + $routes->post('reply/(:num)', 'CategoryController::reply/$1'); + $routes->get('delete/(:num)', 'CategoryController::delete/$1', ['filter' => 'authFilter:master']); + $routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2'); + $routes->post('batchjob', 'CategoryController::batchjob'); + }); + $routes->group('product', static function ($routes) { + $routes->get('', 'ProductController::index'); + $routes->get('excel', 'ProductController::excel/$1'); + $routes->get('insert', 'ProductController::insert_form'); + $routes->post('insert', 'ProductController::insert'); + $routes->get('update/(:uuid)', 'ProductController::update_form/$1'); + $routes->post('update/(:uuid)', 'ProductController::update/$1'); + $routes->get('view/(:uuid)', 'ProductController::view/$1'); + $routes->get('delete/(:uuid)', 'ProductController::delete/$1', ['filter' => 'authFilter:master']); + $routes->get('toggle/(:uuid)/(:hash)', 'ProductController::toggle/$1/$2'); + $routes->post('batchjob', 'ProductController::batchjob'); + }); + $routes->group('order', static function ($routes) { + $routes->get('', 'OrderController::index'); + $routes->get('view/(:uuid)', 'OrderController::view/$1'); + $routes->get('delete/(:uuid)', 'OrderController::delete/$1', ['filter' => 'authFilter:master']); + $routes->get('toggle/(:uuid)/(:hash)', 'OrderController::toggle/$1/$2'); + $routes->post('batchjob', 'OrderController::batchjob`'); + }); }); $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) { $routes->group('user', ['namespace' => 'App\Controllers\Front', 'filter' => 'authFilter:master,director,cloudflare,manager,gold,silver,brone,vip,user'], static function ($routes) { @@ -115,6 +148,15 @@ $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($rou $routes->get('delete/(:num)', 'BoardController::delete/$1', ['filter' => 'authFilter:master']); $routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2'); }); + $routes->group('product', static function ($routes) { + $routes->get('', 'ProductController::index'); + $routes->get('excel', 'ProductController::excel/$1'); + $routes->get('view/(:uuid)', 'ProductController::view/$1'); + }); + $routes->group('order', static function ($routes) { + $routes->get('', 'OrderController::index'); + $routes->get('view/(:uuid)', 'OrderController::view/$1'); + });; }); /* * -------------------------------------------------------------------- diff --git a/app/Views/admin/category/index.php b/app/Views/admin/category/index.php index 9f35470..08b5334 100644 --- a/app/Views/admin/category/index.php +++ b/app/Views/admin/category/index.php @@ -9,7 +9,7 @@ - + @@ -21,12 +21,12 @@ getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);"> - + @@ -36,7 +36,7 @@ - + diff --git a/app/Views/admin/order/index.php b/app/Views/admin/order/index.php index 020703d..a196f32 100644 --- a/app/Views/admin/order/index.php +++ b/app/Views/admin/order/index.php @@ -9,7 +9,7 @@ - +
번호
"checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> - getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> + getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
diff --git a/app/Views/admin/product/index.php b/app/Views/admin/product/index.php index f4cc3d1..c0aa53b 100644 --- a/app/Views/admin/product/index.php +++ b/app/Views/admin/product/index.php @@ -9,7 +9,7 @@ - +
번호
@@ -21,12 +21,12 @@ getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);"> - + @@ -36,7 +36,7 @@ - + diff --git a/app/Views/front/board/index.php b/app/Views/front/board/index.php index 5637821..cc70ffd 100644 --- a/app/Views/front/board/index.php +++ b/app/Views/front/board/index.php @@ -19,7 +19,7 @@ getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);">
번호
"checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> - getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> + getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
get(SESSION_NAMES['ISLOGIN']) && $entity->getUser_Uid() == $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']]) : ?> - getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> + getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?> diff --git a/app/Views/layouts/front/header.php b/app/Views/layouts/front/header.php deleted file mode 100644 index 6bd4c0b..0000000 --- a/app/Views/layouts/front/header.php +++ /dev/null @@ -1,5 +0,0 @@ -
- HOME - title_japanese:$parentCategory->title ?> - title_japanese:$currentCategory->title ?> -
diff --git a/app/Views/layouts/front/siteboard_left_banner.php b/app/Views/layouts/front/siteboard_left_banner.php deleted file mode 100644 index a7e11b4..0000000 --- a/app/Views/layouts/front/siteboard_left_banner.php +++ /dev/null @@ -1,8 +0,0 @@ - - - -
-
-
-
- diff --git a/app/Views/layouts/front/sitecontent_left_banner.php b/app/Views/layouts/front/sitecontent_left_banner.php deleted file mode 100644 index 2cf1792..0000000 --- a/app/Views/layouts/front/sitecontent_left_banner.php +++ /dev/null @@ -1,8 +0,0 @@ - - - -
-
-
-
- diff --git a/app/Views/layouts/front/top_logo.php b/app/Views/layouts/front/top_logo.php deleted file mode 100644 index 6e5a8d2..0000000 --- a/app/Views/layouts/front/top_logo.php +++ /dev/null @@ -1,13 +0,0 @@ - -
- - -
- - - - - -
-
- \ No newline at end of file diff --git a/app/Views/layouts/front/top_menu.php b/app/Views/layouts/front/top_menu.php deleted file mode 100644 index cac30be..0000000 --- a/app/Views/layouts/front/top_menu.php +++ /dev/null @@ -1,14 +0,0 @@ - \ No newline at end of file diff --git a/app/Views/layouts/front/welcome_left_banner.php b/app/Views/layouts/front/welcome_left_banner.php deleted file mode 100644 index 18c3514..0000000 --- a/app/Views/layouts/front/welcome_left_banner.php +++ /dev/null @@ -1,5 +0,0 @@ -
- -
-
-
diff --git a/app/Views/layouts/front/welcome_partner_banner.php b/app/Views/layouts/front/welcome_partner_banner.php deleted file mode 100644 index 95013bf..0000000 --- a/app/Views/layouts/front/welcome_partner_banner.php +++ /dev/null @@ -1,16 +0,0 @@ -
-     -   -   -   -   -   -   -   -   -   -   -   -   -   -
diff --git a/app/Views/layouts/front/welcome_right_banner.php b/app/Views/layouts/front/welcome_right_banner.php deleted file mode 100644 index 45c9c01..0000000 --- a/app/Views/layouts/front/welcome_right_banner.php +++ /dev/null @@ -1,14 +0,0 @@ -
- -
-
-
-
-
-
-
-
-
-
-
-