From caa933d5658254e59e2bb428bc206ee1a87f6e13 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Fri, 21 Nov 2025 13:10:03 +0900 Subject: [PATCH] dbmsv4 init...1 --- app/Cells/Customer/ServiceCell.php | 27 +--- app/Cells/Equipment/ServerPartCell.php | 26 +--- app/Cells/{Customer => }/PaymentCell.php | 17 +-- app/Config/Services.php | 2 +- app/Controllers/Admin/BoardController.php | 10 +- .../Admin/Customer/ClientController.php | 44 ++++++ app/Controllers/Auth/AuthController.php | 16 +- app/DTOs/Auth/AuthDTO.php | 4 +- app/DTOs/Auth/GoogleDTO.php | 7 +- app/DTOs/Auth/LocalDTO.php | 7 +- app/DTOs/BoardDTO.php | 7 +- app/DTOs/CommonDTO.php | 55 ++++++- app/DTOs/Customer/AccountDTO.php | 7 +- app/DTOs/Customer/ClientDTO.php | 53 ++++--- app/DTOs/Customer/CouponDTO.php | 7 +- app/DTOs/Customer/PointDTO.php | 7 +- app/DTOs/Customer/ServiceDTO.php | 9 +- app/DTOs/Equipment/LineDTO.php | 7 +- app/DTOs/Equipment/ServerDTO.php | 13 +- app/DTOs/Equipment/ServerPartDTO.php | 13 +- app/DTOs/MylogDTO.php | 7 +- app/DTOs/Part/CPUDTO.php | 11 +- app/DTOs/Part/CSDTO.php | 7 +- app/DTOs/Part/DISKDTO.php | 7 +- app/DTOs/Part/IPDTO.php | 7 +- app/DTOs/Part/RAMDTO.php | 7 +- app/DTOs/Part/SOFTWAREDTO.php | 7 +- app/DTOs/Part/SWITCHDTO.php | 7 +- app/DTOs/PaymentDTO.php | 7 +- app/DTOs/UserDTO.php | 47 ++++-- app/Forms/Equipment/ServerPartForm.php | 24 +++ app/Helpers/CommonHelper.php | 11 +- app/Helpers/Customer/AccountHelper.php | 31 ++++ app/Helpers/Customer/ClientHelper.php | 7 + app/Helpers/Customer/ServiceHelper.php | 5 +- app/Helpers/Equipment/ServerPartHelper.php | 8 +- app/Services/Customer/AccountService.php | 4 +- app/Services/Customer/ClientService.php | 6 +- app/Services/Equipment/ServerService.php | 5 +- app/Views/admin/client/detail.php | 137 ++++++++++++++++++ app/Views/admin/popup/create_form.php | 22 +++ app/Views/admin/popup/download.php | 17 +++ app/Views/admin/popup/index.php | 55 +++++++ app/Views/admin/popup/modify_form.php | 22 +++ app/Views/admin/popup/view.php | 17 +++ app/Views/admin/welcome/banner.php | 4 +- app/Views/cells/part/disk_stock.php | 2 +- app/Views/cells/part/ram_stock.php | 2 +- app/Views/cells/payment/detail.php | 12 +- .../{part_detail.php => partlist_detail.php} | 6 +- .../cells/serverpart/partlist_server.php | 4 +- .../cells/serverpart/partlist_service.php | 6 +- app/Views/cells/serverpart/parttable.php | 4 +- app/Views/cells/service/detail.php | 6 +- app/Views/cells/service/payment.php | 2 +- app/Views/cells/service/server.php | 2 +- .../admin/popup/index_content_filter.php | 11 ++ .../templates/admin/popup/index_header.php | 7 + 58 files changed, 623 insertions(+), 268 deletions(-) rename app/Cells/{Customer => }/PaymentCell.php (55%) create mode 100644 app/Views/admin/client/detail.php create mode 100644 app/Views/admin/popup/create_form.php create mode 100644 app/Views/admin/popup/download.php create mode 100644 app/Views/admin/popup/index.php create mode 100644 app/Views/admin/popup/modify_form.php create mode 100644 app/Views/admin/popup/view.php rename app/Views/cells/serverpart/{part_detail.php => partlist_detail.php} (67%) create mode 100644 app/Views/templates/admin/popup/index_content_filter.php create mode 100644 app/Views/templates/admin/popup/index_header.php diff --git a/app/Cells/Customer/ServiceCell.php b/app/Cells/Customer/ServiceCell.php index 271ef60..38d01ea 100644 --- a/app/Cells/Customer/ServiceCell.php +++ b/app/Cells/Customer/ServiceCell.php @@ -3,46 +3,33 @@ namespace App\Cells\Customer; use App\Helpers\Equipment\ServerPartHelper; -use App\Services\Customer\ServiceService; use App\Services\PaymentService; class ServiceCell extends CustomerCell { - - private ?PaymentService $_paymentService = null; public function __construct() { - parent::__construct(new ServiceService()); - } - final public function getPaymentService(): PaymentService - { - if (!$this->_paymentService) { - $this->_paymentService = new PaymentService(); - } - return $this->_paymentService; + parent::__construct(service('customer_serviceservice')); } public function detail(array $params): string { - $this->getService()->setAction(__FUNCTION__); - $this->getService()->setFormFields(); - $this->getService()->setFormFilters(); - $this->getService()->setFormRules(); - $this->getService()->setFormOptions(); + $this->getService()->action_init_process(__FUNCTION__); //서비스별 미납 Count - $unPaids = $this->getPaymentService()->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]); + $unPaids = service('paymentservice')->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]); //서비스별 서버리스트 $entities = []; $childServers = []; foreach ($this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]) as $entity) { $entities[] = $entity; - $childServers[$entity->getPK()] = $this->getService()->getServerService()->getEntities(['serviceinfo_uid' => $entity->getPK()]); + $childServers[$entity->getPK()] = service('equipment_serverservice')->getEntities(['serviceinfo_uid' => $entity->getPK()]); } $template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__; return view('cells/service/' . $template, [ 'serviceCellDatas' => [ - 'control' => $this->getService()->getControlDatas(), - 'service' => $this->getService(), + 'formFilters' => $this->getService()->getFormService()->getFormFilters(), + 'formOptions' => $this->getService()->getFormService()->getFormOptions(), + 'helper' => $this->getService()->getHelper(), 'unPaids' => $unPaids, 'entities' => $entities, 'childServers' => $childServers, diff --git a/app/Cells/Equipment/ServerPartCell.php b/app/Cells/Equipment/ServerPartCell.php index 15ae8ba..363d72d 100644 --- a/app/Cells/Equipment/ServerPartCell.php +++ b/app/Cells/Equipment/ServerPartCell.php @@ -4,32 +4,17 @@ namespace App\Cells\Equipment; use App\Entities\Equipment\ServerEntity; -use App\Services\Equipment\ServerPartService; -use App\Services\Equipment\ServerService; class ServerPartCell extends EquipmentCell { - private ?ServerService $_serverService = null; public function __construct() { - parent::__construct(new ServerPartService()); - } - - final public function getServerService(): ServerService - { - if (!$this->_serverService) { - $this->_serverService = new ServerService(); - } - return $this->_serverService; + parent::__construct(service('equipment_serverpartservice')); } public function parttable(array $params): string { - $this->getService()->setAction(__FUNCTION__); - $this->getService()->setFormFields(); - $this->getService()->setFormFilters(); - $this->getService()->setFormRules(); - $this->getService()->setFormOptions(); + $this->getService()->action_init_process(__FUNCTION__); if (!array_key_exists('serverinfo_uid', $params)) { return "서버정보를 정의하셔야합니다."; } @@ -37,7 +22,7 @@ class ServerPartCell extends EquipmentCell return "부품정보 형태(Types) 리스트를 정의하셔야합니다."; } //서버정보 - $serverEntity = $this->getServerService()->getEntity($params['serverinfo_uid']); + $serverEntity = service('equipment_serverservice')->getEntity($params['serverinfo_uid']); if (!$serverEntity instanceof ServerEntity) { return "[{$params['serverinfo_uid']}]의 서버정보를 확인할수없습니다.."; } @@ -50,8 +35,9 @@ class ServerPartCell extends EquipmentCell $template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__; return view('cells/serverpart/' . $template, [ 'serverPartCellDatas' => [ - 'control' => $this->getService()->getControlDatas(), - 'service' => $this->getService(), + 'formFilters' => $this->getService()->getFormService()->getFormFilters(), + 'formOptions' => $this->getService()->getFormService()->getFormOptions(), + 'helper' => $this->getService()->getHelper(), 'serverinfo_uid' => $params['serverinfo_uid'], 'types' => $params['types'], 'serverEntity' => $serverEntity, diff --git a/app/Cells/Customer/PaymentCell.php b/app/Cells/PaymentCell.php similarity index 55% rename from app/Cells/Customer/PaymentCell.php rename to app/Cells/PaymentCell.php index d8b81eb..eb5fb6a 100644 --- a/app/Cells/Customer/PaymentCell.php +++ b/app/Cells/PaymentCell.php @@ -1,30 +1,27 @@ getService()->setAction(__FUNCTION__); - $this->getService()->setFormFields(); - $this->getService()->setFormFilters(); - $this->getService()->setFormRules(); - $this->getService()->setFormOptions(); + $this->getService()->action_init_process(__FUNCTION__); $entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid'], 'billing' => PAYMENT['BILLING']['ONETIME'], 'status' => STATUS['UNPAID']]); $template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__; return view('cells/payment/' . $template, [ 'serviceCellDatas' => [ - 'control' => $this->getService()->getControlDatas(), - 'service' => $this->getService(), + 'formFilters' => $this->getService()->getFormService()->getFormFilters(), + 'formOptions' => $this->getService()->getFormService()->getFormOptions(), + 'helper' => $this->getService()->getHelper(), 'entities' => $entities, ] ]); diff --git a/app/Config/Services.php b/app/Config/Services.php index 1c89846..b460725 100644 --- a/app/Config/Services.php +++ b/app/Config/Services.php @@ -138,7 +138,7 @@ class Services extends BaseService new \App\Models\Customer\AccountModel(), ); } - public static function customer_coupontservice($getShared = true): CouponService + public static function customer_couponservice($getShared = true): CouponService { if ($getShared) { return static::getSharedInstance(__FUNCTION__); diff --git a/app/Controllers/Admin/BoardController.php b/app/Controllers/Admin/BoardController.php index 3f0b1c1..383fd11 100644 --- a/app/Controllers/Admin/BoardController.php +++ b/app/Controllers/Admin/BoardController.php @@ -2,7 +2,7 @@ namespace App\Controllers\Admin; -use App\Entities\UserEntity; +use App\Entities\BoardEntity; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; @@ -20,20 +20,18 @@ class BoardController extends AdminController //Action작업관련 protected function getEntityClass(): string { - return UserEntity::class; + return BoardEntity::class; } //기본 함수 작업 //Custom 추가 함수 public function latest(string $category): ResponseInterface { - $action = __FUNCTION__; - $this->action_init_process($action); + $this->action_init_process(__FUNCTION__); return $this->response->setJSON($this->service->getLatest($category)); } public function reqeusttask(): ResponseInterface { - $action = __FUNCTION__; - $this->action_init_process($action); + $this->action_init_process(__FUNCTION__); return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID())); } } diff --git a/app/Controllers/Admin/Customer/ClientController.php b/app/Controllers/Admin/Customer/ClientController.php index bf47ad8..b9bcf33 100644 --- a/app/Controllers/Admin/Customer/ClientController.php +++ b/app/Controllers/Admin/Customer/ClientController.php @@ -3,6 +3,7 @@ namespace App\Controllers\Admin\Customer; use App\Entities\Customer\ClientEntity; +use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\ResponseInterface; use Psr\Log\LoggerInterface; @@ -23,4 +24,47 @@ class ClientController extends CustomerController } //기본 함수 작업 //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 \Exception("{$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 (\Exception $e) { + return $e->getMessage(); + // return $this->action_redirect_process('error', "{$this->getTitle()}에서 {$uid} 수정폼 오류:" . $e->getMessage()); + } + } + + public function history(int $uid): RedirectResponse|string + { + try { + $action = __FUNCTION__; + $this->action_init_process($action); + $this->addViewDatas('entity', $this->service->modify($uid, $this->request->getPost())); + return $this->action_redirect_process('error', "{$this->getTitle()}에서 비고설정이 완료되었습니다."); + } catch (\Exception $e) { + return $e->getMessage(); + } + } } diff --git a/app/Controllers/Auth/AuthController.php b/app/Controllers/Auth/AuthController.php index 4be4d7d..b2a8e62 100644 --- a/app/Controllers/Auth/AuthController.php +++ b/app/Controllers/Auth/AuthController.php @@ -49,19 +49,9 @@ abstract class AuthController extends AbstractWebController abstract protected function login_process(): UserEntity; final public function login(): RedirectResponse { - try { - $this->login_process(); - $redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths()); - return redirect()->to($redirect_url)->with('message', MESSAGES['LOGIN']); - } catch (ValidationException $e) { - // 검증 실패 시 폼으로 돌아가서 오류 메시지 표시 - log_message('error', $e->getMessage()); - return redirect()->back()->withInput()->with('message', $e->getMessage()); - } catch (\Exception $e) { - log_message('error', $e->getMessage()); - return redirect()->back()->withInput()->with('message', $e->getMessage()); - // return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('message', $e->getMessage()); - } + $this->login_process(); + $redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths()); + return redirect()->to($redirect_url)->with('message', MESSAGES['LOGIN']); } //로그아웃 abstract protected function logout_process(): void; diff --git a/app/DTOs/Auth/AuthDTO.php b/app/DTOs/Auth/AuthDTO.php index dc318c8..b0124bb 100644 --- a/app/DTOs/Auth/AuthDTO.php +++ b/app/DTOs/Auth/AuthDTO.php @@ -6,8 +6,8 @@ use App\DTOs\CommonDTO; abstract class AuthDTO extends CommonDTO { - public function __construct() + public function __construct(array $datas = []) { - parent::__construct(); + parent::__construct($datas); } } diff --git a/app/DTOs/Auth/GoogleDTO.php b/app/DTOs/Auth/GoogleDTO.php index b605b19..737eb60 100644 --- a/app/DTOs/Auth/GoogleDTO.php +++ b/app/DTOs/Auth/GoogleDTO.php @@ -8,11 +8,6 @@ class GoogleDTO extends AuthDTO public $access_code = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Auth/LocalDTO.php b/app/DTOs/Auth/LocalDTO.php index 6477e4d..cf740b8 100644 --- a/app/DTOs/Auth/LocalDTO.php +++ b/app/DTOs/Auth/LocalDTO.php @@ -9,11 +9,6 @@ class LocalDTO extends AuthDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/BoardDTO.php b/app/DTOs/BoardDTO.php index 5f722d2..72710a1 100644 --- a/app/DTOs/BoardDTO.php +++ b/app/DTOs/BoardDTO.php @@ -14,11 +14,6 @@ class BoardDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/CommonDTO.php b/app/DTOs/CommonDTO.php index 678e5df..df46e72 100644 --- a/app/DTOs/CommonDTO.php +++ b/app/DTOs/CommonDTO.php @@ -2,9 +2,62 @@ namespace App\DTOs; +use ReflectionClass; +use ReflectionNamedType; + abstract class CommonDTO { - public function __construct() {} + public function __construct(array $datas = []) + { + // 데이터가 없으면 바로 리턴 + if (empty($datas)) { + return; + } + + // $this는 이 시점에 자식 클래스(AccountDTO)의 인스턴스입니다. + $reflection = new ReflectionClass($this); + + foreach ($datas as $key => $value) { + // 1. 속성이 존재하는지 확인 + if (!$reflection->hasProperty($key)) { + continue; + } + + $property = $reflection->getProperty($key); + + // public이 아닌 속성도 접근 가능하게 설정 (필요시) + // $property->setAccessible(true); + + // 2. 속성의 타입 정보를 가져옴 + $type = $property->getType(); + + // 값을 할당하기 전 정제된 값을 담을 변수 + $assignValue = $value; + + // 3. 빈 문자열("") 처리 + // HTML 폼에서 온 빈 값은 null로 처리해야 ?int 등에 들어갈 수 있음 + if ($value === '') { + $assignValue = null; + } + // 4. 타입에 따른 강제 형변환 (Casting) + elseif ($type instanceof ReflectionNamedType) { + $typeName = $type->getName(); + + // int 타입이고 값이 숫자형일 때 + if ($typeName === 'int' && is_numeric($value)) { + $assignValue = (int) $value; + } + // float 타입이고 값이 숫자형일 때 + elseif ($typeName === 'float' && is_numeric($value)) { + $assignValue = (float) $value; + } + // 필요하다면 bool 처리 등 추가 가능 + } + + // 5. 값 할당 + $this->{$key} = $assignValue; + } + } public function __get(string $name) { diff --git a/app/DTOs/Customer/AccountDTO.php b/app/DTOs/Customer/AccountDTO.php index 9023bf8..c4c536e 100644 --- a/app/DTOs/Customer/AccountDTO.php +++ b/app/DTOs/Customer/AccountDTO.php @@ -20,11 +20,6 @@ class AccountDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Customer/ClientDTO.php b/app/DTOs/Customer/ClientDTO.php index 8892499..df5e756 100644 --- a/app/DTOs/Customer/ClientDTO.php +++ b/app/DTOs/Customer/ClientDTO.php @@ -1,7 +1,5 @@ role 접근 시 __get을 거치지 않고 직접 접근합니다. + protected ?string $role = null; + public ?string $name = null; public ?string $phone = null; public ?string $email = null; - public ?string $history = null; + public ?string $history = null; public ?int $account_balance = null; public ?int $coupon_balance = null; public ?int $point_balance = null; @@ -21,24 +23,39 @@ class ClientDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - if ($key === 'role' && is_array($value)) { - // 배열일 경우, 쉼표로 구분된 문자열로 변환하여 저장 - $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $value); - } else { - $this->{$key} = $value; - } - } + // 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기 + if (isset($datas['role']) && is_array($datas['role'])) { + $datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); } + + // 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출 + // 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다. + parent::__construct($datas); } + + /** + * role 속성을 읽을 때 자동으로 배열로 변환해서 반환 + */ public function __get(string $name) { - // 'role' 속성을 요청했을 때만 특별히 처리 - if ($name === 'role' && is_string($this->role)) { - return explode(DEFAULTS["DELIMITER_ROLE"], $this->role); + // role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환 + if ($name === 'role') { + if (is_string($this->role)) { + return explode(DEFAULTS["DELIMITER_ROLE"], $this->role); + } + return []; // null이거나 값이 없으면 빈 배열 반환 } - return parent::__get($name); + + // 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면) + // CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로, + // 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다. + return $this->{$name} ?? null; + } + + // role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다. + // (선택 사항) + public function setRole(array $roles) + { + $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles); } } diff --git a/app/DTOs/Customer/CouponDTO.php b/app/DTOs/Customer/CouponDTO.php index ef5b2c1..02a00ab 100644 --- a/app/DTOs/Customer/CouponDTO.php +++ b/app/DTOs/Customer/CouponDTO.php @@ -16,11 +16,6 @@ class CouponDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Customer/PointDTO.php b/app/DTOs/Customer/PointDTO.php index a7a2ea3..97e2552 100644 --- a/app/DTOs/Customer/PointDTO.php +++ b/app/DTOs/Customer/PointDTO.php @@ -16,11 +16,6 @@ class PointDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Customer/ServiceDTO.php b/app/DTOs/Customer/ServiceDTO.php index 15f4e98..8f47f40 100644 --- a/app/DTOs/Customer/ServiceDTO.php +++ b/app/DTOs/Customer/ServiceDTO.php @@ -22,16 +22,11 @@ class ServiceDTO extends CommonDTO public ?int $amount = null; public ?string $start_at = null; public ?string $end_at = null; - public ?int $history = null; + public ?string $history = null; public ?string $status = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Equipment/LineDTO.php b/app/DTOs/Equipment/LineDTO.php index 1a3a4b3..14af121 100644 --- a/app/DTOs/Equipment/LineDTO.php +++ b/app/DTOs/Equipment/LineDTO.php @@ -16,11 +16,6 @@ class LineDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Equipment/ServerDTO.php b/app/DTOs/Equipment/ServerDTO.php index 632d655..0163ab2 100644 --- a/app/DTOs/Equipment/ServerDTO.php +++ b/app/DTOs/Equipment/ServerDTO.php @@ -8,9 +8,9 @@ class ServerDTO extends CommonDTO { public ?int $uid = null; public ?string $code = null; - public ?string $type = null; - public ?string $switch = null; - public ?string $ip = null; + public ?string $type = null; + public ?string $switch = null; + public ?string $ip = null; public ?string $os = null; public ?string $title = null; public ?int $price = null; @@ -19,11 +19,6 @@ class ServerDTO extends CommonDTO public ?string $status = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Equipment/ServerPartDTO.php b/app/DTOs/Equipment/ServerPartDTO.php index f1517a9..06fd6e4 100644 --- a/app/DTOs/Equipment/ServerPartDTO.php +++ b/app/DTOs/Equipment/ServerPartDTO.php @@ -8,20 +8,15 @@ class ServerPartDTO extends CommonDTO { public ?int $uid = null; public ?string $serverinfo_uid = null; - public ?string $type = null; - public ?string $billing = null; - public ?int $part_uid = null; + public ?string $type = null; + public ?string $billing = null; + public ?int $part_uid = null; public ?string $title = null; public ?int $cnt = null; public ?string $extra = null; public ?string $amount = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/MylogDTO.php b/app/DTOs/MylogDTO.php index 5837b16..11d822c 100644 --- a/app/DTOs/MylogDTO.php +++ b/app/DTOs/MylogDTO.php @@ -12,11 +12,6 @@ class MylogDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/CPUDTO.php b/app/DTOs/Part/CPUDTO.php index 55691bf..f6573d8 100644 --- a/app/DTOs/Part/CPUDTO.php +++ b/app/DTOs/Part/CPUDTO.php @@ -8,18 +8,13 @@ class CPUDTO extends CommonDTO { public ?int $uid = null; public ?string $title = null; - public ?int $price = null; + public ?int $price = null; public ?string $used = null; - public ?int $stock = null; + public ?int $stock = null; public ?string $status = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/CSDTO.php b/app/DTOs/Part/CSDTO.php index b765283..24b8f99 100644 --- a/app/DTOs/Part/CSDTO.php +++ b/app/DTOs/Part/CSDTO.php @@ -19,11 +19,6 @@ class CSDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/DISKDTO.php b/app/DTOs/Part/DISKDTO.php index aad476f..5b2e568 100644 --- a/app/DTOs/Part/DISKDTO.php +++ b/app/DTOs/Part/DISKDTO.php @@ -16,11 +16,6 @@ class DISKDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/IPDTO.php b/app/DTOs/Part/IPDTO.php index 9ca132b..c846595 100644 --- a/app/DTOs/Part/IPDTO.php +++ b/app/DTOs/Part/IPDTO.php @@ -18,11 +18,6 @@ class IPDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/RAMDTO.php b/app/DTOs/Part/RAMDTO.php index 0c26649..407a19c 100644 --- a/app/DTOs/Part/RAMDTO.php +++ b/app/DTOs/Part/RAMDTO.php @@ -15,11 +15,6 @@ class RAMDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/SOFTWAREDTO.php b/app/DTOs/Part/SOFTWAREDTO.php index 9400174..2ebf656 100644 --- a/app/DTOs/Part/SOFTWAREDTO.php +++ b/app/DTOs/Part/SOFTWAREDTO.php @@ -15,11 +15,6 @@ class SOFTWAREDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/Part/SWITCHDTO.php b/app/DTOs/Part/SWITCHDTO.php index 6debbd4..e2c8790 100644 --- a/app/DTOs/Part/SWITCHDTO.php +++ b/app/DTOs/Part/SWITCHDTO.php @@ -16,11 +16,6 @@ class SWITCHDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/PaymentDTO.php b/app/DTOs/PaymentDTO.php index 2cb06d4..935eaee 100644 --- a/app/DTOs/PaymentDTO.php +++ b/app/DTOs/PaymentDTO.php @@ -19,11 +19,6 @@ class PaymentDTO extends CommonDTO public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - $this->{$key} = $value; - } - } + parent::__construct($datas); } } diff --git a/app/DTOs/UserDTO.php b/app/DTOs/UserDTO.php index 16247be..3e4d81a 100644 --- a/app/DTOs/UserDTO.php +++ b/app/DTOs/UserDTO.php @@ -11,29 +11,46 @@ class UserDTO extends CommonDTO public ?string $name = null; public ?string $email = null; public ?string $mobile = null; - public ?string $role = null; + // __get이 동작하려면 public이 아닌 protected여야 합니다. + // public으로 선언되어 있으면 $dto->role 접근 시 __get을 거치지 않고 직접 접근합니다. + protected ?string $role = null; public ?string $status = null; public function __construct(array $datas = []) { - parent::__construct(); - foreach ($datas as $key => $value) { - if (property_exists($this, $key)) { - if ($key === 'role' && is_array($value)) { - // 배열일 경우, 쉼표로 구분된 문자열로 변환하여 저장 - $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $value); - } else { - $this->{$key} = $value; - } - } + // 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기 + if (isset($datas['role']) && is_array($datas['role'])) { + $datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']); } + + // 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출 + // 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다. + parent::__construct($datas); } + + /** + * role 속성을 읽을 때 자동으로 배열로 변환해서 반환 + */ public function __get(string $name) { - // 'role' 속성을 요청했을 때만 특별히 처리 - if ($name === 'role' && is_string($this->role)) { - return explode(DEFAULTS["DELIMITER_ROLE"], $this->role); + // role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환 + if ($name === 'role') { + if (is_string($this->role)) { + return explode(DEFAULTS["DELIMITER_ROLE"], $this->role); + } + return []; // null이거나 값이 없으면 빈 배열 반환 } - return parent::__get($name); + + // 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면) + // CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로, + // 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다. + return $this->{$name} ?? null; + } + + // role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다. + // (선택 사항) + public function setRole(array $roles) + { + $this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles); } } diff --git a/app/Forms/Equipment/ServerPartForm.php b/app/Forms/Equipment/ServerPartForm.php index 831d82a..d15c1f1 100644 --- a/app/Forms/Equipment/ServerPartForm.php +++ b/app/Forms/Equipment/ServerPartForm.php @@ -36,4 +36,28 @@ class ServerPartForm extends EquipmentForm } return $rule; } + public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array + { + $tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"]; + switch ($field) { + case 'part_uid': + foreach (service('equipment_serverpartservice')->getEntities() as $entity) { + $tempOptions[$entity->getPK()] = $entity->getTitle(); + // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; + } + $options['options'] = $tempOptions; + break; + case 'serverinfo_uid': + foreach (service('equipment_serverservice')->getEntities() as $entity) { + $tempOptions[$entity->getPK()] = $entity->getTitle(); + // $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())]; + } + $options['options'] = $tempOptions; + break; + default: + $options = parent::getFormOption($field, $options); + break; + } + return $options; + } } diff --git a/app/Helpers/CommonHelper.php b/app/Helpers/CommonHelper.php index 232745d..40d3c6e 100644 --- a/app/Helpers/CommonHelper.php +++ b/app/Helpers/CommonHelper.php @@ -120,6 +120,13 @@ abstract class CommonHelper $extras['style'] = 'width:100%;'; $form = form_textarea($field, html_entity_decode($value ?? "", ENT_QUOTES, 'UTF-8'), $extras); break; + case 'status': + $forms = []; + array_shift($viewDatas['formOptions'][$field]['options']); + foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) + $forms[] = form_radio($field, $key, $key == $value, $extras) . $label; + $form = implode(" ", $forms); + break; default: $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' form-control' : 'form-control'; if (in_array($field, $viewDatas['formFilters'])) { @@ -160,9 +167,7 @@ abstract class CommonHelper case 'content': case 'detail': case 'history': - if (in_array($viewDatas['action'], ['view', 'index'])) { - $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); - } + $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); break; case 'issue_at': case 'expired_at': diff --git a/app/Helpers/Customer/AccountHelper.php b/app/Helpers/Customer/AccountHelper.php index 66821e9..b55fd10 100644 --- a/app/Helpers/Customer/AccountHelper.php +++ b/app/Helpers/Customer/AccountHelper.php @@ -8,6 +8,37 @@ class AccountHelper extends CustomerHelper { parent::__construct(); } + public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string + { + switch ($field) { + case 'bank': + $forms = []; + array_shift($viewDatas['formOptions'][$field]['options']); + foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) + $forms[] = form_radio($field, $key, $key == $value, $extras) . $label; + $form = implode(" ", $forms); + break; + case 'role': + $currentRoles = is_array($value) + ? array_map('strtolower', array_map('trim', $value)) + : []; + $form = ''; + //Form페이지에서는 맨앞에것 제외하기 위함 + $firstOption = array_shift($viewDatas['formOptions'][$field]['options']); + foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) { + $checked = in_array(strtolower(trim($key)), $currentRoles); + $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) { diff --git a/app/Helpers/Customer/ClientHelper.php b/app/Helpers/Customer/ClientHelper.php index 5fc85aa..84868bf 100644 --- a/app/Helpers/Customer/ClientHelper.php +++ b/app/Helpers/Customer/ClientHelper.php @@ -11,6 +11,13 @@ class ClientHelper extends CustomerHelper public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string { switch ($field) { + case 'site': + $forms = []; + array_shift($viewDatas['formOptions'][$field]['options']); + foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) + $forms[] = form_radio($field, $key, $key == $value, $extras) . $label; + $form = implode(" ", $forms); + break; case 'role': $currentRoles = is_array($value) ? array_map('strtolower', array_map('trim', $value)) diff --git a/app/Helpers/Customer/ServiceHelper.php b/app/Helpers/Customer/ServiceHelper.php index 048d3de..cc02a39 100644 --- a/app/Helpers/Customer/ServiceHelper.php +++ b/app/Helpers/Customer/ServiceHelper.php @@ -13,12 +13,11 @@ class ServiceHelper extends CustomerHelper switch ($field) { case 'site': $extras['onChange'] = "$('select[name=\'clientinfo_uid\']').select2('open')"; - $form = $this->form_dropdown_common($field, $value, $viewDatas, $extras); + $form = form_dropdown($field, $value, $viewDatas, $extras); break; case 'serverinfo_uid': $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; - $attributes = ['data-price' => 'price']; - $form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes); + $form = form_dropdown($field, $value, $viewDatas, $extras); break; case 'amount': $form = form_input($field, 0, ["readonly" => "readonly", ...$extras]); diff --git a/app/Helpers/Equipment/ServerPartHelper.php b/app/Helpers/Equipment/ServerPartHelper.php index 0ae6a01..0743f3c 100644 --- a/app/Helpers/Equipment/ServerPartHelper.php +++ b/app/Helpers/Equipment/ServerPartHelper.php @@ -14,8 +14,8 @@ class ServerPartHelper extends EquipmentHelper case 'part_uid': $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; $extras['onChange'] = "document.querySelector('input[name=\'title\']').value = this.options[this.selectedIndex].getAttribute('data-title'); document.querySelector('input[name=\'amount\']').value = this.options[this.selectedIndex].getAttribute('data-price')"; - $attributes = ['data-title' => 'title', 'data-price' => 'price']; - $form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes); + // $attributes = ['data-title' => 'title', 'data-price' => 'price']; + $form = form_dropdown($field, $value, $viewDatas, $extras); break; case 'extra': if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') { @@ -38,12 +38,12 @@ class ServerPartHelper extends EquipmentHelper $value = form_label( sprintf( "[%s] %s", - lang("Equipment/ServerPart.TYPE")[$viewDatas['serverEntity']->getType()], + lang("Equipment/Server.TYPE")[$viewDatas['serverEntity']->getType()], $viewDatas['serverEntity']->getCode(), ), $field, [ - "data-src" => "/admin/equipment/server/modify/{$viewDatas['serverEntity']->getPK()}?ActionTemplate=server", + "data-src" => "/admin/equipment/server/modify/{$viewDatas['serverEntity']->getPK()}", "data-bs-toggle" => "modal", "data-bs-target" => "#modal_action_form", "class" => "btn btn-sm form-label-sm text-primary", diff --git a/app/Services/Customer/AccountService.php b/app/Services/Customer/AccountService.php index e5ddb00..ad81825 100644 --- a/app/Services/Customer/AccountService.php +++ b/app/Services/Customer/AccountService.php @@ -68,12 +68,14 @@ class AccountService extends CustomerService "status", ]; $indexFilter = $filters; - $batchjobFilters = ['status']; + $batchjobFilters = ['bank', 'status']; switch ($action) { case 'create': case 'create_form': + break; case 'modify': case 'modify_form': + $fields = [...$fields, 'status']; break; case 'view': $fields = [...$fields, 'created_at']; diff --git a/app/Services/Customer/ClientService.php b/app/Services/Customer/ClientService.php index 63f7466..ae2d2dc 100644 --- a/app/Services/Customer/ClientService.php +++ b/app/Services/Customer/ClientService.php @@ -65,15 +65,17 @@ class ClientService extends CustomerService 'status', ]; $indexFilter = $filters; - $batchjobFilters = ['status']; + $batchjobFilters = ['site', 'role', 'status']; switch ($action) { case 'create': case 'create_form': + break; case 'modify': case 'modify_form': + $fields = [...$fields, 'status']; break; case 'view': - $fields = [...$fields, 'created_at']; + $fields = [...$fields, 'status', 'created_at']; break; case 'index': case 'download': diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index ab050d2..a3ab100 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -65,10 +65,13 @@ class ServerService extends EquipmentService ]; $filters = [ "clientinfo_uid", + 'title', + 'type', + 'os', "status", ]; $indexFilter = $filters; - $batchjobFilters = ['status']; + $batchjobFilters = ['type', 'title', 'os', 'status']; switch ($action) { case 'create': case 'create_form': diff --git a/app/Views/admin/client/detail.php b/app/Views/admin/client/detail.php new file mode 100644 index 0000000..feb985c --- /dev/null +++ b/app/Views/admin/client/detail.php @@ -0,0 +1,137 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> + + +alertTrait(session('message')) : ""; ?> +
include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
+ + + + + + +
+ + include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?> + + + +
include("templates/{$viewDatas['layout']}/index_header"); ?>
+
+
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
getTitle() ?>
+
+ "/admin/customer/payment?clientinfo_uid=" . $viewDatas['entity']->getPK() . "&ActionTemplate=popup", + "data-bs-toggle" => "modal", + "data-bs-target" => "#modal_action_form", + "class" => "text-primary form-label-sm", + ] + ); + ?> +
+
+ '/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", + ] + ); + ?> +
+
도코치바VPN일반방어전용이벤트테스트대체쿠폰예치금포인트전체요금전체미납금
getListButton("coupon", $viewDatas['entity']->getCouponBalance(), $viewDatas) ?>getListButton("account", number_format($viewDatas['entity']->getAccountBalance()) . "원", $viewDatas) ?>getListButton("point", number_format($viewDatas['entity']->getPointBalance()), $viewDatas) ?>getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?>원 + getPK(), $viewDatas['unPaids'])): ?> + getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])), + 'payment_unpaid', + [ + "data-src" => "/admin/customer/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", + ] + ); + ?> + +
+
+ getPK()}?return_url=" . urlencode(current_url()), ['method' => "post"]) ?> +
+
+
고객 비고
+
+
+ +
+
+ "btn btn-outline btn-primary")); ?> +
+
+ + $viewDatas['entity']->getPK()]) ?> + $viewDatas['entity']->getPK()]) ?> +
+ +
+ + +
+ +
include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/create_form.php b/app/Views/admin/popup/create_form.php new file mode 100644 index 0000000..decc70a --- /dev/null +++ b/app/Views/admin/popup/create_form.php @@ -0,0 +1,22 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> +alertTrait(session('message')) : ""; ?> +
+
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
+ + + $label): ?> + + + + + +
getFieldLabel($field, $label, $viewDatas) ?> + getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?> +
+
+
"btn btn-outline btn-primary")); ?>
+ +
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/download.php b/app/Views/admin/popup/download.php new file mode 100644 index 0000000..80008b7 --- /dev/null +++ b/app/Views/admin/popup/download.php @@ -0,0 +1,17 @@ + + + + $label): ?> + + + + + + + $label): ?> + + + + + +
getFieldView($field, $entity->$field, $viewDatas) ?>
\ No newline at end of file diff --git a/app/Views/admin/popup/index.php b/app/Views/admin/popup/index.php new file mode 100644 index 0000000..5fc6f50 --- /dev/null +++ b/app/Views/admin/popup/index.php @@ -0,0 +1,55 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> + +section('content') ?> +alertTrait(session('message')) : ""; ?> + + + + +
+
include("{$template}/popup/index_header"); ?>
+
+ +
+ include("{$template}/popup/index_content_filter"); ?> + 'batchjob_form', 'method' => "post"]) ?> + + + + + $label): ?> + + + + + + + + + + + + $label): ?> + + + + + +
번호getListLabel($field, $label, $viewDatas) ?>작업
getListButton('modify', $num, $viewDatas) ?>getFieldView($field, $entity->$field, $viewDatas) ?> + $label): ?> + getListButton($action, $label, $viewDatas) ?>  + +
+ include("{$template}/index_content_bottom"); ?> + +
+
+ +
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/modify_form.php b/app/Views/admin/popup/modify_form.php new file mode 100644 index 0000000..2960392 --- /dev/null +++ b/app/Views/admin/popup/modify_form.php @@ -0,0 +1,22 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> +alertTrait(session('message')) : ""; ?> +
+
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
+ + + $label): ?> + + + + + +
getFieldLabel($field, $label, $viewDatas) ?> + getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?> +
+
+
"btn btn-outline btn-primary")); ?>
+ +
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/view.php b/app/Views/admin/popup/view.php new file mode 100644 index 0000000..81d484c --- /dev/null +++ b/app/Views/admin/popup/view.php @@ -0,0 +1,17 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> +alertTrait(session('message')) : ""; ?> +
+
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
+ + $label): ?> + + + + + +
getFieldLabel($field, $label, $viewDatas) ?>getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
+
+
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/welcome/banner.php b/app/Views/admin/welcome/banner.php index f8952d8..6b2ea8c 100644 --- a/app/Views/admin/welcome/banner.php +++ b/app/Views/admin/welcome/banner.php @@ -97,7 +97,7 @@
-
+
@@ -108,7 +108,7 @@
diff --git a/app/Views/cells/part/disk_stock.php b/app/Views/cells/part/disk_stock.php index 471cb4d..312f237 100644 --- a/app/Views/cells/part/disk_stock.php +++ b/app/Views/cells/part/disk_stock.php @@ -15,7 +15,7 @@ $entity->getTitle(), 'disk_modify', [ - "data-src" => "admin/part/disk/modify/" . $entity->getPK(), + "data-src" => "admin/part/disk/modify/{$entity->getPK()}", "data-bs-toggle" => "modal", "data-bs-target" => "#modal_action_form", "class" => "text-primary form-label-sm", diff --git a/app/Views/cells/part/ram_stock.php b/app/Views/cells/part/ram_stock.php index e6fe9ef..6b9816c 100644 --- a/app/Views/cells/part/ram_stock.php +++ b/app/Views/cells/part/ram_stock.php @@ -14,7 +14,7 @@ $entity->getTitle(), 'disk_modify', [ - "data-src" => "admin/part/ram/modify/" . $entity->getPK(), + "data-src" => "admin/part/ram/modify/{$entity->getPK()}", "data-bs-toggle" => "modal", "data-bs-target" => "#modal_action_form", "class" => "text-primary form-label-sm", diff --git a/app/Views/cells/payment/detail.php b/app/Views/cells/payment/detail.php index f05bf88..60168cc 100644 --- a/app/Views/cells/payment/detail.php +++ b/app/Views/cells/payment/detail.php @@ -12,12 +12,12 @@ - getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $serviceCellDatas) ?> - getHelper()->getFieldView('create_at', $entity->getCreatedAt(), $serviceCellDatas) ?> - getHelper()->getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?> - getHelper()->getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?> - getHelper()->getFieldView('content', html_entity_decode($entity->getContent(), ENT_QUOTES, 'UTF-8'), $serviceCellDatas) ?> - getHelper()->getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?> + getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $serviceCellDatas) ?> + getFieldView('create_at', $entity->getCreatedAt(), $serviceCellDatas) ?> + getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?> + getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?> + getFieldView('content', $entity->getContent(), $serviceCellDatas) ?> + getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?> diff --git a/app/Views/cells/serverpart/part_detail.php b/app/Views/cells/serverpart/partlist_detail.php similarity index 67% rename from app/Views/cells/serverpart/part_detail.php rename to app/Views/cells/serverpart/partlist_detail.php index 3b79aba..dfbc65c 100644 --- a/app/Views/cells/serverpart/part_detail.php +++ b/app/Views/cells/serverpart/partlist_detail.php @@ -3,7 +3,7 @@ -
getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
+
getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
@@ -13,7 +13,7 @@ -
getHelper()->getFieldView('IP', $entity->getPK(), $serverPartCellDatas) ?>
+
getFieldView('IP', $entity->getPK(), $serverPartCellDatas) ?>
  @@ -22,7 +22,7 @@ -
getHelper()->getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?>
+
getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?>
  diff --git a/app/Views/cells/serverpart/partlist_server.php b/app/Views/cells/serverpart/partlist_server.php index 992c892..470f1e7 100644 --- a/app/Views/cells/serverpart/partlist_server.php +++ b/app/Views/cells/serverpart/partlist_server.php @@ -5,8 +5,8 @@ - getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?> - getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?> + getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?> + getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?> diff --git a/app/Views/cells/serverpart/partlist_service.php b/app/Views/cells/serverpart/partlist_service.php index 06bcde5..34e867e 100644 --- a/app/Views/cells/serverpart/partlist_service.php +++ b/app/Views/cells/serverpart/partlist_service.php @@ -5,13 +5,13 @@ - getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?> - getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?> + getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?> + getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?> getHelper()->getFieldView('SERVER', "", $serverPartCellDatas), + $serverPartCellDatas['helper']->getFieldView('SERVER', "", $serverPartCellDatas), $serverPartCellDatas['serverEntity']->getIP(), $serverPartCellDatas['serverEntity']->getSwitch(), $serverPartCellDatas['serverEntity']->getOS() diff --git a/app/Views/cells/serverpart/parttable.php b/app/Views/cells/serverpart/parttable.php index 7b9238e..2c9c59a 100644 --- a/app/Views/cells/serverpart/parttable.php +++ b/app/Views/cells/serverpart/parttable.php @@ -5,7 +5,7 @@ $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas), + 'view' => $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas), 'amount' => $entity->getTotalAmount(), 'entity' => $entity ] ?> @@ -15,7 +15,7 @@ - + - +
getHelper()->getListButton($type, '', $serverPartCellDatas) ?>getListButton($type, '', $serverPartCellDatas) ?> [원]
diff --git a/app/Views/cells/service/detail.php b/app/Views/cells/service/detail.php index 96850d4..e04558e 100644 --- a/app/Views/cells/service/detail.php +++ b/app/Views/cells/service/detail.php @@ -12,9 +12,9 @@
getCode() ?>
getTitle() ?>
-
getHelper()->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?>
-
getHelper()->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?>
-
getHelper()->getListButton('addServer', '대체서버추가', ['entity' => $entity], ['class' => 'btn btn-sm btn-primary']) ?>
+
getFieldView('site', $entity->getSite(), $serviceCellDatas) ?>
+
getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?>
+
getListButton('addServer', '대체서버추가', ['entity' => $entity], ['class' => 'btn btn-sm btn-primary']) ?>
$entity, 'serverEntities' => $serviceCellDatas['childServers'][$entity->getPK()]]) ?> diff --git a/app/Views/cells/service/payment.php b/app/Views/cells/service/payment.php index ed1f0f8..31cd8df 100644 --- a/app/Views/cells/service/payment.php +++ b/app/Views/cells/service/payment.php @@ -27,6 +27,6 @@
getHelper()->getListButton('onetime', '일회성추가', ['entity' => $serviceEntity], ['class' => 'btn btn-sm btn-primary']) ?>getListButton('onetime', '일회성추가', ['entity' => $serviceEntity], ['class' => 'btn btn-sm btn-primary']) ?>
\ No newline at end of file diff --git a/app/Views/cells/service/server.php b/app/Views/cells/service/server.php index 72e9c68..7ce01b1 100644 --- a/app/Views/cells/service/server.php +++ b/app/Views/cells/service/server.php @@ -23,7 +23,7 @@ $serverEntity->getPK(), 'types' => SERVERPART['ALL_PARTTYPES'], - 'template' => 'part_detail' + 'template' => 'partlist_detail' ]) ?> diff --git a/app/Views/templates/admin/popup/index_content_filter.php b/app/Views/templates/admin/popup/index_content_filter.php new file mode 100644 index 0000000..7531113 --- /dev/null +++ b/app/Views/templates/admin/popup/index_content_filter.php @@ -0,0 +1,11 @@ + "get"]) ?> + + \ No newline at end of file diff --git a/app/Views/templates/admin/popup/index_header.php b/app/Views/templates/admin/popup/index_header.php new file mode 100644 index 0000000..3c85cd3 --- /dev/null +++ b/app/Views/templates/admin/popup/index_header.php @@ -0,0 +1,7 @@ + \ No newline at end of file