dbmsv2_init...1

This commit is contained in:
choi.jh 2025-09-30 14:05:14 +09:00
parent a68c539ec0
commit d84c355c59
34 changed files with 941 additions and 826 deletions

View File

@ -0,0 +1,32 @@
<?php
namespace App\Cells\Customer;
use App\Services\PaymentService;
class PaymentCell extends CustomerCell
{
public function __construct()
{
parent::__construct(new PaymentService());
}
public function detail(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$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(),
'entities' => $entities,
]
]);
}
}

View File

@ -217,6 +217,7 @@ define('ICONS', [
'POINT' => '<i class="bi bi-coin"></i>', 'POINT' => '<i class="bi bi-coin"></i>',
'ALRAM' => '<i class="bi bi-bell"></i>', 'ALRAM' => '<i class="bi bi-bell"></i>',
'PAYMENT' => '<i class="bi bi-credit-card-2-back"></i>', 'PAYMENT' => '<i class="bi bi-credit-card-2-back"></i>',
'LINK' => '<i class="bi bi-link-45deg"></i>',
'SALE_UP' => '<i class="bi bi-graph-up-arrow"></i>', 'SALE_UP' => '<i class="bi bi-graph-up-arrow"></i>',
'SALE_DOWN' => '<i class="bi bi-graph-down-arrow"></i>', 'SALE_DOWN' => '<i class="bi bi-graph-down-arrow"></i>',
'SERVICE' => '<i class="bi bi-gear-wide-connected"></i>', 'SERVICE' => '<i class="bi bi-gear-wide-connected"></i>',

View File

@ -141,7 +141,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'PaymentController::batchjob'); $routes->post('batchjob', 'PaymentController::batchjob');
$routes->post('batchjob_delete', 'PaymentController::batchjob_delete'); $routes->post('batchjob_delete', 'PaymentController::batchjob_delete');
$routes->get('download/(:alpha)', 'PaymentController::download/$1'); $routes->get('download/(:alpha)', 'PaymentController::download/$1');
$routes->post('invoice', 'PaymentController::invoice', []); $routes->post('invoice', 'PaymentController::invoice');
}); });
}); });
//Customer 관련 //Customer 관련

View File

@ -117,4 +117,13 @@ class PaymentController extends CustomerController
return $this->getResultFail($e->getMessage()); return $this->getResultFail($e->getMessage());
} }
} }
protected function create_form_process(): void
{
$formDatas = $this->getService()->getFormDatas();
$formDatas['billing'] = PAYMENT['BILLING']['ONETIME'];
$formDatas['billing_at'] = date("Y-m-d");
$this->getService()->setFormDatas($formDatas);
parent::create_form_process();
}
} }

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -17,18 +17,18 @@ class ServiceEntity extends CustomerEntity
$this->attributes['serverEntity'] = $entity; $this->attributes['serverEntity'] = $entity;
return $this; return $this;
} }
final public function getServerEntity(): ServerEntity final public function getServerEntity(): ServerEntity|null
{ {
return $this->attributes['serverEntity']; return $this->attributes['serverEntity'] ?? null;
} }
final public function setPaymentEntity(PaymentEntity $entity): self final public function setPaymentEntity(PaymentEntity $entity): self
{ {
$this->attributes['paymentEntity'] = $entity; $this->attributes['paymentEntity'] = $entity;
return $this; return $this;
} }
final public function getPaymentEntity(): PaymentEntity final public function getPaymentEntity(): PaymentEntity|null
{ {
return $this->attributes['paymentEntity']; return $this->attributes['paymentEntity'] ?? null;
} }
final public function getUserUID(): string final public function getUserUID(): string
{ {

View File

@ -24,9 +24,9 @@ class ServerPartEntity extends EquipmentEntity
$this->attributes['paymentEntity'] = $entity; $this->attributes['paymentEntity'] = $entity;
return $this; return $this;
} }
final public function getPaymentEntity(): PaymentEntity final public function getPaymentEntity(): PaymentEntity|null
{ {
return $this->attributes['paymentEntity']; return $this->attributes['paymentEntity'] ?? null;
} }
public function getPartUID(): int public function getPartUID(): int
{ {

View File

@ -9,4 +9,9 @@ class DISKEntity extends PartEntity
const PK = DISKModel::PK; const PK = DISKModel::PK;
const TITLE = DISKModel::TITLE; const TITLE = DISKModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE']; const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getFormat(): int
{
return intval($this->attributes['format'] ?? 0);
}
} }

View File

@ -39,6 +39,10 @@ class PaymentEntity extends CommonEntity
{ {
return $this->attributes['pay'] ?? ""; return $this->attributes['pay'] ?? "";
} }
public function getContent(): string
{
return $this->attributes['content'] ?? "";
}
public function getCountDueAt(): string public function getCountDueAt(): string
{ {
$result = ""; $result = "";

View File

@ -322,6 +322,11 @@ class CommonHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {
case 'clientinfo_uid':
if (array_key_exists($value, $viewDatas['control']['field_optons'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
}
break;
case 'role': case 'role':
$roles = []; $roles = [];
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) { foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {

View File

@ -14,6 +14,9 @@ class ClientHelper extends CustomerHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {
case 'name':
$value = "<a href=\"/admin/customer/client/detail/{$viewDatas['entity']->getPK()}\">" . $value . "</a>";
break;
case "email": case "email":
case "phone": case "phone":
$value = $this->getMyAuth()->isAccessRole(['security']) ? parent::getFieldView($field, $value, $viewDatas, $extras) : "***********"; $value = $this->getMyAuth()->isAccessRole(['security']) ? parent::getFieldView($field, $value, $viewDatas, $extras) : "***********";

View File

@ -74,11 +74,6 @@ class ServiceHelper extends CustomerHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {
case 'clientinfo_uid':
if (array_key_exists($value, $viewDatas['control']['field_optons'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
}
break;
case 'amount': case 'amount':
$value = number_format($value) . ""; $value = number_format($value) . "";
break; break;
@ -113,7 +108,7 @@ class ServiceHelper extends CustomerHelper
case 'alternative': case 'alternative':
$extras = ["class" => "btn btn-outline btn-info btn-circle", "target" => "_self", ...$extras]; $extras = ["class" => "btn btn-outline btn-info btn-circle", "target" => "_self", ...$extras];
$action = form_label( $action = form_label(
$label ? $label : ICONS['SETUP'], $label ? $label : ICONS['REBOOT'],
$action, $action,
[ [
"data-src" => "/admin/customer/service/alternative/{$viewDatas['entity']->getPK()}", "data-src" => "/admin/customer/service/alternative/{$viewDatas['entity']->getPK()}",
@ -123,6 +118,19 @@ class ServiceHelper extends CustomerHelper
] ]
); );
break; break;
case 'onetime':
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['ONETIME'],
$action,
[
"data-src" => "/admin/customer/payment/create?serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
]
);
break;
case 'history': case 'history':
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras]; $extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
$action = form_label( $action = form_label(

View File

@ -40,11 +40,6 @@ class ServerHelper extends EquipmentHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{ {
switch ($field) { switch ($field) {
case 'clientinfo_uid':
if (array_key_exists($value, $viewDatas['control']['field_optons'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
}
break;
case 'title': case 'title':
$value = parent::getFieldView($field, $value, $viewDatas, $extras); $value = parent::getFieldView($field, $value, $viewDatas, $extras);
break; break;

View File

@ -5,6 +5,7 @@ return [
'title' => "모델명", 'title' => "모델명",
'price' => "기본가", 'price' => "기본가",
'stock' => "재고", 'stock' => "재고",
'format' => "포맷",
'status' => "상태", 'status' => "상태",
'updated_at' => "수정일", 'updated_at' => "수정일",
'created_at' => "작성일", 'created_at' => "작성일",

View File

@ -6,6 +6,7 @@ return [
'clientinfo_uid' => "고객", 'clientinfo_uid' => "고객",
'serviceinfo_uid' => "서비스", 'serviceinfo_uid' => "서비스",
'title' => "청구항목", 'title' => "청구항목",
'content' => "내용",
'amount' => "청구금액", 'amount' => "청구금액",
'billing' => "청구방법", 'billing' => "청구방법",
'billing_at' => "지급기한일", 'billing_at' => "지급기한일",

View File

@ -17,6 +17,7 @@ class DISKModel extends PartModel
"title", "title",
"price", "price",
"stock", "stock",
"format",
"status", "status",
"updated_at" "updated_at"
]; ];

View File

@ -18,6 +18,7 @@ class PaymentModel extends CommonModel
"serviceinfo_uid", "serviceinfo_uid",
"serverpartinfo_uid", "serverpartinfo_uid",
"title", "title",
"content",
"amount", "amount",
"billing", "billing",
"billing_at", "billing_at",
@ -53,6 +54,7 @@ class PaymentModel extends CommonModel
$rule = "required|valid_date"; $rule = "required|valid_date";
break; break;
case "pay": case "pay":
case "content":
$rule = "permit_empty|trim|string"; $rule = "permit_empty|trim|string";
break; break;
default: default:

View File

@ -333,22 +333,9 @@ class ServerPartService extends EquipmentService implements ServerInterface
$entity = parent::delete($entity); $entity = parent::delete($entity);
//Type에 따른 부품서비스 정의 //Type에 따른 부품서비스 정의
$this->getPartService($entity->getType())->unSetServerPart($entity, []); $this->getPartService($entity->getType())->unSetServerPart($entity, []);
//서비스 및 결제정보 처리 //삭제시는 월비용 서비스만 처리
switch ($entity->getBilling()) { if ($entity->getBilling() === PAYMENT['BILLING']['MONTH']) {
case PAYMENT['BILLING']['MONTH']: //월별과금일때만 처리
$entity = $this->getServiceService()->unSetServerPart($entity, []); $entity = $this->getServiceService()->unSetServerPart($entity, []);
break;
case PAYMENT['BILLING']['ONETIME']: //일회성일때만 처리
$entity = $this->getPaymentService()->unSetServerPart($entity, []);
//결제정보PK정의
$entity = parent::modify($entity, ['payment_uid' => $entity->getPaymentEntity()->getPK()]);
break;
case PAYMENT['BILLING']['BASE']: //기본처리
//아무처리 않함
break;
default:
throw new \Exception(__METHOD__ . "에서 오류발생:{$entity->getBilling()}은 지정되지 않은 결제방식입니다.");
// break;
} }
return $entity; return $entity;
} }
@ -372,7 +359,6 @@ class ServerPartService extends EquipmentService implements ServerInterface
switch ($serverPartEntity->getType()) { switch ($serverPartEntity->getType()) {
case 'CPU': case 'CPU':
case 'RAM': case 'RAM':
case 'DISK':
//기본이 아닌 결제방식의 경우 모두 회수처리 //기본이 아닌 결제방식의 경우 모두 회수처리
if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['BASE']) { if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['BASE']) {
//Type에 따른 부품서비스 정의 //Type에 따른 부품서비스 정의
@ -381,7 +367,7 @@ class ServerPartService extends EquipmentService implements ServerInterface
parent::delete($serverPartEntity); parent::delete($serverPartEntity);
} }
break; break;
default: //IP,SWITCH,CS,SOFTWARE,OS등은 모두 회수처리 default: //DISK,IP,SWITCH,CS,SOFTWARE,OS등은 모두 회수처리
$this->getPartService($serverPartEntity->getType())->unSetServerPart($serverPartEntity, []); $this->getPartService($serverPartEntity->getType())->unSetServerPart($serverPartEntity, []);
//서버연결정보 식제 //서버연결정보 식제
parent::delete($serverPartEntity); parent::delete($serverPartEntity);

View File

@ -154,14 +154,6 @@ class ServerService extends EquipmentService implements ServiceInterface
} }
return $formDatas; return $formDatas;
} }
//Action 기능
private function action_process(ServerEntity $entity, string $action): ServerEntity
{
//서비스정보수정(청구액수정)
$entity = $this->getServiceService()->$action($entity);
$entity = $this->getServerPartService()->$action($entity);
return $entity;
}
public function create(array $formDatas): ServerEntity public function create(array $formDatas): ServerEntity
{ {
$entity = parent::create($formDatas); $entity = parent::create($formDatas);
@ -182,6 +174,10 @@ class ServerService extends EquipmentService implements ServiceInterface
//삭제 //삭제
public function delete(mixed $entity): ServerEntity public function delete(mixed $entity): ServerEntity
{ {
//서비스중인지 확인
if ($entity->getServiceInfoUID() !== null || $entity->getStatus() === STATUS['OCCUPIED']) {
throw new \Exception("서비스중이 서버는 삭제하실수 없습니다.");
}
//선처리작업 //선처리작업
$entity = $this->getServerPartService()->unsetServer($entity, []);; $entity = $this->getServerPartService()->unsetServer($entity, []);;
return parent::delete($entity); return parent::delete($entity);
@ -235,7 +231,7 @@ class ServerService extends EquipmentService implements ServiceInterface
throw new \Exception("서비스를 해지할 서버정보가 없습니다."); throw new \Exception("서비스를 해지할 서버정보가 없습니다.");
} }
if ($serviceEntity->getServerEntity()->getPK() === $serviceDatas['serverinfo_uid']) { if ($serviceEntity->getServerEntity()->getPK() === $serviceDatas['serverinfo_uid']) {
throw new \Exception("Main으로 설정된 서버는 해지하실 수 습니다."); throw new \Exception("Main으로 설정된 서버는 해지하실 수 습니다.");
} }
$entity = $this->getEntity($serviceDatas['serverinfo_uid']); $entity = $this->getEntity($serviceDatas['serverinfo_uid']);
if (!$entity instanceof ServerEntity) { if (!$entity instanceof ServerEntity) {

View File

@ -22,6 +22,7 @@ class DISKService extends PartService implements ServerPartInterface
"title", "title",
"price", "price",
"stock", "stock",
"format",
"status", "status",
]; ];
} }
@ -37,6 +38,7 @@ class DISKService extends PartService implements ServerPartInterface
"title", "title",
"price", "price",
"stock", "stock",
"format",
"status", "status",
]; ];
} }
@ -70,7 +72,6 @@ class DISKService extends PartService implements ServerPartInterface
} }
public function changeServerPart(ServerPartEntity $oldServerPartEntity, ServerPartEntity $serverPartEntity, array $serverPartDatas): ServerPartEntity public function changeServerPart(ServerPartEntity $oldServerPartEntity, ServerPartEntity $serverPartEntity, array $serverPartDatas): ServerPartEntity
{ {
//수정 전 부품연결정보관련 정보처리 갯수,파트가 달라졌을경우 (회수 -> 사용 처리) //수정 전 부품연결정보관련 정보처리 갯수,파트가 달라졌을경우 (회수 -> 사용 처리)
//기존것 회수 처리 //기존것 회수 처리
if ($oldServerPartEntity->getCnt() != $serverPartEntity->getCnt() || $oldServerPartEntity->getPartUID() !== $serverPartEntity->getPartUID()) { if ($oldServerPartEntity->getCnt() != $serverPartEntity->getCnt() || $oldServerPartEntity->getPartUID() !== $serverPartEntity->getPartUID()) {
@ -86,7 +87,7 @@ class DISKService extends PartService implements ServerPartInterface
if (!$entity instanceof DISKEntity) { if (!$entity instanceof DISKEntity) {
throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다."); throw new \Exception("{$serverPartEntity->getPartUID()}에 해당하는 부품정보를 찾을수없습니다.");
} }
$entity = parent::modify($entity, ['stock' => $entity->getStock() + $serverPartEntity->getCnt()]); $entity = parent::modify($entity, ['format' => $entity->getFormat() + $serverPartEntity->getCnt()]);
return $serverPartEntity->setPartEntity($entity); return $serverPartEntity->setPartEntity($entity);
} }
} }

View File

@ -29,14 +29,12 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
final public function getFormFields(): array final public function getFormFields(): array
{ {
return [ return [
"clientinfo_uid",
"serviceinfo_uid", "serviceinfo_uid",
"title", "title",
"amount", "amount",
"billing", "billing",
"billing_at", "billing_at",
"pay", "content"
"status",
]; ];
} }
final public function getFormFilters(): array final public function getFormFilters(): array
@ -135,6 +133,19 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
return $options; return $options;
} }
//Action 기능 //Action 기능
public function create(array $formDatas): PaymentEntity
{
if (!array_key_exists('serviceinfo_uid', $formDatas)) {
throw new \Exception("서비스정보가 없습니다.");
}
//결제정보 가져오기
$serviceEntity = $this->getServiceService()->getEntity($formDatas['serviceinfo_uid']);
if (!$serviceEntity instanceof ServiceEntity) {
throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보[{$formDatas['serviceinfo_uid']}]를 찾을수 없습니다.");
}
$formDatas['clientinfo_uid'] = $serviceEntity->getClientInfoUID();
return parent::create($formDatas);
}
//List 검색용 //List 검색용
//OrderBy 처리 //OrderBy 처리
final public function setOrderBy(mixed $field = null, mixed $value = null): void final public function setOrderBy(mixed $field = null, mixed $value = null): void
@ -194,10 +205,6 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
if ($serverPartEntity->getServiceInfoUID() === null) { if ($serverPartEntity->getServiceInfoUID() === null) {
throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다."); throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다.");
} }
//일회인이 아닌경우
if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['ONETIME']) {
throw new \Exception(__METHOD__ . "에서 오류발생: :" . lang("{$this->getClassName()}.BILLING." . PAYMENT['BILLING'][$serverPartEntity->getBilling()]) . "지급 상품은 처리가 불가, 일회성만 가능합니다.");
}
$formDatas = []; $formDatas = [];
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID(); $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
$formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID(); $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID();
@ -218,10 +225,11 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['ONETIME']) { if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['ONETIME']) {
throw new \Exception("[{$serverPartEntity->getBilling()}],청구방식이 일회성이 아닙니다."); throw new \Exception("[{$serverPartEntity->getBilling()}],청구방식이 일회성이 아닙니다.");
} }
//결제정보 가져오기 //기존 결제정보 가져오기
$entity = $serverPartEntity->getPaymentEntity(); $entity = $serverPartEntity->getPaymentEntity();
//기존 결제정보가 없다면 신규입력으로 처리
if (!$entity instanceof PaymentEntity) { if (!$entity instanceof PaymentEntity) {
throw new \Exception(__METHOD__ . "에서 오류발생: 서버파트연결정보{$serverPartEntity->getPK()}]에 해당하는 결제정보를 찾을수 없습니다."); return $this->setServerPart($serverPartEntity, $serverPartDatas);
} }
//미납상태확인 //미납상태확인
if ($entity->getStatus() !== STATUS['UNPAID']) { if ($entity->getStatus() !== STATUS['UNPAID']) {
@ -230,10 +238,6 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
if ($serverPartEntity->getServiceInfoUID() === null) { if ($serverPartEntity->getServiceInfoUID() === null) {
throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다."); throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다.");
} }
//일회인이 아닌경우
if ($serverPartEntity->getBilling() !== PAYMENT['BILLING']['ONETIME']) {
throw new \Exception(__METHOD__ . "에서 오류발생: :" . lang("{$this->getClassName()}.BILLING." . PAYMENT['BILLING'][$serverPartEntity->getBilling()]) . "지급 상품은 처리가 불가, 일회성만 가능합니다.");
}
$formDatas = []; $formDatas = [];
$formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID(); $formDatas['clientinfo_uid'] = $serverPartEntity->getClientInfoUID();
$formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID(); $formDatas['serviceinfo_uid'] = $serverPartEntity->getServiceInfoUID();
@ -247,7 +251,8 @@ class PaymentService extends CommonService implements ServiceInterface, ServerPa
//결제정보수정 //결제정보수정
$entity = $this->getModel()->modify($entity, $formDatas); $entity = $this->getModel()->modify($entity, $formDatas);
//서버연결정보 Entity에 결제정보 설정 //서버연결정보 Entity에 결제정보 설정
return $serverPartEntity->setPaymentEntity($entity); $serverPartEntity->setPaymentEntity($entity);
return $serverPartEntity;
} }
public function unsetServerPart(ServerPartEntity $serverPartEntity, array $serverPartDatas): ServerPartEntity public function unsetServerPart(ServerPartEntity $serverPartEntity, array $serverPartDatas): ServerPartEntity
{ {

View File

@ -81,6 +81,7 @@
</div> </div>
<?= form_close() ?> <?= form_close() ?>
<?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['clientinfo_uid' => $viewDatas['entity']->getPK()]) ?> <?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['clientinfo_uid' => $viewDatas['entity']->getPK()]) ?>
<?= view_cell("\App\Cells\Customer\PaymentCell::detail", ['clientinfo_uid' => $viewDatas['entity']->getPK()]) ?>
</div> </div>
<!-- index_body --> <!-- index_body -->
</div> </div>

View File

@ -104,8 +104,7 @@
<?= form_close() ?> <?= form_close() ?>
</div> </div>
</div> </div>
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?> <div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
</div>
<!-- Layout Right End --> <!-- Layout Right End -->
</td> </td>
</tr> </tr>

View File

@ -85,6 +85,7 @@
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td> <td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
<td nowrap> <td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('alternative', '', $viewDatas) ?>&nbsp; <?= $viewDatas['service']->getHelper()->getListButton('alternative', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('onetime', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp; <?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?> <?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
</td> </td>
@ -97,8 +98,7 @@
<?= form_close() ?> <?= form_close() ?>
</div> </div>
</div> </div>
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?> <div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
</div>
<!-- Layout Right End --> <!-- Layout Right End -->
</td> </td>
</tr> </tr>

View File

@ -32,5 +32,6 @@
</tr> </tr>
</table> </table>
<!-- Layout Middle End --> <!-- Layout Middle End -->
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div> <div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -8,9 +8,19 @@
</ul> </ul>
</div> </div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;"> <div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table"> <table class="table table-bordered table-striped">
<?= view_cell("\App\Cells\Part\RAMCell::stock") ?> <tr>
<?= view_cell("\App\Cells\Part\DISKCell::stock") ?> <th width="20%">메모리</th>
<th width="20%">저장장치</th>
<th width="30%">서버</th>
<th width="30%">데스크탑</th>
</tr>
<tr>
<td><?= view_cell("\App\Cells\Part\RAMCell::stock") ?></td>
<td><?= view_cell("\App\Cells\Part\DISKCell::stock") ?></td>
<td>준비중...</td>
<td>준비중...</td>
</tr>
</table> </table>
</div> </div>
<div class="layout_footer"></div> <div class="layout_footer"></div>

View File

@ -1,7 +1,15 @@
<?php foreach ($partCellDatas['entities'] as $entity): ?> <table class="table table-bordered table-hover table-striped">
<tr>
<th>항목</th>
<th>갯수</th>
<th>포맷</th>
</tr>
<?php foreach ($partCellDatas['entities'] as $entity): ?>
<?php $partCellDatas['entity'] = $entity; ?> <?php $partCellDatas['entity'] = $entity; ?>
<?php foreach (['title', 'stock'] as $field): ?> <tr>
<td><?= $partCellDatas['service']->getHelper()->getFieldView($field, $entity->$field, $partCellDatas) ?></td> <?php foreach (['title', 'stock', 'format'] as $field): ?>
<td nowrap><?= $partCellDatas['service']->getHelper()->getFieldView($field, $entity->$field, $partCellDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</table>

View File

@ -1,7 +1,14 @@
<?php foreach ($partCellDatas['entities'] as $entity): ?> <table class="table table-bordered table-hover table-striped">
<tr>
<th>항목</th>
<th>갯수</th>
</tr>
<?php foreach ($partCellDatas['entities'] as $entity): ?>
<?php $partCellDatas['entity'] = $entity; ?> <?php $partCellDatas['entity'] = $entity; ?>
<tr>
<?php foreach (['title', 'stock'] as $field): ?> <?php foreach (['title', 'stock'] as $field): ?>
<td><?= $partCellDatas['service']->getHelper()->getFieldView($field, $entity->$field, $partCellDatas) ?></td> <td nowrap><?= $partCellDatas['service']->getHelper()->getFieldView($field, $entity->$field, $partCellDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
<?php endforeach ?> <?php endforeach ?>
</table>

View File

@ -0,0 +1,24 @@
<div class="rounded border border-gray p-2 mt-3">
<div style="font-size:15px">미지급 1회성정보</div>
<table class="table table-bordered table-hover table-striped">
<tr class="text-center">
<th style="width: 250px">서비스</th>
<th style="width: 120px">날자</th>
<th style="width: 120px">결제금액</th>
<th style="width: 250px">항목</th>
<th style="width: 250px">내용</th>
<th style="width: 250px">처리자</th>
</tr>
<?php foreach ($serviceCellDatas['entities'] as $entity): ?>
<?php $serviceCellDatas['entity'] = $entity ?>
<tr class="text-left">
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $serviceCellDatas) ?></td>
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('create_at', $entity->getCreatedAt(), $serviceCellDatas) ?></td>
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?></td>
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?></td>
<td class="text-start"><?= $serviceCellDatas['service']->getHelper()->getFieldView('content', nl2br($entity->getContent()), $serviceCellDatas) ?></td>
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?></td>
</tr>
<?php endforeach; ?>
</table>
</div>

View File

@ -10,14 +10,14 @@
<?php endforeach ?> <?php endforeach ?>
<?php endforeach ?> <?php endforeach ?>
<?php endforeach ?> <?php endforeach ?>
<?php $view_htmls = [] ?>
<?php foreach ($htmls as $type => $datas): ?>
<?php $view_htmls[] = $serverPartCellDatas['service']->getHelper()->getListButton($type, '', $serverPartCellDatas) . implode(",", $datas) ?>
<?php endforeach ?>
<?= implode(" / ", $view_htmls) ?>
<?php $view_texts = [] ?> <?php $view_texts = [] ?>
<?php foreach ($htmls as $type => $datas): ?> <?php foreach ($htmls as $type => $datas): ?>
<?php $view_texts[] = implode(',', $texts[$type]) ?> <?php $view_texts[] = implode(',', $texts[$type]) ?>
<?php endforeach ?> <?php endforeach ?>
<?php $text = implode(" / ", $view_texts) ?> <?php $text = implode(" / ", $view_texts) ?>
<span class="serverparts float-start rounded border border-primary" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span> <span class="rounded border border-primary" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span>
<?php $view_htmls = [] ?>
<?php foreach ($htmls as $type => $datas): ?>
<?php $view_htmls[] = $serverPartCellDatas['service']->getHelper()->getListButton($type, '', $serverPartCellDatas) . implode(",", $datas) ?>
<?php endforeach ?>
<?= implode(" / ", $view_htmls) ?>

View File

@ -18,10 +18,10 @@
<?php foreach ($texts as $type => $datas): ?> <?php foreach ($texts as $type => $datas): ?>
<?php $view_texts[] = implode(',', $datas) ?> <?php $view_texts[] = implode(',', $datas) ?>
<?php endforeach ?> <?php endforeach ?>
<?php $text = implode(" / ", $view_texts) ?>
<div class="text-nowrap"> <div class="text-nowrap">
<?php $text = implode(" / ", $view_texts) ?>
<span class="rounded border border-primary" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span>
<?= implode(" / ", $view_htmls) ?> <?= implode(" / ", $view_htmls) ?>
<span class="serverparts float-start" style="cursor:pointer;" onClick="copyServerPartToClipboard('<?= $text ?>')" text-data="<?= $text ?>">📋</span>
<?php if ($serverPartCellDatas['serverEntity']): ?> <?php if ($serverPartCellDatas['serverEntity']): ?>
<a href="/admin/customer/service/terminate/<?= $serverPartCellDatas['serverEntity']->getServiceInfoUID() ?>?serverinfo_uid=<?= $serverPartCellDatas['serverEntity']->getPK() ?>"></a> <a href="/admin/customer/service/terminate/<?= $serverPartCellDatas['serverEntity']->getServiceInfoUID() ?>?serverinfo_uid=<?= $serverPartCellDatas['serverEntity']->getPK() ?>"></a>
<?php endif ?> <?php endif ?>

View File

@ -8,6 +8,7 @@
<?php foreach ($serviceCellDatas['entities'] as $entity): ?> <?php foreach ($serviceCellDatas['entities'] as $entity): ?>
<?php $serviceCellDatas['entity'] = $entity ?> <?php $serviceCellDatas['entity'] = $entity ?>
<div class="rounded border border-gray p-2 mt-3"> <div class="rounded border border-gray p-2 mt-3">
<div style="font-size:15px">서비스 목록</div>
<table class="table table-bordered table-hover table-striped"> <table class="table table-bordered table-hover table-striped">
<tr class="text-center"> <tr class="text-center">
<th style="width: 120px"><a href="#">[상세정보]</a></th> <th style="width: 120px"><a href="#">[상세정보]</a></th>

View File

@ -8,12 +8,21 @@
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/client">고객정보</a></span> <span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/client">고객정보</a></span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/service">서비스현황</a></span> <span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/account">예치금정보</a></span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/payment?status=<?= STATUS['UNPAID'] ?>">결제현황</a></span> <span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/coupon">쿠폰정보</a></span>
</li> </li>
<li class="nav-item"> <li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/equipment/server">서버현황</a></span> <span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/point">포인트정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/service">서비스정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/payment?status=<?= STATUS['UNPAID'] ?>">결제정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/equipment/server">서버정보</a></span>
</li> </li>
</ul> </ul>