dbms_init...1

This commit is contained in:
choi.jh 2025-08-07 14:14:50 +09:00
parent 1cbb338acd
commit 733bc37763
26 changed files with 177 additions and 92 deletions

View File

@ -71,6 +71,9 @@ class ServicePaymentController extends CustomerController
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;
case 'index':
$result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'payment');
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;

View File

@ -20,8 +20,7 @@ class Home extends AdminController
$this->content_title = lang("{$this->getService()->getClassName()}.title");
$this->class_path .= $this->getService()->getClassName();
$this->uri_path .= strtolower($this->getService()->getClassName('/')) . '/';
// $this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
$this->view_path .= 'welcome' . DIRECTORY_SEPARATOR;
}
final public function getService(): ServiceService
@ -55,7 +54,7 @@ class Home extends AdminController
if ($actionTemplate) {
$view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . $this->getAction();
} else {
$view_file = $this->view_path . 'welcome_message';
$view_file = $this->view_path . $this->getAction();
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;

View File

@ -626,9 +626,7 @@ abstract class CommonController extends BaseController
$this->setConditionForList();
$this->order_field = $this->request->getVar('order_field');
$this->order_value = $this->request->getVar('order_value');
if ($this->order_field !== null && $this->order_field !== '') {
$this->getService()->setOrderBy($this->order_field, $this->order_value);
}
$this->getService()->setOrderBy($this->order_field, $this->order_value);
$this->getService()->setLimit($this->per_page);
$this->getService()->setOffset(($this->page - 1) * $this->per_page);
$this->entities = $this->getService()->getEntities();

View File

@ -205,8 +205,10 @@ abstract class CommonService
$this->getModel()->where(sprintf("%s.created_at <= '%s 23:59:59'", $this->getModel()->getTable(), $end));
}
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy(sprintf("%s.%s %s", $this->getModel()->getTable(), $field, $value ?: "DESC"));
if ($field !== null && $value !== null) {
$this->getModel()->orderBy(sprintf("%s.%s %s", $this->getModel()->getTable(), $field, $value));
}
}
}

View File

@ -46,7 +46,7 @@ class ServicePaymentService extends CustomerService
}
public function getIndexFields(): array
{
return ['serviceinfo_uid', "ownerinfo_uid", 'item_type', 'item_uid', 'billing_cycle', 'amount', 'billing_at', 'issue_at', 'countdown', 'status', 'user_uid'];
return ["ownerinfo_uid", 'serviceinfo_uid', 'item_type', 'item_uid', 'billing_cycle', 'amount', 'billing_at', 'issue_at', 'countdown', 'status', 'user_uid'];
}
//기본 기능부분
//FieldForm관련용
@ -96,20 +96,21 @@ class ServicePaymentService extends CustomerService
//Service정보 와 관리자가 기존 정보과 같고, 결제가 아직 완료되지 않은 결제정보의 관리자 변경
public function modifyOwnerByService(ServiceEntity $serviceEntity, int $ownerinfo_uid)
{
$wheres = [
'serviceinfo_uid' => $serviceEntity->getPK(),
'ownerinfo_uid' => $serviceEntity->getOwnerUID(),
'status' => DEFAULTS['STATUS']
];
foreach ($this->getEntities($wheres) as $entity) {
foreach (
$this->getEntities([
'serviceinfo_uid' => $serviceEntity->getPK(),
'ownerinfo_uid' => $serviceEntity->getOwnerUID(),
'status' => DEFAULTS['STATUS']
]) as $entity
) {
$this->modify($entity, ['ownerinfo_uid' => $ownerinfo_uid]);
}
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('billing_at', 'ASC', false);
$this->getModel()->orderBy('billing_at ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -142,9 +142,8 @@ class ServiceService extends CustomerService
//interval을 기준으로 최근 신규 서비스정보 가져오기
final public function getEntitiesByNewService(int $interval, string $status = DEFAULTS['STATUS']): array
{
$where = sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status);
$entities = [];
foreach ($this->getEntities($where) as $entity) {
foreach ($this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status)) as $entity) {
$entities[$entity->getPK()] = $this->setItemEntitiesByService($entity);
};
return $entities;

View File

@ -52,9 +52,9 @@ class CodeService extends EquipmentService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('code', 'ASC', false);
$this->getModel()->orderBy('code', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -41,9 +41,9 @@ class CpuService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('model', 'ASC', false);
$this->getModel()->orderBy('model', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -45,9 +45,9 @@ class DefenceService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('INET_ATON(ip)', 'ASC', false);
$this->getModel()->orderBy('INET_ATON(ip)', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -42,9 +42,9 @@ class DomainService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('domain', 'ASC', false);
$this->getModel()->orderBy('domain', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -86,9 +86,9 @@ class IpService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('INET_ATON(ip)', 'ASC', false);
$this->getModel()->orderBy('INET_ATON(ip)', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -41,9 +41,9 @@ class RamService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('model', 'ASC', false);
$this->getModel()->orderBy('model', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -43,9 +43,9 @@ class SoftwareService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('model', 'ASC', false);
$this->getModel()->orderBy('model', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -41,9 +41,9 @@ class StorageService extends PartService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('model', 'ASC', false);
$this->getModel()->orderBy('model', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -43,9 +43,9 @@ class ServerService extends EquipmentService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('model', 'ASC', false);
$this->getModel()->orderBy('model', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -52,9 +52,9 @@ class SwitchService extends EquipmentService
}
//List 검색용
//OrderBy 처리
public function setOrderBy(string $field, $value): void
public function setOrderBy(mixed $field = null, mixed $value = null): void
{
$this->getModel()->orderBy('code', 'ASC', false);
$this->getModel()->orderBy('code', 'ASC');
parent::setOrderBy($field, $value);
}
}

View File

@ -0,0 +1,62 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['helper']->alert($error) ?><?php endif ?>
<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">
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
<?= 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="index_head_short_column">번호</th>
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<?php endforeach ?>
<th class="index_head_short_column">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td nowrap><?= $viewDatas['helper']->getListButton('modify', '', $viewDatas) ?></td>
<?php foreach ($viewDatas['control']['index_fields'] as $field): ?>
<td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?>
<td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('history', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</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() ?>

View File

@ -0,0 +1,24 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['helper']->alert($error) ?><?php endif ?>
<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']) ?>
<div class="action_form">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['form_fields'] as $field): ?>
<tr>
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['filter_values'][$field] ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
</div>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -12,13 +12,13 @@
</td>
<td class="layout_right">
<!-- Layout Right Start -->
<?= $this->include("templates/{$viewDatas['layout']}/welcome_banner"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/banner"); ?>
<div class="row align-items-start" style="padding-top:20px;">
<div class="col-7">
<?= $this->include("templates/{$viewDatas['layout']}/welcome_total"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/total"); ?>
</div>
<div class="col-5">
<?= $this->include("templates/{$viewDatas['layout']}/welcome_new"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/new"); ?>
</div>
</div>
<!-- Layout Right End -->
@ -26,5 +26,5 @@
</tr>
</table>
<!-- Layout Middle End -->
<div class=" layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<?= $this->endSection() ?>

View File

@ -38,5 +38,4 @@
</tbody>
</table>
</div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/welcome_footer"); ?></div>
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
<div class="layout_footer"></div>

View File

@ -76,4 +76,4 @@
</tfoot>
</table>
</div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/welcome_footer"); ?></div>
<div class="layout_footer"></div>

View File

@ -1 +0,0 @@
<?= $this->include("templates/common/modal_iframe"); ?>

View File

@ -10,4 +10,47 @@
</ul>
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
</div>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom_script"); ?>
<script>
//이 스크립트를 사용하려면 Form 안에 아래 Tag필요
// <input type = "hidden"name = "batchjob_uids"id = "batchjob_uids"value = "" >
function submitBatchJob() {
var validate = false;
//batchjob용 선택사항 검증
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?>
var element = document.querySelector('[name="<?= $field ?>"][data-batchjob="true"]');
if (element && element.value !== "") {
validate = true;
}
<?php endforeach ?>
if (!validate) {
alert('변경할 항목을 선택하셔야합니다.');
return false;
}
//적용받는 uids가 한개라도 선택되었다면 true
var batchjobUids = [];
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
checkboxes.forEach(function(checkbox) {
batchjobUids.push(checkbox.value);
});
if (batchjobUids.length === 0) {
alert('적용할 리스트를 선택하셔야합니다.');
return false;
}
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
return true;
}
function submitBatchJobDelete() {
var batchjobUids = [];
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
checkboxes.forEach(function(checkbox) {
batchjobUids.push(checkbox.value);
});
if (batchjobUids.length === 0) {
alert('적용할 리스트를 선택하셔야합니다.');
return false;
}
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
return true;
}
</script>

View File

@ -1,44 +0,0 @@
<script>
//이 스크립트를 사용하려면 Form 안에 아래 Tag필요
// <input type = "hidden"name = "batchjob_uids"id = "batchjob_uids"value = "" >
function submitBatchJob() {
var validate = false;
//batchjob용 선택사항 검증
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?>
var element = document.querySelector('[name="<?= $field ?>"][data-batchjob="true"]');
if (element && element.value !== "") {
validate = true;
}
<?php endforeach ?>
if (!validate) {
alert('변경할 항목을 선택하셔야합니다.');
return false;
}
//적용받는 uids가 한개라도 선택되었다면 true
var batchjobUids = [];
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
checkboxes.forEach(function(checkbox) {
batchjobUids.push(checkbox.value);
});
if (batchjobUids.length === 0) {
alert('적용할 리스트를 선택하셔야합니다.');
return false;
}
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
return true;
}
function submitBatchJobDelete() {
var batchjobUids = [];
var checkboxes = document.querySelectorAll('input[name="batchjob_uids[]"]:checked');
checkboxes.forEach(function(checkbox) {
batchjobUids.push(checkbox.value);
});
if (batchjobUids.length === 0) {
alert('적용할 리스트를 선택하셔야합니다.');
return false;
}
document.getElementById('batchjob_uids').value = batchjobUids.join(',');
return true;
}
</script>