diff --git a/app/Config/App.php b/app/Config/App.php index b761da7..74aabc3 100644 --- a/app/Config/App.php +++ b/app/Config/App.php @@ -93,7 +93,7 @@ class App extends BaseConfig * strings (like currency markers, numbers, etc), that your program * should run under for this request. */ - public string $defaultLocale = 'en'; + public string $defaultLocale = 'ko'; /** * -------------------------------------------------------------------------- diff --git a/app/Config/Constants.php b/app/Config/Constants.php index bfafb42..1b87a71 100644 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -287,4 +287,11 @@ define("BOARD", [ 'NOTICE' => 'notice', 'REQUESTTASK' => 'requesttask' ], +]); + +//사이트 선택관련 +define("SITES", [ + "primeidc" => "PRIME", + "itsolution" => "ITSOLUTION", + "gdidc" => "GDIDC", ]); \ No newline at end of file diff --git a/app/Config/Layout.php b/app/Config/Layout.php new file mode 100644 index 0000000..25a17cf --- /dev/null +++ b/app/Config/Layout.php @@ -0,0 +1,107 @@ + [ + 'title' => self::KEYWORD, + 'path' => 'auth', + 'layout' => 'layouts' . DIRECTORY_SEPARATOR . 'auth', + 'template' => 'templates' . DIRECTORY_SEPARATOR . 'auth', + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + ], + 'javascripts' => [ + '', + ], + 'footerScripts' => [] + ], + 'front' => [ + 'title' => self::KEYWORD, + 'path' => 'front', + 'layout' => 'layouts' . DIRECTORY_SEPARATOR . 'front', + 'template' => 'templates' . DIRECTORY_SEPARATOR . 'front', + 'topmenus' => ['aboutus', 'hosting', 'service', 'support'], + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + ], + 'footerScripts' => [] + ], + 'admin' => [ + 'title' => '관리자화면', + 'path' => 'admin', + 'layout' => 'layouts' . DIRECTORY_SEPARATOR . 'admin', + 'template' => 'templates' . DIRECTORY_SEPARATOR . 'admin', + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + '', + '' + ], + 'footerScripts' => [] + ], + ]; +} diff --git a/app/Config/Services.php b/app/Config/Services.php index 0c1a17e..0742937 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -8,7 +8,7 @@ use App\Services\Auth\GoogleService; use App\Services\Auth\LocalService; use App\Services\BoardService; use App\Services\UserService; - +use App\Services\Customer\ClientService; /** * Services Configuration file. * @@ -86,4 +86,15 @@ class Services extends BaseService new \App\Models\BoardModel(), ); } + + //Customer + public static function customer_clientservice($getShared = true): ClientService + { + if ($getShared) { + return static::getSharedInstance(__FUNCTION__); + } + return new ClientService( + new \App\Models\Customer\ClientModel(), + ); + } } diff --git a/app/Controllers/Admin/Customer/ClientController.php b/app/Controllers/Admin/Customer/ClientController.php new file mode 100644 index 0000000..5353318 --- /dev/null +++ b/app/Controllers/Admin/Customer/ClientController.php @@ -0,0 +1,70 @@ +service === null) { + $this->service = service('customer_clientservice'); + } + $this->addActionPaths('client'); + } + //기본 함수 작업 + //Custom 추가 함수 + //고객 상세정보 + public function detail(mixed $uid): string|RedirectResponse + { + try { + $action = __FUNCTION__; + $this->action_init_process($action); + //Return Url정의 + $this->getAuthContext()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : "")); + //일괄작업용 Fields정의 + $entity = $this->service->getEntity($uid); + if (!$entity instanceof ClientEntity) { + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 {$uid}에 해당하는 고객정보를 찾을수 없습니다."); + } + $this->addViewDatas('totalCounts', service('equipment_serverservice')->getTotalServiceCount(['serviceinfo.clientinfo_uid' => $entity->getPK()])); + $this->addViewDatas('totalAmounts', service('customer_serviceservice')->getTotalAmounts([ + 'clientinfo_uid' => $entity->getPK(), + 'status' => STATUS['AVAILABLE'] + ])); + //서비스별 미납 Count + $this->addViewDatas('unPaids', service('paymentservice')->getUnPaids('clientinfo_uid', [ + 'clientinfo_uid' => $entity->getPK() + ])); + $this->addViewDatas('serviceEntities', service('customer_serviceservice')->getEntities(['clientinfo_uid' => $entity->getPK()])); + $this->addViewDatas('entity', $entity); + helper(['form']); + return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? 'client'); + } catch (\Throwable $e) { + return $this->action_redirect_process('error', static::class . '->' . __FUNCTION__ . "에서 {$this->getTitle()} 고객 Detail Page 오류:" . $e->getMessage()); + } + } + + //비고사항 변경 + public function history(int $uid): RedirectResponse|string + { + try { + $history = $this->request->getPost('history'); + if (!$history) { + throw new RuntimeException(static::class . '->' . __FUNCTION__ . "에서 오류발생: 비고가 정의되지 않았습니다."); + } + $entity = $this->service->modify($uid, ['history' => $history]); + $this->addViewDatas('entity', $entity); + return $this->action_redirect_process('info', static::class . '->' . __FUNCTION__ . "에서 {$this->getTitle()} 비고설정이 완료되었습니다."); + } catch (\Throwable $e) { + return $this->action_redirect_process('error', static::class . '->' . __FUNCTION__ . "에서 {$this->getTitle()} 비고설정 오류:" . $e->getMessage()); + } + } +} diff --git a/app/Controllers/Admin/Customer/CustomerController.php b/app/Controllers/Admin/Customer/CustomerController.php new file mode 100644 index 0000000..a24cd69 --- /dev/null +++ b/app/Controllers/Admin/Customer/CustomerController.php @@ -0,0 +1,19 @@ +addActionPaths('customer'); + } + //Index,FieldForm관련 +} diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Home.php index 1b7908e..59eb9a0 100644 --- a/app/Controllers/Admin/Home.php +++ b/app/Controllers/Admin/Home.php @@ -40,7 +40,7 @@ class Home extends AbstractWebController $this->addViewDatas('boardRequestTaskCount', service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID())); //Total 서버 현황 //interval을 기준으로 최근 신규 서비스정보 가져오기 - $interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']); + $interval = intval($this->request->getVar('interval') ?? 7); $this->addViewDatas('interval', $interval); $newServiceEntities = $this->service->getNewServiceEntities($interval); $this->addViewDatas('newServiceEntities', $newServiceEntities); diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index 5934333..ee47cb4 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -2,10 +2,40 @@ namespace App\Controllers; -class Home extends BaseController +use App\Controllers\AbstractWebController; +use CodeIgniter\HTTP\RequestInterface; +use CodeIgniter\HTTP\ResponseInterface; +use Psr\Log\LoggerInterface; + +class Home extends AbstractWebController { + private $_layout = 'front'; + protected $layouts = []; + public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) + { + parent::initController($request, $response, $logger); + if ($this->service === null) { + $this->service = service('customer_clientservice'); + } + $this->addActionPaths($this->_layout); + $this->layouts = config('Layout')->layouts[$this->_layout] ?? []; + } + protected function action_init_process(string $action, array $formDatas = []): void + { + parent::action_init_process($action, $formDatas); + $this->addViewDatas('layout', $this->layouts); + $this->addViewDatas('helper', $this->service->getHelper()); + $this->service->getActionForm()->action_init_process($action, $formDatas); + $this->addViewDatas('formFields', $this->service->getActionForm()->getFormFields()); + $this->addViewDatas('formRules', $this->service->getActionForm()->getFormRules()); + $this->addViewDatas('formFilters', $this->service->getActionForm()->getFormFilters()); + $this->addViewDatas('formOptions', $this->service->getActionForm()->getFormOptions()); + } + //Index,FieldForm관련 public function index(): string { - return view('welcome_message'); + $action = __FUNCTION__; + $this->action_init_process($action); + return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome"); } } diff --git a/app/DTOs/Customer/ClientDTO.php b/app/DTOs/Customer/ClientDTO.php new file mode 100644 index 0000000..030eaa6 --- /dev/null +++ b/app/DTOs/Customer/ClientDTO.php @@ -0,0 +1,51 @@ +role); + } +} diff --git a/app/Database/init.sql b/app/Database/init.sql index b5e94da..5a57add 100644 --- a/app/Database/init.sql +++ b/app/Database/init.sql @@ -83,6 +83,43 @@ INSERT INTO `user` VALUES (1,'choi.jh','$2y$10$.vl2FtwJsjMNFCJJm3ISDu7m3vBB85mZ5 UNLOCK TABLES; /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; +-- +-- 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 */; @@ -92,3 +129,4 @@ UNLOCK TABLES; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; -- Dump completed on 2026-02-09 17:04:26 + diff --git a/app/Entities/Customer/ClientEntity.php b/app/Entities/Customer/ClientEntity.php new file mode 100644 index 0000000..f390579 --- /dev/null +++ b/app/Entities/Customer/ClientEntity.php @@ -0,0 +1,142 @@ + null, + 'passwd' => null, + 'site' => '', + 'name' => '', + 'phone' => '', + 'email' => '', + 'role' => '', // ✅ [] 금지 + 'account_balance' => 0, + 'coupon_balance' => 0, + 'point_balance' => 0, + 'status' => '', + 'history' => '', + ]; + + public function __construct(array|null $data = null) + { + parent::__construct($data); + } + + public function getUserUid(): int|null + { + return $this->user_uid ?? null; + } + + public function getCustomTitle(mixed $title = null): string + { + return sprintf("%s/%s", $this->getSite(), $title ? $title : $this->getTitle()); + } + + public function getName(): string + { + return (string) ($this->attributes['name'] ?? ''); + } + + public function getSite(): string + { + return (string) ($this->attributes['site'] ?? ''); + } + + public function getAccountBalance(): int + { + return (int) ($this->attributes['account_balance'] ?? 0); + } + + public function getCouponBalance(): int + { + return (int) ($this->attributes['coupon_balance'] ?? 0); + } + + public function getPointBalance(): int + { + return (int) ($this->attributes['point_balance'] ?? 0); + } + + public function getHistory(): string|null + { + return $this->attributes['history'] ?? null; + } + + /** + * role을 배열로 반환 + */ + public function getRole(): array + { + $role = $this->attributes['role'] ?? null; + + if (is_array($role)) { + return array_values(array_filter($role, fn($v) => (string) $v !== '')); + } + + if (is_string($role) && $role !== '') { + $decoded = json_decode($role, true); + if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) { + $clean = array_map( + fn($item) => trim((string) ($item ?? ''), " \t\n\r\0\x0B\""), + $decoded + ); + return array_values(array_filter($clean, fn($v) => $v !== '')); + } + + $parts = explode(DEFAULTS["DELIMITER_COMMA"], $role); + $clean = array_map( + fn($item) => trim((string) ($item ?? ''), " \t\n\r\0\x0B\""), + $parts + ); + return array_values(array_filter($clean, fn($v) => $v !== '')); + } + + return []; + } + + /** + * ✅ role은 DB 저장용 CSV 문자열로 반환 + */ + public function setRole($role): string + { + $roleArray = []; + + if (is_string($role)) { + $clean = trim($role, " \t\n\r\0\x0B\""); + if ($clean !== '') { + $decoded = json_decode($clean, true); + if (json_last_error() === JSON_ERROR_NONE && is_array($decoded)) { + $roleArray = $decoded; + } else { + $roleArray = explode(DEFAULTS["DELIMITER_COMMA"], $clean); + } + } + } elseif (is_array($role)) { + $roleArray = $role; + } else { + $roleArray = []; + } + + $cleaned = array_map( + fn($item) => trim((string) ($item ?? ''), " \t\n\r\0\x0B\""), + $roleArray + ); + + $roleArray = array_values(array_filter($cleaned, fn($v) => $v !== '')); + + return implode(DEFAULTS["DELIMITER_COMMA"], $roleArray); + } +} diff --git a/app/Entities/Customer/CustomerEntity.php b/app/Entities/Customer/CustomerEntity.php new file mode 100644 index 0000000..bea2a44 --- /dev/null +++ b/app/Entities/Customer/CustomerEntity.php @@ -0,0 +1,13 @@ +setFormFields($fields); + $this->setFormRules($action, $fields); + $this->setFormFilters($filters); + $this->setFormOptions($action, $filters, $formDatas); + $this->setIndexFilters($indexFilter); + $this->setBatchjobFilters($batchjobFilters); + } + public function getFormRule(string $action, string $field, array $formRules): array + { + switch ($field) { + case "name": + $formRules[$field] = sprintf("required|trim|string%s", in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->getAttribute('table')}.{$field}]" : ""); + break; + case "site": + $formRules[$field] = "required|trim|string"; + break; + case "role": + $formRules[$field] = 'required|is_array|at_least_one'; + $formRules['role.*'] = 'permit_empty|trim|in_list[user,vip,reseller]'; + break; + case "email": + $formRules[$field] = "permit_empty|trim|valid_email"; + break; + case "phone": + case "history": + $formRules[$field] = "permit_empty|trim|string"; + break; + case "account_balance": + case "coupon_balance": + case "point_balance": + $formRules[$field] = "permit_empty|numeric"; + break; + default: + $formRules = parent::getFormRule($action, $field, $formRules); + break; + } + return $formRules; + } +} diff --git a/app/Forms/Customer/CustomerForm.php b/app/Forms/Customer/CustomerForm.php new file mode 100644 index 0000000..641b8ed --- /dev/null +++ b/app/Forms/Customer/CustomerForm.php @@ -0,0 +1,13 @@ + $label) + $forms[] = form_radio($field, $key, $key == $value, $extras) . $label; + $form = implode(" ", $forms); + break; + case 'role': + // 1) value가 배열이면 그대로, 문자열이면 CSV를 배열로 변환 + if (is_string($value)) { + $value = trim($value, " \t\n\r\0\x0B\""); + $value = ($value === '') ? [] : explode(DEFAULTS["DELIMITER_COMMA"], $value); + } elseif (!is_array($value)) { + $value = []; + } + + // 2) 정리 + $currentRoles = array_values(array_filter( + array_map( + fn($item) => strtolower(trim((string) ($item ?? ''), " \t\n\r\0\x0B\"")), + $value + ) + )); + + $form = ''; + array_shift($viewDatas['formOptions'][$field]['options']); + foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) { + $checked = in_array(strtolower(trim((string) $key)), $currentRoles, true); + $form .= ''; + } + // dd($form); + break; + default: + $form = parent::getFieldForm($field, $value, $viewDatas, $extras); + break; + } + return $form; + } // + public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null + { + switch ($field) { + case 'name': + $value = "getPK()}\">" . $value . ""; + break; + case "email": + case "phone": + //역활이 보안관리자가 아니면 정보숨김 + $value = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ? parent::getFieldView($field, $value, $viewDatas, $extras) : "***********"; + break; + case 'account_balance': + $value = form_label( + number_format($value) . "원", + $field, + [ + "data-src" => "/admin/customer/wallet/account?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary", + ...$extras, + ] + ); + break; + case 'coupon_balance': + $value = form_label( + number_format($value) . "개", + $field, + [ + "data-src" => "/admin/customer/wallet/coupon?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary", + ...$extras, + ] + ); + break; + case 'point_balance': + $value = form_label( + number_format($value) . "점", + $field, + [ + "data-src" => "/admin/customer/wallet/point?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary", + ...$extras, + ] + ); + break; + default: + $value = parent::getFieldView($field, $value, $viewDatas, $extras); + break; + } + if (is_array($value)) { + throw new RuntimeException(static::class . "->" . __FUNCTION__ . "에서 오류발생:{$field}에 해당하는 Return 값이 배열형식입니다.\n" . var_export($value, true)); + } + return $value; + } // + public function getListButton(string $action, string $label, array $viewDatas, array $extras = []): string + { + switch ($action) { + case 'delete': + case 'batchjob': + case 'batchjob_delete': + //역활이 보안관리자가 아니면 사용불가 + $action = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ? parent::getListButton($action, $label, $viewDatas, $extras) : ""; + break; + case 'modify': + //역활이 보안관리자가 아니면 수정불가 + $action = $this->getAuthContext()->isAccessRole([ROLE['USER']['SECURITY']]) ? parent::getListButton($action, $label, $viewDatas, $extras) : $label; + break; + case 'history': + $action = form_label( + $label ? $label : ICONS['HISTORY'], + $action, + [ + "data-src" => "/admin/customer/client/history?clientinfo_uid={$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm btn-primary form-label-sm", + ...$extras + ] + ); + break; + case 'coupon': + case 'account': + case 'point': + $action = form_label( + $label, + $action, + [ + "data-src" => "/admin/customer/wallet/{$action}?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary", + ...$extras + ] + ); + break; + case 'invoice': + $action = form_label( + $label, + 'payment_invoice', + [ + "data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + break; + case 'addService': + $action = form_label( + '서비스추가', + 'create_service', + [ + "data-src" => "/admin/customer/service/create?clientinfo_uid={$viewDatas['entity']->getPK()}", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "btn btn-sm btn-primary form-label-sm", + ] + ); + break; + case 'unpaid': + $action = "{$label} 0원"; + if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])) { + $action = form_label( + sprintf("%s건/%s원", $viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])), + 'payment_unpaid', + [ + "data-src" => "/admin/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + } + break; + default: + $action = parent::getListButton($action, $label, $viewDatas, $extras); + break; + } + return $action; + } +} diff --git a/app/Helpers/Customer/CustomerHelper.php b/app/Helpers/Customer/CustomerHelper.php new file mode 100644 index 0000000..b6f19f8 --- /dev/null +++ b/app/Helpers/Customer/CustomerHelper.php @@ -0,0 +1,13 @@ + "고객정보", + 'label' => [ + 'user_uid' => "관리자UID", + 'code' => "고객코드", + 'site' => "사이트", + 'email' => "메일", + 'phone' => "연락처", + 'role' => "권한", + 'name' => "이름", + 'account_balance' => "예치금", + 'coupon_balance' => "쿠폰", + 'point_balance' => "포인트", + 'status' => "상태", + 'updated_at' => "갱신일", + 'created_at' => "등록일", + 'deleted_at' => "삭제일", + ], + "SITE" => SITES, + "ROLE" => [ + ROLE['CLIENT']['USER'] => "일반회원", + ROLE['CLIENT']['VIP'] => "VIP회원", + ROLE['CLIENT']['RESELLER'] => "리셀러", + ], + "STATUS" => [ + STATUS['AVAILABLE'] => "사용중", + STATUS['PAUSE'] => "일시정지", + STATUS['TERMINATED'] => "해지", + ], +]; diff --git a/app/Models/Customer/ClientModel.php b/app/Models/Customer/ClientModel.php new file mode 100644 index 0000000..00773a3 --- /dev/null +++ b/app/Models/Customer/ClientModel.php @@ -0,0 +1,38 @@ +addClassPaths('Client'); + } + public function getDTOClass(): string + { + return ClientDTO::class; + } + public function createDTO(array $formDatas): ClientDTO + { + return new ClientDTO($formDatas); + } + public function getEntityClass(): string + { + return ClientEntity::class; + } + //기본 기능부분 + protected function getEntity_process(mixed $entity): ClientEntity + { + return $entity; + } + //List 검색용 + //FormFilter 조건절 처리 + //검색어조건절처리 + //OrderBy 처리 + public function setOrderBy(mixed $field = null, mixed $value = null): void + { + $this->model->orderBy("site ASC,name ASC"); + parent::setOrderBy($field, $value); + } + + protected function action_process_fieldhook(string $field, $value, array $formDatas): array + { + switch ($field) { + case 'role': + if (is_string($value)) { + $value = ($value === '') ? [] : explode(DEFAULTS["DELIMITER_COMMA"], $value); + } elseif (!is_array($value)) { + $value = []; + } + $value = array_values(array_filter(array_map( + fn($v) => trim((string) ($v ?? ''), " \t\n\r\0\x0B\""), + $value + ))); + $formDatas[$field] = $value; + break; + default: + $formDatas = parent::action_process_fieldhook($field, $value, $formDatas); + break; + } + return $formDatas; + } + +} diff --git a/app/Services/Customer/CustomerService.php b/app/Services/Customer/CustomerService.php new file mode 100644 index 0000000..bc5deb2 --- /dev/null +++ b/app/Services/Customer/CustomerService.php @@ -0,0 +1,15 @@ +addClassPaths('Customer'); + } +} diff --git a/app/Views/front/welcome/index.php b/app/Views/front/welcome/index.php new file mode 100644 index 0000000..69fff44 --- /dev/null +++ b/app/Views/front/welcome/index.php @@ -0,0 +1,9 @@ +extend($viewDatas['layout']['layout']) ?> +section('content') ?> + +
include($viewDatas['layout']['layout'] . '/top'); ?>
+ + + +
include($viewDatas['layout']['layout'] . '/bottom'); ?>
+endSection() ?> \ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/banner.php b/app/Views/layouts/admin/welcome/banner.php new file mode 100644 index 0000000..830fc33 --- /dev/null +++ b/app/Views/layouts/admin/welcome/banner.php @@ -0,0 +1,115 @@ + + + +
+
+
+
+
+
+
+
+
요청업무 알림
+
+
+
+ +
+
+
+
+
+
+
+
+
+
최근 일간 신규서버수
+
+
+
+ +
+
+
+
+
+
+
+
+
건/
+
금일 기준 미납 서비스
+
+
+
+ +
+
+
\ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/index.php b/app/Views/layouts/admin/welcome/index.php new file mode 100644 index 0000000..604279c --- /dev/null +++ b/app/Views/layouts/admin/welcome/index.php @@ -0,0 +1,31 @@ +extend($viewDatas['layout']['layout']) ?> +section('content') ?> + +
include($viewDatas['layout']['layout'] . '/top'); ?>
+ + + + + + +
+ + include($viewDatas['layout']['layout'] . '/left_menu'); ?> + + + + include("{$viewDatas['layout']['path']}/welcome/banner"); ?> +
+
+ include("{$viewDatas['layout']['path']}/welcome/total_service"); ?> + include("{$viewDatas['layout']['path']}/welcome/new_service"); ?> + include("{$viewDatas['layout']['path']}/welcome/stock"); ?> +
+
include("{$viewDatas['layout']['path']}/welcome/mylog"); ?>
+
+ +
+ + +
include($viewDatas['layout']['layout'] . '/bottom'); ?>
+endSection() ?> \ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/mylog.php b/app/Views/layouts/admin/welcome/mylog.php new file mode 100644 index 0000000..f792387 --- /dev/null +++ b/app/Views/layouts/admin/welcome/mylog.php @@ -0,0 +1,13 @@ +
+ +
+
+ +
+ \ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/new_service.php b/app/Views/layouts/admin/welcome/new_service.php new file mode 100644 index 0000000..488c587 --- /dev/null +++ b/app/Views/layouts/admin/welcome/new_service.php @@ -0,0 +1,39 @@ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + +
사이트업체명 + ALL 📋 장비번호 / 스위치정보 / IP정보 / CS정보 + 등록자
getSite()] ?>getFieldView('clientinfo_uid', $entity->getClientInfoUid(), $viewDatas) ?> + + getFieldView('serverinfo_uid', $entity->getServerInfoUid(), $viewDatas) ?>getFieldView('user_uid', $entity->getUserUid(), $viewDatas) ?>
+
+ + \ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/stock.php b/app/Views/layouts/admin/welcome/stock.php new file mode 100644 index 0000000..409449b --- /dev/null +++ b/app/Views/layouts/admin/welcome/stock.php @@ -0,0 +1,24 @@ +
+ +
+
+ + + + + + + + + + + +
사용 서버메모리 재고저장장치 재고
+
+ \ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/total_service.php b/app/Views/layouts/admin/welcome/total_service.php new file mode 100644 index 0000000..7ade694 --- /dev/null +++ b/app/Views/layouts/admin/welcome/total_service.php @@ -0,0 +1,45 @@ +
+ +
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
사이트일반방어전용대체VPN이벤트테스트합계
도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바합계
+
+ \ No newline at end of file diff --git a/app/Views/layouts/front/left_menu.php b/app/Views/layouts/front/left_menu.php deleted file mode 100644 index e920e68..0000000 --- a/app/Views/layouts/front/left_menu.php +++ /dev/null @@ -1,2 +0,0 @@ - - \ No newline at end of file diff --git a/app/Views/welcome_message.php b/app/Views/welcome_message.php deleted file mode 100644 index c6a7ca2..0000000 --- a/app/Views/welcome_message.php +++ /dev/null @@ -1,130 +0,0 @@ - - - - - - - <?= esc($title) ?> - - - - - - - - - - - -
-
-
- - IDC Background -
-
-
-
- CodeIgniter 4.6.4 Powered
-

일본 비즈니스의
견고한 뿌리

-

PHP 8.3 기반의 초고속 백엔드와 일본 현지 데이터센터의 결합. 가장 - 신뢰받는 인프라를 지금 바로 경험하십시오.

-
- -
-
-
-
- - -
-
-

전문적인 인프라 솔루션

-
- -
-
- - - - -
-

-

-
- -
-
-
- - -
-
-

투명한 요금제

-
- -
- -
- Popular
-

-
- - -
- -
- -
-
-
- - - - - - \ No newline at end of file