dbmsv2 init...1
This commit is contained in:
parent
7fb1a2b1d7
commit
ba6dfd23b4
@ -4,6 +4,7 @@ namespace App\Cells\Customer;
|
|||||||
|
|
||||||
use App\Services\Customer\PaymentService;
|
use App\Services\Customer\PaymentService;
|
||||||
use App\Services\Customer\ServiceService;
|
use App\Services\Customer\ServiceService;
|
||||||
|
use App\Services\Equipment\ServerPartService;
|
||||||
|
|
||||||
class ServiceCell extends CustomerCell
|
class ServiceCell extends CustomerCell
|
||||||
{
|
{
|
||||||
@ -21,7 +22,7 @@ class ServiceCell extends CustomerCell
|
|||||||
$this->getService()->setFormOptions();
|
$this->getService()->setFormOptions();
|
||||||
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['userinfo_uid']]);
|
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['userinfo_uid']]);
|
||||||
return view('cells/service/detail', [
|
return view('cells/service/detail', [
|
||||||
'cellDatas' => [
|
'serviceCellDatas' => [
|
||||||
'control' => $this->getService()->getControlDatas(),
|
'control' => $this->getService()->getControlDatas(),
|
||||||
'service' => $this->getService(),
|
'service' => $this->getService(),
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
|
|||||||
15
app/Cells/Equipment/EquipmentCell.php
Normal file
15
app/Cells/Equipment/EquipmentCell.php
Normal 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);
|
||||||
|
}
|
||||||
|
}
|
||||||
41
app/Cells/Equipment/ServerPartCell.php
Normal file
41
app/Cells/Equipment/ServerPartCell.php
Normal 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'],
|
||||||
|
]
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -70,6 +70,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
$routes->post('batchjob_delete', 'ClientController::batchjob_delete');
|
$routes->post('batchjob_delete', 'ClientController::batchjob_delete');
|
||||||
$routes->get('download/(:alpha)', 'ClientController::download/$1');
|
$routes->get('download/(:alpha)', 'ClientController::download/$1');
|
||||||
$routes->get('detail/(:num)', 'ClientController::detail/$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->group('account', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
|
||||||
$routes->get('/', 'AccountController::index');
|
$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', 'ServiceController::batchjob');
|
||||||
$routes->post('batchjob_delete', 'ServiceController::batchjob_delete');
|
$routes->post('batchjob_delete', 'ServiceController::batchjob_delete');
|
||||||
$routes->get('download/(:alpha)', 'ServiceController::download/$1');
|
$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->group('serviceitem', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
|
||||||
$routes->get('/', 'ServiceItemController::index');
|
$routes->get('/', 'ServiceItemController::index');
|
||||||
|
|||||||
@ -86,6 +86,9 @@ class ClientController extends CustomerController
|
|||||||
}
|
}
|
||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
|
case 'history':
|
||||||
|
$result = redirect()->to($this->request->getGET('return_url'))->with('error', $message);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
@ -124,4 +127,31 @@ class ClientController extends CustomerController
|
|||||||
// return $this->getResultFail($e->getMessage());
|
// 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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -55,6 +55,9 @@ class ServiceController extends CustomerController
|
|||||||
}
|
}
|
||||||
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
|
||||||
break;
|
break;
|
||||||
|
case 'history':
|
||||||
|
$result = redirect()->to($this->request->getGET('return_url'))->with('error', $message);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$result = parent::getResultSuccess($message, $actionTemplate);
|
$result = parent::getResultSuccess($message, $actionTemplate);
|
||||||
break;
|
break;
|
||||||
@ -62,6 +65,22 @@ class ServiceController extends CustomerController
|
|||||||
return $result;
|
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
|
protected function create_process(array $formDatas): ServiceEntity
|
||||||
{
|
{
|
||||||
// 관리자 UID는 현재 인증된 사용자로 설정
|
// 관리자 UID는 현재 인증된 사용자로 설정
|
||||||
@ -88,4 +107,31 @@ class ServiceController extends CustomerController
|
|||||||
//부모함수처리
|
//부모함수처리
|
||||||
return parent::index_process($entities);
|
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());
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -24,5 +24,4 @@ class ServerPartController extends EquipmentController
|
|||||||
}
|
}
|
||||||
return $this->_service;
|
return $this->_service;
|
||||||
}
|
}
|
||||||
//Index,FieldForm관련
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,34 +17,43 @@ abstract class CommonEntity extends Entity
|
|||||||
parent::__construct($data);
|
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");
|
$field = constant("static::PK");
|
||||||
return $this->attributes[$field];
|
return $this->attributes[$field] ?? "";
|
||||||
}
|
}
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
$field = constant("static::TITLE");
|
$field = constant("static::TITLE");
|
||||||
return $this->attributes[$field];
|
return $this->attributes[$field] ?? "";
|
||||||
}
|
}
|
||||||
public function getCustomTitle(): string
|
public function getCustomTitle(): string
|
||||||
{
|
{
|
||||||
return $this->getTitle();
|
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
|
final public function getCreatedAt(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['created_at'];
|
return $this->attributes['created_at'] ?? "";
|
||||||
}
|
}
|
||||||
final public function getDeletedAt(): string
|
final public function getDeletedAt(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['deleted_at'] ?? null;
|
return $this->attributes['deleted_at'] ?? "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,17 +10,13 @@ class ClientEntity extends CustomerEntity
|
|||||||
const TITLE = ClientModel::TITLE;
|
const TITLE = ClientModel::TITLE;
|
||||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||||
//타 객체정의 부분
|
//타 객체정의 부분
|
||||||
public function getCode(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['code'] ?? "null";
|
|
||||||
}
|
|
||||||
public function getName(): string
|
public function getName(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['name'];
|
return $this->attributes['name'] ?? "";
|
||||||
}
|
}
|
||||||
public function getRole(): string
|
public function getRole(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['role'];
|
return $this->attributes['role'] ?? "";
|
||||||
}
|
}
|
||||||
public function getSaleRate(): int
|
public function getSaleRate(): int
|
||||||
{
|
{
|
||||||
@ -28,15 +24,15 @@ class ClientEntity extends CustomerEntity
|
|||||||
}
|
}
|
||||||
public function getAccountBalance(): int
|
public function getAccountBalance(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['account_balance'];
|
return $this->attributes['account_balance'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getCouponBalance(): int
|
public function getCouponBalance(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['coupon_balance'];
|
return $this->attributes['coupon_balance'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getPointBalance(): int
|
public function getPointBalance(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['point_balance'];
|
return $this->attributes['point_balance'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getHistory(): string
|
public function getHistory(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -12,19 +12,19 @@ class PaymentEntity extends CustomerEntity
|
|||||||
const DEFAULT_STATUS = STATUS['UNPAID'];
|
const DEFAULT_STATUS = STATUS['UNPAID'];
|
||||||
public function getBilling(): string
|
public function getBilling(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['billing'];
|
return $this->attributes['billing'] ?? "";
|
||||||
}
|
}
|
||||||
public function getAmount(): int
|
public function getAmount(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['amount'];
|
return $this->attributes['amount'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getBillingAt(): string
|
public function getBillingAt(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['billing_at'];
|
return $this->attributes['billing_at'] ?? "";
|
||||||
}
|
}
|
||||||
public function getPay(): string
|
public function getPay(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['pay'];
|
return $this->attributes['pay'] ?? "";
|
||||||
}
|
}
|
||||||
public function getCountDueAt(): string
|
public function getCountDueAt(): string
|
||||||
{
|
{
|
||||||
|
|||||||
@ -38,25 +38,21 @@ class ServiceEntity extends CustomerEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['serverEntity'];
|
return $this->attributes['serverEntity'];
|
||||||
}
|
}
|
||||||
public function getCode(): string|null
|
|
||||||
{
|
|
||||||
return $this->attributes['code'];
|
|
||||||
}
|
|
||||||
final public function getSite(): string
|
final public function getSite(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['site'];
|
return $this->attributes['site'] ?? "";
|
||||||
}
|
}
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['type'];
|
return $this->attributes['type'] ?? "";
|
||||||
}
|
}
|
||||||
final public function getLocation(): string
|
final public function getLocation(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['location'];
|
return $this->attributes['location'] ?? "";
|
||||||
}
|
}
|
||||||
final public function getBillingAt(): string
|
final public function getBillingAt(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['billing_at'];
|
return $this->attributes['billing_at'] ?? "";
|
||||||
}
|
}
|
||||||
final public function getAmount(): int
|
final public function getAmount(): int
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Entities\Equipment;
|
namespace App\Entities\Equipment;
|
||||||
|
|
||||||
use App\Entities\Equipment\ServerPartEntity;
|
|
||||||
use App\Models\Equipment\ServerModel;
|
use App\Models\Equipment\ServerModel;
|
||||||
|
|
||||||
class ServerEntity extends EquipmentEntity
|
class ServerEntity extends EquipmentEntity
|
||||||
@ -10,46 +9,13 @@ class ServerEntity extends EquipmentEntity
|
|||||||
const PK = ServerModel::PK;
|
const PK = ServerModel::PK;
|
||||||
const TITLE = ServerModel::TITLE;
|
const TITLE = ServerModel::TITLE;
|
||||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
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
|
public function getCustomTitle(): string
|
||||||
{
|
{
|
||||||
return sprintf("[%s] %s", $this->getCode(), $this->getTitle());
|
return sprintf("[%s] %s", $this->getCode(), $this->getTitle());
|
||||||
}
|
}
|
||||||
public function getPrice(): int
|
public function getPrice(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['price'];
|
return $this->attributes['price'] ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,26 +34,26 @@ class ServerPartEntity extends EquipmentEntity
|
|||||||
//기본기능용
|
//기본기능용
|
||||||
public function getPartUID(): int
|
public function getPartUID(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['part_uid'];
|
return $this->attributes['part_uid'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getType(): string
|
public function getType(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['type'];
|
return $this->attributes['type'] ?? "";
|
||||||
}
|
}
|
||||||
public function getBilling(): string
|
public function getBilling(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['billing'];
|
return $this->attributes['billing'] ?? "";
|
||||||
}
|
}
|
||||||
public function getAmount(): int
|
public function getAmount(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['amount'];
|
return $this->attributes['amount'] ?? 0;
|
||||||
}
|
}
|
||||||
public function getCnt(): int
|
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'] ?? "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,13 +10,8 @@ class SwitchEntity extends EquipmentEntity
|
|||||||
const TITLE = SwitchModel::TITLE;
|
const TITLE = SwitchModel::TITLE;
|
||||||
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
const DEFAULT_STATUS = STATUS['AVAILABLE'];
|
||||||
|
|
||||||
public function getCode(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['code'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPrice(): int
|
public function getPrice(): int
|
||||||
{
|
{
|
||||||
return $this->attributes['price'];
|
return $this->attributes['price'] ?? 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,14 +13,14 @@ class UserEntity extends CommonEntity
|
|||||||
|
|
||||||
public function getID(): string
|
public function getID(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['id'];
|
return $this->attributes['id'] ?? "";
|
||||||
}
|
}
|
||||||
public function getPassword(): string
|
public function getPassword(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['passwd'];
|
return $this->attributes['passwd'] ?? "";
|
||||||
}
|
}
|
||||||
public function getRole(): string
|
public function getRole(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['role'];
|
return $this->attributes['role'] ?? "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,14 +17,14 @@ class UserSNSEntity extends CommonEntity
|
|||||||
}
|
}
|
||||||
public function getID(): string
|
public function getID(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['id'];
|
return $this->attributes['id'] ?? "";
|
||||||
}
|
}
|
||||||
public function getSite(): string
|
public function getSite(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['site'];
|
return $this->attributes['site'] ?? "";
|
||||||
}
|
}
|
||||||
public function getEmail(): string
|
public function getEmail(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['email'];
|
return $this->attributes['email'] ?? "";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -196,7 +196,7 @@ class CommonHelper
|
|||||||
|
|
||||||
return $ips;
|
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'])) {
|
if (!array_key_exists($field, $viewDatas['control']['field_optons'])) {
|
||||||
@ -208,7 +208,7 @@ class CommonHelper
|
|||||||
}
|
}
|
||||||
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
|
// $formOptions는 필터 옵션 배열로, key는 필터 엔티티의 PK, value는 필터 엔티티 객체
|
||||||
$html = sprintf("<select name=\"%s\" %s>", $field, $extra);
|
$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>';
|
$html .= '</select>';
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
@ -225,25 +225,19 @@ class CommonHelper
|
|||||||
return $label;
|
return $label;
|
||||||
}
|
}
|
||||||
// header.php에서 getFieldForm_Helper사용
|
// 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) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
||||||
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
||||||
$isSelected = $key == $value ? ' selected' : '';
|
$isSelected = $key == $value ? ' selected' : '';
|
||||||
$attribute = "";
|
$isDisabled = "";
|
||||||
foreach ($attributes as $attribute_tag => $attribute_value) {
|
if (in_array($viewDatas['control']['action'], ['create_form', 'index'])) {
|
||||||
switch ($attribute_tag) {
|
if ($entity->getStatus() != $entity::DEFAULT_STATUS)
|
||||||
case 'disabled':
|
$isDisabled = ' 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>%s</option>", $key, $isSelected, $isDisabled, $entity->getCustomTitle());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -300,8 +294,7 @@ class CommonHelper
|
|||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
$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);
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
@ -377,8 +370,7 @@ class CommonHelper
|
|||||||
case 'serviceinfo_uid':
|
case 'serviceinfo_uid':
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
$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);
|
||||||
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
if (in_array($field, $viewDatas['control']['actionFilters'])) {
|
||||||
@ -431,7 +423,7 @@ class CommonHelper
|
|||||||
$checkbox = form_checkbox([
|
$checkbox = form_checkbox([
|
||||||
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
"id" => "checkbox_uid_{$viewDatas['entity']->getPK()}",
|
||||||
"name" => "batchjob_uids[]",
|
"name" => "batchjob_uids[]",
|
||||||
"value" => $viewDatas['entity']->getPK(),
|
"value" => $label ? $label : $viewDatas['entity']->getPK(),
|
||||||
"class" => "batchjobuids_checkboxs",
|
"class" => "batchjobuids_checkboxs",
|
||||||
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
"checked" => in_array($viewDatas['entity']->getPK(), $oldBatchJobUids)
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -57,6 +57,9 @@ class ClientHelper extends CustomerHelper
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
case 'history':
|
||||||
|
$value = nl2br($value);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -40,7 +40,7 @@ class ServiceHelper extends CustomerHelper
|
|||||||
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
|
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
|
||||||
break;
|
break;
|
||||||
case 'serverinfo_uid':
|
case 'serverinfo_uid':
|
||||||
$value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCustomTitle() : "지정된서버없음";
|
$value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCode() : "지정된서버없음";
|
||||||
break;
|
break;
|
||||||
case 'billing_at':
|
case 'billing_at':
|
||||||
if (array_key_exists('unPaids', $viewDatas)) {
|
if (array_key_exists('unPaids', $viewDatas)) {
|
||||||
@ -49,17 +49,8 @@ class ServiceHelper extends CustomerHelper
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case 'CPU':
|
case 'history':
|
||||||
case 'RAM':
|
$value = nl2br($value);
|
||||||
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);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
@ -91,18 +82,6 @@ class ServiceHelper extends CustomerHelper
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -6,16 +6,10 @@ use App\Models\Equipment\ServerModel;
|
|||||||
|
|
||||||
class ServerHelper extends EquipmentHelper
|
class ServerHelper extends EquipmentHelper
|
||||||
{
|
{
|
||||||
private ?ServerPartHelper $_serverPartHelper = null;
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServerModel::TITLE);
|
$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
|
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';
|
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' calender' : 'calender';
|
||||||
$form = form_input($field, $value ?? "", $extras);
|
$form = form_input($field, $value ?? "", $extras);
|
||||||
break;
|
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:
|
default:
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
@ -51,19 +36,6 @@ class ServerHelper extends EquipmentHelper
|
|||||||
case 'format_at':
|
case 'format_at':
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||||
break;
|
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:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
@ -93,19 +65,6 @@ class ServerHelper extends EquipmentHelper
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
break;
|
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:
|
default:
|
||||||
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
$action = parent::getListButton($action, $label, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Helpers\Equipment;
|
namespace App\Helpers\Equipment;
|
||||||
|
|
||||||
use App\Entities\FormOptionEntity;
|
|
||||||
use App\Models\Equipment\ServerPartModel;
|
use App\Models\Equipment\ServerPartModel;
|
||||||
|
|
||||||
class ServerPartHelper extends EquipmentHelper
|
class ServerPartHelper extends EquipmentHelper
|
||||||
@ -12,29 +11,18 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
parent::__construct();
|
parent::__construct();
|
||||||
$this->setTitleField(field: ServerPartModel::TITLE);
|
$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) {
|
switch ($field) {
|
||||||
case 'part_uid':
|
case 'serverinfo_uid':
|
||||||
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
$html = "<option value=\"\">" . lang("{$viewDatas['class_path']}.label.{$field}") . " 선택" . "</option>";
|
||||||
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
foreach ($viewDatas['control']['field_optons'][$field] as $key => $entity) {
|
||||||
$isSelected = $key == $value ? ' selected' : '';
|
$isSelected = $key == $value ? ' selected' : '';
|
||||||
$attribute = "";
|
$html .= sprintf("<option value=\"%s\"%s>%s</option>", $key, $isSelected, $entity->getCustomTitle());
|
||||||
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());
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$html = parent::form_dropdown_common_process($field, $value, $viewDatas, $extras, $attributes);
|
$html = parent::form_dropdown_common_process($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $html;
|
return $html;
|
||||||
@ -54,27 +42,9 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
|
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
|
||||||
break;
|
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':
|
case 'part_uid':
|
||||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
|
$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')";
|
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
|
||||||
$attributes = ['disabled' => null, 'data-price' => 'getPrice'];
|
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
@ -94,13 +64,16 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
case 'SWITCH':
|
case 'SWITCH':
|
||||||
case 'IP':
|
case 'IP':
|
||||||
case 'CS':
|
case 'CS':
|
||||||
|
if (!array_key_exists($field, $viewDatas['entities'])) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
$temps = [];
|
$temps = [];
|
||||||
foreach ($viewDatas['serverPartEntities'] as $partEntity) {
|
foreach ($viewDatas['entities'][$field] as $entity) {
|
||||||
$modal = form_label(
|
$modal = form_label(
|
||||||
ICONS['SETUP'],
|
ICONS['SETUP'],
|
||||||
$field,
|
$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-toggle" => "modal",
|
||||||
"data-bs-target" => "#index_action_form",
|
"data-bs-target" => "#index_action_form",
|
||||||
"class" => "btn btn-sm btn-outline btn-circle",
|
"class" => "btn btn-sm btn-outline btn-circle",
|
||||||
@ -110,13 +83,25 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$temps[] = sprintf(
|
$temps[] = sprintf(
|
||||||
"%s%s*%s개%s",
|
"%s%s*%s개%s",
|
||||||
$modal,
|
$modal,
|
||||||
$partEntity->getTitle(),
|
$entity->getTitle(),
|
||||||
$partEntity->getCnt(),
|
$entity->getCnt(),
|
||||||
!$partEntity->getExtra() ? "" : "/" . $partEntity->getExtra()
|
!$entity->getExtra() ? "" : "/" . $entity->getExtra()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$value = implode("<BR>", $temps);
|
$value = implode("<BR>", $temps);
|
||||||
break;
|
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:
|
default:
|
||||||
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -153,4 +153,11 @@ class ClientService extends CustomerService
|
|||||||
$this->getModel()->orderBy("site ASC,name ASC");
|
$this->getModel()->orderBy("site ASC,name ASC");
|
||||||
parent::setOrderBy($field, $value);
|
parent::setOrderBy($field, $value);
|
||||||
}
|
}
|
||||||
|
//History
|
||||||
|
public function history(mixed $entity, array $formDatas): ClientEntity
|
||||||
|
{
|
||||||
|
//서비스 정보수정
|
||||||
|
$entity = $this->getModel()->modify($entity, $formDatas);
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -113,7 +113,7 @@ class ServiceService extends CustomerService
|
|||||||
//서버정보 정의
|
//서버정보 정의
|
||||||
$serverEntity = $this->getServerService()->getEntity(['serviceinfo_uid' => $entity->getPK()]);
|
$serverEntity = $this->getServerService()->getEntity(['serviceinfo_uid' => $entity->getPK()]);
|
||||||
if (!($serverEntity instanceof ServerEntity)) {
|
if (!($serverEntity instanceof ServerEntity)) {
|
||||||
throw new \Exception("{$entity->getPK()}에 해당하는 서버정보를 찾을수 없습니다.");
|
$serverEntity = new ServerEntity();
|
||||||
}
|
}
|
||||||
return $entity->setServerEntity($serverEntity);
|
return $entity->setServerEntity($serverEntity);
|
||||||
}
|
}
|
||||||
@ -266,4 +266,11 @@ class ServiceService extends CustomerService
|
|||||||
);
|
);
|
||||||
return parent::delete($entity);
|
return parent::delete($entity);
|
||||||
}
|
}
|
||||||
|
//History
|
||||||
|
public function history(mixed $entity, array $formDatas): ServiceEntity
|
||||||
|
{
|
||||||
|
//서비스 정보수정
|
||||||
|
$entity = $this->getModel()->modify($entity, $formDatas);
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -37,9 +37,6 @@ class ServerService extends EquipmentService
|
|||||||
"serviceinfo_uid",
|
"serviceinfo_uid",
|
||||||
"type",
|
"type",
|
||||||
"title",
|
"title",
|
||||||
"CPU",
|
|
||||||
"RAM",
|
|
||||||
"DISK",
|
|
||||||
"status"
|
"status"
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
@ -83,38 +80,10 @@ class ServerService extends EquipmentService
|
|||||||
if (!($entity instanceof ServerEntity)) {
|
if (!($entity instanceof ServerEntity)) {
|
||||||
throw new \Exception(__METHOD__ . "에서 형식오류: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;
|
return $entity;
|
||||||
}
|
}
|
||||||
//기본 기능부분
|
//기본 기능부분
|
||||||
//FieldForm관련용
|
//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용 장비코드 마지막번호 가져오기
|
//create용 장비코드 마지막번호 가져오기
|
||||||
final public function getLastestCode(string $format, int $default): string
|
final public function getLastestCode(string $format, int $default): string
|
||||||
{
|
{
|
||||||
@ -134,23 +103,6 @@ class ServerService extends EquipmentService
|
|||||||
throw new \Exception("Server코드[{$formDatas['code']}의 형식이 맞지않습니다");
|
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별 수정
|
//Service별 수정
|
||||||
public function modify(mixed $entity, array $formDatas): ServerEntity
|
public function modify(mixed $entity, array $formDatas): ServerEntity
|
||||||
{
|
{
|
||||||
|
|||||||
@ -15,11 +15,20 @@
|
|||||||
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
|
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
|
||||||
<div id="container" class="layout_content">
|
<div id="container" class="layout_content">
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
<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">
|
<div class="index_body p-4">
|
||||||
<!-- index_body -->
|
<!-- index_body -->
|
||||||
<div class="row align-items-end rounded border border-gray p-2 mt-3">
|
<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">
|
<tr class="text-center">
|
||||||
<th rowspan="2">
|
<th rowspan="2">
|
||||||
<div><?= $viewDatas['entity']->getTitle() ?></div>
|
<div><?= $viewDatas['entity']->getTitle() ?></div>
|
||||||
@ -58,17 +67,19 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</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="row align-items-center rounded border border-gray p-2 mt-3">
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<div class="text-center fw-bold">고객 비고</div>
|
<div class="text-center fw-bold">고객 비고</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-10">
|
<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>
|
||||||
<div class="col-1">
|
<div class="col-1">
|
||||||
<button class="btn btn-primary">저장</button>
|
<?= form_submit('', '저장', array("class" => "btn btn-outline btn-primary")); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<?= form_close() ?>
|
||||||
<?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['userinfo_uid' => $viewDatas['entity']->getPK()]) ?>
|
<?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['userinfo_uid' => $viewDatas['entity']->getPK()]) ?>
|
||||||
</div>
|
</div>
|
||||||
<!-- index_body -->
|
<!-- index_body -->
|
||||||
|
|||||||
@ -51,7 +51,6 @@
|
|||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>
|
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -79,18 +79,10 @@
|
|||||||
</td>
|
</td>
|
||||||
<td><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></td>
|
<td><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<table class="table table-bordered table-striped m-0 p-0">
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getPK(), 'types' => SERVERPART['SERVER_PARTTYPES']]) ?>
|
||||||
<?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>
|
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>
|
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -24,16 +24,7 @@
|
|||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></td>>
|
||||||
<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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
||||||
|
|||||||
@ -35,27 +35,21 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th class="index_head_short_column">번호</th>
|
<th class="index_head_short_column">번호</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('site', lang("{$viewDatas['class_path']}.label.site"), $viewDatas) ?>/
|
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?> /
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('location', lang("{$viewDatas['class_path']}.label.location"), $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>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>/
|
<?= $viewDatas['service']->getHelper()->getListLabel('serverinfo_uid', lang("{$viewDatas['class_path']}.label.serverinfo_uid"), $viewDatas) ?>/SWITCH/IP/OS
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>
|
|
||||||
</th>
|
</th>
|
||||||
<th class="index_head_short_column">
|
<th class="index_head_short_column">
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('serverinfo_uid', lang("{$viewDatas['class_path']}.label.serverinfo_uid"), $viewDatas) ?>/
|
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?> /
|
||||||
<?= $viewDatas['service']->getHelper()->getListLabel('start_at', lang("{$viewDatas['class_path']}.label.start_at"), $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>
|
||||||
<th class="index_head_short_column">
|
<!-- <th class="index_head_short_column"><?= $viewDatas['service']->getHelper()->getListLabel('user_uid', lang("{$viewDatas['class_path']}.label.user_uid"), $viewDatas) ?></th> -->
|
||||||
<?= $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">작업</th>
|
<th class="index_head_short_column">작업</th>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -64,41 +58,28 @@
|
|||||||
<?php $viewDatas['entity'] = $entity; ?>
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
<?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>
|
<td nowrap>
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?></div>
|
<div>
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?></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>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></div>
|
<?= $viewDatas['service']->getHelper()->getFieldView('serverinfo_uid', $entity->getServerEntity()->getTitle() ?? "", $viewDatas) ?> /
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?></div>
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partservice']) ?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<td nowrap>
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('serverinfo_uid', $entity->getServerEntity()->getTitle(), $viewDatas) ?></div>
|
<?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?> /
|
||||||
<div><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></div>
|
<?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?> /
|
||||||
|
<?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
<td nowrap>
|
<!-- <td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->user_uid, $viewDatas) ?></td> -->
|
||||||
<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>
|
<td nowrap>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('history', '', $viewDatas) ?>
|
|
||||||
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -24,16 +24,7 @@
|
|||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getServerEntity()->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></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>
|
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
||||||
|
|||||||
11
app/Views/cells/serverpart/partdetail.php
Normal file
11
app/Views/cells/serverpart/partdetail.php
Normal 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>
|
||||||
3
app/Views/cells/serverpart/partservice.php
Normal file
3
app/Views/cells/serverpart/partservice.php
Normal 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) ?>
|
||||||
8
app/Views/cells/serverpart/parttable.php
Normal file
8
app/Views/cells/serverpart/parttable.php
Normal 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>
|
||||||
@ -1,60 +1,68 @@
|
|||||||
<?php foreach ($cellDatas['entities'] as $entity): ?>
|
<style>
|
||||||
<?php $cellDatas['entity'] = $entity ?>
|
.note-box {
|
||||||
<?php $unpaids = $cellDatas['paymentService']->getUnPaids('serviceinfo_uid', ['serviceinfo_uid' => $entity->getPK()]) ?>
|
width: 100%;
|
||||||
<div class="row align-items-end rounded border border-gray p-2 mt-3">
|
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">
|
<table class="table table-bordered table-hover table-striped">
|
||||||
<tr class="text-center">
|
<tr class="text-center">
|
||||||
<th><a href="#">[상세정보]</a></th>
|
<th style="width: 120px"><a href="#">[상세정보]</a></th>
|
||||||
<th>사이트</th>
|
<th style="width: 120px">사이트/위치/형식</th>
|
||||||
<th>위치</th>
|
<th style="width: 250px">CPU / 메모리 / 저장장치</th>
|
||||||
<th>형식</th>
|
<th style="width: 250px">OS / SOFTWARE</th>
|
||||||
<th>CPU</th>
|
<th style="width: 200px">IP주소</th>
|
||||||
<th>메모리</th>
|
<th style="width: 200px">CS</th>
|
||||||
<th>저장장치</th>
|
<th>서비스 비고</th>
|
||||||
<th>OS</th>
|
<th style="width: 200px">결제처리</th>
|
||||||
<th>SOFTWARE</th>
|
|
||||||
<th>IP주소</th>
|
|
||||||
<th>CS</th>
|
|
||||||
<th>결제처리</th>
|
|
||||||
</tr>
|
</tr>
|
||||||
<tr class="text-center">
|
<tr class="text-left">
|
||||||
<td rowspan="4">
|
<td rowspan="4" class="text-center">
|
||||||
<div><?= $entity->getCode() ?></div>
|
<div><?= $entity->getCode() ?></div>
|
||||||
<div><?= $entity->getServerEntity()->getCode() ?></div>
|
<div><?= $entity->getServerEntity()->getCode() ?></div>
|
||||||
</td>
|
</td>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $cellDatas) ?></td>
|
<td class="text-center">
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $cellDatas) ?></td>
|
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?></div>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $cellDatas) ?></td>
|
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?></div>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('CPU', "", $cellDatas) ?></td>
|
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('type', $entity->getType(), $serviceCellDatas) ?></div>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('RAM', "", $cellDatas) ?></td>
|
</td>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('DISK', "", $cellDatas) ?></td>
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partdetail']) ?>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('OS', "", $cellDatas) ?></td>
|
<td>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('SOFTWARE', "", $cellDatas) ?></td>
|
<?= form_open("/admin/customer/service/history/{$entity->getPK()}?return_url=" . urlencode(current_url()), ['method' => "post"]) ?>
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('IP', "", $cellDatas) ?></td>
|
<div class="row align-items-center">
|
||||||
<td><?= $cellDatas['service']->getHelper()->getFieldView('CS', "", $cellDatas) ?></td>
|
<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">
|
<td rowspan="4">
|
||||||
<table class="table">
|
<table class="table m-0 p-0">
|
||||||
<tr class="text-center">
|
<tr>
|
||||||
<th class="text-start fw-bold">결제일</th>
|
<th class="fw-bold">결제일</th>
|
||||||
<td><?= $entity->getBillingAT() ?></td>
|
<td><?= $entity->getBillingAT() ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th class="text-start fw-bold">결제금</th>
|
<th class="fw-bold">결제금</th>
|
||||||
<td class="amount-green"><?= number_format(intval($entity->getBillingAT())) ?>원</td>
|
<td class="amount-green"><?= number_format(intval($entity->getAmount())) ?>원</td>
|
||||||
</tr>
|
</tr>
|
||||||
<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>
|
<td class="amount-red"><?= array_key_exists('amount', $unpaids) ? number_format($unpaids['amount']) : 0 ?>원</td>
|
||||||
</tr>
|
</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>
|
</table>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
|
||||||
<th colspan="10">서비스 비고</th>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td colspan="10"><?= nl2br($entity->getHistory()) ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -1,8 +0,0 @@
|
|||||||
table.layout_middle td.layout_right div#container * {
|
|
||||||
font-size:12px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.note-box {
|
|
||||||
height: 150px;
|
|
||||||
resize: none;
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user