diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 78e10d1..ddcce8d 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -121,6 +121,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au $routes->post('batchjob', 'ServiceController::batchjob'); $routes->post('batchjob_delete', 'ServiceController::batchjob_delete'); $routes->get('download/(:alpha)', 'ServiceController::download/$1'); + $routes->get('detail', 'ServiceController::detail'); }); $routes->group('serviceitem', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) { $routes->get('/', 'ServiceItemController::index'); diff --git a/app/Controllers/Admin/Customer/ServiceController.php b/app/Controllers/Admin/Customer/ServiceController.php index 36a1583..395259a 100644 --- a/app/Controllers/Admin/Customer/ServiceController.php +++ b/app/Controllers/Admin/Customer/ServiceController.php @@ -51,6 +51,7 @@ class ServiceController extends CustomerController switch ($this->getAction()) { // case 'create_form': // case 'modify_form': + case 'detail': case 'view': case 'index': $this->control = $this->getControlDatas(); @@ -91,4 +92,45 @@ class ServiceController extends CustomerController //부모함수처리 return parent::index_process($entities); } + + public function detail(): RedirectResponse|string + { + try { + $this->setAction(__FUNCTION__); + $this->setFormFields(); + $this->setFormFilters(); + $this->setFormRules(); + //기본값정의 + $this->setFormDatas($this->request->getGet()); + $this->setFormOptions(); + //일괄작업용 Fields정의 + $this->setControlDatas('batchjob_fields', $this->getService()->getBatchjobFields()); + //일괄작업용 버튼정의 + $this->setControlDatas('batchjob_buttions', $this->getService()->getBatchjobButtons()); + helper(['form']); + //Return Url정의 + $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : "")); + //조건절 처리 + $this->index_condition_process(); + //TotalCount (SoftDelete적용이 되려면 countAllResults를 사용해야함) + $this->total_count = $this->getService()->getTotalCount(); + //Pagination 처리 + $this->pagination = $this->index_pagenation_process(); + //줄수 처리용 + $this->page_options = $this->index_pageOptions_process(); + //조건절 처리 + //OrcerBy , Limit 처리 + $this->order_field = $this->request->getVar('order_field'); + $this->order_value = $this->request->getVar('order_value'); + $this->getService()->setOrderBy($this->order_field, $this->order_value); + $this->getService()->setLimit($this->per_page); + $this->getService()->setOffset(($this->page - 1) * $this->per_page); + $this->index_condition_process(); + $this->entities = $this->index_process(); + return $this->getResultSuccess(); + } catch (\Exception $e) { + return $e->getMessage(); + // return $this->getResultFail($e->getMessage()); + } + } } diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index f612692..7fbf352 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -62,7 +62,7 @@ abstract class CommonController extends BaseController } return array_key_exists($key, $this->_control) ? $this->_control[$key] : null; } - private function setControlDatas(string $key, mixed $values): void + final protected function setControlDatas(string $key, mixed $values): void { if (!array_key_exists($key, $this->_control)) { $this->_control[$key] = []; diff --git a/app/Database/dbmsv2_test1.sql b/app/Database/dbmsv2_test1.sql index c15093d..5d915ea 100644 --- a/app/Database/dbmsv2_test1.sql +++ b/app/Database/dbmsv2_test1.sql @@ -391,7 +391,7 @@ CREATE TABLE `serverinfo` ( LOCK TABLES `serverinfo` WRITE; /*!40000 ALTER TABLE `serverinfo` DISABLE KEYS */; -INSERT INTO `serverinfo` VALUES (3,585,5,'250904-M1','hp','HP DL360 Gen6',300000,'2025-08-31 15:00:00','2025-09-29 15:00:00','occupied','2025-09-05 08:50:32','2025-09-04 08:09:50',NULL),(4,223,8,'250905-M4','hp','Hitach HA3000',200000,'2025-09-02 15:00:00','2025-09-28 15:00:00','occupied','2025-09-08 07:28:50','2025-09-05 00:04:09',NULL),(5,NULL,NULL,'250905-M5','del','HP DL360 Gen9',100000,'2025-09-03 15:00:00','2025-09-26 15:00:00','available',NULL,'2025-09-05 00:05:26',NULL),(6,NULL,NULL,'250905-M6','etc','HP DL360 Gen10',300000,'2025-09-03 15:00:00','2025-09-27 15:00:00','available',NULL,'2025-09-05 07:36:21',NULL),(10,NULL,NULL,'250908-M7','hp','HP DL360 Gen9',500000,'2025-09-02 15:00:00','2025-09-27 15:00:00','available',NULL,'2025-09-08 07:14:10',NULL),(11,69,9,'250908-M11','etc','HP DL360 Gen10',500000,'2025-09-04 15:00:00','2025-09-26 15:00:00','occupied','2025-09-09 03:40:56','2025-09-08 07:25:24',NULL); +INSERT INTO `serverinfo` VALUES (3,585,5,'250904-M1','hp','HP DL360 Gen6',300000,'2025-08-31 15:00:00','2025-09-29 15:00:00','occupied','2025-09-05 08:50:32','2025-09-04 08:09:50',NULL),(4,223,8,'250905-M4','hp','Hitach HA3000',200000,'2025-09-02 15:00:00','2025-09-28 15:00:00','occupied','2025-09-08 07:28:50','2025-09-05 00:04:09',NULL),(5,260,10,'250905-M5','del','HP DL360 Gen7',100000,'2025-09-03 15:00:00','2025-09-26 15:00:00','occupied','2025-09-09 06:22:00','2025-09-05 00:05:26',NULL),(6,NULL,NULL,'250905-M6','etc','HP DL360 Gen8',300000,'2025-09-03 15:00:00','2025-09-27 15:00:00','available','2025-09-09 06:09:35','2025-09-05 07:36:21',NULL),(10,NULL,NULL,'250908-M7','hp','HP DL360 Gen9',500000,'2025-09-02 15:00:00','2025-09-27 15:00:00','available',NULL,'2025-09-08 07:14:10',NULL),(11,69,9,'250908-M11','etc','HP DL360 Gen10',500000,'2025-09-04 15:00:00','2025-09-26 15:00:00','occupied','2025-09-09 03:40:56','2025-09-08 07:25:24',NULL); /*!40000 ALTER TABLE `serverinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -463,7 +463,7 @@ CREATE TABLE `serviceinfo` ( KEY `FK_clientinfo_TO_serviceinfo` (`clientinfo_uid`), CONSTRAINT `FK_clientinfo_TO_serviceinfo` FOREIGN KEY (`clientinfo_uid`) REFERENCES `clientinfo` (`uid`), CONSTRAINT `FK_user_TO_serviceinfo` FOREIGN KEY (`user_uid`) REFERENCES `user` (`uid`) -) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8 COMMENT='서비스정보'; +) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8 COMMENT='서비스정보'; /*!40101 SET character_set_client = @saved_cs_client */; -- @@ -472,7 +472,7 @@ CREATE TABLE `serviceinfo` ( LOCK TABLES `serviceinfo` WRITE; /*!40000 ALTER TABLE `serviceinfo` DISABLE KEYS */; -INSERT INTO `serviceinfo` VALUES (5,1,585,'s1757062232','prime','normal','chiba','2025-09-05',400000,'2025-09-05',NULL,NULL,'available','2025-09-05 09:12:29','2025-09-05 08:50:32',NULL),(8,1,223,'s1757316530','itsolution','VPN','tokyo','2025-09-23',500000,'2025-09-08',NULL,NULL,'available','2025-09-09 04:19:07','2025-09-08 07:28:50',NULL),(9,1,69,'s1757389256','gdidc','dedicated','3center','2025-09-27',500000,'2025-09-10',NULL,NULL,'available',NULL,'2025-09-09 03:40:56',NULL); +INSERT INTO `serviceinfo` VALUES (5,1,585,'s1757062232','prime','normal','chiba','2025-09-05',400000,'2025-09-05',NULL,NULL,'available','2025-09-05 09:12:29','2025-09-05 08:50:32',NULL),(8,1,223,'s1757316530','itsolution','VPN','tokyo','2025-09-23',500000,'2025-09-08',NULL,NULL,'available','2025-09-09 04:19:07','2025-09-08 07:28:50',NULL),(9,1,69,'s1757389256','gdidc','dedicated','3center','2025-09-27',500000,'2025-09-10',NULL,NULL,'available',NULL,'2025-09-09 03:40:56',NULL),(10,1,260,'s1757398920','prime','alternative','3center','2025-09-25',500000,'2025-09-03',NULL,NULL,'available',NULL,'2025-09-09 06:22:00',NULL); /*!40000 ALTER TABLE `serviceinfo` ENABLE KEYS */; UNLOCK TABLES; @@ -590,4 +590,4 @@ UNLOCK TABLES; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2025-09-09 14:27:17 +-- Dump completed on 2025-09-09 15:38:53 diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index 7c4405f..8bea334 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -36,8 +36,11 @@ class ServiceHelper extends CustomerHelper public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null { switch ($field) { + case 'clientinfo_uid': + $value = "" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . ""; + break; case 'serverinfo_uid': - $value = $viewDatas['entity']->getServerEntity()->getCustomTitle(); + $value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCustomTitle() : "지정된서버없음"; break; case 'billing_at': if (array_key_exists('unPaids', $viewDatas)) { diff --git a/app/Views/admin/service/detail.php b/app/Views/admin/service/detail.php new file mode 100644 index 0000000..4f19e5a --- /dev/null +++ b/app/Views/admin/service/detail.php @@ -0,0 +1,180 @@ += $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?> += $this->section('content') ?> +alert($error) ?> +
| + + = $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?> + + | +
+
+ = $this->include("templates/{$viewDatas['layout']}/index_header"); ?>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ gobetsoft
+
+
+
+
+
+
+
+
+ 도코
+ 0
+
+
+ 서버
+ 1
+
+
+ VPN
+ 0
+
+
+ 일반
+ 1
+
+
+ 방어
+ 0
+
+
+ 전용
+ 0
+
+
+ 이벤트
+ 0
+
+
+ 테스트
+ 0
+
+
+ 대체
+ 0
+
+
+ 장기할인
+ 30%
+
+
+ 쿠폰
+ 0
+
+
+
+
+
+
+ 예치금
+ 30,000
+
+
+ 전체요금
+ 567,000
+
+
+ 전체미납금
+ 567,000
+
+
+
+
+ 비고
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 사이트
+ Prime
+
+
+ 위치
+ 도쿄
+
+
+ 형식
+ 대체
+
+
+ CPU/메모리/저장장치
+ XEON*2/2G*2/SSD 128G*2
+
+
+ SOFTWARE
+ 0
+
+
+ OS
+ Windows
+
+
+
+
+ IP주소
+ 10.20.20.20
+
+
+ CS
+ 20.1.2.3
+
+
+ 메모
+ asdfsdfsdfsdf
+
+
+ 부가서비스
+ 부가
+
+
+ 결제처리
+ 0
+
+
+ 결제처리
+ 0
+ |
+