From 245f6c19d4c97ee4e38851cd3738ac82b27b7f64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Wed, 9 Apr 2025 17:00:23 +0900 Subject: [PATCH] dbms_primeidc_init...1 --- extdbms/lib/Configs/Constant.php | 36 +++++++------------ .../DBMS/Client/DashboardController.php | 2 +- .../Controllers/DBMS/DashboardController.php | 2 +- extdbms/lib/Database/DB.php | 10 ++---- extdbms/lib/Utils/Pagination.php | 2 +- .../Views/dbms/client/payment/nonpayment.php | 2 +- 6 files changed, 18 insertions(+), 36 deletions(-) diff --git a/extdbms/lib/Configs/Constant.php b/extdbms/lib/Configs/Constant.php index d43e43f..569696c 100644 --- a/extdbms/lib/Configs/Constant.php +++ b/extdbms/lib/Configs/Constant.php @@ -1,5 +1,17 @@ [ "id" => "PRIMEIDC", @@ -59,27 +71,3 @@ define('DBMS_SERVICE_LINE', [ 'vpn' => 'VPN', 'event' => '이벤트', ]); -define('DBMS_SERVICE_STATUS', [ - 'o' => '정상', - 'x' => '정지', - 's' => '정지예정', - 'c' => '취소', -]); -define('DBMS_SERVICE_STATUS_COLOR', [ - 'o' => 'success', - 'x' => 'danger', - 's' => 'warning', - 'c' => 'info', -]); -define('DBMS_SERVICE_STATUS_TEXT', [ - 'o' => '정상', - 'x' => '정지', - 's' => '정지예정', - 'c' => '취소', -]); -define('DBMS_SERVICE_STATUS_TEXT_COLOR', [ - 'o' => 'success', - 'x' => 'danger', - 's' => 'warning', - 'c' => 'info', -]); diff --git a/extdbms/lib/Controllers/DBMS/Client/DashboardController.php b/extdbms/lib/Controllers/DBMS/Client/DashboardController.php index 4b6f2c9..54a8db7 100644 --- a/extdbms/lib/Controllers/DBMS/Client/DashboardController.php +++ b/extdbms/lib/Controllers/DBMS/Client/DashboardController.php @@ -31,7 +31,7 @@ class DashboardController extends ClientController $switchcode_end ); } //foreach - foreach (array_keys(DBMS_SERVICE_LINE) as $service_line) { + foreach (DBMS_SERVICE_LINE as $service_line => $label) { $dashboard[$service_line] = $this->getServiceService()->getServiceLineCountByClient($client_code, $service_line); } //foreach $dashboard['coupon'] = $this->getServiceService()->getCouponCountByClient($client_code); diff --git a/extdbms/lib/Controllers/DBMS/DashboardController.php b/extdbms/lib/Controllers/DBMS/DashboardController.php index 6e89c54..f4ce175 100644 --- a/extdbms/lib/Controllers/DBMS/DashboardController.php +++ b/extdbms/lib/Controllers/DBMS/DashboardController.php @@ -68,7 +68,7 @@ class DashboardController extends DBMSController // 최근7일 신규서버수 //예외,service_line = "test","substitution" $excepts = ["test", "substitution"]; - $this->day = intval($_ENV['SITE_DASHBOARD_DAY'] ?? $_SERVER['SITE_DASHBOARD_DAY'] ?? 7); + $this->day = intval(DBMS_SITE_DASHBOARD_DAY); $this->newServers = $this->getServiceService()->getLatestCount($this->day, $excepts); // 금일기준 미납서버수 //예외,service_line = "test","substitution",C012:게임윙,C116:WinIDC,C219:IDC-JP diff --git a/extdbms/lib/Database/DB.php b/extdbms/lib/Database/DB.php index e0be95c..da67ff3 100644 --- a/extdbms/lib/Database/DB.php +++ b/extdbms/lib/Database/DB.php @@ -14,14 +14,8 @@ class DB public static function getPDO(): PDO { if (self::$pdo === null) { - $driver = $_ENV['DATABASE_DRIVER'] ?? $_SERVER['DATABASE_DRIVER'] ?? 'mysql'; - $host = $_ENV['DATABASE_HOST'] ?? $_SERVER['DATABASE_HOST'] ?? 'localhost'; - $dbname = $_ENV['DATABASE_DB'] ?? $_SERVER['DATABASE_DB'] ?? 'test'; - $charset = $_ENV['DATABASE_CHARSET'] ?? $_SERVER['DATABASE_CHARSET'] ?? 'utf8'; - $user = $_ENV['DATABASE_ID'] ?? $_SERVER['DATABASE_ID'] ?? 'root'; - $pass = $_ENV['DATABASE_PASSWORD'] ?? $_SERVER['DATABASE_PASSWORD'] ?? ''; - $dsn = sprintf("%s:host=%s;dbname=%s;charset=%s", $driver, $host, $dbname, $charset); - self::$pdo = new \PDO($dsn, $user, $pass); + $dsn = sprintf("%s:host=%s;dbname=%s;charset=%s", DATABASE_DRIVER, DATABASE_HOST, DATABASE_DB, DATABASE_CHARSET); + self::$pdo = new \PDO($dsn, DATABASE_ID, DATABASE_PASSWORD); self::$pdo->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION); } return self::$pdo; diff --git a/extdbms/lib/Utils/Pagination.php b/extdbms/lib/Utils/Pagination.php index 1bcff34..d74fa29 100644 --- a/extdbms/lib/Utils/Pagination.php +++ b/extdbms/lib/Utils/Pagination.php @@ -20,7 +20,7 @@ class Pagination $this->totalPages = (int)ceil($totalItems / $perPage); $this->start = ($this->currentPage - 1) * $perPage; $this->end = min($this->start + $perPage, $totalItems); - $this->groupSize = $_ENV['VIEW_LIST_PAGINATION_GROUPSIZE'] ?? $_SERVER['VIEW_LIST_PAGINATION_GROUPSIZE'] ?? 10; + $this->groupSize = intval(VIEW_LIST_PAGINATION_GROUPSIZE); } public function hasPrevious(): bool diff --git a/extdbms/lib/Views/dbms/client/payment/nonpayment.php b/extdbms/lib/Views/dbms/client/payment/nonpayment.php index d7efeee..e305e48 100644 --- a/extdbms/lib/Views/dbms/client/payment/nonpayment.php +++ b/extdbms/lib/Views/dbms/client/payment/nonpayment.php @@ -45,4 +45,4 @@ -
pagination->render("http://{$_SERVER['HTTP_HOST']}:6752/IdcDepositNonPaymentListMK.dep?mode=", ['mode' => "{$this->mode}", 'ea' => "{$this->total}"]) ?>
\ No newline at end of file +
pagination->render(DBMS_SITE_URL . "/IdcDepositNonPaymentListMK.dep?mode=", ['mode' => "{$this->mode}", 'ea' => "{$this->total}"]) ?>
\ No newline at end of file