diff --git a/app/Cells/CommonCell.php b/app/Cells/CommonCell.php new file mode 100644 index 0000000..1b7f0cf --- /dev/null +++ b/app/Cells/CommonCell.php @@ -0,0 +1,15 @@ +service = $service; + } +} diff --git a/app/Cells/SearchCell.php b/app/Cells/SearchCell.php new file mode 100644 index 0000000..afd088f --- /dev/null +++ b/app/Cells/SearchCell.php @@ -0,0 +1,29 @@ + "사용자명 선택"]; + foreach ($this->service->getEntities() as $entity) { + $options[$entity->getPK()] = $entity->getTitle(); + } + $template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__; + return view('cells/search/' . $template, [ + 'searchCellDatas' => [ + 'options' => $options, + 'selected' => null, + ] + ]); + } +} diff --git a/app/Config/Constants.php b/app/Config/Constants.php index 1b87a71..9126cc2 100644 --- a/app/Config/Constants.php +++ b/app/Config/Constants.php @@ -78,6 +78,104 @@ defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code +define("KEYWORD", '일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버 가상서버'); +define('LAYOUTS', [ + 'auth' => [ + 'title' => KEYWORD, + 'path' => 'auth', + 'layout' => 'layouts/auth', + 'template' => 'templates/auth', + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + ], + 'javascripts' => [ + '', + ], + 'footerScripts' => [] + ], + 'front' => [ + 'title' => KEYWORD, + 'path' => 'front', + 'layout' => 'layouts/front', + 'template' => 'templates/front', + 'topmenus' => ['aboutus', 'hosting', 'service', 'support'], + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + ], + 'footerScripts' => [] + ], + 'admin' => [ + 'title' => '관리자화면', + 'path' => 'admin', + 'layout' => 'layouts/admin', + 'template' => 'templates/admin', + 'metas' => [ + '', + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'stylesheets' => [ + '', + '', + '', + '', + '', + '', + '', + '', + ], + 'javascripts' => [ + '', + '', + '', + '', + '', + '' + ], + 'footerScripts' => [] + ], +]); + define('MESSAGES', [ 'CREATED' => '생성되었습니다.', 'UPDATED' => '수정되였습니다.', diff --git a/app/Config/Layout.php b/app/Config/Layout.php deleted file mode 100644 index 25a17cf..0000000 --- a/app/Config/Layout.php +++ /dev/null @@ -1,107 +0,0 @@ - [ - '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 0742937..c8a9d13 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -8,7 +8,6 @@ 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,15 +85,4 @@ 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/Config/View.php b/app/Config/View.php index cf8dd06..582ef73 100644 --- a/app/Config/View.php +++ b/app/Config/View.php @@ -59,4 +59,21 @@ class View extends BaseView * @var list> */ public array $decorators = []; + + /** + * Subdirectory within app/Views for namespaced view overrides. + * + * Namespaced views will be searched in: + * + * app/Views/{$appOverridesFolder}/{Namespace}/{view_path}.{php|html...} + * + * This allows application-level overrides for package or module views + * without modifying vendor source files. + * + * Examples: + * 'overrides' -> app/Views/overrides/Example/Blog/post/card.php + * 'vendor' -> app/Views/vendor/Example/Blog/post/card.php + * '' -> app/Views/Example/Blog/post/card.php (direct mapping) + */ + public string $appOverridesFolder = 'overrides'; } diff --git a/app/Controllers/AbstractWebController.php b/app/Controllers/AbstractWebController.php index 4da710a..07cd88e 100644 --- a/app/Controllers/AbstractWebController.php +++ b/app/Controllers/AbstractWebController.php @@ -20,12 +20,11 @@ use Psr\Log\LoggerInterface; abstract class AbstractWebController extends Controller { use LogTrait; - - protected $service = null; private array $_action_paths = []; private array $_viewDatas = []; private ?string $_title = null; - + protected $layouts = []; + protected $service = null; // --- 초기화 및 DI --- public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) @@ -112,26 +111,32 @@ abstract class AbstractWebController extends Controller /** * 뷰 경로와 데이터를 이용하여 최종 HTML을 렌더링합니다. */ - protected function action_render_process(string $view_file, array $viewDatas, ?string $template_path = null): string - { - helper(['form', 'IconHelper', 'utility']); - $config = config('Layout'); - $layoutConfig = $config->layouts[$viewDatas['layout']['path']] ?? []; + protected function action_render_process( + string $view_file, + array $viewDatas, + ?string $template_path = null + ): string { + helper(['form', 'utility']); + /** + * 🔥 핵심: + * View name은 항상 슬래시 기반 + */ + $baseViewPath = trim($viewDatas['layout']['path'], '/'); - $viewDatas['layout'] = array_merge($layoutConfig, $viewDatas['layout']); - $view_path = $viewDatas['layout']['path']; if ($template_path) { - $view_path .= '/' . $template_path; + $baseViewPath .= '/' . trim($template_path, '/'); } - // dd($view_path); - //최종 ViewPath - $viewDatas['view_path'] = $view_path; - helper([__FUNCTION__]); - return view($view_path . '/' . $view_file, [ + + $viewName = $baseViewPath . '/' . ltrim($view_file, '/'); + + return view($viewName, [ 'viewDatas' => [ ...$viewDatas, - 'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []], - ] + 'forms' => [ + 'attributes' => ['method' => 'post'], + 'hiddens' => [], + ], + ], ]); } -} +} \ No newline at end of file diff --git a/app/Controllers/Admin/AdminController.php b/app/Controllers/Admin/AdminController.php index 591b2f0..d27f51f 100644 --- a/app/Controllers/Admin/AdminController.php +++ b/app/Controllers/Admin/AdminController.php @@ -10,12 +10,11 @@ use Psr\Log\LoggerInterface; abstract class AdminController extends CommonController { private $_layout = 'admin'; - protected $layouts = []; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); $this->addActionPaths($this->_layout); - $this->layouts = config('Layout')->layouts[$this->_layout] ?? []; + $this->layouts = LAYOUTS[$this->_layout]; } protected function action_init_process(string $action, array $formDatas = []): void { diff --git a/app/Controllers/Admin/Customer/ClientController.php b/app/Controllers/Admin/Customer/ClientController.php deleted file mode 100644 index 5353318..0000000 --- a/app/Controllers/Admin/Customer/ClientController.php +++ /dev/null @@ -1,70 +0,0 @@ -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 deleted file mode 100644 index a24cd69..0000000 --- a/app/Controllers/Admin/Customer/CustomerController.php +++ /dev/null @@ -1,19 +0,0 @@ -addActionPaths('customer'); - } - //Index,FieldForm관련 -} diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Home.php index 59eb9a0..49461e7 100644 --- a/app/Controllers/Admin/Home.php +++ b/app/Controllers/Admin/Home.php @@ -7,18 +7,14 @@ use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class Home extends AbstractWebController +class Home extends AdminController { - private $_layout = 'admin'; - protected $layouts = []; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); if ($this->service === null) { - $this->service = service('customer_serviceservice'); + $this->service = service('userservice'); } - $this->addActionPaths($this->_layout); - $this->layouts = config('Layout')->layouts[$this->_layout] ?? []; } protected function action_init_process(string $action, array $formDatas = []): void { @@ -40,19 +36,19 @@ class Home extends AbstractWebController $this->addViewDatas('boardRequestTaskCount', service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID())); //Total 서버 현황 //interval을 기준으로 최근 신규 서비스정보 가져오기 - $interval = intval($this->request->getVar('interval') ?? 7); - $this->addViewDatas('interval', $interval); - $newServiceEntities = $this->service->getNewServiceEntities($interval); - $this->addViewDatas('newServiceEntities', $newServiceEntities); - $this->addViewDatas('newServiceCount', count($newServiceEntities)); + // $interval = intval($this->request->getVar('interval') ?? 7); + // $this->addViewDatas('interval', $interval); + // $newServiceEntities = service('customer_serviceservice')->getNewServiceEntities($interval); + // $this->addViewDatas('newServiceEntities', $newServiceEntities); + // $this->addViewDatas('newServiceCount', count($newServiceEntities)); //서비스별 미납 Count - $unPaidTotalCount = $unPaidTotalAmount = 0; - foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) { - $unPaidTotalCount += $unPaid['cnt']; - $unPaidTotalAmount += $unPaid['amount']; - } - $this->addViewDatas('unPaidTotalCount', $unPaidTotalCount); - $this->addViewDatas('unPaidTotalAmount', $unPaidTotalAmount); + // $unPaidTotalCount = $unPaidTotalAmount = 0; + // foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) { + // $unPaidTotalCount += $unPaid['cnt']; + // $unPaidTotalAmount += $unPaid['amount']; + // } + // $this->addViewDatas('unPaidTotalCount', $unPaidTotalCount); + // $this->addViewDatas('unPaidTotalAmount', $unPaidTotalAmount); return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? "welcome"); } } diff --git a/app/Controllers/Auth/AuthController.php b/app/Controllers/Auth/AuthController.php index b5e45d4..e816c1a 100644 --- a/app/Controllers/Auth/AuthController.php +++ b/app/Controllers/Auth/AuthController.php @@ -12,12 +12,11 @@ use Psr\Log\LoggerInterface; abstract class AuthController extends AbstractWebController { private $_layout = 'auth'; - protected $layouts = []; public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) { parent::initController($request, $response, $logger); $this->addActionPaths($this->_layout); - $this->layouts = config('Layout')->layouts[$this->_layout] ?? []; + $this->layouts = LAYOUTS[$this->_layout]; } protected function action_init_process(string $action, array $formDatas = []): void { diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index a0227bd..ba3d2b2 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -212,7 +212,7 @@ abstract class CommonController extends AbstractCRUDController $this->addViewDatas('formDatas', $this->request->getVar() ?? []); } - final public function index(): string + public function index(): string { $action = __FUNCTION__; $this->action_init_process($action); diff --git a/app/Controllers/FrontController.php b/app/Controllers/FrontController.php new file mode 100644 index 0000000..aeaa223 --- /dev/null +++ b/app/Controllers/FrontController.php @@ -0,0 +1,34 @@ +addActionPaths($this->_layout); + $this->layouts = 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('title', $this->getTitle()); + $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()); + $this->addViewDatas('index_actionButtons', $this->service->getActionForm()->getActionButtons()); + $this->addViewDatas('index_batchjobFields', $this->service->getActionForm()->getBatchjobFilters()); + $this->addViewDatas('index_batchjobButtons', $this->service->getActionForm()->getBatchjobButtons()); + } +} diff --git a/app/Controllers/Home.php b/app/Controllers/Home.php index ee47cb4..ce81f32 100644 --- a/app/Controllers/Home.php +++ b/app/Controllers/Home.php @@ -2,23 +2,18 @@ namespace App\Controllers; -use App\Controllers\AbstractWebController; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; -class Home extends AbstractWebController +class Home extends FrontController { - 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->service = service('userservice'); } - $this->addActionPaths($this->_layout); - $this->layouts = config('Layout')->layouts[$this->_layout] ?? []; } protected function action_init_process(string $action, array $formDatas = []): void { @@ -31,6 +26,7 @@ class Home extends AbstractWebController $this->addViewDatas('formFilters', $this->service->getActionForm()->getFormFilters()); $this->addViewDatas('formOptions', $this->service->getActionForm()->getFormOptions()); } + //Index,FieldForm관련 public function index(): string { diff --git a/app/DTOs/Customer/ClientDTO.php b/app/DTOs/Customer/ClientDTO.php deleted file mode 100644 index 030eaa6..0000000 --- a/app/DTOs/Customer/ClientDTO.php +++ /dev/null @@ -1,51 +0,0 @@ -role); - } -} diff --git a/app/Entities/Customer/ClientEntity.php b/app/Entities/Customer/ClientEntity.php deleted file mode 100644 index f390579..0000000 --- a/app/Entities/Customer/ClientEntity.php +++ /dev/null @@ -1,142 +0,0 @@ - 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 deleted file mode 100644 index bea2a44..0000000 --- a/app/Entities/Customer/CustomerEntity.php +++ /dev/null @@ -1,13 +0,0 @@ -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 deleted file mode 100644 index 641b8ed..0000000 --- a/app/Forms/Customer/CustomerForm.php +++ /dev/null @@ -1,13 +0,0 @@ - $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 deleted file mode 100644 index b6f19f8..0000000 --- a/app/Helpers/Customer/CustomerHelper.php +++ /dev/null @@ -1,13 +0,0 @@ - "고객정보", - '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 deleted file mode 100644 index 00773a3..0000000 --- a/app/Models/Customer/ClientModel.php +++ /dev/null @@ -1,38 +0,0 @@ -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 deleted file mode 100644 index bc5deb2..0000000 --- a/app/Services/Customer/CustomerService.php +++ /dev/null @@ -1,15 +0,0 @@ -addClassPaths('Customer'); - } -} diff --git a/app/Views/admin/popup/payment/coupon_form.php b/app/Views/admin/popup/payment/coupon_form.php deleted file mode 100644 index 55537cd..0000000 --- a/app/Views/admin/popup/payment/coupon_form.php +++ /dev/null @@ -1,25 +0,0 @@ -extend($viewDatas['layout']['layout']) ?> -section('content') ?> -alertTrait(session('message')) : ""; ?> -
-
include("{$viewDatas['layout']['template']}/form_content_top"); ?>
- - - - - - $label): ?> - - - - - -
getFieldLabel($field, $label, $viewDatas) ?> - getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?> -
-
-
"btn btn-outline btn-primary")); ?>
- -
include("{$viewDatas['layout']['template']}/form_content_bottom"); ?>
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/payment/onetime_form.php b/app/Views/admin/popup/payment/onetime_form.php deleted file mode 100644 index 55537cd..0000000 --- a/app/Views/admin/popup/payment/onetime_form.php +++ /dev/null @@ -1,25 +0,0 @@ -extend($viewDatas['layout']['layout']) ?> -section('content') ?> -alertTrait(session('message')) : ""; ?> -
-
include("{$viewDatas['layout']['template']}/form_content_top"); ?>
- - - - - - $label): ?> - - - - - -
getFieldLabel($field, $label, $viewDatas) ?> - getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?> -
-
-
"btn btn-outline btn-primary")); ?>
- -
include("{$viewDatas['layout']['template']}/form_content_bottom"); ?>
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/payment/point_form.php b/app/Views/admin/popup/payment/point_form.php deleted file mode 100644 index 55537cd..0000000 --- a/app/Views/admin/popup/payment/point_form.php +++ /dev/null @@ -1,25 +0,0 @@ -extend($viewDatas['layout']['layout']) ?> -section('content') ?> -alertTrait(session('message')) : ""; ?> -
-
include("{$viewDatas['layout']['template']}/form_content_top"); ?>
- - - - - - $label): ?> - - - - - -
getFieldLabel($field, $label, $viewDatas) ?> - getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?> -
-
-
"btn btn-outline btn-primary")); ?>
- -
include("{$viewDatas['layout']['template']}/form_content_bottom"); ?>
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/payment/prepayment_form.php b/app/Views/admin/popup/payment/prepayment_form.php deleted file mode 100644 index 55537cd..0000000 --- a/app/Views/admin/popup/payment/prepayment_form.php +++ /dev/null @@ -1,25 +0,0 @@ -extend($viewDatas['layout']['layout']) ?> -section('content') ?> -alertTrait(session('message')) : ""; ?> -
-
include("{$viewDatas['layout']['template']}/form_content_top"); ?>
- - - - - - $label): ?> - - - - - -
getFieldLabel($field, $label, $viewDatas) ?> - getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?> -
-
-
"btn btn-outline btn-primary")); ?>
- -
include("{$viewDatas['layout']['template']}/form_content_bottom"); ?>
-
-endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/welcome/index.php b/app/Views/admin/welcome/index.php index 604279c..4146425 100644 --- a/app/Views/admin/welcome/index.php +++ b/app/Views/admin/welcome/index.php @@ -12,15 +12,6 @@ - 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"); ?>
-
diff --git a/app/Views/admin/welcome/mylog.php b/app/Views/admin/welcome/mylog.php deleted file mode 100644 index f792387..0000000 --- a/app/Views/admin/welcome/mylog.php +++ /dev/null @@ -1,13 +0,0 @@ -
- -
-
- -
- \ No newline at end of file diff --git a/app/Views/admin/welcome/new_service.php b/app/Views/admin/welcome/new_service.php deleted file mode 100644 index 488c587..0000000 --- a/app/Views/admin/welcome/new_service.php +++ /dev/null @@ -1,39 +0,0 @@ -
- -
-
- - - - - - - - - - - - - - - - - - - - -
사이트업체명 - 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/admin/welcome/stock.php b/app/Views/admin/welcome/stock.php deleted file mode 100644 index 409449b..0000000 --- a/app/Views/admin/welcome/stock.php +++ /dev/null @@ -1,24 +0,0 @@ -
- -
-
- - - - - - - - - - - -
사용 서버메모리 재고저장장치 재고
-
- \ No newline at end of file diff --git a/app/Views/admin/welcome/total_service.php b/app/Views/admin/welcome/total_service.php deleted file mode 100644 index 7ade694..0000000 --- a/app/Views/admin/welcome/total_service.php +++ /dev/null @@ -1,45 +0,0 @@ -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
사이트일반방어전용대체VPN이벤트테스트합계
도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바합계
-
- \ No newline at end of file diff --git a/app/Views/cells/search/client.php b/app/Views/cells/search/client.php new file mode 100644 index 0000000..04d8a8c --- /dev/null +++ b/app/Views/cells/search/client.php @@ -0,0 +1,4 @@ + 'form-select w-auto d-inline-block select-field', + 'onchange' => "if(this.value) window.location.href='/admin/customer/client/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 c50687b..326ac65 100644 --- a/app/Views/layouts/admin/left_menu.php +++ b/app/Views/layouts/admin/left_menu.php @@ -4,7 +4,7 @@
include($viewDatas['layout']['layout'] . '/left_menu/base'); ?> include($viewDatas['layout']['layout'] . '/left_menu/board'); ?> diff --git a/app/Views/layouts/admin/left_menu/base.php b/app/Views/layouts/admin/left_menu/base.php index fb1a8df..9a09de4 100644 --- a/app/Views/layouts/admin/left_menu/base.php +++ b/app/Views/layouts/admin/left_menu/base.php @@ -1,6 +1,6 @@ \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/board.php b/app/Views/layouts/admin/left_menu/board.php index 54cc889..a5dd2a6 100644 --- a/app/Views/layouts/admin/left_menu/board.php +++ b/app/Views/layouts/admin/left_menu/board.php @@ -1,13 +1,13 @@

\ 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 index 4658dcf..7f704f7 100644 --- a/app/Views/layouts/admin/left_menu/customer.php +++ b/app/Views/layouts/admin/left_menu/customer.php @@ -1,13 +1,13 @@

\ 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 index 686b45e..99a470a 100644 --- a/app/Views/layouts/admin/left_menu/equipment.php +++ b/app/Views/layouts/admin/left_menu/equipment.php @@ -1,17 +1,17 @@

\ 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 index 37b9c43..0d9e851 100644 --- a/app/Views/layouts/admin/left_menu/part.php +++ b/app/Views/layouts/admin/left_menu/part.php @@ -1,28 +1,28 @@

\ No newline at end of file diff --git a/app/Views/layouts/admin/top.php b/app/Views/layouts/admin/top.php index 76dd259..a284e7f 100644 --- a/app/Views/layouts/admin/top.php +++ b/app/Views/layouts/admin/top.php @@ -15,7 +15,7 @@ diff --git a/app/Views/layouts/admin/welcome/banner.php b/app/Views/layouts/admin/welcome/banner.php deleted file mode 100644 index 830fc33..0000000 --- a/app/Views/layouts/admin/welcome/banner.php +++ /dev/null @@ -1,115 +0,0 @@ - - - -
-
-
-
-
-
-
-
-
요청업무 알림
-
-
-
- -
-
-
-
-
-
-
-
-
-
최근 일간 신규서버수
-
-
-
- -
-
-
-
-
-
-
-
-
건/
-
금일 기준 미납 서비스
-
-
-
- -
-
-
\ No newline at end of file diff --git a/app/Views/layouts/admin/welcome/index.php b/app/Views/layouts/admin/welcome/index.php deleted file mode 100644 index 604279c..0000000 --- a/app/Views/layouts/admin/welcome/index.php +++ /dev/null @@ -1,31 +0,0 @@ -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 deleted file mode 100644 index f792387..0000000 --- a/app/Views/layouts/admin/welcome/mylog.php +++ /dev/null @@ -1,13 +0,0 @@ -
- -
-
- -
- \ 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 deleted file mode 100644 index 488c587..0000000 --- a/app/Views/layouts/admin/welcome/new_service.php +++ /dev/null @@ -1,39 +0,0 @@ -
- -
-
- - - - - - - - - - - - - - - - - - - - -
사이트업체명 - 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 deleted file mode 100644 index 409449b..0000000 --- a/app/Views/layouts/admin/welcome/stock.php +++ /dev/null @@ -1,24 +0,0 @@ -
- -
-
- - - - - - - - - - - -
사용 서버메모리 재고저장장치 재고
-
- \ 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 deleted file mode 100644 index 7ade694..0000000 --- a/app/Views/layouts/admin/welcome/total_service.php +++ /dev/null @@ -1,45 +0,0 @@ -
- -
-
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
사이트일반방어전용대체VPN이벤트테스트합계
도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바도쿄치바합계
-
- \ No newline at end of file diff --git a/app/Views/layouts/front/top.php b/app/Views/layouts/front/top.php index 204e322..8cb3b8c 100644 --- a/app/Views/layouts/front/top.php +++ b/app/Views/layouts/front/top.php @@ -4,7 +4,7 @@ @@ -14,11 +14,11 @@
- Login + Login diff --git a/app/Views/templates/admin/index_content_top.php b/app/Views/templates/admin/index_content_top.php index 6e8f28e..b620d65 100644 --- a/app/Views/templates/admin/index_content_top.php +++ b/app/Views/templates/admin/index_content_top.php @@ -3,7 +3,7 @@ 검색일: "calender"]) ?>~ "calender"]) ?> - "_self", "class" => "excel"]) ?> + "_self", "class" => "excel"]) ?>