dbmsv2 init...1

This commit is contained in:
choi.jh 2025-09-11 15:54:56 +09:00
parent 7fb1a2b1d7
commit ba6dfd23b4
35 changed files with 351 additions and 384 deletions

View File

@ -4,6 +4,7 @@ namespace App\Cells\Customer;
use App\Services\Customer\PaymentService;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\ServerPartService;
class ServiceCell extends CustomerCell
{
@ -21,7 +22,7 @@ class ServiceCell extends CustomerCell
$this->getService()->setFormOptions();
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['userinfo_uid']]);
return view('cells/service/detail', [
'cellDatas' => [
'serviceCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'entities' => $entities,

View File

@ -0,0 +1,15 @@
<?php
namespace App\Cells\Equipment;
use App\Cells\CommonCell;
use App\Services\CommonService;
abstract class EquipmentCell extends CommonCell
{
protected function __construct(CommonService $service)
{
parent::__construct($service);
}
}

View File

@ -0,0 +1,41 @@
<?php
namespace App\Cells\Equipment;
use App\Services\Equipment\ServerPartService;
class ServerPartCell extends EquipmentCell
{
public function __construct()
{
parent::__construct(new ServerPartService());
}
public function parttable(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$serverPartEntities = $this->getService()->getEntities(['serverinfo_uid' => $params['serverinfo_uid']]);
$entities = [];
foreach ($serverPartEntities as $entity) {
if (!array_key_exists($entity->getType(), $entities)) {
$entities[$entity->getType()] = [];
}
$entities[$entity->getType()][] = $entity;
}
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/serverpart/' . $template, [
'serverPartCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'entities' => $entities,
'serverinfo_uid' => $params['serverinfo_uid'],
'types' => $params['types'],
]
]);
}
}

View File

@ -70,6 +70,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'ClientController::batchjob_delete');
$routes->get('download/(:alpha)', 'ClientController::download/$1');
$routes->get('detail/(:num)', 'ClientController::detail/$1');
$routes->post('history/(:num)', 'ClientController::history/$1');
});
$routes->group('account', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'AccountController::index');
@ -122,6 +123,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'ServiceController::batchjob');
$routes->post('batchjob_delete', 'ServiceController::batchjob_delete');
$routes->get('download/(:alpha)', 'ServiceController::download/$1');
$routes->post('history/(:num)', 'ServiceController::history/$1');
});
$routes->group('serviceitem', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'ServiceItemController::index');

View File

@ -86,6 +86,9 @@ class ClientController extends CustomerController
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;
case 'history':
$result = redirect()->to($this->request->getGET('return_url'))->with('error', $message);
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;
@ -124,4 +127,31 @@ class ClientController extends CustomerController
// return $this->getResultFail($e->getMessage());
}
}
public function history(int $uid): RedirectResponse|string
{
//Transaction Start
$db = \Config\Database::connect();
$db->transStart();
try {
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(['history']);
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
//전달값정의
$this->setFormDatas($this->request->getPost());
$this->doValidations();
//기존 Entity 가져오기
$entity = $this->getService()->getEntity($uid);
if (!$entity) {
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
}
$this->entity = $this->getService()->history($entity, $this->getFormDatas());
$db->transCommit();
return $this->getResultSuccess('고객 비고가 수정되었습니다.');
} catch (\Exception $e) {
$db->transRollback();
return $this->getResultFail($e->getMessage());
}
}
}

View File

@ -55,6 +55,9 @@ class ServiceController extends CustomerController
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;
case 'history':
$result = redirect()->to($this->request->getGET('return_url'))->with('error', $message);
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;
@ -62,6 +65,22 @@ class ServiceController extends CustomerController
return $result;
}
//생성관련
protected function create_form_process(): void
{
$format = env("Server.Prefix.code.format", false);
if (!$format) {
throw new \Exception(__METHOD__ . "에서 code의 format[Server.Prefix.code.format]이 정의되지 않았습니다.");
}
//기본값정의
$this->setFormDatas([
'location' => 'chiba',
'type' => 'normal',
'billing_at' => date("Y-m-d"),
'start_at' => date("Y-m-d"),
'status' => ServiceEntity::DEFAULT_STATUS,
]);
parent::create_form_process();
}
protected function create_process(array $formDatas): ServiceEntity
{
// 관리자 UID는 현재 인증된 사용자로 설정
@ -88,4 +107,31 @@ class ServiceController extends CustomerController
//부모함수처리
return parent::index_process($entities);
}
public function history(int $uid): RedirectResponse|string
{
//Transaction Start
$db = \Config\Database::connect();
$db->transStart();
try {
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields(['history']);
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
//전달값정의
$this->setFormDatas($this->request->getPost());
$this->doValidations();
//기존 Entity 가져오기
$entity = $this->getService()->getEntity($uid);
if (!$entity) {
throw new \Exception("{$uid}에 대한 정보를 찾을수 없습니다.");
}
$this->entity = $this->getService()->history($entity, $this->getFormDatas());
$db->transCommit();
return $this->getResultSuccess('서비스객 비고가 수정되었습니다.');
} catch (\Exception $e) {
$db->transRollback();
return $this->getResultFail($e->getMessage());
}
}
}

View File

@ -24,5 +24,4 @@ class ServerPartController extends EquipmentController
}
return $this->_service;
}
//Index,FieldForm관련
}

View File

@ -17,34 +17,43 @@ abstract class CommonEntity extends Entity
parent::__construct($data);
}
public function getPK(): int|string|null
final public function __call($name, $arguments): string
{
return "";
}
public function getPK(): int|string
{
$field = constant("static::PK");
return $this->attributes[$field];
return $this->attributes[$field] ?? "";
}
public function getTitle(): string
{
$field = constant("static::TITLE");
return $this->attributes[$field];
return $this->attributes[$field] ?? "";
}
public function getCustomTitle(): string
{
return $this->getTitle();
}
public function getStatus(): string|null
final public function getCode(): string
{
return $this->attributes['status'] ?? null;
return $this->attributes['code'] ?? "";
}
final public function getUpdatedAt(): string|null
public function getStatus(): string
{
return $this->attributes['updated_at'] ?? null;
return $this->attributes['status'] ?? "";
}
final public function getUpdatedAt(): string
{
return $this->attributes['updated_at'] ?? "";
}
final public function getCreatedAt(): string
{
return $this->attributes['created_at'];
return $this->attributes['created_at'] ?? "";
}
final public function getDeletedAt(): string
{
return $this->attributes['deleted_at'] ?? null;
return $this->attributes['deleted_at'] ?? "";
}
}

View File

@ -10,17 +10,13 @@ class ClientEntity extends CustomerEntity
const TITLE = ClientModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
//타 객체정의 부분
public function getCode(): string
{
return $this->attributes['code'] ?? "null";
}
public function getName(): string
{
return $this->attributes['name'];
return $this->attributes['name'] ?? "";
}
public function getRole(): string
{
return $this->attributes['role'];
return $this->attributes['role'] ?? "";
}
public function getSaleRate(): int
{
@ -28,15 +24,15 @@ class ClientEntity extends CustomerEntity
}
public function getAccountBalance(): int
{
return $this->attributes['account_balance'];
return $this->attributes['account_balance'] ?? 0;
}
public function getCouponBalance(): int
{
return $this->attributes['coupon_balance'];
return $this->attributes['coupon_balance'] ?? 0;
}
public function getPointBalance(): int
{
return $this->attributes['point_balance'];
return $this->attributes['point_balance'] ?? 0;
}
public function getHistory(): string
{

View File

@ -12,19 +12,19 @@ class PaymentEntity extends CustomerEntity
const DEFAULT_STATUS = STATUS['UNPAID'];
public function getBilling(): string
{
return $this->attributes['billing'];
return $this->attributes['billing'] ?? "";
}
public function getAmount(): int
{
return $this->attributes['amount'];
return $this->attributes['amount'] ?? 0;
}
public function getBillingAt(): string
{
return $this->attributes['billing_at'];
return $this->attributes['billing_at'] ?? "";
}
public function getPay(): string
{
return $this->attributes['pay'];
return $this->attributes['pay'] ?? "";
}
public function getCountDueAt(): string
{

View File

@ -38,25 +38,21 @@ class ServiceEntity extends CustomerEntity
{
return $this->attributes['serverEntity'];
}
public function getCode(): string|null
{
return $this->attributes['code'];
}
final public function getSite(): string
{
return $this->attributes['site'];
return $this->attributes['site'] ?? "";
}
public function getType(): string
{
return $this->attributes['type'];
return $this->attributes['type'] ?? "";
}
final public function getLocation(): string
{
return $this->attributes['location'];
return $this->attributes['location'] ?? "";
}
final public function getBillingAt(): string
{
return $this->attributes['billing_at'];
return $this->attributes['billing_at'] ?? "";
}
final public function getAmount(): int
{

View File

@ -2,7 +2,6 @@
namespace App\Entities\Equipment;
use App\Entities\Equipment\ServerPartEntity;
use App\Models\Equipment\ServerModel;
class ServerEntity extends EquipmentEntity
@ -10,46 +9,13 @@ class ServerEntity extends EquipmentEntity
const PK = ServerModel::PK;
const TITLE = ServerModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function addServerPartEntity(string $partType, ServerPartEntity $entity): ServerEntity
{
if (!array_key_exists('serverPartEntities', $this->attributes)) {
$this->attributes['serverPartEntities'] = [];
}
if (!array_key_exists($partType, $this->attributes['serverPartEntities'])) {
$this->attributes['serverPartEntities'][$partType] = [];
}
$this->attributes['serverPartEntities'][$partType][] = $entity;
return $this;
}
public function setServerPartEntities(string $partType, array $serverPartEntities): ServerEntity
{
if (!array_key_exists('serverPartEntities', $this->attributes)) {
$this->attributes['serverPartEntities'] = [];
}
$this->attributes['serverPartEntities'][$partType] = $serverPartEntities;
return $this;
}
public function getServerPartEntities(string $partType): array
{
if (!array_key_exists('serverPartEntities', $this->attributes)) {
return [];
}
if (!array_key_exists($partType, $this->attributes['serverPartEntities'])) {
return [];
}
return $this->attributes['serverPartEntities'][$partType];
}
//기본기능용
public function getCode(): string
{
return $this->attributes['code'];
}
public function getCustomTitle(): string
{
return sprintf("[%s] %s", $this->getCode(), $this->getTitle());
}
public function getPrice(): int
{
return $this->attributes['price'];
return $this->attributes['price'] ?? 0;
}
}

View File

@ -34,26 +34,26 @@ class ServerPartEntity extends EquipmentEntity
//기본기능용
public function getPartUID(): int
{
return $this->attributes['part_uid'];
return $this->attributes['part_uid'] ?? 0;
}
public function getType(): string
{
return $this->attributes['type'];
return $this->attributes['type'] ?? "";
}
public function getBilling(): string
{
return $this->attributes['billing'];
return $this->attributes['billing'] ?? "";
}
public function getAmount(): int
{
return $this->attributes['amount'];
return $this->attributes['amount'] ?? 0;
}
public function getCnt(): int
{
return $this->attributes['cnt'];
return $this->attributes['cnt'] ?? 0;
}
public function getExtra(): string|null
public function getExtra(): string
{
return $this->attributes['extra'] ?? null;
return $this->attributes['extra'] ?? "";
}
}

View File

@ -10,13 +10,8 @@ class SwitchEntity extends EquipmentEntity
const TITLE = SwitchModel::TITLE;
const DEFAULT_STATUS = STATUS['AVAILABLE'];
public function getCode(): string
{
return $this->attributes['code'];
}
public function getPrice(): int
{
return $this->attributes['price'];
return $this->attributes['price'] ?? 0;
}
}

View File

@ -13,14 +13,14 @@ class UserEntity extends CommonEntity
public function getID(): string
{
return $this->attributes['id'];
return $this->attributes['id'] ?? "";
}
public function getPassword(): string
{
return $this->attributes['passwd'];
return $this->attributes['passwd'] ?? "";
}
public function getRole(): string
{
return $this->attributes['role'];
return $this->attributes['role'] ?? "";
}
}

View File

@ -17,14 +17,14 @@ class UserSNSEntity extends CommonEntity
}
public function getID(): string
{
return $this->attributes['id'];
return $this->attributes['id'] ?? "";
}
public function getSite(): string
{
return $this->attributes['site'];
return $this->attributes['site'] ?? "";
}
public function getEmail(): string
{
return $this->attributes['email'];
return $this->attributes['email'] ?? "";
}
}

View File

@ -196,7 +196,7 @@ class CommonHelper
return $ips;
}
final public function form_dropdown_common(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
final public function form_dropdown_common(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
// 필터 옵션이 없으면 빈 배열로 초기화
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
@ -208,7 +208,7 @@ class CommonHelper
}
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
$html = sprintf("<select name=\"%s\" %s>", $field, $extra);
$html .= $this->form_dropdown_common_process($field, $value, $viewDatas, $extras, $attributes);
$html .= $this->form_dropdown_common_process($field, $value, $viewDatas, $extras);
$html .= '</select>';
return $html;
}
@ -225,25 +225,19 @@ class CommonHelper
return $label;
}
// header.php에서 getFieldForm_Helper사용
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
default:
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
$isSelected = $key == $value ? ' selected' : '';
$attribute = "";
foreach ($attributes as $attribute_tag => $attribute_value) {
switch ($attribute_tag) {
case 'disabled':
$attribute .= in_array($viewDatas['control']['action'], ['create_form', 'index']) && $entity->getStatus() !== ($attribute_value ?? $entity::DEFAULT_STATUS) ? ' disabled' : '';
break;
default:
$attribute .= sprintf(" %s=\"%s\"", $attribute_tag, $entity->$attribute_value);
break;
}
$isDisabled = "";
if (in_array($viewDatas['control']['action'], ['create_form', 'index'])) {
if ($entity->getStatus() != $entity::DEFAULT_STATUS)
$isDisabled = ' disabled';
}
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $attribute, $entity->getCustomTitle());
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $isDisabled, $entity->getCustomTitle());
}
break;
}
@ -300,8 +294,7 @@ class CommonHelper
case 'serviceinfo_uid':
case 'serverinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$attributes = ['disabled' => null];
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
break;
default:
if (in_array($field, $viewDatas['control']['actionFilters'])) {
@ -377,8 +370,7 @@ class CommonHelper
case 'serviceinfo_uid':
case 'serverinfo_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$attributes = ['disabled' => null];
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
break;
default:
if (in_array($field, $viewDatas['control']['actionFilters'])) {
@ -431,7 +423,7 @@ class CommonHelper
$checkbox = form_checkbox([
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
"name" => "batchjob_uids[]",
"value" => $viewDatas['entity']->getPK(),
"value" => $label ? $label : $viewDatas['entity']->getPK(),
"class" => "batchjobuids_checkboxs",
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
]);

View File

@ -57,6 +57,9 @@ class ClientHelper extends CustomerHelper
]
);
break;
case 'history':
$value = nl2br($value);
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
break;

View File

@ -40,7 +40,7 @@ class ServiceHelper extends CustomerHelper
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
break;
case 'serverinfo_uid':
$value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCustomTitle() : "지정된서버없음";
$value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCode() : "지정된서버없음";
break;
case 'billing_at':
if (array_key_exists('unPaids', $viewDatas)) {
@ -49,17 +49,8 @@ class ServiceHelper extends CustomerHelper
}
}
break;
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'SWITCH':
case 'IP':
case 'CS':
$viewDatas['serverEntity'] = $viewDatas['entity']->getServerEntity();
$value = $this->getServerHelper()->getFieldView($field, $value, $viewDatas, $extras);
case 'history':
$value = nl2br($value);
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
@ -91,18 +82,6 @@ class ServiceHelper extends CustomerHelper
]
);
break;
case 'SWITCH':
case 'IP':
case 'CS':
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
$viewDatas['serverEntity'] = $viewDatas['entity']->getServerEntity();
$action = $this->getServerHelper()->getListButton($action, $label, $viewDatas, $extras);
break;
default:
$action = parent::getListButton($action, $label, $viewDatas, $extras);
break;

View File

@ -6,16 +6,10 @@ use App\Models\Equipment\ServerModel;
class ServerHelper extends EquipmentHelper
{
private ?ServerPartHelper $_serverPartHelper = null;
public function __construct()
{
parent::__construct();
$this->setTitleField(field: ServerModel::TITLE);
$this->_serverPartHelper = new ServerPartHelper();
}
private function getServerPartHelper(): ServerPartHelper
{
return $this->_serverPartHelper;
}
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
@ -29,15 +23,6 @@ class ServerHelper extends EquipmentHelper
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' calender' : 'calender';
$form = form_input($field, $value ?? "", $extras);
break;
case 'CPU':
case 'CPU_cnt':
case 'RAM':
case 'RAM_cnt':
case 'DISK':
case 'DISK_cnt':
case 'DISK_extra':
$form = $this->getServerPartHelper()->getFieldForm($field, $value, $viewDatas, $extras);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
break;
@ -51,19 +36,6 @@ class ServerHelper extends EquipmentHelper
case 'format_at':
$value = $value ? date("Y-m-d", strtotime($value)) : "";
break;
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'SWITCH':
case 'IP':
case 'CS':
$serverEntity = array_key_exists('serverEntity', $viewDatas) ? $viewDatas['serverEntity'] : $viewDatas['entity'];
$viewDatas['serverPartEntities'] = $serverEntity->getServerPartEntities($field);
$value = $this->getServerPartHelper()->getFieldView($field, $value, $viewDatas, $extras);
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
break;
@ -93,19 +65,6 @@ class ServerHelper extends EquipmentHelper
]
);
break;
case 'SWITCH':
case 'IP':
case 'CS':
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
$serverEntity = array_key_exists('serverEntity', $viewDatas) ? $viewDatas['serverEntity'] : $viewDatas['entity'];
$viewDatas['serverinfo_uid'] = $serverEntity->getPK();
$action = $this->getServerPartHelper()->getListButton($action, $label, $viewDatas, $extras);
break;
default:
$action = parent::getListButton($action, $label, $viewDatas, $extras);
break;

View File

@ -2,7 +2,6 @@
namespace App\Helpers\Equipment;
use App\Entities\FormOptionEntity;
use App\Models\Equipment\ServerPartModel;
class ServerPartHelper extends EquipmentHelper
@ -12,29 +11,18 @@ class ServerPartHelper extends EquipmentHelper
parent::__construct();
$this->setTitleField(field: ServerPartModel::TITLE);
}
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = []): string
protected function form_dropdown_common_process(string $field, mixed $value, array $viewDatas, array $extras = []): string
{
switch ($field) {
case 'part_uid':
case 'serverinfo_uid':
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
$isSelected = $key == $value ? ' selected' : '';
$attribute = "";
foreach ($attributes as $attribute_tag => $attribute_value) {
switch ($attribute_tag) {
case 'disabled':
$attribute .= in_array($viewDatas['control']['action'], ['create_form', 'index']) && $entity->getStatus() !== ($attribute_value ?? $entity::DEFAULT_STATUS) ? ' disabled' : '';
break;
default:
$attribute .= sprintf(" %s=\"%s\"", $attribute_tag, $entity->$attribute_value);
break;
}
}
$html .= sprintf("<option value=\"%s\"%s%s>%s</option>", $key, $isSelected, $attribute, $entity->getCustomTitle());
$html .= sprintf("<option value=\"%s\"%s>%s</option>", $key, $isSelected, $entity->getCustomTitle());
}
break;
default:
$html = parent::form_dropdown_common_process($field, $value, $viewDatas, $extras, $attributes);
$html = parent::form_dropdown_common_process($field, $value, $viewDatas, $extras);
break;
}
return $html;
@ -54,27 +42,9 @@ class ServerPartHelper extends EquipmentHelper
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
break;
case 'CPU_cnt':
case 'RAM_cnt':
case 'DISK_cnt':
case 'DB_cnt':
case 'OS_cnt':
case 'SOFTWARE_cnt':
$form = "*" . form_dropdown($field, SERVERPART['CNT_RANGE'], $value, $extras) . "";
break;
case 'DISK_extra':
$formOptionDatas = lang("Equipment/ServerPart.EXTRA");
if (!is_array($formOptionDatas)) {
throw new \Exception(__FUNCTION__ . "에서 {$field}}의 formOptionDatas 값이 array가 아닙니다.\n" . var_export($formOptionDatas, true));
}
$options = ["" => lang("Equipment/ServerPart.label.extra") . " 선택", ...$formOptionDatas];
$form = form_dropdown($field, $options, $value, $extras);
break;
case 'part_uid':
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
$extras['onChange'] = "document.getElementById('amount').value=this.options[this.selectedIndex].getAttribute('data-price')";
$attributes = ['disabled' => null, 'data-price' => 'getPrice'];
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
break;
default:
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
@ -94,13 +64,16 @@ class ServerPartHelper extends EquipmentHelper
case 'SWITCH':
case 'IP':
case 'CS':
if (!array_key_exists($field, $viewDatas['entities'])) {
return "";
}
$temps = [];
foreach ($viewDatas['serverPartEntities'] as $partEntity) {
foreach ($viewDatas['entities'][$field] as $entity) {
$modal = form_label(
ICONS['SETUP'],
$field,
[
"data-src" => "/admin/equipment/serverpart/modify/{$partEntity->getPK()}?type={$partEntity->getType()}&ActionTemplate=popup",
"data-src" => "/admin/equipment/serverpart/modify/{$entity->getPK()}?type={$entity->getType()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"class" => "btn btn-sm btn-outline btn-circle",
@ -110,13 +83,25 @@ class ServerPartHelper extends EquipmentHelper
$temps[] = sprintf(
"%s%s*%s개%s",
$modal,
$partEntity->getTitle(),
$partEntity->getCnt(),
!$partEntity->getExtra() ? "" : "/" . $partEntity->getExtra()
$entity->getTitle(),
$entity->getCnt(),
!$entity->getExtra() ? "" : "/" . $entity->getExtra()
);
}
$value = implode("<BR>", $temps);
break;
case 'SWITCH_SERVICE':
case 'IP_SERVICE':
case 'OS_SERVICE':
$field = str_replace('_SERVICE', '', $field);
if (!array_key_exists($field, $viewDatas['entities'])) {
return "";
}
foreach ($viewDatas['entities'][$field] as $entity) {
$temps[] = $entity->getTitle();
}
$value = implode(",", $temps);
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
break;

View File

@ -153,4 +153,11 @@ class ClientService extends CustomerService
$this->getModel()->orderBy("site ASC,name ASC");
parent::setOrderBy($field, $value);
}
//History
public function history(mixed $entity, array $formDatas): ClientEntity
{
//서비스 정보수정
$entity = $this->getModel()->modify($entity, $formDatas);
return $entity;
}
}

View File

@ -113,7 +113,7 @@ class ServiceService extends CustomerService
//서버정보 정의
$serverEntity = $this->getServerService()->getEntity(['serviceinfo_uid' => $entity->getPK()]);
if (!($serverEntity instanceof ServerEntity)) {
throw new \Exception("{$entity->getPK()}에 해당하는 서버정보를 찾을수 없습니다.");
$serverEntity = new ServerEntity();
}
return $entity->setServerEntity($serverEntity);
}
@ -266,4 +266,11 @@ class ServiceService extends CustomerService
);
return parent::delete($entity);
}
//History
public function history(mixed $entity, array $formDatas): ServiceEntity
{
//서비스 정보수정
$entity = $this->getModel()->modify($entity, $formDatas);
return $entity;
}
}

View File

@ -37,9 +37,6 @@ class ServerService extends EquipmentService
"serviceinfo_uid",
"type",
"title",
"CPU",
"RAM",
"DISK",
"status"
];
}
@ -83,38 +80,10 @@ class ServerService extends EquipmentService
if (!($entity instanceof ServerEntity)) {
throw new \Exception(__METHOD__ . "에서 형식오류:ServerEntity만 허용됩니다.");
}
foreach (SERVERPART['PARTTYPES'] as $partType) {
foreach ($this->getServerPartService()->getEntities(['serverinfo_uid' => $entity->getPK(), 'type' => $partType]) as $serverPartEntity) {
$entity = $entity->addServerPartEntity($partType, $serverPartEntity);
}
}
return $entity;
}
//기본 기능부분
//FieldForm관련용
public function getFormOption(string $field, array $options = []): array
{
switch ($field) {
case 'CPU':
case 'RAM':
case 'DISK':
case 'OS':
case 'DB':
case 'SOFTWARE':
case 'SWITCH':
case 'IP':
case 'CS':
$options = $this->getServerPartService()->getFormOption($field, $options);
break;
default:
$options = parent::getFormOption($field, $options);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$field}의 options 값이 array가 아닙니다.\n" . var_export($options, true));
}
return $options;
}
//create용 장비코드 마지막번호 가져오기
final public function getLastestCode(string $format, int $default): string
{
@ -134,23 +103,6 @@ class ServerService extends EquipmentService
throw new \Exception("Server코드[{$formDatas['code']}의 형식이 맞지않습니다");
}
}
//생성
public function create(array $formDatas): ServerEntity
{
$entity = parent::create($formDatas);
//신규 ServerPart정보 생성
// foreach (SERVERPART['SERVER_PARTTYPES'] as $partType) {
// $serverPartFormDatas = [];
// $serverPartFormDatas['serverEntity'] = $entity;
// $serverPartFormDatas['type'] = $partType;
// $serverPartFormDatas['part_uid'] = $partType . "_uid";
// $serverPartFormDatas["billing"] = array_key_exists("{$partType}_billing", $formDatas) ? $formDatas["{$partType}_billing"] : null;
// $serverPartFormDatas["cnt"] = array_key_exists("{$partType}_cnt", $formDatas) ? $formDatas["{$partType}_cnt"] : 1;
// $serverPartFormDatas["extra"] = array_key_exists("{$partType}_extra", $formDatas) ? $formDatas["{$partType}_extra"] : null;
// $this->getServerPartService()->create($serverPartFormDatas);
// }
return $this->getEntity_process($entity);
}
//Service별 수정
public function modify(mixed $entity, array $formDatas): ServerEntity
{

View File

@ -15,11 +15,20 @@
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
<div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<link href="/css/admin/client/detail.css" media="screen" rel="stylesheet" type="text/css" />
<style>
table.layout_middle td.layout_right div#container * {
font-size: 12px;
}
.note-box {
height: 150px;
resize: none;
}
</style>
<div class="index_body p-4">
<!-- index_body -->
<div class="row align-items-end rounded border border-gray p-2 mt-3">
<table class="table table-bordered table-hover table-striped">
<table class="table table-bordered table-hover table-striped m-0 p-0">
<tr class="text-center">
<th rowspan="2">
<div><?= $viewDatas['entity']->getTitle() ?></div>
@ -58,17 +67,19 @@
</tr>
</table>
</div>
<?= form_open("/admin/customer/client/history/{$viewDatas['entity']->getPK()}?return_url=" . urlencode(current_url()), ['method' => "post"]) ?>
<div class="row align-items-center rounded border border-gray p-2 mt-3">
<div class="col-1">
<div class="text-center fw-bold">고객 비고</div>
</div>
<div class="col-10">
<textarea class="form-control note-box"><?= nl2br($viewDatas['entity']->getHistory()) ?></textarea>
<textarea name="history" class="form-control note-box"><?= $viewDatas['entity']->getHistory() ?></textarea>
</div>
<div class="col-1">
<button class="btn btn-primary">저장</button>
<?= form_submit('', '저장', array("class" => "btn btn-outline btn-primary")); ?>
</div>
</div>
<?= form_close() ?>
<?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['userinfo_uid' => $viewDatas['entity']->getPK()]) ?>
</div>
<!-- index_body -->

View File

@ -51,7 +51,6 @@
<?php endforeach ?>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>

View File

@ -79,18 +79,10 @@
</td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></td>
<td nowrap>
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach (SERVERPART['SERVER_PARTTYPES'] as $partType): ?>
<tr class="m-0 p-0">
<th class="m-0 p-0" width="15%"><?= $viewDatas['service']->getHelper()->getListButton($partType, $partType, $viewDatas) ?></th>
<td class="m-0 p-0"><?= $viewDatas['service']->getHelper()->getFieldView($partType, "", $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</table>
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getPK(), 'types' => SERVERPART['SERVER_PARTTYPES']]) ?>
</td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>

View File

@ -24,16 +24,7 @@
<?php endforeach ?>
</table>
</td>
<td nowrap>
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach (SERVERPART['SERVER_PARTTYPES'] as $partType): ?>
<tr class="m-0 p-0">
<th class="text-end m-0 p-0"><?= $viewDatas['service']->getHelper()->getListButton($partType, $partType, $viewDatas) ?></th>
<td class="text-start m-0 p-0"><?= $viewDatas['service']->getHelper()->getFieldView($partType, "", $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</table>
</td>
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></td>>
</tr>
</table>
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>

View File

@ -35,27 +35,21 @@
<tr>
<th class="index_head_short_column">번호</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('site', lang("{$viewDatas['class_path']}.label.site"), $viewDatas) ?>/
<?= $viewDatas['service']->getHelper()->getListLabel('location', lang("{$viewDatas['class_path']}.label.location"), $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('start_at', lang("{$viewDatas['class_path']}.label.start_at"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('site', lang("{$viewDatas['class_path']}.label.site"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('location', lang("{$viewDatas['class_path']}.label.location"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?> /
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>/
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getListLabel('serverinfo_uid', lang("{$viewDatas['class_path']}.label.serverinfo_uid"), $viewDatas) ?>/SWITCH/IP/OS
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('serverinfo_uid', lang("{$viewDatas['class_path']}.label.serverinfo_uid"), $viewDatas) ?>/
<?= $viewDatas['service']->getHelper()->getListLabel('start_at', lang("{$viewDatas['class_path']}.label.start_at"), $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('billing_at', lang("{$viewDatas['class_path']}.label.billing_at"), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getListLabel('status', lang("{$viewDatas['class_path']}.label.status"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?>/
<?= $viewDatas['service']->getHelper()->getListLabel('billing_at', lang("{$viewDatas['class_path']}.label.billing_at"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('status', lang("{$viewDatas['class_path']}.label.status"), $viewDatas) ?>/
<?= $viewDatas['service']->getHelper()->getListLabel('updated_at', lang("{$viewDatas['class_path']}.label.updated_at"), $viewDatas) ?>
</th>
<th class="index_head_short_column">부품정보</th>
<th class="index_head_short_column"><?= $viewDatas['service']->getHelper()->getListLabel('user_uid', lang("{$viewDatas['class_path']}.label.user_uid"), $viewDatas) ?></th>
<!-- <th class="index_head_short_column"><?= $viewDatas['service']->getHelper()->getListLabel('user_uid', lang("{$viewDatas['class_path']}.label.user_uid"), $viewDatas) ?></th> -->
<th class="index_head_short_column">작업</th>
</thead>
<tbody>
@ -64,41 +58,28 @@
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', '', $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $viewDatas['cnt'], $viewDatas) ?></td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?></div>
<div><?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?></div>
<div>
<?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?>
</div>
<?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?>
<?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></div>
<div><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?></div>
<?= $viewDatas['service']->getHelper()->getFieldView('serverinfo_uid', $entity->getServerEntity()->getTitle() ?? "", $viewDatas) ?> /
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partservice']) ?>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('serverinfo_uid', $entity->getServerEntity()->getTitle(), $viewDatas) ?></div>
<div><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></div>
<?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?> /
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?></div>
<div><?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></div>
<div><?= $viewDatas['service']->getHelper()->getFieldView('updated_at', $entity->updated_at, $viewDatas) ?></div>
</td>
<td nowrap>
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach (SERVERPART['SERVICE_PARTTYPES'] as $partType): ?>
<tr class="m-0 p-0">
<th class="m-0 p-0" width="15%"><?= $viewDatas['service']->getHelper()->getListButton($partType, $partType, $viewDatas) ?></th>
<td class="m-0 p-0"><?= $viewDatas['service']->getHelper()->getFieldView($partType, "", $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</table>
</td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->user_uid, $viewDatas) ?></td>
<!-- <td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->user_uid, $viewDatas) ?></td> -->
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>

View File

@ -24,16 +24,7 @@
<?php endforeach; ?>
</table>
</td>
<td>
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach (SERVERPART['PARTTYPES'] as $partType): ?>
<tr class="m-0 p-0">
<th class="m-0 p-0"><?= $viewDatas['service']->getHelper()->getListButton($partType, $partType, $viewDatas) ?></th>
<td class="m-0 p-0"><?= $viewDatas['service']->getHelper()->getFieldView($partType, "", $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</table>
</td>
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getServerEntity()->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></td>
</tr>
</table>
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>

View File

@ -0,0 +1,11 @@
<td>
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('CPU', "", $serverPartCellDatas) ?></div>
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('RAM', "", $serverPartCellDatas) ?></div>
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('DISK', "", $serverPartCellDatas) ?></div>
</td>
<td>
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('OS', "", $serverPartCellDatas) ?></div>
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('SOFTWARE', "", $serverPartCellDatas) ?></div>
</td>
<td><?= $serverPartCellDatas['service']->getHelper()->getFieldView('IP', "", $serverPartCellDatas) ?></td>
<td><?= $serverPartCellDatas['service']->getHelper()->getFieldView('CS', "", $serverPartCellDatas) ?></td>

View File

@ -0,0 +1,3 @@
<?= $serverPartCellDatas['service']->getHelper()->getFieldView('SWITCH_SERVICE', "", $serverPartCellDatas) ?> /
<?= $serverPartCellDatas['service']->getHelper()->getFieldView('IP_SERVICE', "", $serverPartCellDatas) ?> /
<?= $serverPartCellDatas['service']->getHelper()->getFieldView('OS_SERVICE', "", $serverPartCellDatas) ?>

View File

@ -0,0 +1,8 @@
<table class="table table-bordered table-striped m-0 p-0">
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
<tr class="m-0 p-0">
<th class="text-end m-0 p-0" width="15%"><?= $serverPartCellDatas['service']->getHelper()->getListButton($type, $type, $serverPartCellDatas) ?></th>
<td class="text-start m-0 p-0"><?= $serverPartCellDatas['service']->getHelper()->getFieldView($type, "", $serverPartCellDatas) ?></td>
</tr>
<?php endforeach ?>
</table>

View File

@ -1,60 +1,68 @@
<?php foreach ($cellDatas['entities'] as $entity): ?>
<?php $cellDatas['entity'] = $entity ?>
<?php $unpaids = $cellDatas['paymentService']->getUnPaids('serviceinfo_uid', ['serviceinfo_uid' => $entity->getPK()]) ?>
<div class="row align-items-end rounded border border-gray p-2 mt-3">
<style>
.note-box {
width: 100%;
height: 140px;
resize: none;
}
</style>
<?php foreach ($serviceCellDatas['entities'] as $entity): ?>
<?php $serviceCellDatas['entity'] = $entity ?>
<?php $unpaids = $serviceCellDatas['paymentService']->getUnPaids('serviceinfo_uid', ['serviceinfo_uid' => $entity->getPK()]) ?>
<div class="rounded border border-gray p-2 mt-3">
<table class="table table-bordered table-hover table-striped">
<tr class="text-center">
<th><a href="#">[상세정보]</a></th>
<th>사이트</th>
<th>위치</th>
<th>형식</th>
<th>CPU</th>
<th>메모리</th>
<th>저장장치</th>
<th>OS</th>
<th>SOFTWARE</th>
<th>IP주소</th>
<th>CS</th>
<th>결제처리</th>
<th style="width: 120px"><a href="#">[상세정보]</a></th>
<th style="width: 120px">사이트/위치/형식</th>
<th style="width: 250px">CPU / 메모리 / 저장장치</th>
<th style="width: 250px">OS / SOFTWARE</th>
<th style="width: 200px">IP주소</th>
<th style="width: 200px">CS</th>
<th>서비스 비고</th>
<th style="width: 200px">결제처리</th>
</tr>
<tr class="text-center">
<td rowspan="4">
<tr class="text-left">
<td rowspan="4" class="text-center">
<div><?= $entity->getCode() ?></div>
<div><?= $entity->getServerEntity()->getCode() ?></div>
</td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('CPU', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('RAM', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('DISK', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('OS', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('SOFTWARE', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('IP', "", $cellDatas) ?></td>
<td><?= $cellDatas['service']->getHelper()->getFieldView('CS', "", $cellDatas) ?></td>
<td class="text-center">
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?></div>
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?></div>
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $serviceCellDatas) ?></div>
</td>
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partdetail']) ?>
<td>
<?= form_open("/admin/customer/service/history/{$entity->getPK()}?return_url=" . urlencode(current_url()), ['method' => "post"]) ?>
<div class="row align-items-center">
<div class="col-10">
<textarea name="history" class="form-control note-box"><?= $entity->getHistory() ?></textarea>
</div>
<div class="col-2">
<?= form_submit('', '저장', array("class" => "btn btn-outline btn-primary")); ?>
</div>
</div>
<?= form_close() ?>
</td>
<td rowspan="4">
<table class="table">
<tr class="text-center">
<th class="text-start fw-bold">결제일</th>
<table class="table m-0 p-0">
<tr>
<th class="fw-bold">결제일</th>
<td><?= $entity->getBillingAT() ?></td>
</tr>
<tr>
<th class="text-start fw-bold">결제금</th>
<td class="amount-green"><?= number_format(intval($entity->getBillingAT())) ?>원</td>
<th class="fw-bold">결제금</th>
<td class="amount-green"><?= number_format(intval($entity->getAmount())) ?>원</td>
</tr>
<tr>
<th class="text-start fw-bold">미납금</th>
<th class="fw-bold">미납금</th>
<td class="amount-red"><?= array_key_exists('amount', $unpaids) ? number_format($unpaids['amount']) : 0 ?>원</td>
</tr>
<tr>
<td colspan="2" class="text-center"><a href="/admin/customer/payment?clientinfo_uid=<?= $entity->getClientInfoUID() ?>"><button class="btn btn-success">결제내역</button></a></td>
</tr>
</table>
</td>
</tr>
<tr>
<th colspan="10">서비스 비고</th>
</tr>
<tr>
<td colspan="10"><?= nl2br($entity->getHistory()) ?></td>
</tr>
</table>
</div>
<?php endforeach; ?>

View File

@ -1,8 +0,0 @@
table.layout_middle td.layout_right div#container * {
font-size:12px;
}
.note-box {
height: 150px;
resize: none;
}