dbms_primeidc/extdbms/lib/Controllers/DBMS/Client/DashboardController.php
2025-04-11 09:11:33 +09:00

46 lines
1.8 KiB
PHP

<?php
namespace lib\Controllers\DBMS\Client;
use lib\Services\ClientService;
class DashboardController extends ClientController
{
public function __construct()
{
parent::__construct();
$this->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()->getCouponCountByClient($client_code));
$this->dashboard = $dashboard;
$this->client_code = $client_code;
return $this->render(__FUNCTION__);
}
} //Class