diff --git a/app/Controllers/Admin/Customer/ServicePaymentController.php b/app/Controllers/Admin/Customer/ServicePaymentController.php index abb4553..a1c9712 100644 --- a/app/Controllers/Admin/Customer/ServicePaymentController.php +++ b/app/Controllers/Admin/Customer/ServicePaymentController.php @@ -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; diff --git a/app/Controllers/Admin/Home.php b/app/Controllers/Admin/Home.php index 6050250..439b5ae 100644 --- a/app/Controllers/Admin/Home.php +++ b/app/Controllers/Admin/Home.php @@ -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; diff --git a/app/Controllers/CommonController.php b/app/Controllers/CommonController.php index e47b44b..76d3263 100644 --- a/app/Controllers/CommonController.php +++ b/app/Controllers/CommonController.php @@ -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(); diff --git a/app/Services/CommonService.php b/app/Services/CommonService.php index 07072fd..19d30a4 100644 --- a/app/Services/CommonService.php +++ b/app/Services/CommonService.php @@ -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)); + } } } diff --git a/app/Services/Customer/ServicePaymentService.php b/app/Services/Customer/ServicePaymentService.php index 461cdaa..1624fcf 100644 --- a/app/Services/Customer/ServicePaymentService.php +++ b/app/Services/Customer/ServicePaymentService.php @@ -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); } } diff --git a/app/Services/Customer/ServiceService.php b/app/Services/Customer/ServiceService.php index ab64f29..d2b72d2 100644 --- a/app/Services/Customer/ServiceService.php +++ b/app/Services/Customer/ServiceService.php @@ -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; diff --git a/app/Services/Equipment/CodeService.php b/app/Services/Equipment/CodeService.php index 70209d9..9b10fe4 100644 --- a/app/Services/Equipment/CodeService.php +++ b/app/Services/Equipment/CodeService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/CpuService.php b/app/Services/Equipment/Part/CpuService.php index 78f8095..72707ee 100644 --- a/app/Services/Equipment/Part/CpuService.php +++ b/app/Services/Equipment/Part/CpuService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/DefenceService.php b/app/Services/Equipment/Part/DefenceService.php index e1dfbdf..1c5c76f 100644 --- a/app/Services/Equipment/Part/DefenceService.php +++ b/app/Services/Equipment/Part/DefenceService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/DomainService.php b/app/Services/Equipment/Part/DomainService.php index edd27a0..a15e6e5 100644 --- a/app/Services/Equipment/Part/DomainService.php +++ b/app/Services/Equipment/Part/DomainService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/IpService.php b/app/Services/Equipment/Part/IpService.php index 5a1fe72..1f81634 100644 --- a/app/Services/Equipment/Part/IpService.php +++ b/app/Services/Equipment/Part/IpService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/RamService.php b/app/Services/Equipment/Part/RamService.php index be53f13..46f75ae 100644 --- a/app/Services/Equipment/Part/RamService.php +++ b/app/Services/Equipment/Part/RamService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/SoftwareService.php b/app/Services/Equipment/Part/SoftwareService.php index 9c8a996..32372b0 100644 --- a/app/Services/Equipment/Part/SoftwareService.php +++ b/app/Services/Equipment/Part/SoftwareService.php @@ -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); } } diff --git a/app/Services/Equipment/Part/StorageService.php b/app/Services/Equipment/Part/StorageService.php index 0017ea8..f84febf 100644 --- a/app/Services/Equipment/Part/StorageService.php +++ b/app/Services/Equipment/Part/StorageService.php @@ -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); } } diff --git a/app/Services/Equipment/ServerService.php b/app/Services/Equipment/ServerService.php index 88a0d99..8549a9a 100644 --- a/app/Services/Equipment/ServerService.php +++ b/app/Services/Equipment/ServerService.php @@ -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); } } diff --git a/app/Services/Equipment/SwitchService.php b/app/Services/Equipment/SwitchService.php index 01b87fc..bfd1534 100644 --- a/app/Services/Equipment/SwitchService.php +++ b/app/Services/Equipment/SwitchService.php @@ -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); } } diff --git a/app/Views/admin/payment/index.php b/app/Views/admin/payment/index.php new file mode 100644 index 0000000..2399a5a --- /dev/null +++ b/app/Views/admin/payment/index.php @@ -0,0 +1,62 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> +alert($error) ?> +
include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
+ + + + + + +
+ + include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?> + + + +
include("templates/{$viewDatas['layout']}/index_header"); ?>
+
+ +
+ include("templates/{$viewDatas['layout']}/index_content_top"); ?> + 'batchjob_form', 'method' => "post"]) ?> + + + + + + + + + + + + + + + getListRowColor($entity) ?>> + + + + + + + + + + +
번호getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?>작업
getListButton('modify', '', $viewDatas) ?>getFieldView($field, $entity->$field, $viewDatas) ?> + getListButton('view', '', $viewDatas) ?>  + getListButton('history', '', $viewDatas) ?>  + getListButton('delete', '', $viewDatas) ?> +
+ include("templates/{$viewDatas['layout']}/index_content_bottom"); ?> + +
+
+ + +
+ +
include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/popup/create_form.php b/app/Views/admin/popup/create_form.php new file mode 100644 index 0000000..149122a --- /dev/null +++ b/app/Views/admin/popup/create_form.php @@ -0,0 +1,24 @@ +extend(LAYOUTS[$viewDatas['layout']]['path']) ?> +section('content') ?> +alert($error) ?> +
+
include("templates/{$viewDatas['layout']}/form_content_top"); ?>
+ +
+ + + + + + + +
getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?> + getFieldForm($field, old($field) ?? ($viewDatas['control']['filter_values'][$field] ?? null), $viewDatas) ?> + +
+
"btn btn-outline btn-primary")); ?>
+ +
+
include("templates/{$viewDatas['layout']}/form_content_bottom"); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/templates/admin/welcome_banner.php b/app/Views/admin/welcome/banner.php similarity index 100% rename from app/Views/templates/admin/welcome_banner.php rename to app/Views/admin/welcome/banner.php diff --git a/app/Views/admin/welcome_message.php b/app/Views/admin/welcome/index.php similarity index 70% rename from app/Views/admin/welcome_message.php rename to app/Views/admin/welcome/index.php index ce96ed0..f6b5005 100644 --- a/app/Views/admin/welcome_message.php +++ b/app/Views/admin/welcome/index.php @@ -12,13 +12,13 @@ - include("templates/{$viewDatas['layout']}/welcome_banner"); ?> + include("{$viewDatas['layout']}/welcome/banner"); ?>
- include("templates/{$viewDatas['layout']}/welcome_total"); ?> + include("{$viewDatas['layout']}/welcome/total"); ?>
- include("templates/{$viewDatas['layout']}/welcome_new"); ?> + include("{$viewDatas['layout']}/welcome/new"); ?>
@@ -26,5 +26,5 @@ -
include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
+
include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
endSection() ?> \ No newline at end of file diff --git a/app/Views/templates/admin/welcome_new.php b/app/Views/admin/welcome/new.php similarity index 87% rename from app/Views/templates/admin/welcome_new.php rename to app/Views/admin/welcome/new.php index f429008..f1fbdbd 100644 --- a/app/Views/templates/admin/welcome_new.php +++ b/app/Views/admin/welcome/new.php @@ -38,5 +38,4 @@ - -
include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?>
\ No newline at end of file + \ No newline at end of file diff --git a/app/Views/templates/admin/welcome_total.php b/app/Views/admin/welcome/total.php similarity index 96% rename from app/Views/templates/admin/welcome_total.php rename to app/Views/admin/welcome/total.php index 9c6d8a0..ec450cb 100644 --- a/app/Views/templates/admin/welcome_total.php +++ b/app/Views/admin/welcome/total.php @@ -76,4 +76,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/templates/admin/form_content_bottom.php b/app/Views/templates/admin/form_content_bottom.php index 0d89182..e69de29 100644 --- a/app/Views/templates/admin/form_content_bottom.php +++ b/app/Views/templates/admin/form_content_bottom.php @@ -1 +0,0 @@ -include("templates/common/modal_iframe"); ?> \ No newline at end of file diff --git a/app/Views/templates/admin/index_content_bottom.php b/app/Views/templates/admin/index_content_bottom.php index b03b379..6ce283a 100644 --- a/app/Views/templates/admin/index_content_bottom.php +++ b/app/Views/templates/admin/index_content_bottom.php @@ -10,4 +10,47 @@
-include("templates/{$viewDatas['layout']}/index_content_bottom_script"); ?> \ No newline at end of file + \ No newline at end of file diff --git a/app/Views/templates/admin/index_content_bottom_script.php b/app/Views/templates/admin/index_content_bottom_script.php deleted file mode 100644 index 275c2f3..0000000 --- a/app/Views/templates/admin/index_content_bottom_script.php +++ /dev/null @@ -1,44 +0,0 @@ - \ No newline at end of file diff --git a/app/Views/templates/admin/welcome_footer.php b/app/Views/templates/admin/welcome_footer.php deleted file mode 100644 index e69de29..0000000