dbmsv3 init...1

This commit is contained in:
choi.jh 2025-10-16 14:25:06 +09:00
parent a4b6580071
commit ac6119286e
15 changed files with 72 additions and 78 deletions

View File

@ -35,23 +35,22 @@ class UserController extends AdminController
//Index,FieldForm관련
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{
switch ($this->getService()->getAction()) {
case 'profile_modify_form':
switch ($this->getService()->getControlDatas('action')) {
case 'profile':
$result = $this->view($this->entity->getPK());
break;
case 'profile_form':
$this->service = $this->getService();
$this->control = $this->getService()->getControlDatas();
$this->getService()->getHelper()->setViewDatas($this->getViewDatas());
$actionTemplate = $this->request->getVar('ActionTemplate') ?? $actionTemplate;
if ($actionTemplate) {
$view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . 'modify_form';
$view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . "modify_form";
} else {
$view_file = $this->view_path . 'modify_form';
$view_file = $this->view_path . "modify_form";
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;
case 'profile_modify':
$this->getMyLogService()->save($this->getService()->getClassName(), $this->getService()->getAction(), $message, $this->getMyAuth()->getUIDByAuthInfo());
$result = $this->view($this->entity->getPK());
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;

View File

@ -108,7 +108,6 @@ abstract class CommonController extends BaseController
switch ($this->getService()->getControlDatas('action')) {
case 'create':
case 'modify':
// $this->getMyLogService()->save($this->getService()->getClassName(), $this->getAction(), $message, $this->getMyAuth()->getUIDByAuthInfo());
$result = $this->view($this->entity->getPK());
break;
case 'create_form':

View File

@ -429,14 +429,14 @@ class CommonHelper
{
switch ($action) {
case 'create':
$extras = ["class" => "btn btn-outline btn-primary btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : '입력',
$action,
[
"data-src" => current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(),
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);
@ -457,44 +457,48 @@ class CommonHelper
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
'class' => 'form-label-sm',
...$extras
]
);
break;
case 'view':
$extras = ["class" => "btn btn-outline btn-primary btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['SEARCH'],
$action,
[
"data-src" => current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK() . '?' . $viewDatas['uri']->getQuery(),
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);
break;
case 'delete':
$extras = ["class" => "btn btn-sm btn-danger btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = anchor(
current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(),
$label ? $label : ICONS['DELETE'],
$extras
[
"class" => "btn btn-sm btn-danger form-label-sm",
...$extras
]
);
break;
case 'batchjob':
$action = form_submit("batchjob_submit", $label ? $label : '일괄처리', [
"formaction" => current_url() . '/batchjob',
"class" => "btn btn-outline btn-warning",
"class" => "btn btn-sm btn-warning form-label-sm",
...$extras,
// "onclick" => "return submitBatchJob()"
]);
break;
case 'batchjob_delete':
$action = form_submit("batchjob_submit", $label ? $label : '일괄삭제', [
"formaction" => current_url() . '/batchjob_delete',
"class" => "btn btn-outline btn-danger",
"class" => "btn btn-sm btn-danger form-label-sm",
...$extras,
// "onclick" => "return submitBatchJobDelete()"
]);
break;

View File

@ -22,41 +22,41 @@ class ClientHelper extends CustomerHelper
$value = $this->getMyAuth()->isAccessRole(['security']) ? parent::getFieldView($field, $value, $viewDatas, $extras) : "***********";
break;
case 'account_balance':
$extras = ["class" => "btn btn-link form-label-sm", "target" => "_self", ...$extras];
$value = form_label(
number_format(intval($value)) . "",
'index',
[
"data-src" => "/admin/customer/account?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);
break;
case 'coupon_balance':
$extras = ["class" => "btn btn-link form-label-sm", "target" => "_self", ...$extras];
$value = form_label(
number_format(intval($value)) . "",
'index',
[
"data-src" => "/admin/customer/coupon?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);
break;
case 'point_balance':
$extras = ["class" => "btn btn-link form-label-sm", "target" => "_self", ...$extras];
$value = form_label(
number_format(intval($value)) . "",
'index',
[
"data-src" => "/admin/customer/point?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);
break;
@ -82,14 +82,14 @@ class ClientHelper extends CustomerHelper
$action = $this->getMyAuth()->isAccessRole(['security']) ? parent::getListButton($action, $label, $viewDatas, $extras) : "";
break;
case 'history':
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['HISTORY'],
$action,
[
"data-src" => "/admin/customer/client/history?clientinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);
@ -97,19 +97,15 @@ class ClientHelper extends CustomerHelper
case 'coupon':
case 'account':
case 'point':
$extras = [
"class" => "btn btn-sm btn-outline btn-circle btn-link form-label-sm",
"target" => "_self",
...$extras,
];
$action = form_label(
$label,
$action,
[
"data-src" => "/admin/customer/{$action}?clientinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras,
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);
break;

View File

@ -107,40 +107,40 @@ class ServiceHelper extends CustomerHelper
$action = parent::getListButton($action, $label, $viewDatas, $extras);
break;
case 'addServer':
$extras = ["class" => "btn btn-outline btn-light btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['REBOOT'],
$action,
[
"data-src" => "/admin/customer/service/addServer/{$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm",
...$extras
]
);
break;
case 'onetime':
$extras = ["class" => "btn btn-outline btn-light btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['ONETIME'],
$action,
[
"data-src" => "/admin/customer/payment/create?serviceinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm",
...$extras
]
);
break;
case 'history':
$extras = ["class" => "btn btn-outline btn-primary btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['HISTORY'],
$action,
[
"data-src" => "/admin/customer/service/history?serviceinfo_uid={$viewDatas['entity']->getPK()}&serviceinfo_uid={$viewDatas['entity']->getPK()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);

View File

@ -84,14 +84,14 @@ class ServerHelper extends EquipmentHelper
$action = parent::getListButton($action, $viewDatas['entity']->getCode(), $viewDatas, $extras);
break;
case 'history':
$extras = ["class" => "btn btn-outline btn-primary btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = $label ? $label : form_label(
$label ? $label : ICONS['HISTORY'],
$action,
[
"data-src" => "/admin/customer/clienthistory?clientinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm btn-primary form-label-sm",
...$extras
]
);

View File

@ -85,9 +85,9 @@ class ServerPartHelper extends EquipmentHelper
[
"data-src" => "/admin/equipment/server/modify/{$viewDatas['serverEntity']->getPK()}?ActionTemplate=server",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"class" => "btn btn-sm btn-outline btn-circle form-label-sm",
"target" => "_self",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);
break;
@ -111,9 +111,9 @@ class ServerPartHelper extends EquipmentHelper
[
"data-src" => "/admin/equipment/serverpart/modify/{$viewDatas['entity']->getPK()}?type={$viewDatas['entity']->getType()}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"class" => "btn btn-sm btn-outline btn-circle form-label-sm",
"target" => "_self",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);
}
@ -136,18 +136,14 @@ class ServerPartHelper extends EquipmentHelper
case 'RAM':
case 'DISK':
case 'SOFTWARE':
$extras = [
"class" => "btn btn-sm btn-outline btn-circle btn-link form-label-sm",
"target" => "_self",
...$extras,
];
$action = form_label(
$label ? $label : ICONS["SERVER_ITEM_{$action}"],
$action,
[
"data-src" => "/admin/equipment/serverpart?serverinfo_uid={$viewDatas['serverinfo_uid']}&type={$action}&ActionTemplate=popup",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm text-primary",
...$extras,
]
);

View File

@ -34,15 +34,15 @@ class HomeHelper extends CommonHelper
{
switch ($action) {
case 'new_service_view':
$extras = ["class" => "btn btn-outline btn-light btn-circle form-label-sm", "target" => "_self", ...$extras];
$action = form_label(
$label ? $label : ICONS['SEARCH'],
$action,
[
"data-src" => '/admin/customer/service/view/' . $viewDatas['entity']->getPK(),
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
"data-bs-target" => "#modal_action_form",
"class" => "btn btn-sm form-label-sm",
...$extras,
]
);
break;

View File

@ -30,9 +30,9 @@
"modify",
[
"class" => "dropdown-item form-label-sm",
"data-src" => "/admin/user/profile_modify/" . $viewDatas['myAuthUID'],
"data-src" => "/admin/user/profile/" . $viewDatas['myAuthUID'],
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form"
"data-bs-target" => "#modal_action_form"
]
) ?></li>
<li>

View File

@ -23,7 +23,7 @@
"class" => "dropdown-item form-label-sm",
"data-src" => "/user/modify/" . $viewDatas['myAuthUID'],
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form"
"data-bs-target" => "#modal_action_form"
]
) ?></li>
<li>

View File

@ -1,5 +1,5 @@
<!-- 모달 HTML -->
<div id="index_action_form" class="index_action_form modal fade" tabindex="-1" aria-labelledby="modal_label" aria-hidden="true">
<div id="modal_action_form" class="modal_action_form modal fade" tabindex="-1" aria-labelledby="modal_label" aria-hidden="true">
<div class="modal-dialog modal-lg modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
@ -16,7 +16,7 @@
</div>
<script>
const modal = document.getElementById('index_action_form');
const modal = document.getElementById('modal_action_form');
const modalBody = document.getElementById('modal-body-content');
// 콘텐츠 로드 함수

View File

@ -1,5 +1,5 @@
<!-- 모달 HTML -->
<div id="index_action_form" class="modal fade" tabindex="-1" aria-labelledby="modal_label" aria-hidden="true">
<div id="modal_action_form" class="modal fade" tabindex="-1" aria-labelledby="modal_label" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
@ -24,7 +24,7 @@
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/6/tinymce.min.js" referrerpolicy="origin"></script>
<script>
const modal = document.getElementById('index_action_form');
const modal = document.getElementById('modal_action_form');
const modalBody = document.getElementById('modal-body-content');
// 콘텐츠 로드 함수

View File

@ -1,10 +1,10 @@
<!-- 처음 호출할때 사용법
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="시작URL">시작</button>
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modal_action_form" data-src="시작URL">시작</button>
-->
<!-- 동적으로 ifram src 바꾸고싶을때
<span data-bs-toggle="modal" data-bs-target="#index_action_form" data-src="바꾸고싶은URL" style="cursor:pointer;">바꾸기</span>
<span data-bs-toggle="modal" data-bs-target="#modal_action_form" data-src="바꾸고싶은URL" style="cursor:pointer;">바꾸기</span>
-->
<div id="index_action_form" class="index_action_form modal fade" tabindex="-1" aria-labelledby="iframe_modal_label"
<div id="modal_action_form" class="modal_action_form modal fade" tabindex="-1" aria-labelledby="iframe_modal_label"
aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered modal-dialog-scrollable"> <!-- modal-lg는 모달 크기를 크게 설정 -->
<div class="modal-content">
@ -29,7 +29,7 @@
}
function closeBootstrapModal() {
var modalElement = document.getElementById('index_action_form'); // 모달의 실제 DOM 요소 가져오기
var modalElement = document.getElementById('modal_action_form'); // 모달의 실제 DOM 요소 가져오기
var modalInstance = bootstrap.Modal.getInstance(modalElement); // 모달 인스턴스 가져오기
if (modalInstance) {
modalInstance.hide(); // 모달 닫기 (hide() 메서드 사용)
@ -47,13 +47,13 @@
newIframe.frameBorder = '0';
newIframe.allowFullscreen = true;
// body에 다시 추가
document.querySelector('#index_action_form .modal-body').appendChild(newIframe);
document.querySelector('#modal_action_form .modal-body').appendChild(newIframe);
// 부모창만 리로드
window.location.reload();
}
var index_action_form = document.getElementById('index_action_form');
index_action_form.addEventListener('show.bs.modal', function(event) {
var modal_action_form = document.getElementById('modal_action_form');
modal_action_form.addEventListener('show.bs.modal', function(event) {
var button = event.relatedTarget;
var iframe = document.getElementById('form-container');
iframe.src = button.getAttribute('data-src');
@ -72,7 +72,7 @@
});
// 모달이 닫힐 때 iframe src를 초기화하여 종료 처리
index_action_form.addEventListener('hidden.bs.modal', function() {
modal_action_form.addEventListener('hidden.bs.modal', function() {
var iframe = document.getElementById('form-container');
iframe.src = "about:blank"; // 모달 닫힐 때 iframe 초기화
});

View File

@ -160,12 +160,12 @@ div.index_bottom {
/* border: 1px solid red; */
}
div.index_bottom div.index_action_form {
div.index_bottom div.modal_action_form {
margin-top: 20px;
/* border: 1px solid red; */
}
div.index_bottom div.index_action_form iframe {
div.index_bottom div.modal_action_form iframe {
width: 100%;
border: none;
/* border: 1px solid blue; */

View File

@ -156,12 +156,12 @@ div.index_bottom {
/* border: 1px solid red; */
}
div.index_bottom div.index_action_form {
div.index_bottom div.modal_action_form {
margin-top: 20px;
/* border: 1px solid red; */
}
div.index_bottom div.index_action_form iframe {
div.index_bottom div.modal_action_form iframe {
width: 100%;
border: none;
/* border: 1px solid blue; */