dbmsv4 init...1
This commit is contained in:
parent
5748324945
commit
caa933d565
@ -3,46 +3,33 @@
|
|||||||
namespace App\Cells\Customer;
|
namespace App\Cells\Customer;
|
||||||
|
|
||||||
use App\Helpers\Equipment\ServerPartHelper;
|
use App\Helpers\Equipment\ServerPartHelper;
|
||||||
use App\Services\Customer\ServiceService;
|
|
||||||
use App\Services\PaymentService;
|
use App\Services\PaymentService;
|
||||||
|
|
||||||
class ServiceCell extends CustomerCell
|
class ServiceCell extends CustomerCell
|
||||||
{
|
{
|
||||||
|
|
||||||
private ?PaymentService $_paymentService = null;
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new ServiceService());
|
parent::__construct(service('customer_serviceservice'));
|
||||||
}
|
|
||||||
final public function getPaymentService(): PaymentService
|
|
||||||
{
|
|
||||||
if (!$this->_paymentService) {
|
|
||||||
$this->_paymentService = new PaymentService();
|
|
||||||
}
|
|
||||||
return $this->_paymentService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function detail(array $params): string
|
public function detail(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->setAction(__FUNCTION__);
|
$this->getService()->action_init_process(__FUNCTION__);
|
||||||
$this->getService()->setFormFields();
|
|
||||||
$this->getService()->setFormFilters();
|
|
||||||
$this->getService()->setFormRules();
|
|
||||||
$this->getService()->setFormOptions();
|
|
||||||
//서비스별 미납 Count
|
//서비스별 미납 Count
|
||||||
$unPaids = $this->getPaymentService()->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
$unPaids = service('paymentservice')->getUnPaids('serviceinfo_uid', ['clientinfo_uid' => $params['clientinfo_uid']]);
|
||||||
//서비스별 서버리스트
|
//서비스별 서버리스트
|
||||||
$entities = [];
|
$entities = [];
|
||||||
$childServers = [];
|
$childServers = [];
|
||||||
foreach ($this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]) as $entity) {
|
foreach ($this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid']]) as $entity) {
|
||||||
$entities[] = $entity;
|
$entities[] = $entity;
|
||||||
$childServers[$entity->getPK()] = $this->getService()->getServerService()->getEntities(['serviceinfo_uid' => $entity->getPK()]);
|
$childServers[$entity->getPK()] = service('equipment_serverservice')->getEntities(['serviceinfo_uid' => $entity->getPK()]);
|
||||||
}
|
}
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/service/' . $template, [
|
return view('cells/service/' . $template, [
|
||||||
'serviceCellDatas' => [
|
'serviceCellDatas' => [
|
||||||
'control' => $this->getService()->getControlDatas(),
|
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
|
||||||
'service' => $this->getService(),
|
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
|
||||||
|
'helper' => $this->getService()->getHelper(),
|
||||||
'unPaids' => $unPaids,
|
'unPaids' => $unPaids,
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
'childServers' => $childServers,
|
'childServers' => $childServers,
|
||||||
|
|||||||
@ -4,32 +4,17 @@ namespace App\Cells\Equipment;
|
|||||||
|
|
||||||
|
|
||||||
use App\Entities\Equipment\ServerEntity;
|
use App\Entities\Equipment\ServerEntity;
|
||||||
use App\Services\Equipment\ServerPartService;
|
|
||||||
use App\Services\Equipment\ServerService;
|
|
||||||
|
|
||||||
class ServerPartCell extends EquipmentCell
|
class ServerPartCell extends EquipmentCell
|
||||||
{
|
{
|
||||||
private ?ServerService $_serverService = null;
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new ServerPartService());
|
parent::__construct(service('equipment_serverpartservice'));
|
||||||
}
|
|
||||||
|
|
||||||
final public function getServerService(): ServerService
|
|
||||||
{
|
|
||||||
if (!$this->_serverService) {
|
|
||||||
$this->_serverService = new ServerService();
|
|
||||||
}
|
|
||||||
return $this->_serverService;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function parttable(array $params): string
|
public function parttable(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->setAction(__FUNCTION__);
|
$this->getService()->action_init_process(__FUNCTION__);
|
||||||
$this->getService()->setFormFields();
|
|
||||||
$this->getService()->setFormFilters();
|
|
||||||
$this->getService()->setFormRules();
|
|
||||||
$this->getService()->setFormOptions();
|
|
||||||
if (!array_key_exists('serverinfo_uid', $params)) {
|
if (!array_key_exists('serverinfo_uid', $params)) {
|
||||||
return "서버정보를 정의하셔야합니다.";
|
return "서버정보를 정의하셔야합니다.";
|
||||||
}
|
}
|
||||||
@ -37,7 +22,7 @@ class ServerPartCell extends EquipmentCell
|
|||||||
return "부품정보 형태(Types) 리스트를 정의하셔야합니다.";
|
return "부품정보 형태(Types) 리스트를 정의하셔야합니다.";
|
||||||
}
|
}
|
||||||
//서버정보
|
//서버정보
|
||||||
$serverEntity = $this->getServerService()->getEntity($params['serverinfo_uid']);
|
$serverEntity = service('equipment_serverservice')->getEntity($params['serverinfo_uid']);
|
||||||
if (!$serverEntity instanceof ServerEntity) {
|
if (!$serverEntity instanceof ServerEntity) {
|
||||||
return "[{$params['serverinfo_uid']}]의 서버정보를 확인할수없습니다..";
|
return "[{$params['serverinfo_uid']}]의 서버정보를 확인할수없습니다..";
|
||||||
}
|
}
|
||||||
@ -50,8 +35,9 @@ class ServerPartCell extends EquipmentCell
|
|||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/serverpart/' . $template, [
|
return view('cells/serverpart/' . $template, [
|
||||||
'serverPartCellDatas' => [
|
'serverPartCellDatas' => [
|
||||||
'control' => $this->getService()->getControlDatas(),
|
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
|
||||||
'service' => $this->getService(),
|
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
|
||||||
|
'helper' => $this->getService()->getHelper(),
|
||||||
'serverinfo_uid' => $params['serverinfo_uid'],
|
'serverinfo_uid' => $params['serverinfo_uid'],
|
||||||
'types' => $params['types'],
|
'types' => $params['types'],
|
||||||
'serverEntity' => $serverEntity,
|
'serverEntity' => $serverEntity,
|
||||||
|
|||||||
@ -1,30 +1,27 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Cells\Customer;
|
namespace App\Cells;
|
||||||
|
|
||||||
use App\Services\PaymentService;
|
use App\Services\PaymentService;
|
||||||
|
|
||||||
class PaymentCell extends CustomerCell
|
class PaymentCell extends CommonCell
|
||||||
{
|
{
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct(new PaymentService());
|
parent::__construct(service('paymentservice'));
|
||||||
}
|
}
|
||||||
|
|
||||||
public function detail(array $params): string
|
public function detail(array $params): string
|
||||||
{
|
{
|
||||||
$this->getService()->setAction(__FUNCTION__);
|
$this->getService()->action_init_process(__FUNCTION__);
|
||||||
$this->getService()->setFormFields();
|
|
||||||
$this->getService()->setFormFilters();
|
|
||||||
$this->getService()->setFormRules();
|
|
||||||
$this->getService()->setFormOptions();
|
|
||||||
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid'], 'billing' => PAYMENT['BILLING']['ONETIME'], 'status' => STATUS['UNPAID']]);
|
$entities = $this->getService()->getEntities(['clientinfo_uid' => $params['clientinfo_uid'], 'billing' => PAYMENT['BILLING']['ONETIME'], 'status' => STATUS['UNPAID']]);
|
||||||
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
|
||||||
return view('cells/payment/' . $template, [
|
return view('cells/payment/' . $template, [
|
||||||
'serviceCellDatas' => [
|
'serviceCellDatas' => [
|
||||||
'control' => $this->getService()->getControlDatas(),
|
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
|
||||||
'service' => $this->getService(),
|
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
|
||||||
|
'helper' => $this->getService()->getHelper(),
|
||||||
'entities' => $entities,
|
'entities' => $entities,
|
||||||
]
|
]
|
||||||
]);
|
]);
|
||||||
@ -138,7 +138,7 @@ class Services extends BaseService
|
|||||||
new \App\Models\Customer\AccountModel(),
|
new \App\Models\Customer\AccountModel(),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
public static function customer_coupontservice($getShared = true): CouponService
|
public static function customer_couponservice($getShared = true): CouponService
|
||||||
{
|
{
|
||||||
if ($getShared) {
|
if ($getShared) {
|
||||||
return static::getSharedInstance(__FUNCTION__);
|
return static::getSharedInstance(__FUNCTION__);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
use App\Entities\UserEntity;
|
use App\Entities\BoardEntity;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
@ -20,20 +20,18 @@ class BoardController extends AdminController
|
|||||||
//Action작업관련
|
//Action작업관련
|
||||||
protected function getEntityClass(): string
|
protected function getEntityClass(): string
|
||||||
{
|
{
|
||||||
return UserEntity::class;
|
return BoardEntity::class;
|
||||||
}
|
}
|
||||||
//기본 함수 작업
|
//기본 함수 작업
|
||||||
//Custom 추가 함수
|
//Custom 추가 함수
|
||||||
public function latest(string $category): ResponseInterface
|
public function latest(string $category): ResponseInterface
|
||||||
{
|
{
|
||||||
$action = __FUNCTION__;
|
$this->action_init_process(__FUNCTION__);
|
||||||
$this->action_init_process($action);
|
|
||||||
return $this->response->setJSON($this->service->getLatest($category));
|
return $this->response->setJSON($this->service->getLatest($category));
|
||||||
}
|
}
|
||||||
public function reqeusttask(): ResponseInterface
|
public function reqeusttask(): ResponseInterface
|
||||||
{
|
{
|
||||||
$action = __FUNCTION__;
|
$this->action_init_process(__FUNCTION__);
|
||||||
$this->action_init_process($action);
|
|
||||||
return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID()));
|
return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,6 +3,7 @@
|
|||||||
namespace App\Controllers\Admin\Customer;
|
namespace App\Controllers\Admin\Customer;
|
||||||
|
|
||||||
use App\Entities\Customer\ClientEntity;
|
use App\Entities\Customer\ClientEntity;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
@ -23,4 +24,47 @@ class ClientController extends CustomerController
|
|||||||
}
|
}
|
||||||
//기본 함수 작업
|
//기본 함수 작업
|
||||||
//Custom 추가 함수
|
//Custom 추가 함수
|
||||||
|
//고객 상세정보
|
||||||
|
public function detail(mixed $uid): string|RedirectResponse
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$action = __FUNCTION__;
|
||||||
|
$this->action_init_process($action);
|
||||||
|
//Return Url정의
|
||||||
|
$this->getAuthContext()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
|
||||||
|
//일괄작업용 Fields정의
|
||||||
|
$entity = $this->service->getEntity($uid);
|
||||||
|
if (!$entity instanceof ClientEntity) {
|
||||||
|
throw new \Exception("{$uid}에 해당하는 고객정보를 찾을수 없습니다.");
|
||||||
|
}
|
||||||
|
$this->addViewDatas('totalCounts', service('equipment_serverservice')->getTotalServiceCount(['serviceinfo.clientinfo_uid' => $entity->getPK()]));
|
||||||
|
$this->addViewDatas('totalAmounts', service('customer_serviceservice')->getTotalAmounts([
|
||||||
|
'clientinfo_uid' => $entity->getPK(),
|
||||||
|
'status' => STATUS['AVAILABLE']
|
||||||
|
]));
|
||||||
|
//서비스별 미납 Count
|
||||||
|
$this->addViewDatas('unPaids', service('paymentservice')->getUnPaids('clientinfo_uid', [
|
||||||
|
'clientinfo_uid' => $entity->getPK()
|
||||||
|
]));
|
||||||
|
$this->addViewDatas('serviceEntities', service('customer_serviceservice')->getEntities(['clientinfo_uid' => $entity->getPK()]));
|
||||||
|
$this->addViewDatas('entity', $entity);
|
||||||
|
helper(['form']);
|
||||||
|
return $this->action_render_process($action, $this->getViewDatas(), $this->request->getVar('ActionTemplate') ?? 'client');
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $e->getMessage();
|
||||||
|
// return $this->action_redirect_process('error', "{$this->getTitle()}에서 {$uid} 수정폼 오류:" . $e->getMessage());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function history(int $uid): RedirectResponse|string
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$action = __FUNCTION__;
|
||||||
|
$this->action_init_process($action);
|
||||||
|
$this->addViewDatas('entity', $this->service->modify($uid, $this->request->getPost()));
|
||||||
|
return $this->action_redirect_process('error', "{$this->getTitle()}에서 비고설정이 완료되었습니다.");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
return $e->getMessage();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -49,19 +49,9 @@ abstract class AuthController extends AbstractWebController
|
|||||||
abstract protected function login_process(): UserEntity;
|
abstract protected function login_process(): UserEntity;
|
||||||
final public function login(): RedirectResponse
|
final public function login(): RedirectResponse
|
||||||
{
|
{
|
||||||
try {
|
$this->login_process();
|
||||||
$this->login_process();
|
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
|
||||||
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
|
return redirect()->to($redirect_url)->with('message', MESSAGES['LOGIN']);
|
||||||
return redirect()->to($redirect_url)->with('message', MESSAGES['LOGIN']);
|
|
||||||
} catch (ValidationException $e) {
|
|
||||||
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
|
|
||||||
log_message('error', $e->getMessage());
|
|
||||||
return redirect()->back()->withInput()->with('message', $e->getMessage());
|
|
||||||
} catch (\Exception $e) {
|
|
||||||
log_message('error', $e->getMessage());
|
|
||||||
return redirect()->back()->withInput()->with('message', $e->getMessage());
|
|
||||||
// return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('message', $e->getMessage());
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
//로그아웃
|
//로그아웃
|
||||||
abstract protected function logout_process(): void;
|
abstract protected function logout_process(): void;
|
||||||
|
|||||||
@ -6,8 +6,8 @@ use App\DTOs\CommonDTO;
|
|||||||
|
|
||||||
abstract class AuthDTO extends CommonDTO
|
abstract class AuthDTO extends CommonDTO
|
||||||
{
|
{
|
||||||
public function __construct()
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,11 +8,6 @@ class GoogleDTO extends AuthDTO
|
|||||||
public $access_code = null;
|
public $access_code = null;
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,11 +9,6 @@ class LocalDTO extends AuthDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -14,11 +14,6 @@ class BoardDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,9 +2,62 @@
|
|||||||
|
|
||||||
namespace App\DTOs;
|
namespace App\DTOs;
|
||||||
|
|
||||||
|
use ReflectionClass;
|
||||||
|
use ReflectionNamedType;
|
||||||
|
|
||||||
abstract class CommonDTO
|
abstract class CommonDTO
|
||||||
{
|
{
|
||||||
public function __construct() {}
|
public function __construct(array $datas = [])
|
||||||
|
{
|
||||||
|
// 데이터가 없으면 바로 리턴
|
||||||
|
if (empty($datas)) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// $this는 이 시점에 자식 클래스(AccountDTO)의 인스턴스입니다.
|
||||||
|
$reflection = new ReflectionClass($this);
|
||||||
|
|
||||||
|
foreach ($datas as $key => $value) {
|
||||||
|
// 1. 속성이 존재하는지 확인
|
||||||
|
if (!$reflection->hasProperty($key)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
$property = $reflection->getProperty($key);
|
||||||
|
|
||||||
|
// public이 아닌 속성도 접근 가능하게 설정 (필요시)
|
||||||
|
// $property->setAccessible(true);
|
||||||
|
|
||||||
|
// 2. 속성의 타입 정보를 가져옴
|
||||||
|
$type = $property->getType();
|
||||||
|
|
||||||
|
// 값을 할당하기 전 정제된 값을 담을 변수
|
||||||
|
$assignValue = $value;
|
||||||
|
|
||||||
|
// 3. 빈 문자열("") 처리
|
||||||
|
// HTML 폼에서 온 빈 값은 null로 처리해야 ?int 등에 들어갈 수 있음
|
||||||
|
if ($value === '') {
|
||||||
|
$assignValue = null;
|
||||||
|
}
|
||||||
|
// 4. 타입에 따른 강제 형변환 (Casting)
|
||||||
|
elseif ($type instanceof ReflectionNamedType) {
|
||||||
|
$typeName = $type->getName();
|
||||||
|
|
||||||
|
// int 타입이고 값이 숫자형일 때
|
||||||
|
if ($typeName === 'int' && is_numeric($value)) {
|
||||||
|
$assignValue = (int) $value;
|
||||||
|
}
|
||||||
|
// float 타입이고 값이 숫자형일 때
|
||||||
|
elseif ($typeName === 'float' && is_numeric($value)) {
|
||||||
|
$assignValue = (float) $value;
|
||||||
|
}
|
||||||
|
// 필요하다면 bool 처리 등 추가 가능
|
||||||
|
}
|
||||||
|
|
||||||
|
// 5. 값 할당
|
||||||
|
$this->{$key} = $assignValue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public function __get(string $name)
|
public function __get(string $name)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -20,11 +20,6 @@ class AccountDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\DTOs\Customer;
|
|
||||||
|
|
||||||
use App\DTOs\CommonDTO;
|
use App\DTOs\CommonDTO;
|
||||||
|
|
||||||
class ClientDTO extends CommonDTO
|
class ClientDTO extends CommonDTO
|
||||||
@ -9,11 +7,15 @@ class ClientDTO extends CommonDTO
|
|||||||
public ?int $uid = null;
|
public ?int $uid = null;
|
||||||
public ?int $user_uid = null;
|
public ?int $user_uid = null;
|
||||||
public ?string $site = null;
|
public ?string $site = null;
|
||||||
public ?string $role = null;
|
|
||||||
|
// __get이 동작하려면 public이 아닌 protected여야 합니다.
|
||||||
|
// public으로 선언되어 있으면 $dto->role 접근 시 __get을 거치지 않고 직접 접근합니다.
|
||||||
|
protected ?string $role = null;
|
||||||
|
|
||||||
public ?string $name = null;
|
public ?string $name = null;
|
||||||
public ?string $phone = null;
|
public ?string $phone = null;
|
||||||
public ?string $email = null;
|
public ?string $email = null;
|
||||||
public ?string $history = null;
|
public ?string $history = null;
|
||||||
public ?int $account_balance = null;
|
public ?int $account_balance = null;
|
||||||
public ?int $coupon_balance = null;
|
public ?int $coupon_balance = null;
|
||||||
public ?int $point_balance = null;
|
public ?int $point_balance = null;
|
||||||
@ -21,24 +23,39 @@ class ClientDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
// 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기
|
||||||
foreach ($datas as $key => $value) {
|
if (isset($datas['role']) && is_array($datas['role'])) {
|
||||||
if (property_exists($this, $key)) {
|
$datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']);
|
||||||
if ($key === 'role' && is_array($value)) {
|
|
||||||
// 배열일 경우, 쉼표로 구분된 문자열로 변환하여 저장
|
|
||||||
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $value);
|
|
||||||
} else {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출
|
||||||
|
// 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다.
|
||||||
|
parent::__construct($datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
||||||
|
*/
|
||||||
public function __get(string $name)
|
public function __get(string $name)
|
||||||
{
|
{
|
||||||
// 'role' 속성을 요청했을 때만 특별히 처리
|
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
||||||
if ($name === 'role' && is_string($this->role)) {
|
if ($name === 'role') {
|
||||||
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
if (is_string($this->role)) {
|
||||||
|
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
||||||
|
}
|
||||||
|
return []; // null이거나 값이 없으면 빈 배열 반환
|
||||||
}
|
}
|
||||||
return parent::__get($name);
|
|
||||||
|
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
||||||
|
// CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로,
|
||||||
|
// 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다.
|
||||||
|
return $this->{$name} ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
||||||
|
// (선택 사항)
|
||||||
|
public function setRole(array $roles)
|
||||||
|
{
|
||||||
|
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,6 @@ class CouponDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,6 @@ class PointDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,16 +22,11 @@ class ServiceDTO extends CommonDTO
|
|||||||
public ?int $amount = null;
|
public ?int $amount = null;
|
||||||
public ?string $start_at = null;
|
public ?string $start_at = null;
|
||||||
public ?string $end_at = null;
|
public ?string $end_at = null;
|
||||||
public ?int $history = null;
|
public ?string $history = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,6 @@ class LineDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,9 +8,9 @@ class ServerDTO extends CommonDTO
|
|||||||
{
|
{
|
||||||
public ?int $uid = null;
|
public ?int $uid = null;
|
||||||
public ?string $code = null;
|
public ?string $code = null;
|
||||||
public ?string $type = null;
|
public ?string $type = null;
|
||||||
public ?string $switch = null;
|
public ?string $switch = null;
|
||||||
public ?string $ip = null;
|
public ?string $ip = null;
|
||||||
public ?string $os = null;
|
public ?string $os = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?int $price = null;
|
public ?int $price = null;
|
||||||
@ -19,11 +19,6 @@ class ServerDTO extends CommonDTO
|
|||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,20 +8,15 @@ class ServerPartDTO extends CommonDTO
|
|||||||
{
|
{
|
||||||
public ?int $uid = null;
|
public ?int $uid = null;
|
||||||
public ?string $serverinfo_uid = null;
|
public ?string $serverinfo_uid = null;
|
||||||
public ?string $type = null;
|
public ?string $type = null;
|
||||||
public ?string $billing = null;
|
public ?string $billing = null;
|
||||||
public ?int $part_uid = null;
|
public ?int $part_uid = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?int $cnt = null;
|
public ?int $cnt = null;
|
||||||
public ?string $extra = null;
|
public ?string $extra = null;
|
||||||
public ?string $amount = null;
|
public ?string $amount = null;
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,11 +12,6 @@ class MylogDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,18 +8,13 @@ class CPUDTO extends CommonDTO
|
|||||||
{
|
{
|
||||||
public ?int $uid = null;
|
public ?int $uid = null;
|
||||||
public ?string $title = null;
|
public ?string $title = null;
|
||||||
public ?int $price = null;
|
public ?int $price = null;
|
||||||
public ?string $used = null;
|
public ?string $used = null;
|
||||||
public ?int $stock = null;
|
public ?int $stock = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,11 +19,6 @@ class CSDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,6 @@ class DISKDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,11 +18,6 @@ class IPDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,6 @@ class RAMDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,6 @@ class SOFTWAREDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,11 +16,6 @@ class SWITCHDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,11 +19,6 @@ class PaymentDTO extends CommonDTO
|
|||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct($datas);
|
||||||
foreach ($datas as $key => $value) {
|
|
||||||
if (property_exists($this, $key)) {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,29 +11,46 @@ class UserDTO extends CommonDTO
|
|||||||
public ?string $name = null;
|
public ?string $name = null;
|
||||||
public ?string $email = null;
|
public ?string $email = null;
|
||||||
public ?string $mobile = null;
|
public ?string $mobile = null;
|
||||||
public ?string $role = null;
|
// __get이 동작하려면 public이 아닌 protected여야 합니다.
|
||||||
|
// public으로 선언되어 있으면 $dto->role 접근 시 __get을 거치지 않고 직접 접근합니다.
|
||||||
|
protected ?string $role = null;
|
||||||
public ?string $status = null;
|
public ?string $status = null;
|
||||||
|
|
||||||
public function __construct(array $datas = [])
|
public function __construct(array $datas = [])
|
||||||
{
|
{
|
||||||
parent::__construct();
|
// 1. [전처리] role이 배열로 들어왔다면 문자열로 변환하여 $datas 덮어쓰기
|
||||||
foreach ($datas as $key => $value) {
|
if (isset($datas['role']) && is_array($datas['role'])) {
|
||||||
if (property_exists($this, $key)) {
|
$datas['role'] = implode(DEFAULTS["DELIMITER_ROLE"], $datas['role']);
|
||||||
if ($key === 'role' && is_array($value)) {
|
|
||||||
// 배열일 경우, 쉼표로 구분된 문자열로 변환하여 저장
|
|
||||||
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $value);
|
|
||||||
} else {
|
|
||||||
$this->{$key} = $value;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 2. 변환된 $datas를 가지고 부모(CommonDTO) 생성자 호출
|
||||||
|
// 이제 'role'은 문자열이므로 부모 클래스의 Reflection 로직이나 타입 검사를 통과합니다.
|
||||||
|
parent::__construct($datas);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* role 속성을 읽을 때 자동으로 배열로 변환해서 반환
|
||||||
|
*/
|
||||||
public function __get(string $name)
|
public function __get(string $name)
|
||||||
{
|
{
|
||||||
// 'role' 속성을 요청했을 때만 특별히 처리
|
// role을 요청했고, 실제 데이터가 문자열로 존재한다면 배열로 변환
|
||||||
if ($name === 'role' && is_string($this->role)) {
|
if ($name === 'role') {
|
||||||
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
if (is_string($this->role)) {
|
||||||
|
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
|
||||||
|
}
|
||||||
|
return []; // null이거나 값이 없으면 빈 배열 반환
|
||||||
}
|
}
|
||||||
return parent::__get($name);
|
|
||||||
|
// 부모에게 위임 (혹시 CommonDTO에도 __get이 있다면)
|
||||||
|
// CommonDTO에 __get이 없다면 이 줄은 에러가 날 수 있으므로,
|
||||||
|
// 보통은 아래처럼 처리하거나 속성을 리턴해야 합니다.
|
||||||
|
return $this->{$name} ?? null;
|
||||||
|
}
|
||||||
|
|
||||||
|
// role 값을 설정할 때도 배열을 받을 수 있게 하려면 __set도 필요할 수 있습니다.
|
||||||
|
// (선택 사항)
|
||||||
|
public function setRole(array $roles)
|
||||||
|
{
|
||||||
|
$this->role = implode(DEFAULTS["DELIMITER_ROLE"], $roles);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,4 +36,28 @@ class ServerPartForm extends EquipmentForm
|
|||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
}
|
}
|
||||||
|
public function getFormOption(string $field, array $options = ['options' => [], 'extras' => [], 'atttributes' => []]): array
|
||||||
|
{
|
||||||
|
$tempOptions = ['' => lang("{$this->getAttribute('class_path')}.label.{$field}") . " 선택"];
|
||||||
|
switch ($field) {
|
||||||
|
case 'part_uid':
|
||||||
|
foreach (service('equipment_serverpartservice')->getEntities() as $entity) {
|
||||||
|
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
||||||
|
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
||||||
|
}
|
||||||
|
$options['options'] = $tempOptions;
|
||||||
|
break;
|
||||||
|
case 'serverinfo_uid':
|
||||||
|
foreach (service('equipment_serverservice')->getEntities() as $entity) {
|
||||||
|
$tempOptions[$entity->getPK()] = $entity->getTitle();
|
||||||
|
// $options['attributes'][$entity->getPK()] = ['data-role' => implode(DEFAULTS['DELIMITER_ROLE'], $entity->getRole())];
|
||||||
|
}
|
||||||
|
$options['options'] = $tempOptions;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$options = parent::getFormOption($field, $options);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -120,6 +120,13 @@ abstract class CommonHelper
|
|||||||
$extras['style'] = 'width:100%;';
|
$extras['style'] = 'width:100%;';
|
||||||
$form = form_textarea($field, html_entity_decode($value ?? "", ENT_QUOTES, 'UTF-8'), $extras);
|
$form = form_textarea($field, html_entity_decode($value ?? "", ENT_QUOTES, 'UTF-8'), $extras);
|
||||||
break;
|
break;
|
||||||
|
case 'status':
|
||||||
|
$forms = [];
|
||||||
|
array_shift($viewDatas['formOptions'][$field]['options']);
|
||||||
|
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
|
||||||
|
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;
|
||||||
|
$form = implode(" ", $forms);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' form-control' : 'form-control';
|
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' form-control' : 'form-control';
|
||||||
if (in_array($field, $viewDatas['formFilters'])) {
|
if (in_array($field, $viewDatas['formFilters'])) {
|
||||||
@ -160,9 +167,7 @@ abstract class CommonHelper
|
|||||||
case 'content':
|
case 'content':
|
||||||
case 'detail':
|
case 'detail':
|
||||||
case 'history':
|
case 'history':
|
||||||
if (in_array($viewDatas['action'], ['view', 'index'])) {
|
$value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
|
||||||
$value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case 'issue_at':
|
case 'issue_at':
|
||||||
case 'expired_at':
|
case 'expired_at':
|
||||||
|
|||||||
@ -8,6 +8,37 @@ class AccountHelper extends CustomerHelper
|
|||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
}
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
case 'bank':
|
||||||
|
$forms = [];
|
||||||
|
array_shift($viewDatas['formOptions'][$field]['options']);
|
||||||
|
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
|
||||||
|
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;
|
||||||
|
$form = implode(" ", $forms);
|
||||||
|
break;
|
||||||
|
case 'role':
|
||||||
|
$currentRoles = is_array($value)
|
||||||
|
? array_map('strtolower', array_map('trim', $value))
|
||||||
|
: [];
|
||||||
|
$form = '';
|
||||||
|
//Form페이지에서는 맨앞에것 제외하기 위함
|
||||||
|
$firstOption = array_shift($viewDatas['formOptions'][$field]['options']);
|
||||||
|
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label) {
|
||||||
|
$checked = in_array(strtolower(trim($key)), $currentRoles);
|
||||||
|
$form .= '<label class="me-3">';
|
||||||
|
$form .= form_checkbox('role[]', $key, $checked, ['id' => "role_{$key}", ...$extras]);
|
||||||
|
$form .= " {$label}";
|
||||||
|
$form .= '</label>';
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
|||||||
@ -11,6 +11,13 @@ class ClientHelper extends CustomerHelper
|
|||||||
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'site':
|
||||||
|
$forms = [];
|
||||||
|
array_shift($viewDatas['formOptions'][$field]['options']);
|
||||||
|
foreach ($viewDatas['formOptions'][$field]['options'] as $key => $label)
|
||||||
|
$forms[] = form_radio($field, $key, $key == $value, $extras) . $label;
|
||||||
|
$form = implode(" ", $forms);
|
||||||
|
break;
|
||||||
case 'role':
|
case 'role':
|
||||||
$currentRoles = is_array($value)
|
$currentRoles = is_array($value)
|
||||||
? array_map('strtolower', array_map('trim', $value))
|
? array_map('strtolower', array_map('trim', $value))
|
||||||
|
|||||||
@ -13,12 +13,11 @@ class ServiceHelper extends CustomerHelper
|
|||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'site':
|
case 'site':
|
||||||
$extras['onChange'] = "$('select[name=\'clientinfo_uid\']').select2('open')";
|
$extras['onChange'] = "$('select[name=\'clientinfo_uid\']').select2('open')";
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras);
|
$form = form_dropdown($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
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 = ['data-price' => 'price'];
|
$form = form_dropdown($field, $value, $viewDatas, $extras);
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
|
||||||
break;
|
break;
|
||||||
case 'amount':
|
case 'amount':
|
||||||
$form = form_input($field, 0, ["readonly" => "readonly", ...$extras]);
|
$form = form_input($field, 0, ["readonly" => "readonly", ...$extras]);
|
||||||
|
|||||||
@ -14,8 +14,8 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
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.querySelector('input[name=\'title\']').value = this.options[this.selectedIndex].getAttribute('data-title'); document.querySelector('input[name=\'amount\']').value = this.options[this.selectedIndex].getAttribute('data-price')";
|
$extras['onChange'] = "document.querySelector('input[name=\'title\']').value = this.options[this.selectedIndex].getAttribute('data-title'); document.querySelector('input[name=\'amount\']').value = this.options[this.selectedIndex].getAttribute('data-price')";
|
||||||
$attributes = ['data-title' => 'title', 'data-price' => 'price'];
|
// $attributes = ['data-title' => 'title', 'data-price' => 'price'];
|
||||||
$form = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes);
|
$form = form_dropdown($field, $value, $viewDatas, $extras);
|
||||||
break;
|
break;
|
||||||
case 'extra':
|
case 'extra':
|
||||||
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
if (array_key_exists('type', $viewDatas['control']['form_datas']) && $viewDatas['control']['form_datas']['type'] === 'DISK') {
|
||||||
@ -38,12 +38,12 @@ class ServerPartHelper extends EquipmentHelper
|
|||||||
$value = form_label(
|
$value = form_label(
|
||||||
sprintf(
|
sprintf(
|
||||||
"[%s] %s",
|
"[%s] %s",
|
||||||
lang("Equipment/ServerPart.TYPE")[$viewDatas['serverEntity']->getType()],
|
lang("Equipment/Server.TYPE")[$viewDatas['serverEntity']->getType()],
|
||||||
$viewDatas['serverEntity']->getCode(),
|
$viewDatas['serverEntity']->getCode(),
|
||||||
),
|
),
|
||||||
$field,
|
$field,
|
||||||
[
|
[
|
||||||
"data-src" => "/admin/equipment/server/modify/{$viewDatas['serverEntity']->getPK()}?ActionTemplate=server",
|
"data-src" => "/admin/equipment/server/modify/{$viewDatas['serverEntity']->getPK()}",
|
||||||
"data-bs-toggle" => "modal",
|
"data-bs-toggle" => "modal",
|
||||||
"data-bs-target" => "#modal_action_form",
|
"data-bs-target" => "#modal_action_form",
|
||||||
"class" => "btn btn-sm form-label-sm text-primary",
|
"class" => "btn btn-sm form-label-sm text-primary",
|
||||||
|
|||||||
@ -68,12 +68,14 @@ class AccountService extends CustomerService
|
|||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['bank', 'status'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
|
break;
|
||||||
case 'modify':
|
case 'modify':
|
||||||
case 'modify_form':
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
break;
|
break;
|
||||||
case 'view':
|
case 'view':
|
||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'created_at'];
|
||||||
|
|||||||
@ -65,15 +65,17 @@ class ClientService extends CustomerService
|
|||||||
'status',
|
'status',
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['site', 'role', 'status'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
|
break;
|
||||||
case 'modify':
|
case 'modify':
|
||||||
case 'modify_form':
|
case 'modify_form':
|
||||||
|
$fields = [...$fields, 'status'];
|
||||||
break;
|
break;
|
||||||
case 'view':
|
case 'view':
|
||||||
$fields = [...$fields, 'created_at'];
|
$fields = [...$fields, 'status', 'created_at'];
|
||||||
break;
|
break;
|
||||||
case 'index':
|
case 'index':
|
||||||
case 'download':
|
case 'download':
|
||||||
|
|||||||
@ -65,10 +65,13 @@ class ServerService extends EquipmentService
|
|||||||
];
|
];
|
||||||
$filters = [
|
$filters = [
|
||||||
"clientinfo_uid",
|
"clientinfo_uid",
|
||||||
|
'title',
|
||||||
|
'type',
|
||||||
|
'os',
|
||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
$indexFilter = $filters;
|
$indexFilter = $filters;
|
||||||
$batchjobFilters = ['status'];
|
$batchjobFilters = ['type', 'title', 'os', 'status'];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'create':
|
case 'create':
|
||||||
case 'create_form':
|
case 'create_form':
|
||||||
|
|||||||
137
app/Views/admin/client/detail.php
Normal file
137
app/Views/admin/client/detail.php
Normal file
@ -0,0 +1,137 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<style>
|
||||||
|
textarea.note-box {
|
||||||
|
width: 100%;
|
||||||
|
min-height: 150px;
|
||||||
|
height: 100%;
|
||||||
|
/* 부모의 높이를 꽉 채움 */
|
||||||
|
resize: none;
|
||||||
|
box-sizing: border-box;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
|
||||||
|
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
||||||
|
<!-- Layout Middle Start -->
|
||||||
|
<table class="layout_middle">
|
||||||
|
<tr>
|
||||||
|
<td class="layout_left">
|
||||||
|
<!-- Layout Left Start -->
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
||||||
|
<!-- Layout Left End -->
|
||||||
|
</td>
|
||||||
|
<td class="layout_right">
|
||||||
|
<!-- Layout Right Start -->
|
||||||
|
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
|
||||||
|
<div id="container" class="layout_content">
|
||||||
|
<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 m-0 p-0">
|
||||||
|
<tr class="text-center">
|
||||||
|
<th rowspan="2">
|
||||||
|
<div> <?= $viewDatas['entity']->getTitle() ?></div>
|
||||||
|
<div>
|
||||||
|
<?=
|
||||||
|
form_label(
|
||||||
|
"[청구서발행]",
|
||||||
|
'payment_invoice',
|
||||||
|
[
|
||||||
|
"data-src" => "/admin/customer/payment?clientinfo_uid=" . $viewDatas['entity']->getPK() . "&ActionTemplate=popup",
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#modal_action_form",
|
||||||
|
"class" => "text-primary form-label-sm",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
<div class="mt-3">
|
||||||
|
<?=
|
||||||
|
form_label(
|
||||||
|
'서비스추가',
|
||||||
|
'create_service',
|
||||||
|
[
|
||||||
|
"data-src" => '/admin/customer/service/create?clientinfo_uid=' . $viewDatas['entity']->getPK(),
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#modal_action_form",
|
||||||
|
"class" => "btn btn-sm btn-primary form-label-sm",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
</div>
|
||||||
|
</th>
|
||||||
|
<th>도코</th>
|
||||||
|
<th>치바</th>
|
||||||
|
<th>VPN</th>
|
||||||
|
<th>일반</th>
|
||||||
|
<th>방어</th>
|
||||||
|
<th>전용</th>
|
||||||
|
<th>이벤트</th>
|
||||||
|
<th>테스트</th>
|
||||||
|
<th>대체</th>
|
||||||
|
<th>쿠폰</th>
|
||||||
|
<th>예치금</th>
|
||||||
|
<th>포인트</th>
|
||||||
|
<th>전체요금</th>
|
||||||
|
<th>전체미납금</th>
|
||||||
|
</tr>
|
||||||
|
<tr class="text-center">
|
||||||
|
<td><?= $viewDatas['totalCounts']['tokyo_summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['chiba_summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['vpn']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['normal']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['defence']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['dedicated']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['event']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['test']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['totalCounts']['alternative']['summary'] ?></td>
|
||||||
|
<td><?= $viewDatas['helper']->getListButton("coupon", $viewDatas['entity']->getCouponBalance(), $viewDatas) ?></td>
|
||||||
|
<td><?= $viewDatas['helper']->getListButton("account", number_format($viewDatas['entity']->getAccountBalance()) . "원", $viewDatas) ?></td>
|
||||||
|
<td><?= $viewDatas['helper']->getListButton("point", number_format($viewDatas['entity']->getPointBalance()), $viewDatas) ?></td>
|
||||||
|
<td><?= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['totalAmounts']) ? number_format($viewDatas['totalAmounts'][$viewDatas['entity']->getPK()]) : 0 ?>원</td>
|
||||||
|
<td>
|
||||||
|
<?php if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])): ?>
|
||||||
|
<?=
|
||||||
|
form_label(
|
||||||
|
sprintf("총:%s건/%s원", $viewDatas['unPaids'][$viewDatas['entity']->getPK()]['cnt'], number_format($viewDatas['unPaids'][$viewDatas['entity']->getPK()]['amount'])),
|
||||||
|
'payment_unpaid',
|
||||||
|
[
|
||||||
|
"data-src" => "/admin/customer/payment?clientinfo_uid={$viewDatas['entity']->getPK()}&status=unpaid&ActionTemplate=popup",
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#modal_action_form",
|
||||||
|
"class" => "text-primary form-label-sm",
|
||||||
|
]
|
||||||
|
);
|
||||||
|
?>
|
||||||
|
<?php endif ?>
|
||||||
|
</td>
|
||||||
|
</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 name="history" class="form-control note-box"><?= $viewDatas['entity']->getHistory() ?></textarea>
|
||||||
|
</div>
|
||||||
|
<div class="col-1">
|
||||||
|
<?= form_submit('', '저장', array("class" => "btn btn-outline btn-primary")); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= form_close() ?>
|
||||||
|
<?= view_cell("\App\Cells\Customer\ServiceCell::detail", ['clientinfo_uid' => $viewDatas['entity']->getPK()]) ?>
|
||||||
|
<?= view_cell("\App\Cells\PaymentCell::detail", ['clientinfo_uid' => $viewDatas['entity']->getPK()]) ?>
|
||||||
|
</div>
|
||||||
|
<!-- index_body -->
|
||||||
|
</div>
|
||||||
|
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||||
|
<!-- Layout Right End -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<!-- Layout Middle End -->
|
||||||
|
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
22
app/Views/admin/popup/create_form.php
Normal file
22
app/Views/admin/popup/create_form.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
|
||||||
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start">
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
|
||||||
|
<div><?= validation_show_error($field); ?></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
17
app/Views/admin/popup/download.php
Normal file
17
app/Views/admin/popup/download.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><th nowrap><?= $label ?></th><?php endforeach ?>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity ?>
|
||||||
|
<tr>
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
|
||||||
|
<td nowrap><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
55
app/Views/admin/popup/index.php
Normal file
55
app/Views/admin/popup/index.php
Normal file
@ -0,0 +1,55 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?php
|
||||||
|
$layouts = LAYOUTS[$viewDatas['layout']];
|
||||||
|
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
|
||||||
|
?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
|
||||||
|
<table class="layout_middle">
|
||||||
|
<tr>
|
||||||
|
<td class="layout_right">
|
||||||
|
<div class="layout_header"><?= $this->include("{$template}/popup/index_header"); ?></div>
|
||||||
|
<div id="container" class="layout_content">
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div class="index_body">
|
||||||
|
<?= $this->include("{$template}/popup/index_content_filter"); ?>
|
||||||
|
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
|
||||||
|
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="text-center bg-light">번호</th>
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
|
||||||
|
<th class="text-center bg-light"><?= $viewDatas['helper']->getListLabel($field, $label, $viewDatas) ?></th>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<th class="text-center bg-light">작업</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $cnt = 0 ?>
|
||||||
|
<?php foreach ($viewDatas['entities'] as $entity): ?>
|
||||||
|
<?php
|
||||||
|
$viewDatas['entity'] = $entity;
|
||||||
|
$num = $viewDatas['index_totalcount'] - (($viewDatas['page'] - 1) * $viewDatas['perpage'] + $cnt);
|
||||||
|
?>
|
||||||
|
<tr>
|
||||||
|
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
|
||||||
|
<td nowrap>
|
||||||
|
<?php foreach ($viewDatas['index_actionButtons'] as $action => $label): ?>
|
||||||
|
<?= $viewDatas['helper']->getListButton($action, $label, $viewDatas) ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?= $this->include("{$template}/index_content_bottom"); ?>
|
||||||
|
<?= form_close() ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
22
app/Views/admin/popup/modify_form.php
Normal file
22
app/Views/admin/popup/modify_form.php
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
|
||||||
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start">
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
|
||||||
|
<div><?= validation_show_error($field); ?></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
17
app/Views/admin/popup/view.php
Normal file
17
app/Views/admin/popup/view.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<?php if (session('message')): ?><div class="alert alert-danger text-start"><?= nl2br(session('message')) ?></div><?php endif; ?>
|
||||||
|
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -97,7 +97,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg">
|
<div class="col-lg">
|
||||||
<div class="card dashboard-card bg-red card-clickable" onclick="document.location.href='/admin/customer/payment';">
|
<div class="card dashboard-card bg-red card-clickable" onclick="document.location.href='/admin/payment'">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-4"><i class="fa fa-support fa-5x"></i></div>
|
<div class="col-4"><i class="fa fa-support fa-5x"></i></div>
|
||||||
@ -108,7 +108,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-footer d-flex justify-content-between align-items-center bg-detail">
|
<div class="card-footer d-flex justify-content-between align-items-center bg-detail">
|
||||||
<a href="/admin/customer/payment'"><span class="bg_red_font">자세히보기</span></a><i class="fa fa-arrow-circle-right bg_red_font"></i>
|
<a href="/admin/payment'"><span class=" bg_red_font">자세히보기</span></a><i class="fa fa-arrow-circle-right bg_red_font"></i>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -15,7 +15,7 @@
|
|||||||
$entity->getTitle(),
|
$entity->getTitle(),
|
||||||
'disk_modify',
|
'disk_modify',
|
||||||
[
|
[
|
||||||
"data-src" => "admin/part/disk/modify/" . $entity->getPK(),
|
"data-src" => "admin/part/disk/modify/{$entity->getPK()}",
|
||||||
"data-bs-toggle" => "modal",
|
"data-bs-toggle" => "modal",
|
||||||
"data-bs-target" => "#modal_action_form",
|
"data-bs-target" => "#modal_action_form",
|
||||||
"class" => "text-primary form-label-sm",
|
"class" => "text-primary form-label-sm",
|
||||||
|
|||||||
@ -14,7 +14,7 @@
|
|||||||
$entity->getTitle(),
|
$entity->getTitle(),
|
||||||
'disk_modify',
|
'disk_modify',
|
||||||
[
|
[
|
||||||
"data-src" => "admin/part/ram/modify/" . $entity->getPK(),
|
"data-src" => "admin/part/ram/modify/{$entity->getPK()}",
|
||||||
"data-bs-toggle" => "modal",
|
"data-bs-toggle" => "modal",
|
||||||
"data-bs-target" => "#modal_action_form",
|
"data-bs-target" => "#modal_action_form",
|
||||||
"class" => "text-primary form-label-sm",
|
"class" => "text-primary form-label-sm",
|
||||||
|
|||||||
@ -12,12 +12,12 @@
|
|||||||
<?php foreach ($serviceCellDatas['entities'] as $entity): ?>
|
<?php foreach ($serviceCellDatas['entities'] as $entity): ?>
|
||||||
<?php $serviceCellDatas['entity'] = $entity ?>
|
<?php $serviceCellDatas['entity'] = $entity ?>
|
||||||
<tr class="text-left">
|
<tr class="text-left">
|
||||||
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $serviceCellDatas) ?></td>
|
<td class="text-center"><?= $serviceCellDatas['helper']->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $serviceCellDatas) ?></td>
|
||||||
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('create_at', $entity->getCreatedAt(), $serviceCellDatas) ?></td>
|
<td class="text-center"><?= $serviceCellDatas['helper']->getFieldView('create_at', $entity->getCreatedAt(), $serviceCellDatas) ?></td>
|
||||||
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?></td>
|
<td class="text-center"><?= $serviceCellDatas['helper']->getFieldView('amount', $entity->getAmount(), $serviceCellDatas) ?></td>
|
||||||
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?></td>
|
<td class="text-center"><?= $serviceCellDatas['helper']->getFieldView('title', $entity->getTitle(), $serviceCellDatas) ?></td>
|
||||||
<td class="text-start"><?= $serviceCellDatas['service']->getHelper()->getFieldView('content', html_entity_decode($entity->getContent(), ENT_QUOTES, 'UTF-8'), $serviceCellDatas) ?></td>
|
<td class="text-start"><?= $serviceCellDatas['helper']->getFieldView('content', $entity->getContent(), $serviceCellDatas) ?></td>
|
||||||
<td class="text-center"><?= $serviceCellDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?></td>
|
<td class="text-center"><?= $serviceCellDatas['helper']->getFieldView('user_uid', $entity->getUserUID(), $serviceCellDatas) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
</table>
|
</table>
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?></div>
|
<div><?= $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?></div>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
@ -13,7 +13,7 @@
|
|||||||
<?php foreach ($serverPartCellDatas['entities']['IP'] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities']['IP'] as $entities): ?>
|
||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('IP', $entity->getPK(), $serverPartCellDatas) ?></div>
|
<div><?= $serverPartCellDatas['helper']->getFieldView('IP', $entity->getPK(), $serverPartCellDatas) ?></div>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
@ -22,7 +22,7 @@
|
|||||||
<?php foreach ($serverPartCellDatas['entities']['CS'] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities']['CS'] as $entities): ?>
|
||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<div><?= $serverPartCellDatas['service']->getHelper()->getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?></div>
|
<div><?= $serverPartCellDatas['helper']->getFieldView('CS', $entity->getPK(), $serverPartCellDatas) ?></div>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|
||||||
@ -5,8 +5,8 @@
|
|||||||
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<?php $htmls[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
|
<?php $htmls[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
|
||||||
<?php $texts[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
|
<?php $texts[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
|
|||||||
@ -5,13 +5,13 @@
|
|||||||
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
<?php foreach ($serverPartCellDatas['entities'][$type] as $entities): ?>
|
||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<?php $htmls[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
|
<?php $htmls[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas) ?>
|
||||||
<?php $texts[$type][] = $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
|
<?php $texts[$type][] = $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas, ['return' => 'onlyText']) ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<?php $view_htmls = [
|
<?php $view_htmls = [
|
||||||
$serverPartCellDatas['service']->getHelper()->getFieldView('SERVER', "", $serverPartCellDatas),
|
$serverPartCellDatas['helper']->getFieldView('SERVER', "", $serverPartCellDatas),
|
||||||
$serverPartCellDatas['serverEntity']->getIP(),
|
$serverPartCellDatas['serverEntity']->getIP(),
|
||||||
$serverPartCellDatas['serverEntity']->getSwitch(),
|
$serverPartCellDatas['serverEntity']->getSwitch(),
|
||||||
$serverPartCellDatas['serverEntity']->getOS()
|
$serverPartCellDatas['serverEntity']->getOS()
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
<?php foreach ($entities as $entity): ?>
|
<?php foreach ($entities as $entity): ?>
|
||||||
<?php $serverPartCellDatas['entity'] = $entity ?>
|
<?php $serverPartCellDatas['entity'] = $entity ?>
|
||||||
<?php $htmls[$type][] = [
|
<?php $htmls[$type][] = [
|
||||||
'view' => $serverPartCellDatas['service']->getHelper()->getFieldView($type, $entity->getPK(), $serverPartCellDatas),
|
'view' => $serverPartCellDatas['helper']->getFieldView($type, $entity->getPK(), $serverPartCellDatas),
|
||||||
'amount' => $entity->getTotalAmount(),
|
'amount' => $entity->getTotalAmount(),
|
||||||
'entity' => $entity
|
'entity' => $entity
|
||||||
] ?>
|
] ?>
|
||||||
@ -15,7 +15,7 @@
|
|||||||
<table class="table table-bordered table-striped m-0 p-0">
|
<table class="table table-bordered table-striped m-0 p-0">
|
||||||
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
|
<?php foreach ($serverPartCellDatas['types'] as $type): ?>
|
||||||
<tr class="m-0 p-0">
|
<tr class="m-0 p-0">
|
||||||
<th class="text-end m-0 p-0" width="15%"><?= $serverPartCellDatas['service']->getHelper()->getListButton($type, '', $serverPartCellDatas) ?></th>
|
<th class="text-end m-0 p-0" width="15%"><?= $serverPartCellDatas['helper']->getListButton($type, '', $serverPartCellDatas) ?></th>
|
||||||
<td class="text-start m-0 p-0">
|
<td class="text-start m-0 p-0">
|
||||||
<?php foreach ($htmls[$type] as $html): ?>
|
<?php foreach ($htmls[$type] as $html): ?>
|
||||||
<?= $html['view'] ?>[<?= number_format($html['amount']) ?>원]<a href="/admin/equipment/serverpart/delete/<?= $html['entity']->getPK() ?>">❌</a><BR>
|
<?= $html['view'] ?>[<?= number_format($html['amount']) ?>원]<a href="/admin/equipment/serverpart/delete/<?= $html['entity']->getPK() ?>">❌</a><BR>
|
||||||
|
|||||||
@ -12,9 +12,9 @@
|
|||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
<div><?= $entity->getCode() ?></div>
|
<div><?= $entity->getCode() ?></div>
|
||||||
<div><?= $entity->getTitle() ?></div>
|
<div><?= $entity->getTitle() ?></div>
|
||||||
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?></div>
|
<div><?= $serviceCellDatas['helper']->getFieldView('site', $entity->getSite(), $serviceCellDatas) ?></div>
|
||||||
<div><?= $serviceCellDatas['service']->getHelper()->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?></div>
|
<div><?= $serviceCellDatas['helper']->getFieldView('location', $entity->getLocation(), $serviceCellDatas) ?></div>
|
||||||
<div class="mt-3"><?= $serviceCellDatas['service']->getHelper()->getListButton('addServer', '대체서버추가', ['entity' => $entity], ['class' => 'btn btn-sm btn-primary']) ?></div>
|
<div class="mt-3"><?= $serviceCellDatas['helper']->getListButton('addServer', '대체서버추가', ['entity' => $entity], ['class' => 'btn btn-sm btn-primary']) ?></div>
|
||||||
</td>
|
</td>
|
||||||
<td class="text-center" nowrap><?= view('cells/service/server', ['serviceEntity' => $entity, 'serverEntities' => $serviceCellDatas['childServers'][$entity->getPK()]]) ?></td>
|
<td class="text-center" nowrap><?= view('cells/service/server', ['serviceEntity' => $entity, 'serverEntities' => $serviceCellDatas['childServers'][$entity->getPK()]]) ?></td>
|
||||||
<td class="text-center" nowrap>
|
<td class="text-center" nowrap>
|
||||||
|
|||||||
@ -27,6 +27,6 @@
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="2" class="text-center"><?= $serviceCellDatas['service']->getHelper()->getListButton('onetime', '일회성추가', ['entity' => $serviceEntity], ['class' => 'btn btn-sm btn-primary']) ?></td>
|
<td colspan="2" class="text-center"><?= $serviceCellDatas['helper']->getListButton('onetime', '일회성추가', ['entity' => $serviceEntity], ['class' => 'btn btn-sm btn-primary']) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
@ -23,7 +23,7 @@
|
|||||||
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
|
||||||
'serverinfo_uid' => $serverEntity->getPK(),
|
'serverinfo_uid' => $serverEntity->getPK(),
|
||||||
'types' => SERVERPART['ALL_PARTTYPES'],
|
'types' => SERVERPART['ALL_PARTTYPES'],
|
||||||
'template' => 'part_detail'
|
'template' => 'partlist_detail'
|
||||||
]) ?>
|
]) ?>
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
|
|||||||
11
app/Views/templates/admin/popup/index_content_filter.php
Normal file
11
app/Views/templates/admin/popup/index_content_filter.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?= form_open(current_url(), ["method" => "get"]) ?>
|
||||||
|
<nav class="index_top navbar navbar-expand-lg">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<nav class="condition nav">조건:
|
||||||
|
<?php foreach ($viewDatas['index_filters'] as $field => $value): ?>
|
||||||
|
<?= $viewDatas['helper']->getListFilter($field, $value, $viewDatas) ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<?= form_close() ?>
|
||||||
7
app/Views/templates/admin/popup/index_header.php
Normal file
7
app/Views/templates/admin/popup/index_header.php
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
<ul class="nav nav-tabs">
|
||||||
|
<li class="nav-item">
|
||||||
|
<span class="nav-item navbar-brand" aria-current="page">
|
||||||
|
<h4> <?= ICONS['DESKTOP'] ?> <?= $viewDatas['title'] ?? "" ?> </h4>
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
Loading…
Reference in New Issue
Block a user