From 325dab6b32d140400eb2c25d89c1085c30a40fda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Thu, 17 Apr 2025 19:09:50 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- extdbms/lib/Configs/Route.php | 166 +++++++----------- extdbms/lib/Controllers/CommonController.php | 4 +- .../DBMS/Client/ClientController.php | 43 ++++- .../DBMS/Client/CouponController.php | 107 +++++------ .../DBMS/Client/DashboardController.php | 45 ----- .../DBMS/Client/MemoController.php | 16 +- .../DBMS/Client/OnetimeController.php | 49 ------ .../DBMS/Client/PaymentController.php | 29 ++- .../DBMS/Client/PointController.php | 51 +++--- .../lib/Controllers/DBMS/DBMSController.php | 4 +- .../Controllers/DBMS/DashboardController.php | 63 +++---- .../Controllers/DBMS/DefenceController.php | 11 +- .../Controllers/DBMS/GearlistController.php | 6 +- .../Controllers/DBMS/NavigatorController.php | 15 +- .../lib/Controllers/DBMS/ServerController.php | 41 ++++- .../Controllers/DBMS/ServiceController.php | 15 +- extdbms/lib/Controllers/HomeController.php | 2 +- extdbms/lib/Core/Controller.php | 4 +- extdbms/lib/Database/QueryBuilder.php | 4 +- extdbms/lib/Entities/ServerEntity.php | 8 + extdbms/lib/Http/Request.php | 20 +-- extdbms/lib/Services/DefenceService.php | 2 +- extdbms/lib/Services/ServerService.php | 15 ++ extdbms/lib/Services/ServiceService.php | 4 +- .../lib/Views/dbms/client/coupon/client.php | 44 ----- .../lib/Views/dbms/client/coupon/index.php | 9 +- .../Views/dbms/client/coupon/insert_form.php | 4 +- .../lib/Views/dbms/client/onetime/coupon.php | 35 ---- .../payment/{nonpayment.php => index.php} | 4 +- .../client/{dashboard => }/totalcount.php | 0 extdbms/lib/Views/dbms/defence/mk.php | 22 +-- extdbms/lib/Views/dbms/server/index.php | 42 +++++ idcproject/WebContent/IDC/Navigation.jsp | 108 ++++++------ idcproject/WebContent/IDC/index.jsp | 2 +- .../jsp/client/IdcClientAllServerList.jsp | 5 +- .../WebContent/jsp/cupon/IdcCouponBuyMK.jsp | 2 +- .../WebContent/jsp/cupon/IdcCouponUseMK.jsp | 2 +- .../jsp/cupon/IdcDomainBuyListMK.jsp | 2 +- .../deposit/IdcDepositNonPaymentListMK.jsp | 2 +- .../WebContent/jsp/service/DefenseInfoMK.jsp | 2 +- .../WebContent/jsp/service/serviceDetail.jsp | 58 +++--- .../jsp/service/serviceDetailSolo.jsp | 3 +- .../src/idc/IdcCuponFrontController.java | 2 +- 43 files changed, 479 insertions(+), 593 deletions(-) delete mode 100644 extdbms/lib/Controllers/DBMS/Client/DashboardController.php delete mode 100644 extdbms/lib/Controllers/DBMS/Client/OnetimeController.php delete mode 100644 extdbms/lib/Views/dbms/client/coupon/client.php delete mode 100644 extdbms/lib/Views/dbms/client/onetime/coupon.php rename extdbms/lib/Views/dbms/client/payment/{nonpayment.php => index.php} (95%) rename extdbms/lib/Views/dbms/client/{dashboard => }/totalcount.php (100%) create mode 100644 extdbms/lib/Views/dbms/server/index.php diff --git a/extdbms/lib/Configs/Route.php b/extdbms/lib/Configs/Route.php index fa5f974..659ded0 100644 --- a/extdbms/lib/Configs/Route.php +++ b/extdbms/lib/Configs/Route.php @@ -2,90 +2,69 @@ namespace lib\Configs; +use lib\Controllers\DBMS\Client\ClientController; use lib\Controllers\DBMS\Client\CouponController; use lib\Controllers\DBMS\Client\MemoController; -use lib\Controllers\DBMS\Client\OnetimeController; use lib\Controllers\DBMS\Client\PaymentController; use lib\Controllers\DBMS\DashboardController; use lib\Controllers\DBMS\DefenceController; use lib\Controllers\DBMS\GearlistController; use lib\Controllers\DBMS\NavigatorController; -use lib\Controllers\DBMS\ServerController; use lib\Controllers\DBMS\ServiceController; use lib\Core\Router; -$router->group('dbms/client/dashboard', function (Router $router) { - // 동적 파라미터 없이 기본 path에 추가 파라미터를 받아 key/value 형식으로 처리 +//Client관련련 +$router->group('dbms/client', function (Router $router) { $router->add('GET', 'totalcount', function ($params) { - $controller = new \lib\Controllers\DBMS\Client\DashboardController(); - return $controller->totalcount($params); + $controller = new ClientCOntroller($params); + return $controller->totalcount(); // Response::view($result); }); + //메모관련 + $router->group('memo', function (Router $router) { + $router->add('GET', 'update_form', function ($params) { + $controller = new MemoCOntroller($params); + return $controller->update_form(); + // Response::view($result); + }); + $router->add('POST', 'update', function ($params) { + $controller = new MemoCOntroller($params); + return $controller->update(); + // Response::view($result); + }); + }); + //쿠폰관련 + $router->group('coupon', function (Router $router) { + $router->add('GET', 'index', function ($params) { + $controller = new CouponCOntroller($params); + return $controller->index(); + // Response::view($result); + }); + $router->add('GET', 'insert_form', function ($params) { + $controller = new CouponCOntroller($params); + return $controller->insert_form(); + // Response::view($result); + }); + $router->add('POST', 'insert', function ($params) { + $controller = new CouponCOntroller($params); + return $controller->insert(); + // Response::view($result); + }); + }); + //결제관련 + $router->group('payment', function (Router $router) { + $router->add('GET', 'index', function ($params) { + $controller = new PaymentCOntroller($params); + return $controller->index(); + // Response::view($result); + }); + $router->add('GET', 'billpaper', function ($params) { + $controller = new PaymentCOntroller($params); + return $controller->billpaper(); + // Response::view($result); + }); + }); }); -$router->group('dbms/client/memo', function (Router $router) { - $router->add('GET', 'update_form', function ($params) { - $controller = new MemoController(); - return $controller->update_form($params); - // Response::view($result); - }); - $router->add('POST', 'update', function ($params) { - $controller = new MemoController(); - return $controller->update($params); - // Response::view($result); - }); -}); -$router->group('dbms/client/onetime', function (Router $router) { - $router->add('GET', 'coupon', function ($params) { - $controller = new OnetimeController(); - return $controller->coupon($params); - // Response::view($result); - }); - // $router->add('POST', 'buy', function ($params) { - // $controller = new OnetimeController(); - // return $controller->update($params); - // // Response::view($result); - // }); - // $router->add('POST', 'use', function ($params) { - // $controller = new OnetimeController(); - // return $controller->update($params); - // // Response::view($result); - // }); -}); -$router->group('dbms/client/coupon', function (Router $router) { - $router->add('GET', 'index', function ($params) { - $controller = new CouponController(); - return $controller->index($params); - // Response::view($result); - }); - $router->add('GET', 'client', function ($params) { - $controller = new CouponController(); - return $controller->client($params); - // Response::view($result); - }); - $router->add('GET', 'insert_form', function ($params) { - $controller = new CouponController(); - return $controller->insert_form($params); - // Response::view($result); - }); - $router->add('POST', 'insert', function ($params) { - $controller = new CouponController(); - return $controller->insert($params); - // Response::view($result); - }); -}); -$router->group('dbms/client/payment', function (Router $router) { - $router->add('GET', 'billpaper', function ($params) { - $controller = new PaymentController(); - return $controller->billpaper($params); - // Response::view($result); - }); - $router->add('GET', 'nonpayment', function ($params) { - $controller = new PaymentController(); - return $controller->nonpayment($params); - // Response::view($result); - }); -}); - // 예제 라우트 그룹: dbms/dashboard/index 이후에 key/value 파라미터 허용 $router->group('dbms/dashboard', function (Router $router) { @@ -98,33 +77,33 @@ $router->group('dbms/dashboard', function (Router $router) { // }); // 동적 파라미터 없이 기본 path에 추가 파라미터를 받아 key/value 형식으로 처리 $router->add('GET', 'topboard', function ($params) { - $controller = new DashboardController(); + $controller = new DashboardCOntroller($params); return $controller->topboard(); // Response::view($result); }); $router->add('GET', 'totalcount', function ($params) { - $controller = new DashboardController(); - return $controller->totalcount($params); + $controller = new DashboardCOntroller($params); + return $controller->totalcount(); // Response::view($result); }); $router->add('GET', 'latest_service', function ($params) { - $controller = new DashboardController(); - return $controller->latest_service($params); + $controller = new DashboardCOntroller($params); + return $controller->latest_service(); // Response::view($result); }); $router->add('GET', 'latest_history', function ($params) { - $controller = new DashboardController(); - return $controller->latest_history($params); + $controller = new DashboardCOntroller($params); + return $controller->latest_history(); // Response::view($result); }); $router->add('GET', 'cscount', function ($params) { - $controller = new DashboardController(); - return $controller->cscount($params); + $controller = new DashboardCOntroller($params); + return $controller->cscount(); // Response::view($result); }); $router->add('GET', 'coupon', function ($params) { - $controller = new DashboardController(); - return $controller->coupon($params); + $controller = new DashboardCOntroller($params); + return $controller->coupon(); // Response::view($result); }); }); @@ -132,8 +111,8 @@ $router->group('dbms/dashboard', function (Router $router) { $router->group('dbms/navigator', function (Router $router) { // 동적 파라미터 없이 기본 path에 추가 파라미터를 받아 key/value 형식으로 처리 $router->add('GET', 'ipsearch', function ($params) { - $controller = new NavigatorController(); - return $controller->ipsearch($params); + $controller = new NavigatorCOntroller($params); + return $controller->ipsearch(); // Response::view($result); }); }); @@ -141,8 +120,8 @@ $router->group('dbms/navigator', function (Router $router) { $router->group('dbms/defence', function (Router $router) { // 동적 파라미터 없이 기본 path에 추가 파라미터를 받아 key/value 형식으로 처리 $router->add('GET', 'mk', function ($params) { - $controller = new DefenceController(); - return $controller->mk($params); + $controller = new DefenceCOntroller($params); + return $controller->mk(); // Response::view($result); }); }); @@ -150,25 +129,16 @@ $router->group('dbms/defence', function (Router $router) { $router->group('dbms/service', function (Router $router) { // 동적 파라미터 없이 기본 path에 추가 파라미터를 받아 key/value 형식으로 처리 $router->add('GET', 'extra', function ($params) { - $controller = new ServiceController(); - return $controller->extra($params); + $controller = new ServiceCOntroller($params); + return $controller->extra(); // Response::view($result); }); }); $router->group('dbms/gearlist', function (Router $router) { $router->add('GET', 'index', function ($params) { - $controller = new GearlistController(); - return $controller->index($params); - // Response::view($result); - }); -}); - - -$router->group('dbms/server', function (Router $router) { - $router->add('GET', 'index', function ($params) { - $controller = new ServerController(); - return $controller->index($params); + $controller = new GearlistCOntroller($params); + return $controller->index(); // Response::view($result); }); }); diff --git a/extdbms/lib/Controllers/CommonController.php b/extdbms/lib/Controllers/CommonController.php index 810b6d3..e17b1e2 100644 --- a/extdbms/lib/Controllers/CommonController.php +++ b/extdbms/lib/Controllers/CommonController.php @@ -6,8 +6,8 @@ use lib\Core\Controller as Core; class CommonController extends Core { - protected function __construct() + protected function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); } // } //Class diff --git a/extdbms/lib/Controllers/DBMS/Client/ClientController.php b/extdbms/lib/Controllers/DBMS/Client/ClientController.php index ea6ee86..1f69536 100644 --- a/extdbms/lib/Controllers/DBMS/Client/ClientController.php +++ b/extdbms/lib/Controllers/DBMS/Client/ClientController.php @@ -5,14 +5,14 @@ namespace lib\Controllers\DBMS\Client; use lib\Services\ClientService; use lib\Controllers\DBMS\DBMSController; -abstract class ClientController extends DBMSController +class ClientController extends DBMSController { private ?ClientService $_clientService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('client'); } // final public function getClientService(): ClientService @@ -22,4 +22,41 @@ abstract class ClientController extends DBMSController } return $this->_clientService; } + + //서비스카운팅 , total_counting_customer.php + //CLI 접속방법 : php index.php site/client/totalcount/client_code/코드번호 + //WEB 접속방법 : http://localhost/site/client/totalcount/client_code/코드번호 + public function totalcount() + { + //사용자정보 + $client_code = $this->request->get('client_code'); + // echo "client_code:" . $client_code; + if ($client_code) { + $client = $this->getClientService()->getEntityByCode($client_code); + if (!$client) { + throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); + } + $this->client = $client; + } + //서비스위치별(치바,도쿄등) + $dashboard = []; + foreach (DBMS_SERVICE_SWITCHCODE as $district => $switchcodes) { + $switchcode_begin = $switchcodes['begin']; + $switchcode_end = $switchcodes['end']; + $dashboard[$district] = $this->getServiceService()->getDistrictCountByClient( + $client_code, + $switchcode_begin, + $switchcode_end + ); + } //foreach + //서비스라인별(일반,방어,전용,테스트,대체등) + foreach (DBMS_SERVICE_LINE as $service_line => $label) { + $dashboard[$service_line] = $this->getServiceService()->getServiceLineCountByClient($client_code, $service_line); + } //foreach + //서비스상태별(정상,정지,해지등) + $dashboard['coupon'] = intval($this->getServiceService()->getCouponTotalCountByClient($client_code)); + $this->dashboard = $dashboard; + $this->client_code = $client_code; + return $this->render(__FUNCTION__); + } } //Class diff --git a/extdbms/lib/Controllers/DBMS/Client/CouponController.php b/extdbms/lib/Controllers/DBMS/Client/CouponController.php index 3d073dc..e55eb7b 100644 --- a/extdbms/lib/Controllers/DBMS/Client/CouponController.php +++ b/extdbms/lib/Controllers/DBMS/Client/CouponController.php @@ -12,9 +12,9 @@ class CouponController extends ClientController private ?OnetimeService $_onetimeService = null; private ?HistoryService $_historyService = null; private ?MemberService $_memberService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('coupon'); } // public function getMemberService(): MemberService @@ -42,12 +42,32 @@ class CouponController extends ClientController //IdcCouponListMK.jsp -> domain_coupon.php //CLI 접속방법 : php index.php site/client/counpon/index //WEB 접속방법 : http://localhost/site/client/coupon/index - public function index(array $params) + public function index() { + //사용자정보 + $client_code = $this->request->get('client_code'); + echo "client_code:" . is_null($client_code) ? "NULL" : $client_code; + if ($client_code) { + $client = $this->getClientService()->getEntityByCode($client_code); + if (!$client) { + throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); + } + $this->client = $client; + } + //관리자정보(등록자) + $member_code = $this->request->get('mkid'); + // echo "member_code:" . $member_code; + if ($member_code) { + $member = $this->getMemberService()->getEntityByCode($member_code); + if (!$member) { + throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); + } + $this->member = $member; + } //쿠폰내역 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); - [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage); + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); + [$this->total, $this->services] = $this->getServiceService()->getEntitiesByClient($this->curPage, $this->perPage, $client_code); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); $total_coupon = 0; foreach ($this->services as $service) { @@ -57,52 +77,15 @@ class CouponController extends ClientController return $this->render(__FUNCTION__); } - //IdcCouponUseMK.jsp -> domain_coupon_use.php - //CLI 접속방법 : php index.php site/client/counpon/client/client_code/코드 - //WEB 접속방법 : http://localhost/site/client/coupon/client/client_code/코드 - public function client(array $params) - { - //사용자정보 - if (!array_key_exists('client_code', $params)) { - throw new \Exception("client_code 값이 정의되지 않았습니다."); - } - $client_code = $params['client_code']; - $client = $this->getClientService()->getEntityByCode($client_code); - if (!$client) { - throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); - } - $this->client = $client; - //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { - throw new \Exception("mkid 값이 정의되지 않았습니다."); - } - $member_code = $params['mkid']; - $member = $this->getMemberService()->getEntityByCode($member_code); - if (!$member) { - throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); - } - $this->member = $member; - //쿠폰내역 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); - [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage, $client_code); - $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); - $total_coupon = 0; - foreach ($this->services as $service) { - $total_coupon += $service->getCoupon(); - } - $this->total_coupon = $total_coupon; - return $this->render(__FUNCTION__); - } //IdcCouponBuyMK.jsp -> domain_coupon_buy.php //CLI 접속방법 : php index.php site/client/counpon/insert_form //WEB 접속방법 : http://localhost/site/client/coupon/insert_form - public function insert_form(array $params) + public function insert_form() { - if (!array_key_exists('service_code', $params)) { + $service_code = $this->request->get('service_code'); + if (!$service_code) { throw new \Exception("service_code 값이 정의되지 않았습니다."); } - $service_code = $params['service_code']; $service = $this->getServiceService()->getEntityByCode($service_code); if (!$service) { throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); @@ -114,14 +97,15 @@ class CouponController extends ClientController throw new \Exception("[{$service->getClientCode()}]에 해당하는 사용자정보가 존재하지 않습니다."); } $this->client = $client; - //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { - throw new \Exception("mkid 값이 정의되지 않았습니다."); - } - $member_code = $params['mkid']; - $member = $this->getMemberService()->getEntityByCode($member_code); - if (!$member) { - throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); + //관리자정보(등록자) + $member_code = $this->request->get('mkid'); + // echo "member_code:" . $member_code; + if ($member_code) { + $member = $this->getMemberService()->getEntityByCode($member_code); + if (!$member) { + throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); + } + $this->member = $member; } $this->member = $member; $this->today = date("Y-m-d"); @@ -131,12 +115,12 @@ class CouponController extends ClientController //IdcCouponBuyMK.jsp -> domain_coupon_buy.php //CLI 접속방법 : php index.php site/client/counpon/insert_form //WEB 접속방법 : http://localhost/site/client/coupon/insert_form - public function insert(array $params) + public function insert() { - if (!array_key_exists('service_code', $params)) { + $service_code = $this->request->get('service_code'); + if (!$service_code) { throw new \Exception("service_code 값이 정의되지 않았습니다."); } - $service_code = $params['service_code']; $service = $this->getServiceService()->getEntityByCode($service_code); if (!$service) { throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); @@ -146,16 +130,15 @@ class CouponController extends ClientController if (!$client) { throw new \Exception("[{$service->getClientCode()}]에 해당하는 사용자정보가 존재하지 않습니다."); } - //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { + //관리자정보(등록자) + $member_code = $this->request->get('mkid'); + if (!$member_code) { throw new \Exception("mkid 값이 정의되지 않았습니다."); } - $member_code = $params['mkid']; $member = $this->getMemberService()->getEntityByCode($member_code); if (!$member) { throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); } - //onetime_sub 도메인 구매 수량 $coupon = $this->request->get('coupon'); if (! $coupon || $coupon < 1) { @@ -167,7 +150,7 @@ class CouponController extends ClientController throw new \Exception("도메인 리스트 값이 정의되지 않았습니다."); } //onetime_case 사용용도 - $onetime_case = $this->request->get('onetime_case') ?? 'domain'; + $onetime_case = $this->request->get('onetime_case', 'domain'); //onetime_request_date 사용일 $onetime_request_date = $this->request->get('onetime_request_date') ?? date("Y-m-d"); try { diff --git a/extdbms/lib/Controllers/DBMS/Client/DashboardController.php b/extdbms/lib/Controllers/DBMS/Client/DashboardController.php deleted file mode 100644 index 70c17d1..0000000 --- a/extdbms/lib/Controllers/DBMS/Client/DashboardController.php +++ /dev/null @@ -1,45 +0,0 @@ -getView()->setPath('dashboard'); - } // - - //서비스카운팅 , total_counting_customer.php - //CLI 접속방법 : php index.php site/client/dashboard/totalcount/client_code/코드번호 - //WEB 접속방법 : http://localhost/site/client/dashboard/totalcount/client_code/코드번호 - public function totalcount(array $params) - { - if (!array_key_exists('client_code', $params)) { - throw new \Exception("client_code 값이 정의되지 않았습니다."); - } - $client_code = $params['client_code']; - //서비스위치별(치바,도쿄등) - $dashboard = []; - foreach (DBMS_SERVICE_SWITCHCODE as $district => $switchcodes) { - $switchcode_begin = $switchcodes['begin']; - $switchcode_end = $switchcodes['end']; - $dashboard[$district] = $this->getServiceService()->getDistrictCountByClient( - $client_code, - $switchcode_begin, - $switchcode_end - ); - } //foreach - //서비스라인별(일반,방어,전용,테스트,대체등) - foreach (DBMS_SERVICE_LINE as $service_line => $label) { - $dashboard[$service_line] = $this->getServiceService()->getServiceLineCountByClient($client_code, $service_line); - } //foreach - //서비스상태별(정상,정지,해지등) - $dashboard['coupon'] = intval($this->getServiceService()->getCouponTotalCountByClient($client_code)); - $this->dashboard = $dashboard; - $this->client_code = $client_code; - return $this->render(__FUNCTION__); - } -} //Class diff --git a/extdbms/lib/Controllers/DBMS/Client/MemoController.php b/extdbms/lib/Controllers/DBMS/Client/MemoController.php index 608efae..280fc3f 100644 --- a/extdbms/lib/Controllers/DBMS/Client/MemoController.php +++ b/extdbms/lib/Controllers/DBMS/Client/MemoController.php @@ -6,21 +6,21 @@ use lib\Helpers\ServiceHelper; class MemoController extends ClientController { - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('memo'); $this->helper = new ServiceHelper(); } // //사용자용메모장 , customer_memo.php //CLI 접속방법 : php index.php site/client/memo/update_form/client_code/코드번호 //WEB 접속방법 : http://localhost/site/client/memo/update_form/client_code/코드번호 - public function update_form(array $params) + public function update_form() { - if (!array_key_exists('client_code', $params)) { + $client_code = $this->request->get('client_code'); + if (!$client_code) { throw new \Exception("client_code 값이 정의되지 않았습니다."); } - $client_code = $params['client_code']; $entity = $this->getClientService()->getEntityByCode($client_code); if (!$entity) { throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); @@ -29,12 +29,12 @@ class MemoController extends ClientController return $this->render(__FUNCTION__); } - public function update(array $params) + public function update() { - if (!array_key_exists('client_code', $params)) { + $client_code = $this->request->get('client_code'); + if (!$client_code) { throw new \Exception("client_code 값이 정의되지 않았습니다."); } - $client_code = $params['client_code']; $entity = $this->getClientService()->getEntityByCode($client_code); if (!$entity) { throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); diff --git a/extdbms/lib/Controllers/DBMS/Client/OnetimeController.php b/extdbms/lib/Controllers/DBMS/Client/OnetimeController.php deleted file mode 100644 index 31974f2..0000000 --- a/extdbms/lib/Controllers/DBMS/Client/OnetimeController.php +++ /dev/null @@ -1,49 +0,0 @@ -getView()->setPath('onetime'); - } // - - public function getOnetimeService(): OnetimeService - { - if ($this->_onetimeService === null) { - $this->_onetimeService = new OnetimeService(); - } - return $this->_onetimeService; - } - public function getMemberService(): MemberService - { - if ($this->_memberService === null) { - $this->_memberService = new MemberService(); - } - return $this->_memberService; - } - //domain_buy_list.php - //CLI 접속방법 : php index.php site/counpon - //WEB 접속방법 : http://localhost/site/coupon - public function coupon() - { - //쿠폰내역 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); - [$this->total, $this->entities] = $this->getOnetimeService()->getEntitiesForDomainCoupon($this->curPage, $this->perPage); - $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); - //전체 고객정보 - $this->clients = $this->getClientService()->getEntities(); - //전체 관리자정보(등록자) - $this->members = $this->getMemberService()->getEntities(); - return $this->render(__FUNCTION__); - } -} //Class diff --git a/extdbms/lib/Controllers/DBMS/Client/PaymentController.php b/extdbms/lib/Controllers/DBMS/Client/PaymentController.php index 123b140..119bff9 100644 --- a/extdbms/lib/Controllers/DBMS/Client/PaymentController.php +++ b/extdbms/lib/Controllers/DBMS/Client/PaymentController.php @@ -6,29 +6,29 @@ use lib\Utils\Pagination; class PaymentController extends ClientController { - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('payment'); } // //청구서, depositbillpaper.php //CLI 접속방법 : php index.php site/client/payment/billpaper //WEB 접속방법 : http://localhostsite/client/payment/billpaper - public function billpaper(array $params): string + public function billpaper(): string { //사이트 정보 가져오기 - if (!array_key_exists('sitekey', $params)) { + $sitekey = $this->request->get('sitekey'); + if (!$sitekey) { throw new \Exception("sitekey 값이 정의되지 않았습니다."); } - $sitekey = $params['sitekey']; $this->siteInfo = DBMS_SITEINFOS[$sitekey]; if (!array_key_exists($sitekey, DBMS_SITEINFOS)) { throw new \Exception("[{$sitekey}]에 해당하는 사이트정보가 없습니다."); } //사용자정보가져오기 - $client_code = $params['client_code']; - if (!array_key_exists('client_code', $params)) { + $client_code = $this->request->get('client_code'); + if (!$client_code) { throw new \Exception("client_code 값이 정의되지 않았습니다."); } $client = $this->getClientService()->getEntityByCode($client_code); @@ -38,17 +38,16 @@ class PaymentController extends ClientController $this->client = $client; return $this->render(__FUNCTION__); } - - //청구서, NonPaymentList.php - //CLI 접속방법 : php index.php site/client/payment/unpaid - //WEB 접속방법 : http://localhostsite/client/payment/unpaid - public function nonpayment(array $params): string + //미납리스트트, NonPaymentList.php + //CLI 접속방법 : php index.php site/client/payment/index + //WEB 접속방법 : http://localhostsite/client/payment/index + public function index(): string { //Client_Code = ["C219"=>WinIDC,"C116"=>IDC-JP"] -> 미지급금계산 제외 Client_Code $exclude_clients = ['C116', 'C219']; //mode 당일,1일전,2일전,3일전,custom $today = date("Y-m-d");; - $mode = $params['mode'] ?? $this->request->get('mode') ?? 'all'; + $mode = $this->request->get('mode', 'all'); switch ($mode) { case 'today': $this->message = "[{$today} 기준 당일 "; @@ -71,8 +70,8 @@ class PaymentController extends ClientController break; } $this->mode = $mode; - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); [$this->total, $this->entities] = $this->getServiceService()->getEntitiesForNonPayment($this->curPage, $this->perPage, $mode, $exclude_clients); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); return $this->render(path: __FUNCTION__); diff --git a/extdbms/lib/Controllers/DBMS/Client/PointController.php b/extdbms/lib/Controllers/DBMS/Client/PointController.php index 5534968..dac9ca1 100644 --- a/extdbms/lib/Controllers/DBMS/Client/PointController.php +++ b/extdbms/lib/Controllers/DBMS/Client/PointController.php @@ -12,9 +12,9 @@ class PointController extends ClientController private ?OnetimeService $_onetimeService = null; private ?HistoryService $_historyService = null; private ?MemberService $_memberService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('point'); } // public function getMemberService(): MemberService @@ -42,7 +42,7 @@ class PointController extends ClientController //IdcCouponListMK.jsp -> IdcPointListMK.jsp 신규추가가 //CLI 접속방법 : php index.php site/client/point/index //WEB 접속방법 : http://localhost/site/client/point/index - public function index(array $params) + public function index() { //쿠폰내역 $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); @@ -60,31 +60,31 @@ class PointController extends ClientController //IdcCouponUseMK.jsp -> domain_coupon_use.php //CLI 접속방법 : php index.php site/client/counpon/client/client_code/코드 //WEB 접속방법 : http://localhost/site/client/coupon/client/client_code/코드 - public function client(array $params) + public function client() { //사용자정보 - if (!array_key_exists('client_code', $params)) { + $client_code = $this->request->get('client_code'); + if (!$client_code) { throw new \Exception("client_code 값이 정의되지 않았습니다."); } - $client_code = $params['client_code']; $client = $this->getClientService()->getEntityByCode($client_code); if (!$client) { throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); } $this->client = $client; //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { - throw new \Exception("mkid 값이 정의되지 않았습니다."); + $member_code = $this->request->get('mkid'); + if (!$member_code) { + throw new \Exception("member_code 값이 정의되지 않았습니다."); } - $member_code = $params['mkid']; $member = $this->getMemberService()->getEntityByCode($member_code); if (!$member) { throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); } $this->member = $member; //쿠폰내역 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); [$this->total, $this->services] = $this->getServiceService()->getEntitiesForCoupon($this->curPage, $this->perPage, $client_code); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); return $this->render(__FUNCTION__); @@ -92,12 +92,12 @@ class PointController extends ClientController //IdcCouponBuyMK.jsp -> domain_coupon_buy.php //CLI 접속방법 : php index.php site/client/counpon/insert_form //WEB 접속방법 : http://localhost/site/client/coupon/insert_form - public function insert_form(array $params) + public function insert_form() { - if (!array_key_exists('service_code', $params)) { - throw new \Exception("service_code 값이 정의되지 않았습니다."); + $service_code = $this->request->get('service_code'); + if (!$service_code) { + throw new \Exception("client_code 값이 정의되지 않았습니다."); } - $service_code = $params['service_code']; $service = $this->getServiceService()->getEntityByCode($service_code); if (!$service) { throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); @@ -110,10 +110,10 @@ class PointController extends ClientController } $this->client = $client; //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { - throw new \Exception("mkid 값이 정의되지 않았습니다."); + $member_code = $this->request->get('mkid'); + if (!$member_code) { + throw new \Exception("member_code 값이 정의되지 않았습니다."); } - $member_code = $params['mkid']; $member = $this->getMemberService()->getEntityByCode($member_code); if (!$member) { throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); @@ -126,31 +126,32 @@ class PointController extends ClientController //IdcCouponBuyMK.jsp -> domain_coupon_buy.php //CLI 접속방법 : php index.php site/client/counpon/insert_form //WEB 접속방법 : http://localhost/site/client/coupon/insert_form - public function insert(array $params) + public function insert() { - if (!array_key_exists('service_code', $params)) { + $service_code = $this->request->get('service_code'); + if (!$service_code) { throw new \Exception("service_code 값이 정의되지 않았습니다."); } - $service_code = $params['service_code']; $service = $this->getServiceService()->getEntityByCode($service_code); if (!$service) { throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); } + $this->service = $service; //사용자정보 $client = $this->getClientService()->getEntityByCode($service->getClientCode()); if (!$client) { throw new \Exception("[{$service->getClientCode()}]에 해당하는 사용자정보가 존재하지 않습니다."); } + $this->client = $client; //전체 관리자정보(등록자) - if (!array_key_exists('mkid', $params)) { - throw new \Exception("mkid 값이 정의되지 않았습니다."); + $member_code = $this->request->get('mkid'); + if (!$member_code) { + throw new \Exception("member_code 값이 정의되지 않았습니다."); } - $member_code = $params['mkid']; $member = $this->getMemberService()->getEntityByCode($member_code); if (!$member) { throw new \Exception("[$member_code]에 해당하는 관리자정보가 존재하지 않습니다."); } - //onetime_sub 도메인 구매 수량 $coupon = $this->request->get('coupon'); if (! $coupon || $coupon < 1) { diff --git a/extdbms/lib/Controllers/DBMS/DBMSController.php b/extdbms/lib/Controllers/DBMS/DBMSController.php index 16f6443..8a3337b 100644 --- a/extdbms/lib/Controllers/DBMS/DBMSController.php +++ b/extdbms/lib/Controllers/DBMS/DBMSController.php @@ -8,9 +8,9 @@ use lib\Services\ServiceService; abstract class DBMSController extends CommonController { private ?ServiceService $_service = null; - public function __construct() + protected function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); //View의 추가디렉토리 $this->getView()->setPath('dbms'); } // diff --git a/extdbms/lib/Controllers/DBMS/DashboardController.php b/extdbms/lib/Controllers/DBMS/DashboardController.php index f4ce175..f0aae29 100644 --- a/extdbms/lib/Controllers/DBMS/DashboardController.php +++ b/extdbms/lib/Controllers/DBMS/DashboardController.php @@ -17,9 +17,9 @@ class DashboardController extends DBMSController private ?KCSService $_kcsService = null; private ?HistoryService $_historyService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('dashboard'); $this->helper = new ServiceHelper(); } // @@ -80,16 +80,12 @@ class DashboardController extends DBMSController //서비스카운팅 , total_counting.php //CLI 접속방법 : php index.php site/dashboard/totalcount/sitekey/도메인 //WEB 접속방법 : http://localhost/site/dashboard/totalcount/sitekey/도메인 - public function totalcount(array $params) + public function totalcount() { - if (!array_key_exists('sitekey', $params)) { + $sitekey = $this->request->get('sitekey'); + if (!$sitekey) { throw new \Exception("sitekey 값이 정의되지 않았습니다."); } - $sitekey = $params['sitekey']; - //사이트 정보 가져오기 - if (!array_key_exists($sitekey, DBMS_SITEINFOS)) { - throw new \Exception("[{$sitekey}]에 해당하는 사이트정보가 없습니다."); - } $this->siteInfo = DBMS_SITEINFOS[$sitekey]; $this->totalcount = $this->getServiceService()->getTotalCountForDashboard($this->siteInfo); $summary = array(); @@ -117,11 +113,10 @@ class DashboardController extends DBMSController //신규서버현황 new_server_list.php //CLI 접속방법 : php index.php site/dashboard/latest_service/limit/5 //WEB 접속방법 : http://localhost/site/dashboard/latest_service/limit/5 - public function latest_service(array $params) + public function latest_service() { - $limit = array_key_exists('limit', $params) ? $params['limit'] : 5; //신규서버정보 - $this->limit = intval($limit); + $this->limit = intval($this->request->get('limit', 5)); $this->entities = $this->getServiceService()->getLatest($this->limit); // echo $this->getServiceervice()->getModel()->getLastQuery(); //전체 관리자정보(등록자) @@ -152,11 +147,10 @@ class DashboardController extends DBMSController } //CLI 접속방법 : php index.php site/dashboard/latest_history/limit/5 //WEB 접속방법 : http://localhost/site/dashboard/latest_history/limit/5 - public function latest_history(array $params): string + public function latest_history(): string { - $limit = array_key_exists('limit', $params) ? $params['limit'] : 5; //신규서버정보 - $this->limit = intval($limit); + $this->limit = intval($this->request->get('limit', 5)); $this->entitys = $this->getHistoryService()->getLatest($this->limit); //전체 서비스정보 $this->services = $this->getServiceService()->getEntities(); @@ -167,44 +161,37 @@ class DashboardController extends DBMSController //service_list_cs_count.php //CLI 접속방법 : php index.php site/dashboard/cscount/service_code/서비스코드/client_code/고객코드 //WEB 접속방법 : http://localhost/site/dashboard/cscount/service_code/서비스코드/client_code/고객코드 - public function cscount(array $params): string + public function cscount(): string { - if (!array_key_exists('service_code', $params)) { + $service_code = $this->request->get('service_code'); + if (!$service_code) { throw new \Exception("service_code 값이 정의되지 않았습니다."); } - if (!array_key_exists('client_code', $params)) { - throw new \Exception("client_code 값이 정의되지 않았습니다."); + $service = $this->getServiceService()->getEntityByCode($service_code); + if (!$service) { + throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); } - $serviceCode = $params['service_code']; - $clientCode = $params['client_code']; - $this->service_code = $serviceCode; - $this->client_code = $clientCode; + $this->service = $service; //VPC정보갯수 - $this->vpc = $this->getVPCService()->getCountByServiceCode($serviceCode); + $this->vpc = $this->getVPCService()->getCountByServiceCode($service->getServiceCode()); //KCS정보갯수 - $this->kcs = $this->getKCSService()->getCountByServiceCode($serviceCode); + $this->kcs = $this->getKCSService()->getCountByServiceCode($service->getServiceCode()); return $this->render(__FUNCTION__); } //service_list_cs_count.php //CLI 접속방법 : php index.php site/dashboard/cscount/service_code/서비스코드/client_code/고객코드 //WEB 접속방법 : http://localhost/site/dashboard/cscount/service_code/서비스코드/client_code/고객코드 - public function coupon(array $params): string + public function coupon(): string { - if (!array_key_exists('service_code', $params)) { + $service_code = $this->request->get('service_code'); + if (!$service_code) { throw new \Exception("service_code 값이 정의되지 않았습니다."); } - if (!array_key_exists('client_code', $params)) { - throw new \Exception("client_code 값이 정의되지 않았습니다."); + $service = $this->getServiceService()->getEntityByCode($service_code); + if (!$service) { + throw new \Exception("[$service_code]에 해당하는 서비스정보가 존재하지 않습니다."); } - $serviceCode = $params['service_code']; - $clientCode = $params['client_code']; - $entity = $this->getServiceService()->getEntityByCode($serviceCode); - if (!$entity) { - throw new \Exception("{$serviceCode}에 해당하는 서비스정보가 존재하지 않습니다."); - } - $this->entity = $entity; - $this->service_code = $serviceCode; - $this->client_code = $clientCode; + $this->entity = $service; return $this->render(__FUNCTION__); } } //Class diff --git a/extdbms/lib/Controllers/DBMS/DefenceController.php b/extdbms/lib/Controllers/DBMS/DefenceController.php index 0e04cd9..ab84925 100644 --- a/extdbms/lib/Controllers/DBMS/DefenceController.php +++ b/extdbms/lib/Controllers/DBMS/DefenceController.php @@ -7,9 +7,9 @@ use lib\Services\DefenceService; class DefenceController extends DBMSController { private ?DefenceService $_clientService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('defence'); } // public function getDefenceService(): DefenceService @@ -23,12 +23,13 @@ class DefenceController extends DBMSController //방어 defense_index.php //CLI 접속방법 : php index.php site/defence/mk/zone/존/parent/부모키/child/자식키 //WEB 접속방법 : http://localhostsite/defence/mk/zone/존/parent/부모키/child/자식키 - public function mk(array $params): string + public function mk(): string { - if (!array_key_exists('zone', $params)) { + $zone = $this->request->get('zone'); + if (!$zone) { throw new \Exception("zone 값이 정의되지 않았습니다."); } - $zone = urldecode($params['zone']); + $zone = urldecode($zone); $this->entities = $this->getDefenceService()->getMKList($zone); $this->zone = $zone; return $this->render(__FUNCTION__); diff --git a/extdbms/lib/Controllers/DBMS/GearlistController.php b/extdbms/lib/Controllers/DBMS/GearlistController.php index ed9c0c2..b092dae 100644 --- a/extdbms/lib/Controllers/DBMS/GearlistController.php +++ b/extdbms/lib/Controllers/DBMS/GearlistController.php @@ -11,9 +11,9 @@ class GearlistController extends DBMSController { private ?GearlistService $_gearlistServicerService = null; private ?ServerService $_serverService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('gearlist'); } // public function getGearlistService(): GearlistService @@ -44,7 +44,7 @@ class GearlistController extends DBMSController $entity->format = $this->getServerService()->getCountByMode("format", $cpu, $spec); return $entity; } - public function index(array $params): string + public function index(): string { $gearlistEntities = $this->getGearlistService()->getEntitiesForLineUp(); //DB에 넣지않는 이유가 뭘까? DB에 넣으면 관리가 힘들어서? diff --git a/extdbms/lib/Controllers/DBMS/NavigatorController.php b/extdbms/lib/Controllers/DBMS/NavigatorController.php index 10ea7f1..eded792 100644 --- a/extdbms/lib/Controllers/DBMS/NavigatorController.php +++ b/extdbms/lib/Controllers/DBMS/NavigatorController.php @@ -10,9 +10,9 @@ class NavigatorController extends DBMSController { private ?ClientService $_clientService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('navigator'); $this->helper = new ServiceHelper(); } // @@ -27,17 +27,14 @@ class NavigatorController extends DBMSController //부가서비스 : 닷디펜더,딥파인더 등, deepfinder_list.php,dotdefender_list.php //CLI 접속방법 : php index.php site/navigator/ipsearch //WEB 접속방법 : http://localhost/site/navigator/ipsearch - public function ipsearch(array $params): string + public function ipsearch(): string { - $ip = array_key_exists('ip', $params) ?? null; - if (!$ip) { - $ip = $this->request->get('ip') ?? null; - } + $ip = $this->request->get('ip'); //전체 고객정보 $this->clients = $this->getClientService()->getEntities(); //IP형식이 ipv4인지 확인 후 값가져오기 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); [$this->total, $this->entities] = $this->getServiceService()->getEntitiesForIpSearch($this->curPage, $this->perPage, $ip, $this->helper->isIPAddress($ip)); $this->ip = $ip; $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); diff --git a/extdbms/lib/Controllers/DBMS/ServerController.php b/extdbms/lib/Controllers/DBMS/ServerController.php index f8577ba..e5e5023 100644 --- a/extdbms/lib/Controllers/DBMS/ServerController.php +++ b/extdbms/lib/Controllers/DBMS/ServerController.php @@ -2,14 +2,17 @@ namespace lib\Controllers\DBMS; +use lib\Services\ClientService; use lib\Services\ServerService; +use lib\Utils\Pagination; class ServerController extends DBMSController { private ?ServerService $_serverService = null; - public function __construct() + private ?ClientService $_clientService = null; + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('server'); } // public function getServerService(): ServerService @@ -19,4 +22,38 @@ class ServerController extends DBMSController } return $this->_serverService; } + public function getClientService(): ClientService + { + if ($this->_clientService === null) { + $this->_clientService = new ClientService(); + } + return $this->_clientService; + } + //IdcCouponListMK.jsp -> domain_coupon.php + //CLI 접속방법 : php index.php site/client/counpon/index + //WEB 접속방법 : http://localhost/site/client/coupon/index + public function index() + { + //사용자정보 + $client_code = $this->request->get('client_code'); + // echo "client_code:" . $client_code; + if ($client_code) { + $client = $this->getClientService()->getEntityByCode($client_code); + if (!$client) { + throw new \Exception("[$client_code]에 해당하는 사용자정보가 존재하지 않습니다."); + } + $this->client = $client; + } + //쿠폰내역 + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); + [$this->total, $this->services] = $this->getServerService()->getEntitiesByClient($this->curPage, $this->perPage, $client_code); + $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); + $total_coupon = 0; + foreach ($this->services as $service) { + $total_coupon += $service->getCoupon(); + } + $this->total_coupon = $total_coupon; + return $this->render(__FUNCTION__); + } } //Class diff --git a/extdbms/lib/Controllers/DBMS/ServiceController.php b/extdbms/lib/Controllers/DBMS/ServiceController.php index bdd3c3e..7069ed2 100644 --- a/extdbms/lib/Controllers/DBMS/ServiceController.php +++ b/extdbms/lib/Controllers/DBMS/ServiceController.php @@ -12,9 +12,9 @@ class ServiceController extends DBMSController private ?ClientService $_clientService = null; private ?AddDbService $_addDbService = null; - public function __construct() + public function __construct(array $params = []) { - parent::__construct(); + parent::__construct($params); $this->getView()->setPath('service'); } // public function getClientService(): ClientService @@ -35,12 +35,13 @@ class ServiceController extends DBMSController //부가서비스 : 닷 디펜더,딥 파인더 ,M307-1,M394-2등, deepfinder_list.php,dotdefender_list.php //CLI 접속방법 : php index.php site/service//extra/adddb_code/코드번호 //WEB 접속방법 : http://localhost/site/service/extra/adddb_code/코드번호 - public function extra(array $params): string + public function extra(): string { - if (!array_key_exists('adddb_code', $params)) { + $adddb_code = $this->request->get('adddb_code'); + if (!$adddb_code) { throw new \Exception("adddb_code 값이 정의되지 않았습니다."); } - $this->adddb_code = urldecode($params['adddb_code']); + $this->adddb_code = urldecode($adddb_code); //해당 부가서비스의 services_code 목록 가져오기 //segment의 값이 한글인경우 urldecode가 필요 $addDbEntities = $this->getAddDbService()->getEntitiesByCode($this->adddb_code); @@ -54,8 +55,8 @@ class ServiceController extends DBMSController //전체 사용자정보 $this->clients = $this->getClientService()->getEntities(); //부가서비스용 서비스목록 가져오기 - $this->curPage = intval($params['curPage'] ?? $this->request->get('curPage') ?? 1); - $this->perPage = intval($params['perPage'] ?? $this->request->get('perPage') ?? VIEW_LIST_PERPAGE); + $this->curPage = intval($this->request->get('curPage', 1)); + $this->perPage = intval($this->request->get('perPage', VIEW_LIST_PERPAGE)); [$this->total, $this->entities] = $this->getServiceService()->getEntitiesForExtra($this->curPage, $this->perPage, $service_codes); $this->pagination = new Pagination($this->total, (int)$this->curPage, (int)$this->perPage); return $this->render(__FUNCTION__); diff --git a/extdbms/lib/Controllers/HomeController.php b/extdbms/lib/Controllers/HomeController.php index 59c6d63..5c6dc20 100644 --- a/extdbms/lib/Controllers/HomeController.php +++ b/extdbms/lib/Controllers/HomeController.php @@ -2,7 +2,7 @@ namespace lib\Controllers; -use lib\Core\Response; +use lib\Http\Response; class HomeController { diff --git a/extdbms/lib/Core/Controller.php b/extdbms/lib/Core/Controller.php index e256903..0862913 100644 --- a/extdbms/lib/Core/Controller.php +++ b/extdbms/lib/Core/Controller.php @@ -17,12 +17,12 @@ abstract class Controller protected ?Session $session = null; protected ?Redirect $redirect = null; protected ?Request $request = null; - protected function __construct() + protected function __construct(array $params = []) { $this->url = new Url(); $this->session = new Session(); $this->redirect = new Redirect($this->session); - $this->request = new Request(); + $this->request = new Request($params); } // final public function __get($name) { diff --git a/extdbms/lib/Database/QueryBuilder.php b/extdbms/lib/Database/QueryBuilder.php index 41d9924..6dffc2c 100644 --- a/extdbms/lib/Database/QueryBuilder.php +++ b/extdbms/lib/Database/QueryBuilder.php @@ -56,10 +56,10 @@ class QueryBuilder if (!empty($this->order)) { $sql .= " ORDER BY " . implode(', ', $this->order); } - if ($this->limit !== null) { + if ($this->limit) { $sql .= " LIMIT {$this->limit}"; } - if ($this->offset !== null) { + if ($this->offset) { $sql .= " OFFSET {$this->offset}"; } return $sql; diff --git a/extdbms/lib/Entities/ServerEntity.php b/extdbms/lib/Entities/ServerEntity.php index 0d82401..9b75ee4 100644 --- a/extdbms/lib/Entities/ServerEntity.php +++ b/extdbms/lib/Entities/ServerEntity.php @@ -14,4 +14,12 @@ class ServerEntity extends Entity { parent::__construct($datas); } // + public function getServerCode(): string + { + return $this->server_code; + } + public function getServiceCode(): string + { + return $this->service_code; + } } //Class diff --git a/extdbms/lib/Http/Request.php b/extdbms/lib/Http/Request.php index 511d6d5..8a6997c 100644 --- a/extdbms/lib/Http/Request.php +++ b/extdbms/lib/Http/Request.php @@ -4,22 +4,16 @@ namespace lib\Http; class Request extends Http { - protected array $get; - protected array $post; - protected array $data; - - public function __construct() + private array $_datas = []; + public function __construct(array $params = []) { parent::__construct(); - - $this->get = $_GET; - $this->post = $_POST; - $this->data = array_merge($_GET, $_POST); + $this->_datas = array_merge($_GET, $_POST, $params); } public function all(): array { - return $this->data; + return $this->_datas; } public function get(?string $key = null, $default = null): mixed @@ -27,17 +21,17 @@ class Request extends Http if ($key === null) { return $this->all(); } - return $this->data[$key] ?? $default; + return $this->_datas[$key] ?? $default; } public function only(array $keys): array { - return array_intersect_key($this->data, array_flip($keys)); + return array_intersect_key($this->_datas, array_flip($keys)); } public function has(string $key): bool { - return array_key_exists($key, $this->data); + return array_key_exists($key, $this->_datas); } /** diff --git a/extdbms/lib/Services/DefenceService.php b/extdbms/lib/Services/DefenceService.php index 243b621..e101c39 100644 --- a/extdbms/lib/Services/DefenceService.php +++ b/extdbms/lib/Services/DefenceService.php @@ -30,7 +30,7 @@ class DefenceService extends CommonService public function getMKList(mixed $zone = null): array { - if ($zone !== null) { + if ($zone) { $this->getModel()->where(['zone' => $zone]); } $this->getModel()->orderBy(['zone' => 'asc', 'parents' => 'asc', 'child' => 'asc']); diff --git a/extdbms/lib/Services/ServerService.php b/extdbms/lib/Services/ServerService.php index 582bc9c..5985950 100644 --- a/extdbms/lib/Services/ServerService.php +++ b/extdbms/lib/Services/ServerService.php @@ -57,4 +57,19 @@ class ServerService extends CommonService } return $this->getCount(); } + + //사용자별 서비스리스트트 + public function getEntitiesByClient(int $curPage, int $perPage, ?string $client_code = null): array + { + if ($client_code) { + $this->getModel()->where("client_code", $client_code); + } + //Query문 Rest여부 -> 같은조건에 Count 받고, 결과값을 받고 싶을때는 continue() + $this->getModel()->setContinue(true); + $total = $this->getCount(); + //limit, offset 설정 + $this->getModel()->limit($perPage); + $this->getModel()->offset(($curPage - 1) * $perPage); + return [$total, $this->getEntities()]; + } } diff --git a/extdbms/lib/Services/ServiceService.php b/extdbms/lib/Services/ServiceService.php index 7ab8340..cef26cd 100644 --- a/extdbms/lib/Services/ServiceService.php +++ b/extdbms/lib/Services/ServiceService.php @@ -38,9 +38,9 @@ class ServiceService extends CommonService } //사용자별 서비스리스트트 - public function getEntitiesForCoupon(int $curPage, int $perPage, ?string $client_code = null): array + public function getEntitiesByClient(int $curPage, int $perPage, ?string $client_code = null): array { - if ($client_code !== null) { + if ($client_code) { $this->getModel()->where("client_code", $client_code); } $this->getModel()->whereNotIn("service_line", ['vpn', 'test', 'solo', 'substitution', 'event']); diff --git a/extdbms/lib/Views/dbms/client/coupon/client.php b/extdbms/lib/Views/dbms/client/coupon/client.php deleted file mode 100644 index ad8917b..0000000 --- a/extdbms/lib/Views/dbms/client/coupon/client.php +++ /dev/null @@ -1,44 +0,0 @@ -

고객명 : client->getTitle() ?> / 쿠폰발급대상 : services) ?> 대 / 전체 남은 수량 : total_coupon; ?> 개

-
- - - - - - - - - - - - - - - - - - - services as $service) { ?> - services) - $i; ?> - - - - - - - - - - - getCoupon()) { ?> - - - - - - - - -
No서비스코드장비명서버IP서비스개시일회선종류쿠폰 누적수쿠폰 잔량수쿠폰 사용수사용
getServiceCode() ?>getServerCode() ?>service_ip ?>service_open_date ?>service_line ?>getCoupon() + $service->getUsedCoupon() ?>getCoupon() ?>getUsedCoupon() ?>사용완료사용하기
-
-
pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client->getClientCode(), 'member_code' => $this->member->getPK(), 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/extdbms/lib/Views/dbms/client/coupon/index.php b/extdbms/lib/Views/dbms/client/coupon/index.php index aa7e4a8..a1c88b7 100644 --- a/extdbms/lib/Views/dbms/client/coupon/index.php +++ b/extdbms/lib/Views/dbms/client/coupon/index.php @@ -1,3 +1,6 @@ +client) { ?> +

고객명 : client->getTitle() ?> / 쿠폰발급대상 : services) ?> 대 / 전체 남은 수량 : total_coupon; ?> 개

+
@@ -12,6 +15,7 @@ + @@ -26,12 +30,13 @@ - + +
쿠폰 누적수 쿠폰 잔량수 쿠폰 사용수사용
service_open_date ?> service_line ?> getCoupon() + $service->getUsedCoupon() ?>getCoupon() ?>getCoupon() ?> getUsedCoupon() ?>">getCoupon() ? "사용완료" : "사용하기" ?>
-
pagination->render(DBMS_SITE_URL . "/IdcCouponListMK.cup", ['curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file +
pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client ? $this->client->getClientCode() : "", 'mkid' => $this->member ? $this->member->getPK() : "", 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/extdbms/lib/Views/dbms/client/coupon/insert_form.php b/extdbms/lib/Views/dbms/client/coupon/insert_form.php index 93f2218..f935d23 100644 --- a/extdbms/lib/Views/dbms/client/coupon/insert_form.php +++ b/extdbms/lib/Views/dbms/client/coupon/insert_form.php @@ -1,5 +1,7 @@
-
+ + + "> diff --git a/extdbms/lib/Views/dbms/client/onetime/coupon.php b/extdbms/lib/Views/dbms/client/onetime/coupon.php deleted file mode 100644 index cda685b..0000000 --- a/extdbms/lib/Views/dbms/client/onetime/coupon.php +++ /dev/null @@ -1,35 +0,0 @@ -전체구매건수 : entities) ?> -
-
-
- - - - - - - - - - - - - - - entities as $entity) { ?> - - - - - - - - - - - - - -
고객명서비스코드수량결제금액미납금액신청일결제일비 고담당자
clients[$entity->getClientCode()]->getTitle() ?>getServiceCode() ?>getTitle() ?>getAmount() ?>getNonPayment() ?>getRequestDate() ?>getPaymentDate() ?>getNote() ?>
-
-
pagination->render(DBMS_SITE_URL . "/IdcDomainBuyListMK.cup", ['curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/extdbms/lib/Views/dbms/client/payment/nonpayment.php b/extdbms/lib/Views/dbms/client/payment/index.php similarity index 95% rename from extdbms/lib/Views/dbms/client/payment/nonpayment.php rename to extdbms/lib/Views/dbms/client/payment/index.php index 5793356..e3242d5 100644 --- a/extdbms/lib/Views/dbms/client/payment/nonpayment.php +++ b/extdbms/lib/Views/dbms/client/payment/index.php @@ -20,8 +20,7 @@ 서비스 가격 과금상태 미납과금 - - 비고 + 비고 @@ -38,7 +37,6 @@ addDB_accountStatus ?> addDB_nonpayment ?> - service_note ?> diff --git a/extdbms/lib/Views/dbms/client/dashboard/totalcount.php b/extdbms/lib/Views/dbms/client/totalcount.php similarity index 100% rename from extdbms/lib/Views/dbms/client/dashboard/totalcount.php rename to extdbms/lib/Views/dbms/client/totalcount.php diff --git a/extdbms/lib/Views/dbms/defence/mk.php b/extdbms/lib/Views/dbms/defence/mk.php index b21f7f1..8d1ea03 100644 --- a/extdbms/lib/Views/dbms/defence/mk.php +++ b/extdbms/lib/Views/dbms/defence/mk.php @@ -113,25 +113,15 @@ background-color: #24a2e0; color: #fff; } + + .mk1123 { + opacity: 0.4; + filter: alpha(opacity=40); + } - \ No newline at end of file + \ No newline at end of file diff --git a/extdbms/lib/Views/dbms/server/index.php b/extdbms/lib/Views/dbms/server/index.php new file mode 100644 index 0000000..040a1e7 --- /dev/null +++ b/extdbms/lib/Views/dbms/server/index.php @@ -0,0 +1,42 @@ +client) { ?> +

고객명 : client->getTitle() ?> / 쿠폰발급대상 : servers) ?> 대 / 전체 남은 수량 : total_coupon; ?> 개

+ +
+ + + + + + + + + + + + + + + + + + + servers as $server) { ?> + servers) - $i; ?> + + + + + + + + + + + + + + + +
No서비스코드장비명서버IP서비스개시일회선종류쿠폰 누적수쿠폰 잔량수쿠폰 사용수사용
getServiceCode() ?>getServerCode() ?>server_ip ?>server_open_date ?>server_line ?>getCoupon() + $server->getUsedCoupon() ?>getCoupon() ?>getUsedCoupon() ?>">getCoupon() ? "사용완료" : "사용하기" ?>
+
+
pagination->render(DBMS_SITE_URL . "/IdcCouponUseMK.cup", ['client_code' => $this->client ? $this->client->getClientCode() : "", 'mkid' => $this->member ? $this->member->getPK() : "", 'curPage' => $this->curPage, 'perPage' => $this->perPage]) ?>
\ No newline at end of file diff --git a/idcproject/WebContent/IDC/Navigation.jsp b/idcproject/WebContent/IDC/Navigation.jsp index 6b361ef..65eabd5 100644 --- a/idcproject/WebContent/IDC/Navigation.jsp +++ b/idcproject/WebContent/IDC/Navigation.jsp @@ -379,7 +379,6 @@ $(document).ready(function(){ - + + diff --git a/idcproject/WebContent/IDC/index.jsp b/idcproject/WebContent/IDC/index.jsp index 93b87d4..972ba11 100644 --- a/idcproject/WebContent/IDC/index.jsp +++ b/idcproject/WebContent/IDC/index.jsp @@ -34,7 +34,7 @@
- +
diff --git a/idcproject/WebContent/jsp/client/IdcClientAllServerList.jsp b/idcproject/WebContent/jsp/client/IdcClientAllServerList.jsp index 366760e..0028025 100644 --- a/idcproject/WebContent/jsp/client/IdcClientAllServerList.jsp +++ b/idcproject/WebContent/jsp/client/IdcClientAllServerList.jsp @@ -15,9 +15,7 @@ 고객리스트
- -
diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponBuyMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponBuyMK.jsp index 5644784..ba76593 100644 --- a/idcproject/WebContent/jsp/cupon/IdcCouponBuyMK.jsp +++ b/idcproject/WebContent/jsp/cupon/IdcCouponBuyMK.jsp @@ -22,7 +22,7 @@

도메인 쿠폰 사용하기

- +
diff --git a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp index 30d74f6..76e0a89 100644 --- a/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp +++ b/idcproject/WebContent/jsp/cupon/IdcCouponUseMK.jsp @@ -11,7 +11,7 @@

도메인 쿠폰 사용하기

- +
diff --git a/idcproject/WebContent/jsp/cupon/IdcDomainBuyListMK.jsp b/idcproject/WebContent/jsp/cupon/IdcDomainBuyListMK.jsp index d27f58c..be11721 100644 --- a/idcproject/WebContent/jsp/cupon/IdcDomainBuyListMK.jsp +++ b/idcproject/WebContent/jsp/cupon/IdcDomainBuyListMK.jsp @@ -11,7 +11,7 @@

도메인 구매 목록

- +
diff --git a/idcproject/WebContent/jsp/deposit/IdcDepositNonPaymentListMK.jsp b/idcproject/WebContent/jsp/deposit/IdcDepositNonPaymentListMK.jsp index 43770d3..fc58e45 100644 --- a/idcproject/WebContent/jsp/deposit/IdcDepositNonPaymentListMK.jsp +++ b/idcproject/WebContent/jsp/deposit/IdcDepositNonPaymentListMK.jsp @@ -12,7 +12,7 @@

미납리스트

- +
diff --git a/idcproject/WebContent/jsp/service/DefenseInfoMK.jsp b/idcproject/WebContent/jsp/service/DefenseInfoMK.jsp index 4493d26..99bad38 100644 --- a/idcproject/WebContent/jsp/service/DefenseInfoMK.jsp +++ b/idcproject/WebContent/jsp/service/DefenseInfoMK.jsp @@ -84,7 +84,7 @@ $(function()

방어라인 정보

- +
diff --git a/idcproject/WebContent/jsp/service/serviceDetail.jsp b/idcproject/WebContent/jsp/service/serviceDetail.jsp index 7faba15..cb1f476 100644 --- a/idcproject/WebContent/jsp/service/serviceDetail.jsp +++ b/idcproject/WebContent/jsp/service/serviceDetail.jsp @@ -948,7 +948,7 @@ $(function() 엑셀 @@ -969,11 +969,11 @@ $(function()

${iusc.client_name}

- [청구서발행]
+ [청구서발행]

- +
@@ -1003,7 +1003,7 @@ $(function()
- +
@@ -1055,22 +1055,22 @@ $(function() - - - - - - + + + + + + - - - - - - - - - + + + + + + + + + @@ -1255,12 +1255,12 @@ $(function() - - - - - - + + + + + + @@ -1304,7 +1304,7 @@ $(function() - @@ -1437,7 +1437,7 @@ $(function() - +
  • ${i}
  • @@ -1857,7 +1857,7 @@ $(function() @@ -2065,7 +2065,7 @@ $(function() diff --git a/idcproject/WebContent/jsp/service/serviceDetailSolo.jsp b/idcproject/WebContent/jsp/service/serviceDetailSolo.jsp index 1f83e5f..9789e7f 100644 --- a/idcproject/WebContent/jsp/service/serviceDetailSolo.jsp +++ b/idcproject/WebContent/jsp/service/serviceDetailSolo.jsp @@ -987,7 +987,7 @@ $(function()
    - +
    @@ -1503,7 +1503,6 @@ $(function() - 서비스 코드 diff --git a/idcproject/src/idc/IdcCuponFrontController.java b/idcproject/src/idc/IdcCuponFrontController.java index cb64d18..4878e1f 100644 --- a/idcproject/src/idc/IdcCuponFrontController.java +++ b/idcproject/src/idc/IdcCuponFrontController.java @@ -91,7 +91,7 @@ public class IdcCuponFrontController extends HttpServlet { } //NEW 도메인 구매 목록 조회 - MK - if(cmdURI.equals("/.cup")) + if(cmdURI.equals("/IdcDomainBuyListMK.cup")) { cmd = new IdcCuponListCmd(); cmd.execute(request, response);