dbmsv4 init...1

This commit is contained in:
최준흠 2025-11-20 17:27:03 +09:00
parent f88a98f4cd
commit 1f7cee6585
63 changed files with 1320 additions and 1022 deletions

View File

@ -9,7 +9,7 @@ class ServerCell extends EquipmentCell
public function __construct()
{
parent::__construct(new ServerService());
parent::__construct(service('equipment_serverservice'));
}
//서비스 방식에 따른 서비스별 Count
@ -52,24 +52,15 @@ class ServerCell extends EquipmentCell
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/server/' . $template, [
'serviceCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'totalCounts' => $totalCounts,
]
]);
}
public function stock(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$template = array_key_exists('template', $params) ? $params['template'] : 'stock';
return view('cells/server/' . $template, [
'partCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'rows' => $this->getService()->getStockCount(),
],
]);

View File

@ -10,22 +10,19 @@ class MylogCell extends CommonCell
public function __construct()
{
parent::__construct(new MyLogService());
parent::__construct(service('mylogservice'));
}
public function dashboard(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$this->getService()->action_init_process(__FUNCTION__);
$this->getService()->setLimit(20);
$template = array_key_exists('template', $params) ? $params['template'] : __FUNCTION__;
return view('cells/mylog/' . $template, [
'myLogCellDatas' => [
'service' => $this->getService(),
'control' => $this->getService()->getControlDatas(),
'helper' => $this->getService()->getHelper(),
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
'entities' => $this->getService()->getEntities(),
]
]);

View File

@ -8,21 +8,18 @@ class DISKCell extends PartCell
{
public function __construct()
{
parent::__construct(new DISKService());
parent::__construct(service('part_diskservice'));
}
public function stock(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$this->getService()->action_init_process(__FUNCTION__);
$template = array_key_exists('template', $params) ? $params['template'] : 'disk_stock';
return view('cells/part/' . $template, [
'partCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'helper' => $this->getService()->getHelper(),
'formFilters' => $this->getService()->getFormService()->getFormFilters(),
'formOptions' => $this->getService()->getFormService()->getFormOptions(),
'entities' => $this->getService()->getEntities(),
],
]);

View File

@ -8,21 +8,14 @@ class RAMCell extends PartCell
{
public function __construct()
{
parent::__construct(new RAMService());
parent::__construct(service('part_ramservice'));
}
public function stock(array $params): string
{
$this->getService()->setAction(__FUNCTION__);
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
$template = array_key_exists('template', $params) ? $params['template'] : 'ram_stock';
return view('cells/part/' . $template, [
'partCellDatas' => [
'control' => $this->getService()->getControlDatas(),
'service' => $this->getService(),
'entities' => $this->getService()->getEntities(),
],
]);

View File

@ -68,8 +68,7 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'BoardController::batchjob');
$routes->post('batchjob_delete', 'BoardController::batchjob_delete');
$routes->get('download/(:alpha)', 'BoardController::download/$1');
$routes->get('notice', 'BoardController::notice');
$routes->get('reqeusttask', 'BoardController::reqeusttask');
$routes->get('latest/(:alpha)', 'BoardController::latest/$1');
});
$routes->group('payment', function ($routes) {
$routes->get('/', 'PaymentController::index');

View File

@ -20,8 +20,10 @@ abstract class AdminController extends CommonController
}
protected function action_init_process(string $action): void
{
$this->service->action_init_process($action);
parent::action_init_process($action);
$this->addViewDatas('layout', $this->getLayout());
$this->addViewDatas('title', $this->getTitle());
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());

View File

@ -18,99 +18,22 @@ class BoardController extends AdminController
$this->addActionPaths('board');
}
//Action작업관련
protected function action_init_process(string $action): void
{
$fields = [
'category',
'worker_uid',
'title',
'status',
'content',
];
$filters = [
'user_uid',
'worker_uid',
'category',
'status',
];
$indexFilter = $filters;
$batchjobFilters = ['user_uid', 'category', 'status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at',
'content'
];
break;
case 'index':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at'
];
break;
case 'download':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at',
'content'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return UserEntity::class;
}
//기본 함수 작업
//Custom 추가 함수
// public function notice(): ResponseInterface
// {
// $this->getService()->setAction(__FUNCTION__);
// $this->getService()->setFormFields();
// //전달값정의
// $this->getService()->setFormDatas($this->request->getGet());
// $formDatas = $this->getSErvice()->getFormDatas();
// return $this->response->setJSON($this->getService()->getLatest(
// array_key_exists('category', $formDatas) && $formDatas['category'] ? $formDatas['category'] : BOARD['CATEGORY']['NOTICE'],
// ));
// }
// public function reqeusttask(): ResponseInterface
// {
// $this->getService()->setAction(__FUNCTION__);
// $this->getService()->setFormFields();
// //전달값정의
// $this->getService()->setFormDatas($this->request->getGet());
// $formDatas = $this->getSErvice()->getFormDatas();
// return $this->response->setJSON($this->getService()->getLatest(
// array_key_exists('category', $formDatas) && $formDatas['category'] ? $formDatas['category'] : BOARD['CATEGORY']['NOTICE'],
// ['worker_uid' => $this->getMyAuth()->getUIDByAuthInfo()]
// ));
// }
public function latest(string $category): ResponseInterface
{
$action = __FUNCTION__;
$this->action_init_process($action);
return $this->response->setJSON($this->service->getLatest($category));
}
public function reqeusttask(): ResponseInterface
{
$action = __FUNCTION__;
$this->action_init_process($action);
return $this->response->setJSON($this->service->getRequestTaskCount($this->getAuthContext()->getUID()));
}
}

View File

@ -50,9 +50,6 @@ class AccountController extends CustomerController
case 'download':
$fields = [...$fields, 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);

View File

@ -17,60 +17,6 @@ class ClientController extends CustomerController
}
$this->addActionPaths('client');
}
protected function action_init_process(string $action): void
{
$fields = [
'site',
'name',
'email',
'phone',
'role',
];
$filters = [
'site',
'role',
'status',
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [
'site',
'name',
'email',
'phone',
'role',
'account_balance',
'coupon_balance',
'point_balance',
'status',
'created_at',
'updated_at',
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return ClientEntity::class;

View File

@ -21,47 +21,6 @@ class CouponController extends CustomerController
{
return CouponEntity::class;
}
protected function action_init_process(string $action): void
{
$fields = [
"clientinfo_uid",
"title",
"cnt",
"status",
"content",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
//기본 함수 작업
//Custom 추가 함수
}

View File

@ -17,47 +17,6 @@ class PointController extends CustomerController
}
$this->addActionPaths('point');
}
protected function action_init_process(string $action): void
{
$fields = [
"clientinfo_uid",
"title",
"content",
"amount",
"status",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return PointEntity::class;

View File

@ -17,75 +17,6 @@ class ServiceController extends CustomerController
}
$this->addActionPaths('service');
}
protected function action_init_process(string $action): void
{
$fields = [
"site",
"location",
"clientinfo_uid",
'serverinfo_uid',
"rack",
"line",
"title",
"start_at",
"billing_at",
"status",
'sale',
'amount',
"history",
];
$filters = [
'site',
'location',
'clientinfo_uid',
'serverinfo_uid',
'user_uid',
'status',
];
$indexFilter = $filters;
$batchjobFilters = [
'site',
'location',
'clientinfo_uid',
'status'
];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [
'site',
'location',
'clientinfo_uid',
'serverinfo_uid',
'sale',
'amount',
'billing_at',
'status',
'start_at',
'created_at'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return ServiceEntity::class;

View File

@ -18,48 +18,6 @@ class LineController extends EquipmentController
}
$this->addActionPaths('line');
}
protected function action_init_process(string $action): void
{
$fields = [
"type",
"title",
"bandwith",
"start_at",
"end_at",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return LineEntity::class;

View File

@ -17,52 +17,6 @@ class ServerController extends EquipmentController
}
$this->addActionPaths('server');
}
protected function action_init_process(string $action): void
{
$fields = [
"code",
"type",
"switch",
"ip",
"os",
"title",
"price",
"manufactur_at",
"format_at",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return ServerEntity::class;

View File

@ -17,54 +17,6 @@ class ServerPartController extends EquipmentController
}
$this->addActionPaths('serverpart');
}
protected function action_init_process(string $action): void
{
$fields = [
"serverinfo_uid",
"type",
"billing",
"part_uid",
"title",
"cnt",
"extra",
"amount",
];
$filters = [
"serverinfo_uid",
"type",
"part_uid",
"billing",
];
$indexFilter = $filters;
$batchjobFilters = ['billing', 'type'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return ServerPartEntity::class;

View File

@ -16,23 +16,30 @@ class Home extends AbstractWebController
//Index,FieldForm관련
public function welcome(): string
{
$dashboards = [];
foreach (service('trafficservice')->getEntities(['status' => STATUS['AVAILABLE']]) as $entity)
$dashboards[] = $this->action_render_process(
'dashboard',
[
'layout' => 'admin',
'entity' => $entity
],
'traffic'
);
//요청업무
$boardRequestTaskCount = service('boardservice')->getRequestTaskCount($this->getAuthContext()->getUID());
//Total 서버 현황
//interval을 기준으로 최근 신규 서비스정보 가져오기
$interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']);
$newServiceEntities = service('customer_serviceservice')->getNewServiceEntities($interval);
$newServiceCount = count($newServiceEntities);
//서비스별 미납 Count
$unPaidTotalCount = $unPaidTotalAmount = 0;
foreach (array_values(service('paymentservice')->getUnPaids('serviceinfo_uid')) as $unPaid) {
$unPaidTotalCount += $unPaid['cnt'];
$unPaidTotalAmount += $unPaid['amount'];
}
return $this->action_render_process(
__FUNCTION__,
[
'authContext' => $this->getAuthContext(),
'classPath' => service('trafficservice')->getClassPaths(false),
'layout' => 'admin',
'dashboards' => $dashboards
'boardRequestTaskCount' => $boardRequestTaskCount,
'interval' => $interval,
'newServiceEntities' => $newServiceEntities,
'newServiceCount' => $newServiceCount,
'unPaidTotalCount' => $unPaidTotalCount,
'unPaidTotalAmount' => $unPaidTotalAmount,
]
);
}

View File

@ -17,38 +17,6 @@ class MylogController extends AdminController
}
$this->addActionPaths('mylog');
}
protected function action_init_process(string $action): void
{
$fields = ['title', 'content'];
$filters = [];
$indexFilter = $filters;
$batchjobFilters = $filters;
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return MylogEntity::class;

View File

@ -17,45 +17,6 @@ class CPUController extends PartController
}
$this->addActionPaths('cpu');
}
protected function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return CPUEntity::class;

View File

@ -17,72 +17,6 @@ class CSController extends PartController
}
$this->addActionPaths('cs');
}
protected function action_init_process(string $action): void
{
$fields = [
"type",
"ip",
"accountid",
"domain",
"price",
];
$filters = [
"clientinfo_uid",
'serverinfo_uid',
'type',
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
...$fields,
"clientinfo_uid",
'serverinfo_uid',
'type',
'ip',
'accountid',
'domain',
'price',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
"clientinfo_uid",
'serverinfo_uid',
'type',
'ip',
'accountid',
'domain',
'price',
'status',
'created_at'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return CSEntity::class;

View File

@ -17,47 +17,6 @@ class DISKController extends PartController
}
$this->addActionPaths('disk');
}
protected function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, "format", 'status'];
break;
case 'view':
$fields = [...$fields, "format", 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, "format", 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);;
}
protected function getEntityClass(): string
{
return DISKEntity::class;

View File

@ -17,63 +17,6 @@ class IPController extends PartController
}
$this->addActionPaths('ip');
}
protected function action_init_process(string $action): void
{
$fields = [
"lineinfo_uid",
"ip",
"price",
];
$filters = [
'old_clientinfo_uid',
'clientinfo_uid',
'serverinfo_uid',
"lineinfo_uid",
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
...$fields,
'clientinfo_uid',
'serverinfo_uid',
'old_clientinfo_uid',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
'clientinfo_uid',
'serverinfo_uid',
'old_clientinfo_uid',
'status',
'created_at'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return IPEntity::class;

View File

@ -17,46 +17,6 @@ class RAMController extends PartController
}
$this->addActionPaths('ram');
}
protected function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return RAMEntity::class;

View File

@ -17,46 +17,6 @@ class SOFTWAREController extends PartController
}
$this->addActionPaths('software');
}
protected function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return SOFTWAREEntity::class;

View File

@ -17,65 +17,6 @@ class SWITCHController extends PartController
}
$this->addActionPaths('switch');
}
protected function action_init_process(string $action): void
{
$fields = [
"code",
"price",
];
$filters = [
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status',];
parent::action_init_process($action);
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [
...$fields,
'status',
];
break;
case 'view':
$fields = [
...$fields,
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status',
'created_at'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return SWITCHEntity::class;

View File

@ -18,73 +18,6 @@ class PaymentController extends AdminController
$this->addActionPaths('payment');
}
//Action작업관련
protected function action_init_process(string $action): void
{
$fields = [
"serviceinfo_uid",
"title",
"amount",
"billing",
"billing_at",
"content ",
];
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
$indexFilter = ['serviceinfo_uid', 'status', 'billing'];
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = ['title', 'amount', 'pay', 'status', 'content'];
break;
case 'view':
$fields = [
'clientinfo_uid',
"serviceinfo_uid",
'billing',
'title',
'amount',
'billing_at',
'pay',
'status',
'updated_at',
'countdown',
'user_uid',
'created_at',
'content'
];
break;
case 'index':
case 'download':
$fields = [
'clientinfo_uid',
"serviceinfo_uid",
'billing',
'title',
'amount',
'billing_at',
'pay',
'status',
'updated_at',
'countdown',
'user_uid',
'created_at'
];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return PaymentEntity::class;

View File

@ -18,47 +18,6 @@ class UserController extends AdminController
$this->addActionPaths('user');
}
//Action작업관련
protected function action_init_process(string $action): void
{
$fields = [
'id',
'passwd',
'confirmpassword',
'name',
'email',
'mobile',
'role'
];
$filters = ['role', 'status'];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setIndexFilters($indexFilter);
$this->service->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
protected function getEntityClass(): string
{
return UserEntity::class;

View File

@ -23,6 +23,7 @@ abstract class AuthController extends AbstractWebController
}
protected function action_init_process(string $action): void
{
$this->service->action_init_process($action);
parent::action_init_process($action);
$this->addViewDatas('layout', $this->getLayout());
$this->addViewDatas('helper', $this->service->getHelper());

View File

@ -17,25 +17,6 @@ class GoogleController extends AuthController
$this->service = service('googleauth');
}
}
protected function action_init_process(string $action): void
{
parent::action_init_process($action);
$fields = ['access_code'];
$filters = [];
switch ($action) {
case 'login':
case 'login_form':
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setBatchjobFilters($filters);
}
public function login_form_process(): void
{
//구글 로그인 BUTTON용

View File

@ -22,25 +22,6 @@ class LocalController extends AuthController
$this->service = service('localauth');
}
}
protected function action_init_process(string $action): void
{
parent::action_init_process($action);
$fields = ['id', 'passwd'];
$filters = [];
switch ($action) {
case 'login':
case 'login_form':
break;
default:
throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break;
}
$this->service->getFormService()->setFormFields($fields);
$this->service->getFormService()->setFormRules($action, $fields);
$this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setBatchjobFilters($filters);
}
//로그인처리
protected function login_process(): UserEntity
{

View File

@ -5,7 +5,6 @@ namespace App\Controllers;
use App\Entities\CommonEntity;
use CodeIgniter\HTTP\DownloadResponse;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Exceptions\ValidationException;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Html;

View File

@ -27,6 +27,7 @@ abstract class AuthService
$this->model = $model; // 모델을 직접 주입받아 자식에게 전달
$this->addClassPaths('Auth');
}
abstract public function action_init_process(string $action);
abstract public function getFormService(): mixed;
final public function getHelper(): AuthHelper
{

View File

@ -33,6 +33,22 @@ class GoogleService extends AuthService
}
return $this->_form;
}
public function action_init_process(string $action): void
{
parent::action_init_process($action);
$fields = ['access_code'];
$filters = [];
switch ($action) {
case 'login':
case 'login_form':
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setBatchjobFilters($filters);
}
protected function getEntity_process(mixed $entity): UserEntity
{
return $entity;

View File

@ -33,6 +33,22 @@ class LocalService extends AuthService
}
return $this->_form;
}
public function action_init_process(string $action): void
{
parent::action_init_process($action);
$fields = ['id', 'passwd'];
$filters = [];
switch ($action) {
case 'login':
case 'login_form':
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setBatchjobFilters($filters);
}
protected function getEntity_process(mixed $entity): UserEntity
{
return $entity;

View File

@ -50,6 +50,68 @@ class BoardService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
'category',
'worker_uid',
'title',
'status',
'content',
];
$filters = [
'user_uid',
'worker_uid',
'category',
'status',
];
$indexFilter = $filters;
$batchjobFilters = ['user_uid', 'category', 'status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at',
'content'
];
break;
case 'index':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at'
];
break;
case 'download':
$fields = [
'category',
'worker_uid',
'title',
'status',
'created_at',
'content'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): BoardEntity
{
@ -83,12 +145,12 @@ class BoardService extends CommonService
//추가기능부분
//Category별 최근 $limit갯수만큼 게시물
public function getLatest(string $category, array $where = []): array
public function getLatest(string $category): array
{
//관리자정보
$userEntities = service('userservice')->getEntities();
$datas = [];
foreach ($this->getEntities(['category' => $category, 'status' => STATUS['AVAILABLE'], ...$where]) as $entity) {
foreach ($this->getEntities(['category' => $category, 'status' => STATUS['AVAILABLE']]) as $entity) {
$datas[] = [
'title' => "<label for=\"view\" data-src=\"/admin/board/view/{$entity->getPK()}\" data-bs-toggle=\"modal\" data-bs-target=\" #modal_action_form\" class=\"text-primary form-label-sm\">{$entity->getTitle()}</label>",
'created_at' => date('Y-m-d H:m', strtotime($entity->getCreatedAT())),
@ -97,14 +159,13 @@ class BoardService extends CommonService
}
return $datas;
}
//요청업무 게시물
//요청업무 갯수(Home에서 사용)
public function getRequestTaskCount(int $worker_uid): int
{
$where = [
return count($this->getEntities([
'category' => BOARD['CATEGORY']['REQUESTTASK'],
'worker_uid' => $worker_uid,
'status' => STATUS['AVAILABLE'],
];
return count($this->getEntities($where));
'status' => STATUS['AVAILABLE']
]));
}
}

View File

@ -25,7 +25,7 @@ abstract class CommonService
{
return $isArray ? $this->_classPaths : implode($delimeter, $this->_classPaths);
}
abstract public function action_init_process(string $action);
/**
* 단일 엔티티를 조회합니다.
* @return CommonEntity|null CommonEntity 인스턴스 또는 찾지 못했을 경우 null
@ -83,7 +83,6 @@ abstract class CommonService
throw new \Exception($errorMessage, $e->getCode(), $e);
}
}
final public function getNextPK(): int
{
$pkField = $this->model->getPKField();

View File

@ -50,6 +50,55 @@ class ClientService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
'site',
'name',
'email',
'phone',
'role',
];
$filters = [
'site',
'role',
'status',
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [
'site',
'name',
'email',
'phone',
'role',
'account_balance',
'coupon_balance',
'point_balance',
'status',
'created_at',
'updated_at',
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): ClientEntity
{

View File

@ -50,6 +50,42 @@ class CouponService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"clientinfo_uid",
"title",
"cnt",
"status",
"content",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): CouponEntity
{

View File

@ -50,6 +50,42 @@ class PointService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"clientinfo_uid",
"title",
"content",
"amount",
"status",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): PointEntity
{

View File

@ -7,6 +7,8 @@ use App\Entities\Customer\ServiceEntity;
use App\Forms\Customer\ServiceForm;
use App\Helpers\Customer\ServiceHelper;
use App\Models\Customer\ServiceModel;
use DateTimeImmutable;
use DateTimeZone;
use RuntimeException;
class ServiceService extends CustomerService
@ -50,6 +52,70 @@ class ServiceService extends CustomerService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"site",
"location",
"clientinfo_uid",
'serverinfo_uid',
"rack",
"line",
"title",
"start_at",
"billing_at",
"status",
'sale',
'amount',
"history",
];
$filters = [
'site',
'location',
'clientinfo_uid',
'serverinfo_uid',
'user_uid',
'status',
];
$indexFilter = $filters;
$batchjobFilters = [
'site',
'location',
'clientinfo_uid',
'status'
];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'created_at'];
break;
case 'index':
case 'download':
$fields = [
'site',
'location',
'clientinfo_uid',
'serverinfo_uid',
'sale',
'amount',
'billing_at',
'status',
'start_at',
'created_at'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): ServiceEntity
{
@ -92,4 +158,57 @@ class ServiceService extends CustomerService
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
//추가 기능
//interval을 기준으로 최근 신규 서비스정보 가져오기
final public function getNewServiceEntities(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array
{
return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status));
}
//서비스별 총 금액
final public function getTotalAmounts($where = []): array
{
$rows = $this->model->groupBy('clientinfo_uid')->select("clientinfo_uid,SUM(amount) AS amount")
->where($where)
->get()->getResult();
$amounts = [];
foreach ($rows as $row) {
$amounts[$row->clientinfo_uid] = $row->amount;
}
return $amounts;
}
//다음 달로 결제일 가져오기.
final public function getNextMonthDate(ServiceEntity $entity): string
{
// $sql = "UPDATE serviceinfo SET billing_at =
// IF(DAY(billing_at) > DAY(LAST_DAY(billing_at)),
// LAST_DAY(DATE_ADD(billing_at, INTERVAL 1 MONTH)),
// DATE_ADD(billing_at, INTERVAL 1 MONTH)
// ) WHERE uid = ?";
// return $this->model->query($sql, [$entity->getPK()]);
// 입력된 날짜를 DateTime 객체로 변환
$date = new DateTimeImmutable($entity->getBillingAt(), new DateTimeZone('Asia/Tokyo'));
// 현재 일(day)을 저장
$day = (int)$date->format('d');
// 다음달로 이동 (DateInterval 사용)
$date->modify('first day of next month');
// 다음달의 마지막 날 계산
$lastDayOfNextMonth = (int)$date->format('t');
// 현재 날짜가 다음달의 마지막 날보다 크면 -> 마지막 날로 설정
if ($day > $lastDayOfNextMonth) {
$day = $lastDayOfNextMonth;
}
// 일(day)을 설정
$date->setDate((int)$date->format('Y'), (int)$date->format('m'), $day);
// 최종 결과 리턴 (YYYY-MM-DD)
return $date->format('Y-m-d');
}
//서비스금액관련처리
// public function setAmount(ServiceEntity $entity, int $calculatedServerAmount, string $callBack = "updateForService"): ServiceEntity
// {
// //기본:상면비+회선비+서버금액(price)+서버파트연결(월비용)-할인액
// $amount = $entity->getRack() + $entity->getLine() + $calculatedServerAmount - $entity->getSale();
// //결제정보 반영
// $paymentEntity = $this->getPaymentService()->$callBack($entity, $amount);
// return $this->model->modify($entity, ['amount' => $amount, 'payment_uid' => $paymentEntity->getPK()]);
// }
}

View File

@ -50,6 +50,43 @@ class LineService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"type",
"title",
"bandwith",
"start_at",
"end_at",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): LineEntity
{

View File

@ -50,6 +50,48 @@ class ServerPartService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"serverinfo_uid",
"type",
"billing",
"part_uid",
"title",
"cnt",
"extra",
"amount",
];
$filters = [
"serverinfo_uid",
"type",
"part_uid",
"billing",
];
$indexFilter = $filters;
$batchjobFilters = ['billing', 'type'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): ServerPartEntity
{

View File

@ -50,6 +50,47 @@ class ServerService extends EquipmentService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"code",
"type",
"switch",
"ip",
"os",
"title",
"price",
"manufactur_at",
"format_at",
];
$filters = [
"clientinfo_uid",
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): ServerEntity
{
@ -92,4 +133,98 @@ class ServerService extends EquipmentService
//List 검색용
//FormFilter 조건절 처리
//검색어조건절처리
//추가기능
final public function getTotalServiceCount(array $where = []): array
{
$totalCounts = [
'chiba_summary' => 0,
'tokyo_summary' => 0,
'all_summary' => 0,
'normal' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'defence' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'dedicated' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'alternative' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'vpn' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'event' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
'test' => ['chiba' => 0, 'tokyo' => 0, 'summary' => 0],
];
$builder = $this->model->select("serverinfo.type,
COUNT(CASE WHEN serviceinfo.location = 'chiba' THEN 1 END) AS chiba,
COUNT(CASE WHEN serviceinfo.location = 'tokyo' THEN 1 END) AS tokyo,
COUNT(CASE WHEN serviceinfo.location IN ('chiba', 'tokyo') THEN 1 END) AS summary")
->join('serviceinfo', 'serviceinfo.uid = serverinfo.serviceinfo_uid')
->where($where)
->groupBy('serverinfo.type')
->builder();
// echo $builder->getCompiledSelect(false) . "<BR>"; //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
// dd($rows);
foreach ($builder->get()->getResult() as $row) {
$totalCounts[$row->type]['chiba'] = $row->chiba;
$totalCounts[$row->type]['tokyo'] = $row->tokyo;
$totalCounts[$row->type]['summary'] += $row->summary;
$totalCounts['chiba_summary'] += $row->chiba;
$totalCounts['tokyo_summary'] += $row->tokyo;
$totalCounts['all_summary'] = $totalCounts['chiba_summary'] + $totalCounts['tokyo_summary'];
}
// dd($totalCounts);
return $totalCounts;
}
//검색어에 따른 서버정보를 검색 후 해당하는 서비스리스트를 가져온다.
final public function getSearchServices(string $keyword): array
{
$builder = $this->model->distinct()->select('serverinfo.serviceinfo_uid AS serviceinfo_uid')
->join('clientinfo', 'clientinfo.uid = serverinfo.clientinfo_uid')
->join('serverpartinfo', 'serverpartinfo.clientinfo_uid = clientinfo.uid', 'left')
->groupStart()
->like('clientinfo.name', $keyword, 'both', null, true) // escape=true
->orLike('serverinfo.code', $keyword, 'both', null, true)
->orLike('serverinfo.ip', $keyword, 'both', null, true)
->orLike('serverinfo.title', $keyword, 'both', null, true)
->orLike('serverpartinfo.title', $keyword, 'both', null, true)
->groupEnd()
->builder();
// echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
$rows = $builder->get()->getResult();
if (!count($rows)) {
return [];
}
return $rows;
}
//서버 Title별 카운트수
final public function getStockCount(): array
{
$builder = $this->model->select('title,COUNT(*) AS cnt')->groupBy('title')->builder();
// echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
// dd($builder->get()->getResult());
$rows = [];
foreach ($builder->get()->getResult() as $row) {
$rows[$row->title] = $row->cnt;
}
return $rows;
}
// public function getCalculatedAmount(ServerEntity $entity): int
// {
// $caculatedAmount = $entity->getPrice();
// //해당 서비스(서버) 관련 결제방식(Billing)이 Month인 ServerPart 전체를 다시 검사하여 월청구액을 합산한다.
// foreach ($this->getServerPartService()->getEntities(['serverinfo_uid' => $entity->getPK()]) as $serverPartEntity) {
// if ($serverPartEntity->getBilling() === PAYMENT['BILLING']['MONTH']) { //월비용일때만 적용
// $caculatedAmount += $serverPartEntity->getTotalAmount(); //단가*Cnt
// }
// }
// return $caculatedAmount;
// }
// //결제관련처리
// public function setAmount(ServerEntity $entity): ServerEntity
// {
// if ($entity->getServiceInfoUID() === null) {
// throw new \Exception(__METHOD__ . "에서 오류발생: 서비스정보가 정의된 후에만 가능합니다.");
// }
// //서비스정보 반영
// $serviceEntity = $this->getServiceService()->getEntity($entity->getServiceInfoUID());
// if (!$serviceEntity instanceof ServiceEntity) {
// throw new \Exception(__METHOD__ . "에서 오류발생: {$entity->getServiceInfoUID()} 서비스 정보를 찾을수 없습니다.");
// }
// $this->getServiceService()->setAmount($serviceEntity, $this->getCalculatedAmount($entity));
// return $entity;
// }
}

View File

@ -38,6 +38,33 @@ class MylogService extends CommonService implements PipelineStepInterface
}
return $this->_form;
}
public function action_init_process(string $action): void
{
$fields = ['title', 'content'];
$filters = [];
$indexFilter = $filters;
$batchjobFilters = $filters;
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
public function getHelper(): MylogHelper
{
if ($this->_helper === null) {

View File

@ -50,6 +50,40 @@ class CPUService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): CPUEntity
{

View File

@ -50,6 +50,67 @@ class CSService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"type",
"ip",
"accountid",
"domain",
"price",
];
$filters = [
"clientinfo_uid",
'serverinfo_uid',
'type',
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
...$fields,
"clientinfo_uid",
'serverinfo_uid',
'type',
'ip',
'accountid',
'domain',
'price',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
"clientinfo_uid",
'serverinfo_uid',
'type',
'ip',
'accountid',
'domain',
'price',
'status',
'created_at'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): CSEntity
{

View File

@ -50,6 +50,42 @@ class DISKService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, "format", 'status'];
break;
case 'view':
$fields = [...$fields, "format", 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, "format", 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): DISKEntity
{

View File

@ -50,6 +50,58 @@ class IPService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"lineinfo_uid",
"ip",
"price",
];
$filters = [
'old_clientinfo_uid',
'clientinfo_uid',
'serverinfo_uid',
"lineinfo_uid",
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [
...$fields,
'clientinfo_uid',
'serverinfo_uid',
'old_clientinfo_uid',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
'clientinfo_uid',
'serverinfo_uid',
'old_clientinfo_uid',
'status',
'created_at'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): IPEntity
{

View File

@ -50,6 +50,40 @@ class RAMService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): RAMEntity
{

View File

@ -36,6 +36,41 @@ class SOFTWAREService extends PartService
}
return $this->_form;
}
public function action_init_process(string $action): void
{
$fields = [
"title",
"price",
"stock",
];
$filters = [
"status",
];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = [...$fields, 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = [...$fields, 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
public function getHelper(): SOFTWAREHelper
{
if ($this->_helper === null) {

View File

@ -50,6 +50,60 @@ class SWITCHService extends PartService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"code",
"price",
];
$filters = [
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status'
];
$indexFilter = $filters;
$batchjobFilters = ['status',];
switch ($action) {
case 'create':
case 'create_form':
case 'modify':
case 'modify_form':
$fields = [
...$fields,
'status',
];
break;
case 'view':
$fields = [
...$fields,
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status',
'created_at'
];
break;
case 'index':
case 'download':
$fields = [
...$fields,
'clientinfo_uid',
'serviceinfo_uid',
'serverinfo_uid',
'status',
'created_at'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): SWITCHEntity
{

View File

@ -50,6 +50,70 @@ class PaymentService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
"serviceinfo_uid",
"title",
"amount",
"billing",
"billing_at",
"content ",
];
$filters = ['user_uid', 'clientinfo_uid', 'serviceinfo_uid', 'status', 'billing', 'pay'];
$indexFilter = ['serviceinfo_uid', 'status', 'billing'];
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = ['title', 'amount', 'pay', 'status', 'content'];
break;
case 'view':
$fields = [
'clientinfo_uid',
"serviceinfo_uid",
'billing',
'title',
'amount',
'billing_at',
'pay',
'status',
'updated_at',
'countdown',
'user_uid',
'created_at',
'content'
];
break;
case 'index':
case 'download':
$fields = [
'clientinfo_uid',
"serviceinfo_uid",
'billing',
'title',
'amount',
'billing_at',
'pay',
'status',
'updated_at',
'countdown',
'user_uid',
'created_at'
];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
parent::action_init_process($action);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): PaymentEntity
{
@ -108,4 +172,20 @@ class PaymentService extends CommonService
$this->model->orLike($this->model->getTable() . '.email', $word, 'both');
parent::setSearchWord($word);
}
//추가기능
//총 미납건수, 금액
final public function getUnPaids(string $group, array $where = []): array
{
$builder = $this->model->groupBy($group)
->select("{$group},COUNT(uid) as cnt, SUM(amount) as amount")
->where(['status' => STATUS['UNPAID']])
->where($where)
->builder();
// echo $builder->getCompiledSelect(false); //초기화 없이 SQL만 보고 싶을 때: getCompiledSelect(false) ← 꼭 false!
$unPaids = [];
foreach ($builder->get()->getResult() as $row) {
$unPaids[$row->$group] = ['cnt' => $row->cnt, 'amount' => $row->amount];
}
return $unPaids;
}
}

View File

@ -50,6 +50,43 @@ class UserService extends CommonService
}
return $this->_helper;
}
public function action_init_process(string $action): void
{
$fields = [
'id',
'passwd',
'confirmpassword',
'name',
'email',
'mobile',
'role'
];
$filters = ['role', 'status'];
$indexFilter = $filters;
$batchjobFilters = ['status'];
switch ($action) {
case 'create':
case 'create_form':
break;
case 'modify':
case 'modify_form':
$fields = [...$fields, 'status'];
break;
case 'view':
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break;
case 'index':
case 'download':
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break;
}
$this->getFormService()->setFormFields($fields);
$this->getFormService()->setFormRules($action, $fields);
$this->getFormService()->setFormFilters($filters);
$this->getFormService()->setFormOptions($filters);
$this->getFormService()->setIndexFilters($indexFilter);
$this->getFormService()->setBatchjobFilters($batchjobFilters);
}
//기본 기능부분
protected function getEntity_process(mixed $entity): UserEntity
{

View File

@ -3,9 +3,28 @@
<!-- Layout Middle Start -->
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
<!-- Layout Middle Start -->
<?php foreach ($viewDatas['dashboards'] as $dashboard): ?>
<div class="mt-3"><?= $dashboard ?></div>
<?php endforeach ?>
<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 -->
<?= $this->include("{$viewDatas['layout']}/welcome/banner"); ?>
<div class="row align-items-start mt-3">
<div class="col-8">
<?= $this->include("{$viewDatas['layout']}/welcome/total_service"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/new_service"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/stock"); ?>
</div>
<div class="col-4"><?= $this->include("{$viewDatas['layout']}/welcome/mylog"); ?></div>
</div>
<!-- Layout Right End -->
</td>
</tr>
</table>
<!-- Layout Middle End -->
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>

View File

@ -0,0 +1,115 @@
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">
<style>
.card-clickable {
cursor: pointer;
}
.dashboard-card {
color: white;
}
.bg-blue {
background-color: #337ab7;
}
.bg-yellow {
background-color: #f0ad4e;
}
.bg-green {
background-color: #5cb85c;
}
.bg-red {
background-color: #d9534f;
}
.card-footer a {
color: white;
text-decoration: none;
}
.card-footer .fa {
font-size: 1.2em;
}
.fa-5x {
font-size: 4em;
}
.huge {
font-size: 2.5em;
font-weight: bold;
}
.bg-detail {
background-color: #F5F5F5;
}
.bg-detail .bg_blue_font {
color: #337ab7;
}
.bg-detail .bg_yellow_font {
color: #f0ad4e;
}
.bg-detail .bg_green_font {
color: #5cb85c;
}
.bg-detail .bg_red_font {
color: #d9534f;
}
</style>
</head>
<div class="row">
<div class="col-lg">
<div class="card dashboard-card bg-blue card-clickable" onclick="document.location.href='/admin/board?category=<?= BOARD['CATEGORY']['REQUESTTASK'] ?>&worker_uid=<?= $viewDatas['authContext']->getUID() ?>';">
<div class=" card-body">
<div class="row">
<div class="col-4"><i class="fa fa-comments fa-5x"></i></div>
<div class="col-8 text-end">
<div class="huge"><?= $viewDatas['boardRequestTaskCount'] ?></div>
<div class="bg-blue">요청업무 알림</div>
</div>
</div>
</div>
<div class=" card-footer d-flex justify-content-between align-items-center bg-detail">
<span class="bg_blue_font">자세히보기</span><i class="fa fa-arrow-circle-right bg_blue_font"></i>
</div>
</div>
</div>
<div class="col-lg">
<div class="card dashboard-card bg-yellow card-clickable" onclick="document.location.href='/admin/customer/service';">
<div class=" card-body">
<div class="row">
<div class="col-4"><i class="fa fa-plus-square-o fa-5x"></i></div>
<div class="col-8 text-end">
<div class="huge"><?= $viewDatas['newServiceCount'] ?></div>
<div>최근 <?= $viewDatas['interval'] ?>일간 신규서버수</div>
</div>
</div>
</div>
<div class="card-footer d-flex justify-content-between align-items-center bg-detail">
<span class="bg_yellow_font">자세히보기</span><i class="fa fa-arrow-circle-right bg_yellow_font"></i>
</div>
</div>
</div>
<div class="col-lg">
<div class="card dashboard-card bg-red card-clickable" onclick="document.location.href='/admin/customer/payment';">
<div class="card-body">
<div class="row">
<div class="col-4"><i class="fa fa-support fa-5x"></i></div>
<div class="col-8 text-end">
<div class="huge"><?= number_format($viewDatas['unPaidTotalCount']) ?>건/<?= number_format($viewDatas['unPaidTotalAmount']) ?>원</div>
<div><?= date("Y-m-d") ?> 금일 기준 미납 서비스</div>
</div>
</div>
</div>
<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>
</div>
</div>
</div>
</div>

View File

@ -0,0 +1,13 @@
<div class="layout_header">
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['SETUP'] ?>작업내역&nbsp;&nbsp;</h4>
</span>
</li>
</ul>
</div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
<?= view_cell("\App\Cells\MylogCell::dashboard") ?>
</div>
<div class="layout_footer"></div>

View File

@ -0,0 +1,40 @@
<div class="layout_header mt-3">
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 최신 신규 서비스 현황&nbsp;&nbsp;</h4>
</span>
</li>
</ul>
</div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
<table class="table table-bordered table-hover align-middle">
<thead class="table-light">
<tr class="text-center">
<th>사이트</th>
<th>업체명</th>
<th>
<span class="float-start rounded border border-primary" style="cursor:pointer;" onclick="copyServerPartsToClipboard()">ALL 📋</span> 장비번호 / 스위치정보 / IP정보 / CS정보
</th>
<th>등록자</th>
</tr>
</thead>
<tbody>
<?php foreach ($viewDatas['newServiceEntities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity ?>
<tr class="text-center">
<td><?= SITES[$entity->getSite()] ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></td>
<td class="text-start"><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", [
'serverinfo_uid' => $entity->getServerInfoUID(),
'types' => SERVERPART['SERVICE_PARTTYPES'],
'template' => 'partlist_service'
]) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->getUserUID(), $viewDatas) ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<div class="layout_footer"></div>
<script src="/js/admin/clipboard.js"></script>

View File

@ -0,0 +1,24 @@
<div class="layout_header" style="margin-top:20px;">
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['SETUP'] ?>재고현황&nbsp;&nbsp;</h4>
</span>
</li>
</ul>
</div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
<table class="table table-bordered table-striped">
<tr>
<th class="text-center" width="33%">사용 서버</th>
<th class="text-center" width="33%">메모리 재고</th>
<th class="text-center">저장장치 재고</th>
</tr>
<tr>
<td><?= view_cell("\App\Cells\Equipment\ServerCell::stock") ?></td>
<td><?= view_cell("\App\Cells\Part\RAMCell::stock") ?></td>
<td><?= view_cell("\App\Cells\Part\DISKCell::stock") ?></td>
</tr>
</table>
</div>
<div class="layout_footer"></div>

View File

@ -0,0 +1,45 @@
<div class="layout_header">
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['CHART'] ?> 전체 서비스 현황&nbsp;&nbsp;</h4>
</span>
</li>
</ul>
</div>
<div style="border-left: 1px solid black; border-right: 1px solid black; padding:20px;">
<table class="table table-bordered table-hover table-align-middle">
<tr class="text-center">
<th rowspan="2" class="bg-light">사이트</th>
<th colspan="2" class="bg-light">일반</th>
<th colspan="2" class="bg-light">방어</th>
<th colspan="2" class="bg-light">전용</th>
<th colspan="2" class="bg-light">대체</th>
<th colspan="2" class="bg-light">VPN</th>
<th colspan="2" class="bg-light">이벤트</th>
<th colspan="2" class="bg-light">테스트</th>
<th colspan="3" class="bg-light">합계</th>
</tr>
<tr class="text-center">
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">도쿄</th>
<th class="bg-light">치바</th>
<th class="bg-light">합계</th>
</tr>
<?= view_cell("\App\Cells\Equipment\ServerCell::totalCountDashboard") ?>
</table>
</div>
<div class="layout_footer"></div>

View File

@ -7,9 +7,9 @@
<?php foreach ($myLogCellDatas['entities'] as $entity): ?>
<?php $myLogCellDatas['entity'] = $entity; ?>
<tr>
<td class="text-center" nowrap><?= $myLogCellDatas['service']->getHelper()->getFieldView('created_at', $entity->created_at, $myLogCellDatas) ?></td>
<td class="text-start"><?= $myLogCellDatas['service']->getHelper()->getFieldView('title', $entity->title, $myLogCellDatas) ?></td>
<td class="text-center"><?= $myLogCellDatas['service']->getHelper()->getFieldView('user_uid', $entity->user_uid, $myLogCellDatas) ?></td>
<td class="text-center" nowrap><?= $myLogCellDatas['helper']->getFieldView('created_at', $entity->created_at, $myLogCellDatas) ?></td>
<td class="text-start"><?= $myLogCellDatas['helper']->getFieldView('title', $entity->title, $myLogCellDatas) ?></td>
<td class="text-center"><?= $myLogCellDatas['helper']->getFieldView('user_uid', $entity->user_uid, $myLogCellDatas) ?></td>
</td>
</tr>
<?php endforeach ?>

View File

@ -25,7 +25,7 @@
</td>
<td class="text-center text-nowrap" 저장장치 재고><?= $entity->getUsed() ?></td>
<td class="text-center text-nowrap"><?= $entity->getAvailable() ?></td>
<td class="text-center text-nowrap"><?= $partCellDatas['service']->getHelper()->getFieldView('format', $entity->format, $partCellDatas) ?></td>
<td class="text-center text-nowrap"><?= $partCellDatas['helper']->getFieldView('format', $entity->format, $partCellDatas) ?></td>
<td class="text-center text-nowrap"><?= $entity->getStock() ?></td>
</tr>
<?php endforeach ?>

View File

@ -94,7 +94,7 @@
document.addEventListener("DOMContentLoaded", function() {
async function loadNotices() {
try {
const res = await fetch("/admin/board/notice?category=<?= BOARD['CATEGORY']['NOTICE'] ?>");
const res = await fetch("/admin/board/latest/<?= BOARD['CATEGORY']['NOTICE'] ?>");
const notices = await res.json();
const notice_list = document.getElementById("noticeList");
const notice_count = document.getElementById("notice-count");
@ -116,7 +116,7 @@
}
async function loadrequesttasks() {
try {
const res = await fetch("/admin/board/reqeusttask?category=<?= BOARD['CATEGORY']['REQUESTTASK'] ?>");
const res = await fetch("/admin/board/latest/<?= BOARD['CATEGORY']['REQUESTTASK'] ?>");
const requesttasks = await res.json();
const requesttask_list = document.getElementById("requesttaskList");
const requesttask_count = document.getElementById("requesttask-count");

View File

@ -1,7 +1,7 @@
<ul class="nav nav-tabs">
<li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= lang("{$viewDatas['classPath']}.title") ?>&nbsp;&nbsp;</h4>
<h4>&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= $viewDatas['title'] ?? "" ?>&nbsp;&nbsp;</h4>
</span>
</li>
<li class="nav-item">

View File

@ -10,7 +10,7 @@
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="iframe_modal_label">
&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= lang("{$viewDatas['classPath']}.title") ?>&nbsp;&nbsp;
&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= $viewDatas['title'] ?? "" ?>&nbsp;&nbsp;
</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onClick="window.location.reload()"></button>
</div>