From 4dde9cde70cdb083f37d90b14a48af8d4bcede98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Tue, 10 Feb 2026 14:26:28 +0900 Subject: [PATCH] daemon-idc init --- app/Config/Pager.php | 6 +- app/Config/Routes.php | 17 ++++++ app/Controllers/Admin/SearchController.php | 47 +++++++++++++++ app/Database/init.sql | 33 ----------- app/Helpers/CommonHelper.php | 2 +- app/Views/cells/search/client.php | 2 +- app/Views/layouts/admin/left_menu.php | 3 - app/Views/layouts/admin/left_menu/base.php | 3 - .../layouts/admin/left_menu/customer.php | 13 ----- .../layouts/admin/left_menu/equipment.php | 17 ------ app/Views/layouts/admin/left_menu/part.php | 28 --------- app/Views/templates/admin/index_header.php | 58 +------------------ 12 files changed, 71 insertions(+), 158 deletions(-) create mode 100644 app/Controllers/Admin/SearchController.php delete mode 100644 app/Views/layouts/admin/left_menu/customer.php delete mode 100644 app/Views/layouts/admin/left_menu/equipment.php delete mode 100644 app/Views/layouts/admin/left_menu/part.php diff --git a/app/Config/Pager.php b/app/Config/Pager.php index e341f4d..74e95f0 100644 --- a/app/Config/Pager.php +++ b/app/Config/Pager.php @@ -21,9 +21,11 @@ class Pager extends BaseConfig * @var array */ public array $templates = [ - 'default_full' => 'CodeIgniter\Pager\Views\default_full', + 'default_full' => 'CodeIgniter\Pager\Views\default_full', 'default_simple' => 'CodeIgniter\Pager\Views\default_simple', - 'default_head' => 'CodeIgniter\Pager\Views\default_head', + 'default_head' => 'CodeIgniter\Pager\Views\default_head', + 'bootstrap_full' => 'Pagers/bootstrap_full', + 'bootstrap_simple' => 'Pagers/bootstrap_simple', ]; /** diff --git a/app/Config/Routes.php b/app/Config/Routes.php index a7c4c8b..dbe0f05 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -41,4 +41,21 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob_delete', 'UserController::batchjob_delete', ['filter' => 'authFilter:master']); $routes->get('download/(:alpha)', 'UserController::download/$1'); }); + $routes->group('search', function ($routes) { + $routes->get('/', 'SearchController::index'); + }); + $routes->group('board', function ($routes) { + $routes->get('/', 'BoardController::index'); + $routes->get('create', 'BoardController::create_form'); + $routes->post('create', 'BoardController::create'); + $routes->get('modify/(:num)', 'BoardController::modify_form/$1'); + $routes->post('modify/(:num)', 'BoardController::modify/$1'); + $routes->get('view/(:num)', 'BoardController::view/$1'); + $routes->get('delete/(:num)', 'BoardController::delete/$1'); + $routes->get('toggle/(:num)/(:any)', 'BoardController::toggle/$1/$2'); + $routes->post('batchjob', 'BoardController::batchjob'); + $routes->post('batchjob_delete', 'BoardController::batchjob_delete'); + $routes->get('download/(:alpha)', 'BoardController::download/$1'); + $routes->get('latest/(:alpha)', 'BoardController::latest/$1'); + }); }); \ No newline at end of file diff --git a/app/Controllers/Admin/SearchController.php b/app/Controllers/Admin/SearchController.php new file mode 100644 index 0000000..9cf5c25 --- /dev/null +++ b/app/Controllers/Admin/SearchController.php @@ -0,0 +1,47 @@ +service === null) { + $this->service = service('customer_serviceservice'); + } + $this->addActionPaths('service'); + } + //Action작업관련 + //기본 함수 작업 + //Custom 추가 함수 + protected function index_entities_process(array $entities = []): array + { + $keyword = $this->request->getGet('keyword'); // 검색어 + if (!$keyword) { + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 [{$keyword}] 검색어가 지정되지 않았습니다. "); + } + //검색어에 따른 서버정보를 검색 후 해당하는 서비스리스트를 가져온다. + $rows = service('equipment_serverservice')->getSearchServices($keyword); + $uids = []; + foreach ($rows as $row) { + $uids[] = "'{$row->serviceinfo_uid}'"; + } + if (count($uids) === 0) { + return $entities; + } + //서비스별 서버리스트 + // $childServers = []; + foreach ($this->service->getEntities([sprintf("uid IN (%s)", implode(",", $uids)) => null]) as $entity) { + $entities[] = $entity; + // $childServers[$entity->getPK()] = $this->getService()->getServerService()->getEntities(['serviceinfo_uid' => $entity->getPK()]); + } + // $this->childServers = $childServers; + return $entities; + } +} diff --git a/app/Database/init.sql b/app/Database/init.sql index 5a57add..9cc9405 100644 --- a/app/Database/init.sql +++ b/app/Database/init.sql @@ -87,39 +87,6 @@ UNLOCK TABLES; -- Table structure for table `clientinfo` -- -DROP TABLE IF EXISTS `clientinfo`; -/*!40101 SET @saved_cs_client = @@character_set_client */; -/*!40101 SET character_set_client = utf8mb4 */; -CREATE TABLE `clientinfo` ( - `uid` int(11) NOT NULL AUTO_INCREMENT COMMENT '고객정보', - `user_uid` int(11) NOT NULL COMMENT '관리자정보', - `id` varchar(20) DEFAULT NULL, - `passwd` varchar(255) DEFAULT NULL, - `site` varchar(20) NOT NULL DEFAULT 'prime' COMMENT 'Site구분', - `role` varchar(50) NOT NULL DEFAULT 'user', - `name` varchar(100) NOT NULL, - `phone` varchar(50) DEFAULT NULL, - `email` varchar(50) NOT NULL, - `history` text DEFAULT NULL COMMENT 'history', - `account_balance` int(11) NOT NULL DEFAULT 0 COMMENT '예치금', - `coupon_balance` int(11) NOT NULL DEFAULT 0 COMMENT '쿠폰수', - `point_balance` int(11) NOT NULL DEFAULT 0 COMMENT '포인트', - `status` varchar(20) NOT NULL DEFAULT 'available', - `updated_at` timestamp NULL DEFAULT NULL, - `created_at` timestamp NOT NULL DEFAULT current_timestamp(), - `deleted_at` timestamp NULL DEFAULT NULL, - PRIMARY KEY (`uid`), - UNIQUE KEY `unique_site_name` (`site`,`name`), - UNIQUE KEY `uk_id` (`id`), - KEY `FK_user_TO_clientinfo` (`user_uid`), - CONSTRAINT `FK_user_TO_clientinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci COMMENT='고객정보'; -/*!40101 SET character_set_client = @saved_cs_client */; - --- --- Dumping data for table `clientinfo` --- - /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; diff --git a/app/Helpers/CommonHelper.php b/app/Helpers/CommonHelper.php index b874dbd..eb9f1bc 100644 --- a/app/Helpers/CommonHelper.php +++ b/app/Helpers/CommonHelper.php @@ -165,7 +165,7 @@ abstract class CommonHelper if (!array_key_exists($value, $viewDatas['formOptions'][$field]['options'])) { throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: {$field}에서 {$value}에 해당하는 값이 존재하지 않습니다."); } - $value = !$value ? "" : "{$viewDatas['formOptions'][$field]['options'][$value]}"; + $value = !$value ? "" : "{$viewDatas['formOptions'][$field]['options'][$value]}"; } break; case 'role': diff --git a/app/Views/cells/search/client.php b/app/Views/cells/search/client.php index 04d8a8c..f558c9e 100644 --- a/app/Views/cells/search/client.php +++ b/app/Views/cells/search/client.php @@ -1,4 +1,4 @@ 'form-select w-auto d-inline-block select-field', - 'onchange' => "if(this.value) window.location.href='/admin/customer/client/detail/' + this.value;" + 'onchange' => "if(this.value) window.location.href='/admin/user/detail/' + this.value;" ]) ?> \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu.php b/app/Views/layouts/admin/left_menu.php index 326ac65..3b25bf9 100644 --- a/app/Views/layouts/admin/left_menu.php +++ b/app/Views/layouts/admin/left_menu.php @@ -8,9 +8,6 @@ include($viewDatas['layout']['layout'] . '/left_menu/base'); ?> include($viewDatas['layout']['layout'] . '/left_menu/board'); ?> - include($viewDatas['layout']['layout'] . '/left_menu/customer'); ?> - include($viewDatas['layout']['layout'] . '/left_menu/equipment'); ?> - include($viewDatas['layout']['layout'] . '/left_menu/part'); ?> diff --git a/app/Views/layouts/admin/left_menu/base.php b/app/Views/layouts/admin/left_menu/base.php index 9a09de4..aeed902 100644 --- a/app/Views/layouts/admin/left_menu/base.php +++ b/app/Views/layouts/admin/left_menu/base.php @@ -1,6 +1,3 @@ - \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/customer.php b/app/Views/layouts/admin/left_menu/customer.php deleted file mode 100644 index 7f704f7..0000000 --- a/app/Views/layouts/admin/left_menu/customer.php +++ /dev/null @@ -1,13 +0,0 @@ -

- -

- \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/equipment.php b/app/Views/layouts/admin/left_menu/equipment.php deleted file mode 100644 index 99a470a..0000000 --- a/app/Views/layouts/admin/left_menu/equipment.php +++ /dev/null @@ -1,17 +0,0 @@ -

- -

- \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/part.php b/app/Views/layouts/admin/left_menu/part.php deleted file mode 100644 index 0d9e851..0000000 --- a/app/Views/layouts/admin/left_menu/part.php +++ /dev/null @@ -1,28 +0,0 @@ -

- -

-
- -
- IP정보 -
-
- CS정보 -
-
- CPU정보 -
-
- RAM정보 -
- - -
\ No newline at end of file diff --git a/app/Views/templates/admin/index_header.php b/app/Views/templates/admin/index_header.php index 216208d..37400dd 100644 --- a/app/Views/templates/admin/index_header.php +++ b/app/Views/templates/admin/index_header.php @@ -8,67 +8,11 @@ \ No newline at end of file