dbms_primeidc_init...1

This commit is contained in:
최준흠 2025-04-03 17:46:27 +09:00
parent 082f4c2795
commit a6a34d47bb
30 changed files with 94 additions and 107 deletions

View File

@ -15,7 +15,7 @@ abstract class BaseController extends CommonController
$this->getView()->setPath('dbms');
} //
final public function getServiceervice(): ServiceService
final public function getServiceService(): ServiceService
{
if ($this->_service === null) {
$this->_service = new ServiceService();

View File

@ -69,11 +69,11 @@ class DashboardController extends BaseController
//예외,service_line = "test","substitution"
$excepts = ["test", "substitution"];
$this->day = intval($_ENV['SITE_DASHBOARD_DAY'] ?? $_SERVER['SITE_DASHBOARD_DAY'] ?? 7);
$this->newServers = $this->getServiceervice()->getNewServerCount($this->day, $excepts);
$this->newServers = $this->getServiceService()->getNewServerCount($this->day, $excepts);
// 금일기준 미납서버수
//예외,service_line = "test","substitution",C012:게임윙,C116:WinIDC,C219:IDC-JP
$excepts = ["test", "substitution", 'C116', 'C012', 'C219'];
$this->unPayments = $this->getServiceervice()->getUnPaymentCount($excepts);
$this->unPayments = $this->getServiceService()->getUnPaymentCount($excepts);
return $this->render(__FUNCTION__);
}
@ -90,7 +90,7 @@ class DashboardController extends BaseController
}
//사이트 정보 가져오기
$this->siteInfo = DBMS_SITEINFOS[$sitekey];
$this->totalcount = $this->getServiceervice()->getTotalCount($this->siteInfo);
$this->totalcount = $this->getServiceService()->getTotalCount($this->siteInfo);
$summary = array();
foreach ($this->siteInfo['totalcount_types'] as $type) {
$summary[$type] = array("Tokyo" => 0, "Chiba" => 0);
@ -120,29 +120,29 @@ class DashboardController extends BaseController
{
//신규서버정보
$this->limit = intval($limit);
$this->entitys = $this->getServiceervice()->getNews($this->limit);
$this->entities = $this->getServiceService()->getNews($this->limit);
// echo $this->getServiceervice()->getModel()->getLastQuery();
// 배열 초기화를 명시적으로 수행
$users = [];
$clients = [];
//전체 관리자정보(등록자)
$this->users = $this->getMemberService()->getEntities();
$clients = [];
$vpcs = [];
$kcss = [];
$cnt = 1;
foreach ($this->entitys as $entity) {
foreach ($this->entities as $entity) {
$serviceCode = $entity->getServiceCode();
//관리자정보(등록자)
$users[$serviceCode] = $entity->getMemberCode() ? $this->getMemberService()->getEntitById($entity->getMemberCode()) : "";
//고객정보
$clients[$serviceCode] = $this->getClientService()->getEntityByCode($entity->getClientCode());
//VPC정보
//해당 고객정보
$client = $this->getClientService()->getEntityByCode($entity->getClientCode());
if (!$client) {
throw new \Exception("{$entity->getClientCode()}에 해당하는 고객정보가 존재하지 않습니다.");
}
$clients[$serviceCode] = $client;
//VPC정보갯수
$vpcs[$serviceCode] = $this->getVPCService()->getCountByServiceCode($serviceCode);
//KCS정보
//KCS정보갯수
$kcss[$serviceCode] = $this->getKCSService()->getCountByServiceCode($serviceCode);
$cnt++;
}
// dd($this->entitys);
// 루프가 끝난 후 한번에 속성 할당
$this->users = $users;
$this->clients = $clients;
$this->vpcs = $vpcs;
$this->kcss = $kcss;
@ -155,23 +155,10 @@ class DashboardController extends BaseController
//신규서버정보
$this->limit = intval($limit);
$this->entitys = $this->getHistoryService()->getNews($this->limit);
// 배열 초기화를 명시적으로 수행
$services = [];
$clients = [];
foreach ($this->entitys as $entity) {
$pk = $entity->getPK();
//서비스정보가져오기
$service = $this->getServiceervice()->getEntityByCode($entity->getServiceCode());
if ($service) {
//고객정보
$clients[$pk] = $this->getClientService()->getEntityByCode($service->getClientCode());
//서비스정보
$services[$pk] = $service;
}
}
// 루프가 끝난 후 한번에 속성 할당
$this->services = $services;
$this->clients = $clients;
//전체 서비스정보
$this->services = $this->getServiceService()->getEntities();
//services 고객정보
$this->clients = $this->getClientService()->getEntities();
return $this->render(__FUNCTION__);
}
} //Class

View File

@ -28,24 +28,22 @@ class NavigatorController extends BaseController
//WEB 접속방법 : http://localhost/SiteController/extraservice/sitekey/dbms.prime-idc.jp/client_code/코드번호
public function ipsearch(): string
{
$clients = [];
//전체 고객정보
$this->clients = $this->getClientService()->getEntities();
$ip = $this->getRequest('ip');
//IP형식이 ipv4인지 확인 후 값가져오기
$services = [];
if ($ip && $this->helper->isIPAddress($ip)) {
$services = $this->getServiceervice()->getEntitysByIP($ip);
$this->getServiceService()->getModel()->where('service_ip', $ip);
$services[] = $this->getServiceService()->getEntity();
} elseif ($ip) {
$this->getServiceervice()->getModel()->like('service_ip', $ip);
$services = $this->getServiceervice()->getEntitys();
$this->getServiceService()->getModel()->like('service_ip', $ip);
$services = $this->getServiceService()->getEntities();
} else {
$services = $this->getServiceervice()->getEntitys();
}
foreach ($services as $service) {
$clients[$service->getPK()] = $this->getClientService()->getEntityByCode($service->getClientCode());
$services = $this->getServiceService()->getEntities();
}
$this->request = $this->getRequest();
$this->services = $services;
$this->clients = $clients;
return $this->render(__FUNCTION__);
}
} //Class

View File

@ -3,16 +3,14 @@
namespace lib\Controllers\DBMS;
use lib\Services\ClientService;
use lib\Services\AddDbService;
class PaymentController extends BaseController
{
private ?ClientService $_clientService = null;
public function __construct()
{
parent::__construct();
$this->getView()->setPath('service');
$this->getView()->setPath('payment');
} //
public function getClientService(): ClientService
{

View File

@ -45,20 +45,18 @@ class ServiceController extends BaseController
//해당 부가서비스의 services_code 목록 가져오기
//segment의 값이 한글인경우 urldecode가 필요
$service_codes = [];
$entitys = $this->getAddDbService()->getEntitysByCode(urldecode($adddb_code));
$entitys = $this->getAddDbService()->getEntityByCode(urldecode($adddb_code));
foreach ($entitys as $entity) {
$service_codes[] = $entity->getServiceCode();
}
if (!count($service_codes)) {
throw new \Exception("[{$adddb_code}] 값에 해당하는 부가서비스정보가 존재하지 않습니다.");
}
$clients = [];
$services = $this->getServiceervice()->getEntitysByCodes($service_codes);
foreach ($services as $service) {
$clients[$service->getPK()] = $this->getClientService()->getEntityByCode($service->getClientCode());
}
$this->services = $services;
$this->clients = $clients;
//부가서비스용 서비스목록 가져오기
$this->getServiceService()->getModel()->whereIn($service_codes);
$this->services = $this->getServiceService()->getEntities();
//전체 사용자정보
$this->clients = $this->getClientService()->getEntities();
return $this->render(__FUNCTION__);
}
} //Class

View File

@ -9,6 +9,7 @@ class ClientEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -20,5 +20,10 @@ class CommonEntity extends Core
$field = constant("static::TitleField");
return $this->$field;
}
public function getPairKey(): string
{
$field = constant("static::PairField");
return $this->$field;
}
//공통부분
} //Class

View File

@ -9,6 +9,7 @@ class HistoryEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -9,6 +9,7 @@ class KCSEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -9,6 +9,7 @@ class MemberEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -9,6 +9,7 @@ class ServiceEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -9,6 +9,7 @@ class VPCEntity extends Entity
{
const PKField = Model::PKField;
const TitleField = Model::TitleField;
const PairField = Model::PairField;
public function __construct($datas)
{
parent::__construct($datas);

View File

@ -9,6 +9,7 @@ class AddDbModel extends Model
const TABLE = "adddb";
const PKField = "addDB_num";
const TitleField = "addDB_case";
const PairField = "addDB_code";
public function __construct()
{
parent::__construct();

View File

@ -9,6 +9,7 @@ class ClientModel extends Model
const TABLE = "clientdb";
const PKField = "Client_Num";
const TitleField = "Client_Name";
const PairField = "Client_Code";
public function __construct()
{
parent::__construct();

View File

@ -24,4 +24,8 @@ abstract class CommonModel extends Core
{
return constant("static::TitleField");
}
final public function getPairField(): string
{
return constant("static::PairField");
}
} //Class

View File

@ -9,6 +9,7 @@ class HistoryModel extends Model
const TABLE = "historydb";
const PKField = "history_num";
const TitleField = "behavior";
const PairField = self::PKField;
public function __construct()
{
parent::__construct();

View File

@ -9,6 +9,7 @@ class KCSModel extends Model
const TABLE = "kcsdb";
const PKField = "kcs_num";
const TitleField = "kcs_code";
const PairField = self::TitleField;
public function __construct()
{
parent::__construct();

View File

@ -9,6 +9,7 @@ class MemberModel extends Model
const TABLE = "memberdb";
const PKField = "id";
const TitleField = "name";
const PairField = self::PKField;
public function __construct()
{
parent::__construct();

View File

@ -9,6 +9,7 @@ class ServiceModel extends Model
const TABLE = "servicedb";
const PKField = "service_num";
const TitleField = "service_code";
const PairField = self::TitleField;
public function __construct()
{
parent::__construct();

View File

@ -9,6 +9,7 @@ class VPCModel extends Model
const TABLE = "vpcdb";
const PKField = "vpc_num";
const TitleField = "vpc_code";
const PairField = self::TitleField;
public function __construct()
{
parent::__construct();

View File

@ -27,11 +27,9 @@ class AddDbService extends CommonService
{
return Entity::class;
}
public function getEntitysByCode(string $value): array
public function getEntityByCode(string $key): Entity|null
{
//AddDBService에서 해당코드의(닷디펜더,딥파인더 등) Service_Code를 가져와서 배열에 저장
$this->getModel()->select('DISTINCT(service_code) AS service_code');
$this->getModel()->where('AddDB_code', $value);
return $this->getEntitys();
$this->getModel()->where('addDB_code', $key);
return $this->getEntity();
}
}

View File

@ -27,9 +27,9 @@ class ClientService extends CommonService
{
return Entity::class;
}
public function getEntityByCode(string $value): mixed
public function getEntityByCode(string $key): Entity|null
{
$this->getModel()->where("Client_Code", $value);
$this->getModel()->where('Client_Code', $key);
return $this->getEntity();
}
}

View File

@ -31,12 +31,14 @@ abstract class CommonService extends Core
$entityClass = $this->getEntityClass();
return new $entityClass($result);
}
final public function getEntitys(): array
final public function getEntities(): array
{
$entitys = [];
foreach ($this->getModel()->getResults() as $result) {
$entityClass = $this->getEntityClass();
$entitys[] = new $entityClass($result);
$entity = new $entityClass($result);
$pairField = $this->getModel()->getPairField();
$entitys[$entity->$pairField] = $entity;
}
return $entitys;
} //

View File

@ -31,6 +31,6 @@ class HistoryService extends CommonService
{
$this->getModel()->orderBy($this->getModel()->getPKField(), 'DESC');
$this->getModel()->limit($limit);
return $this->getEntitys();
return $this->getEntities();
}
}

View File

@ -27,9 +27,4 @@ class MemberService extends CommonService
{
return Entity::class;
}
public function getEntitById(string $id): Entity
{
$this->getModel()->where($this->getModel()->getPKField(), $id);
return $this->getEntity();
}
}

View File

@ -27,22 +27,11 @@ class ServiceService extends CommonService
{
return Entity::class;
}
public function getEntityByCode(string $value): mixed
public function getEntityByCode(string $key): Entity|null
{
$this->getModel()->where("service_code", $value);
$this->getModel()->where('service_code', $key);
return $this->getEntity();
}
public function getEntitysByIP(string $value): mixed
{
$this->getModel()->where("service_ip", $value);
return $this->getEntitys();
}
public function getEntitysByCodes(array $values): array
{
$this->getModel()->whereIn('service_code', $values);
return $this->getEntitys();
}
public function getNewServerCount(int $day, array $excepts): int|string
{
$this->getModel()->where("service_open_date > DATE_ADD(now(), INTERVAL -{$day} DAY)");
@ -89,6 +78,6 @@ class ServiceService extends CommonService
{
$this->getModel()->orderBy($this->getModel()->getPKField(), 'DESC');
$this->getModel()->limit($limit);
return $this->getEntitys();
return $this->getEntities();
}
}

View File

@ -13,25 +13,25 @@
</tr>
</thead>
<tbody>
<?php foreach ($this->entitys as $entity): ?>
<?php foreach ($this->entities as $entity): ?>
<?php $this->entity = $entity ?>
<tr>
<td style="text-align:center;"><a href="/serviceDetailSolo.sev?client_code=<?= $entity->client_code ?>&service_code=<?= $entity->service_code ?>"><?= $entity->service_code ?></a></td>
<td style="text-align:center;"><a href="/serviceDetailSolo.sev?client_code=<?= $entity->getClientCode() ?>&service_code=<?= $entity->getServiceCode() ?>"><?= $entity->getServiceCode() ?></a></td>
<td style="text-align:center;">
<nobr style=" display:block;"><?= $this->clients[$entity->getServiceCode()]->getTitle() ?></nobr>
</td>
<td style="text-align:center;"><?= $entity->service_line ?></td>
<td style="text-align:center;">
<nobr style=" display:block;"><?= $entity->service_code ?></nobr>
<nobr style=" display:block;"><?= $entity->getServiceCode() ?></nobr>
</td>
<td style="text-align:center;">
<nobr style=" display:block;"><?= $entity->service_sw ?></nobr>
</td>
<td style="text-align:center;"><?= $entity->service_ip ?></td>
<td style="text-align:center;">
<a href="/vpcInfo.sev?client_code=<?= $entity->client_code ?>&csInfoFlag=true&service_code=<?= $entity->service_code ?>"><?= $this->vpcs[$entity->getServiceCode()] ?></a>
<a href="/vpcInfo.sev?client_code=<?= $entity->getClientCode() ?>&csInfoFlag=true&service_code=<?= $entity->getServiceCode() ?>"><?= $this->vpcs[$entity->getServiceCode()] ?></a>
/
<a href="/vpcInfo.sev?client_code=<?= $entity->client_code ?>&csInfoFlag=true&service_code=<?= $entity->service_code ?>"><?= $this->kcss[$entity->getServiceCode()] ?></a>
<a href="/vpcInfo.sev?client_code=<?= $entity->getClientCode() ?>&csInfoFlag=true&service_code=<?= $entity->getServiceCode() ?>"><?= $this->kcss[$entity->getServiceCode()] ?></a>
</td>
<td style="text-align:center;"><?= !$this->users[$entity->getServiceCode()] ? "" : $this->users[$entity->getServiceCode()]->getTitle() ?></td>
<td>

View File

@ -105,13 +105,13 @@
<?php foreach ($this->services as $service) { ?>
<tr>
<td><?= $service->getClientCode() ?></td>
<td><?= $this->clients[$service->getPK()]->getTitle() ?></td>
<td><?= $this->clients[$service->getClientCode()]->getTitle() ?></td>
<td><?= $service->getServerCode() ?></td>
<td><?= $service->service_ip ?></td>
<td><?= $service->service_os ?></td>
<td><?= $service->service_sw ?></td>
<td><?= $this->clients[$service->getPK()]->getPhone() ?></td>
<td><?= $this->clients[$service->getPK()]->getEmail() ?></td>
<td><?= $this->clients[$service->getClientCode()]->getPhone() ?></td>
<td><?= $this->clients[$service->getClientCode()]->getEmail() ?></td>
</tr>
<?php } ?>
</tbody>

View File

@ -1,11 +1,11 @@
<div class="content-responsive">
<p> 청구서를 받으셨던 서버인 경우에도 발행하는 시점까지 미납인 경우 발행됩니다. 입금을 하신 경우에는 연락 부탁드립니다.</p>
<p>입금 하실 계좌 번호 입니다.</p>
<?php foreach ($this->accounts as $account) { ?>
<?php foreach ($this->siteInfo['banks'] as $bank) { ?>
<div style="margin-top:20px; margin-bottom:20px; color:red;">
은행명 : <?= $account['name'] ?><br>
계좌번호 : <?= $account['id'] ?><br>
예금주: <?= $account['owner'] ?>
은행명 : <?= $bank['name'] ?><br>
계좌번호 : <?= $bank['id'] ?><br>
예금주: <?= $bank['owner'] ?>
</div>
<?php } ?>
<p>고객명과 입금자명이 상이한 경우 반드시 확인 연락이 필요합니다.<br />
@ -35,12 +35,12 @@
보장 트래픽 이상을 사용할 경우 트래픽 과금이 발생할 있습니다<br />
<p> 알림(필히 숙지 하여 주시기 바랍니다.) <br />
<br />
1. <?= $this->site['Title'] ?>에 등록 하신 고객명 / 전화번호 / 메일 주소는 차후 고객님 확인을 위해 사용 되니 고객님께서도 필히 알고 계셔야 합니다. <br />
또한 전화번호와 메일주소 또는 메신져는 <?= $this->site['Title'] ?>에서 고객님에게 연락을 취해야 할 경우 사용됩니다.변동사항이 있을 경우에는 <br />
반드시 <?= $this->site['Title'] ?>에 연락을 하여 변경해 주시기 바랍니다.
1. <?= $this->siteInfo['name'] ?>에 등록 하신 고객명 / 전화번호 / 메일 주소는 차후 고객님 확인을 위해 사용 되니 고객님께서도 필히 알고 계셔야 합니다. <br />
또한 전화번호와 메일주소 또는 메신져는 <?= $this->siteInfo['name'] ?>에서 고객님에게 연락을 취해야 할 경우 사용됩니다.변동사항이 있을 경우에는 <br />
반드시 <?= $this->siteInfo['name'] ?>에 연락을 하여 변경해 주시기 바랍니다.
</p>
<p> 변동사항을 <?= $this->site['Title'] ?>에게 알려 주시지 않거나, <?= $this->site['Title'] ?>에 등록된 연락처로 연락을 해도 연결이 안되어 발생하는 피해에 대해서는<br />
저희 <?= $this->site['Title'] ?>에서 책임을 지지 않습니다. </p>
<p> 변동사항을 <?= $this->siteInfo['name'] ?>에게 알려 주시지 않거나, <?= $this->siteInfo['name'] ?>에 등록된 연락처로 연락을 해도 연결이 안되어 발생하는 피해에 대해서는<br />
저희 <?= $this->siteInfo['name'] ?>에서 책임을 지지 않습니다. </p>
<p>2. 결제는 납부기한내에 주셔야 합니다.<br />
혹시라도 납부기한내에 결제를 하지 못하실 경우는 미리 연락을 주시면 납부기한 최대 3일간은 서버 접속이 유지됩니다.<br />
하지만 납부기한까지 연락을 안주시거나 연락을 하셨더라도 납부기한을 3 초과하시면 서버 접속이 차단되고 차단후에도 <br />
@ -49,7 +49,7 @@
월단위 계약(계산)이므로 중도 <font color="#FF0000">환불(일할계산) 안됩니다.</font><br />
, 셋팅에 문제가 있거나 기타 문제가 있을 경우 서버를 인계 받으시고 <font color="#FF0000">3 안으로는 환불 요청을 하실 있습니다.</font>
</p>
<p>4. 서버 운영중 해킹으로 발생한 피해는 저희 <?= $this->site['Title'] ?>에서 책임을 지지 않습니다.<br />
<p>4. 서버 운영중 해킹으로 발생한 피해는 저희 <?= $this->siteInfo['name'] ?>에서 책임을 지지 않습니다.<br />
서버운영에 있어서 보안에 각별히 주의 부탁드리겠습니다.<br />
&lt;해킹 대비 보안조치사항&gt; <br />
- 주기적인 window 보안 업데이트<br />
@ -62,7 +62,7 @@
- 원격접속 포트 기본포트에서 변경 설정 (기본 포트 window : 3389 / linux : 22 )<br />
<!--
- 폴더eye 설치<br />
* 센터 자체 개발프로그램 : foldereye.<?= $this->site['Title'] ?>.jp 에서 다운로드<br />
* 센터 자체 개발프로그램 : foldereye.<?= $this->siteInfo['name'] ?> 에서 다운로드<br />
* 서버내 파일 복사,삭제, 변경시 알람메일 발송<br />
* 알람 발생시 센터로 신속히 연락<br />
-->
@ -71,9 +71,9 @@
<!-- * 유료 설치 : AVG Business Server Edition 설치<br /> -->
- 웹서비스 보안을 위한 웹방화벽 설치 대행서비스(유료)
</p>
<p> # 원격포트 변경 및 원격접속 제한 설정은 <?= $this->site['Title'] ?>홈페이지에 등록되어 있습니다.<br />
<p> # 원격포트 변경 및 원격접속 제한 설정은 <?= $this->siteInfo['name'] ?>홈페이지에 등록되어 있습니다.<br />
자세한 사항은 센터로 문의주시기 바랍니다.</p>
<p>5. 서버 운영중 장비부품 문제(:하드디스크의 고장 ) 발생한 피해는 저희 <?= $this->site['Title'] ?>에서 책임을 지지 않습니다.<br />
<p>5. 서버 운영중 장비부품 문제(:하드디스크의 고장 ) 발생한 피해는 저희 <?= $this->siteInfo['name'] ?>에서 책임을 지지 않습니다.<br />
(요청하시면 백업을 위해 무료로 추가 하드를 제공해 드리고 있지만, 추가가 불가능한 경우도 있습니다.<br />
번거로우시더라도 주기적인 데이터백업을 부탁드리겠습니다.) </p>
</div>

View File

@ -21,9 +21,9 @@
</tr>
</thead>
<tbody>
<?php foreach ($this->services as $service) { ?>
<?php foreach ($this->services as $key => $service) { ?>
<tr>
<td><?= $this->clients[$service->getPK()]->getTitle() ?></td>
<td><?= $this->clients[$service->getPairKey()]->getTitle() ?></td>
<td><?= $service->getServerCode() ?></td>
<td><?= $service->service_ip ?></td>
<td><?= $service->service_os ?></td>