dbms_init...1

This commit is contained in:
choi.jh 2025-06-26 15:39:53 +09:00
parent e7ce8124be
commit 72b3859106
23 changed files with 668 additions and 52 deletions

View File

@ -56,6 +56,19 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob_delete', 'ClientController::batchjob_delete');
$routes->get('download/(:alpha)', 'ClientController::download/$1');
});
$routes->group('clienthistory', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'ClientHistoryController::index', []);
$routes->get('create', 'ClientHistoryController::create_form');
$routes->post('create', 'ClientHistoryController::create');
$routes->get('modify/(:num)', 'ClientHistoryController::modify_form/$1');
$routes->post('modify/(:num)', 'ClientHistoryController::modify/$1');
$routes->get('view/(:num)', 'ClientHistoryController::view/$1');
$routes->get('delete/(:num)', 'ClientHistoryController::delete/$1');
$routes->get('toggle/(:num)/(:any)', 'ClientHistoryController::toggle/$1/$2');
$routes->post('batchjob', 'ClientHistoryController::batchjob');
$routes->post('batchjob_delete', 'ClientHistoryController::batchjob_delete');
$routes->get('download/(:alpha)', 'ClientHistoryController::download/$1');
});
$routes->group('account', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'AccountController::index', []);
$routes->get('create', 'AccountController::create_form');

View File

@ -2,14 +2,15 @@
namespace App\Controllers\Admin\Customer;
use App\Helpers\Customer\ClientHelper;
use App\Services\Customer\ClientService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface;
use App\Helpers\Customer\ClientHelper;
use App\Services\Customer\ClientService;
class ClientController extends CustomerController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@ -35,6 +36,18 @@ class ClientController extends CustomerController
}
return $this->_helper;
}
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{
switch ($this->getAction()) {
case 'index':
$result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'client');
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;
}
return $result;
}
//Index,FieldForm관련
protected function setValidation(Validation $validation, string $field, string $rule): Validation
{

View File

@ -0,0 +1,53 @@
<?php
namespace App\Controllers\Admin\Customer;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Helpers\Customer\ClientHistoryHelper;
use App\Services\Customer\ClientHistoryService;
class ClientHistoryController extends CustomerController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$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;
}
public function getService(): ClientHistoryService
{
if (!$this->_service) {
$this->_service = new ClientHistoryService();
}
return $this->_service;
}
public function getHelper(): ClientHistoryHelper
{
if (!$this->_helper) {
$this->_helper = new ClientHistoryHelper();
}
return $this->_helper;
}
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{
switch ($this->getAction()) {
case 'index':
$result = parent::getResultSuccess($message, $this->request->getVar('ActionTemplate') ?? $actionTemplate ?? 'popup');
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;
}
return $result;
}
//Index,FieldForm관련
}

File diff suppressed because one or more lines are too long

View File

@ -4,8 +4,8 @@
"settings": {
"width": 3000,
"height": 3000,
"scrollTop": -1480.1953,
"scrollLeft": -994.6025,
"scrollTop": -695.5286,
"scrollLeft": -409.6025,
"zoomLevel": 0.79,
"show": 511,
"database": 4,
@ -51,7 +51,8 @@
"0WXrjcyXXGeoAVM2VB8s2",
"eLGlqJ4z_woGP6CLZEuUr",
"JoMB-mb6p6NoHpiAvjD2y",
"IsMoJXzvtuoOFFt93qS0w"
"IsMoJXzvtuoOFFt93qS0w",
"rlCmi1ybOTx8gPwOXyjTX"
],
"relationshipIds": [
"gAVYXWnBSnCw-0ieO4Mil",
@ -70,7 +71,8 @@
"cRqZmxohkCGd_FTkg1rhI",
"e74Cc4zZztxyoazM_ssbu",
"Y-MNlBi4tzmX_zwrY0zTc",
"my7misDXaAqlgb4tiABJn"
"my7misDXaAqlgb4tiABJn",
"2m5lqUPzTlINKxzoMyyWG"
],
"indexIds": [],
"memoIds": []
@ -394,15 +396,15 @@
"CX9ODlVw-gFnxgfMJ1JyV"
],
"ui": {
"x": 150.6007,
"y": 1934.1184,
"x": 156.9298,
"y": 1983.4854,
"zIndex": 2,
"widthName": 60,
"widthComment": 60,
"color": ""
},
"meta": {
"updateAt": 1750829018823,
"updateAt": 1750916235652,
"createAt": 1745819764138
}
},
@ -794,15 +796,15 @@
"n9ZWAQ9754sZ3MM4IxCAA"
],
"ui": {
"x": 136.0004,
"y": 759.2028,
"x": 146.1271,
"y": 927.5572,
"zIndex": 2278,
"widthName": 110,
"widthComment": 60,
"color": ""
},
"meta": {
"updateAt": 1750829272018,
"updateAt": 1750916226017,
"createAt": 1748484896313
}
},
@ -911,15 +913,15 @@
"ZNqrByaObXV1K12bzagzY"
],
"ui": {
"x": 137.852,
"y": 1186.5143,
"x": 149.2444,
"y": 1342.2104,
"zIndex": 2502,
"widthName": 92,
"widthComment": 86,
"color": ""
},
"meta": {
"updateAt": 1750828899771,
"updateAt": 1750916229463,
"createAt": 1748507247933
}
},
@ -949,15 +951,15 @@
"Z8XCLTbsA5h402twy9vwb"
],
"ui": {
"x": 137.9782,
"y": 1591.4787,
"x": 151.9022,
"y": 1712.9976,
"zIndex": 2505,
"widthName": 99,
"widthComment": 103,
"color": ""
},
"meta": {
"updateAt": 1750828957031,
"updateAt": 1750916232755,
"createAt": 1749520593335
}
},
@ -1027,6 +1029,44 @@
"updateAt": 1750900814178,
"createAt": 1750898626895
}
},
"rlCmi1ybOTx8gPwOXyjTX": {
"id": "rlCmi1ybOTx8gPwOXyjTX",
"name": "clientinfo_history",
"comment": "고객_history",
"columnIds": [
"EEdbsRYJLw-oqKaIcEy4j",
"xM99dcx7-5WMPvULGsgWq",
"TH4M6Y21xogid7W4U19I9",
"7MFKRXZwdneZW5jfT5zDw",
"YWl9ZfaQvqzHphqvdffhi",
"skUFXBIguZ9hstXTw3Cam",
"rr6Zr8XuvAOSjxyt9yzEm",
"LjRSallyJdccFBrFB6FPh"
],
"seqColumnIds": [
"EEdbsRYJLw-oqKaIcEy4j",
"sXpn1a1POuNlWAvXFTuIo",
"xM99dcx7-5WMPvULGsgWq",
"TH4M6Y21xogid7W4U19I9",
"7MFKRXZwdneZW5jfT5zDw",
"YWl9ZfaQvqzHphqvdffhi",
"skUFXBIguZ9hstXTw3Cam",
"rr6Zr8XuvAOSjxyt9yzEm",
"LjRSallyJdccFBrFB6FPh"
],
"ui": {
"x": 140.0029,
"y": 636.1117,
"zIndex": 2566,
"widthName": 92,
"widthComment": 67,
"color": ""
},
"meta": {
"updateAt": 1750916277385,
"createAt": 1750916193767
}
}
},
"tableColumnEntities": {
@ -7449,6 +7489,186 @@
"updateAt": 1750900874920,
"createAt": 1750900801840
}
},
"EEdbsRYJLw-oqKaIcEy4j": {
"id": "EEdbsRYJLw-oqKaIcEy4j",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 11,
"ui": {
"keys": 1,
"widthName": 60,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916244200,
"createAt": 1750916216049
}
},
"sXpn1a1POuNlWAvXFTuIo": {
"id": "sXpn1a1POuNlWAvXFTuIo",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "serviceinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 8,
"ui": {
"keys": 0,
"widthName": 80,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216049,
"createAt": 1750916216049
}
},
"TH4M6Y21xogid7W4U19I9": {
"id": "TH4M6Y21xogid7W4U19I9",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "title",
"comment": "",
"dataType": "VARCHAR(255)",
"default": "",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 81,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216049,
"createAt": 1750916216049
}
},
"7MFKRXZwdneZW5jfT5zDw": {
"id": "7MFKRXZwdneZW5jfT5zDw",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "description",
"comment": "",
"dataType": "TEXT",
"default": "",
"options": 0,
"ui": {
"keys": 0,
"widthName": 61,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216049,
"createAt": 1750916216049
}
},
"YWl9ZfaQvqzHphqvdffhi": {
"id": "YWl9ZfaQvqzHphqvdffhi",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "status",
"comment": "상태",
"dataType": "VARCHAR(20)",
"default": "'default'",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 75,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216049,
"createAt": 1750916216049
}
},
"skUFXBIguZ9hstXTw3Cam": {
"id": "skUFXBIguZ9hstXTw3Cam",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "updated_at",
"comment": "",
"dataType": "TIMESTAMP",
"default": "",
"options": 0,
"ui": {
"keys": 0,
"widthName": 62,
"widthComment": 60,
"widthDataType": 65,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216050,
"createAt": 1750916216050
}
},
"rr6Zr8XuvAOSjxyt9yzEm": {
"id": "rr6Zr8XuvAOSjxyt9yzEm",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "created_at",
"comment": "",
"dataType": "TIMESTAMP",
"default": "CURRENT_TIMESTAMP",
"options": 8,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 65,
"widthDefault": 122
},
"meta": {
"updateAt": 1750916216050,
"createAt": 1750916216050
}
},
"LjRSallyJdccFBrFB6FPh": {
"id": "LjRSallyJdccFBrFB6FPh",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "deleted_at",
"comment": "",
"dataType": "TIMESTAMP",
"default": "",
"options": 0,
"ui": {
"keys": 0,
"widthName": 60,
"widthComment": 60,
"widthDataType": 65,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916216050,
"createAt": 1750916216050
}
},
"xM99dcx7-5WMPvULGsgWq": {
"id": "xM99dcx7-5WMPvULGsgWq",
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"name": "clientinfo_uid",
"comment": "",
"dataType": "INT",
"default": "",
"options": 8,
"ui": {
"keys": 2,
"widthName": 73,
"widthComment": 60,
"widthDataType": 60,
"widthDefault": 60
},
"meta": {
"updateAt": 1750916270440,
"createAt": 1750916263299
}
}
},
"relationshipEntities": {
@ -7583,8 +7803,8 @@
"columnIds": [
"f7_MGvRjkwL1xkCWrAgDR"
],
"x": 648.6007,
"y": 2046.1184,
"x": 654.9298,
"y": 2095.4854,
"direction": 2
},
"meta": {
@ -7631,7 +7851,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 1627.5371,
"y": 777.4445999999999,
"y": 734.4446,
"direction": 1
},
"end": {
@ -7659,7 +7879,7 @@
"N_yJVoCN4oUEDhYqdzApb"
],
"x": 937.1139,
"y": 1231.9058,
"y": 1347.9058,
"direction": 1
},
"end": {
@ -7667,8 +7887,8 @@
"columnIds": [
"TerqekzImISduE6ewW1b5"
],
"x": 654.852,
"y": 1358.5143,
"x": 666.2444,
"y": 1514.2104,
"direction": 2
},
"meta": {
@ -7715,7 +7935,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 1627.5371,
"y": 892.1112666666666,
"y": 820.4446,
"direction": 1
},
"end": {
@ -7742,17 +7962,17 @@
"columnIds": [
"N_yJVoCN4oUEDhYqdzApb"
],
"x": 937.1139,
"y": 1386.5724666666667,
"direction": 1
"x": 1197.1138999999998,
"y": 1463.9058,
"direction": 8
},
"end": {
"tableId": "eLGlqJ4z_woGP6CLZEuUr",
"columnIds": [
"jyD_WqbebGSYxIa72ig3p"
],
"x": 658.9782,
"y": 1715.4787,
"x": 672.9022,
"y": 1836.9976,
"direction": 2
},
"meta": {
@ -7799,7 +8019,7 @@
"N_yJVoCN4oUEDhYqdzApb"
],
"x": 937.1139,
"y": 1077.2391333333333,
"y": 1115.9058,
"direction": 1
},
"end": {
@ -7807,8 +8027,8 @@
"columnIds": [
"ZWV8iXrgQovfYTm32QGbZ"
],
"x": 684.0004,
"y": 1085.8694666666665,
"x": 694.1271,
"y": 1254.2238666666667,
"direction": 2
},
"meta": {
@ -7827,7 +8047,7 @@
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 1627.5371,
"y": 662.7779333333333,
"y": 906.4446,
"direction": 1
},
"end": {
@ -7835,8 +8055,8 @@
"columnIds": [
"yc1mNA3iMmF8xoUX60z6F"
],
"x": 684.0004,
"y": 955.2027999999999,
"x": 694.1271,
"y": 1123.5572,
"direction": 2
},
"meta": {
@ -7855,7 +8075,7 @@
"mfHtgzc_Aeocr6xkgwYWh"
],
"x": 1584.6636,
"y": 364.3842666666667,
"y": 257.7176,
"direction": 1
},
"end": {
@ -7911,7 +8131,7 @@
"mfHtgzc_Aeocr6xkgwYWh"
],
"x": 1584.6636,
"y": 257.7176,
"y": 364.3842666666667,
"direction": 1
},
"end": {
@ -7919,8 +8139,8 @@
"columnIds": [
"s1Az-lXWK0NlVQqFEEK8o"
],
"x": 684.0004,
"y": 824.5361333333333,
"x": 694.1271,
"y": 992.8905333333332,
"direction": 2
},
"meta": {
@ -8011,6 +8231,34 @@
"updateAt": 1750900801840,
"createAt": 1750900801840
}
},
"2m5lqUPzTlINKxzoMyyWG": {
"id": "2m5lqUPzTlINKxzoMyyWG",
"identification": false,
"relationshipType": 16,
"startRelationshipType": 2,
"start": {
"tableId": "6ajvOCaGuXU9pzV0Y9jEi",
"columnIds": [
"_AcWUYKzNJd-V0fRHq8Cx"
],
"x": 1627.5371,
"y": 648.4446,
"direction": 1
},
"end": {
"tableId": "rlCmi1ybOTx8gPwOXyjTX",
"columnIds": [
"xM99dcx7-5WMPvULGsgWq"
],
"x": 654.0029,
"y": 760.1117,
"direction": 2
},
"meta": {
"updateAt": 1750916263300,
"createAt": 1750916263300
}
}
},
"indexEntities": {},

View File

@ -0,0 +1,11 @@
<?php
namespace App\Entities\Customer;
use App\Models\Customer\ClientHistoryModel;
class ClientHistoryEntity extends CustomerEntity
{
const PK = ClientHistoryModel::PK;
const TITLE = ClientHistoryModel::TITLE;
}

View File

@ -321,6 +321,8 @@ class CommonHelper
} else {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
}

View File

@ -21,6 +21,8 @@ class AccountHelper extends CustomerHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -78,6 +78,19 @@ class ClientHelper extends CustomerHelper
case 'batchjob_delete':
$action = !$this->getMyAuth()->isAccessRole(['security']) ? "" : parent::getListButton($action, $viewDatas, $extras);
break;
case 'history':
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
$action = form_label(
ICONS['HISTORY'],
$action,
[
"data-src" => "/admin/customer/clienthistory?clientinfo_uid={$viewDatas['entity']->getPK()}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
...$extras
]
);
break;
default:
$action = parent::getListButton($action, $viewDatas, $extras);
break;

View File

@ -0,0 +1,14 @@
<?php
namespace App\Helpers\Customer;
use App\Models\Customer\ClientHistoryModel;
class ClientHistoryHelper extends CustomerHelper
{
public function __construct()
{
parent::__construct();
$this->setTitleField(field: ClientHistoryModel::TITLE);
}
}

View File

@ -21,6 +21,8 @@ class CouponHelper extends CustomerHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -22,6 +22,8 @@ class PointHelper extends CustomerHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -97,6 +97,24 @@ class ServiceHelper extends CustomerHelper
public function getFieldView(string $field, mixed $value, array $viewDatas, array $extras = []): string|null
{
switch ($field) {
case 'user_uid':
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
break;
case 'clientinfo_uid':
case 'ownerinfo_uid':
$temp = parent::getFieldForm($field, $value, $viewDatas, $extras);
$value = $temp . form_label(
ICONS['HISTORY'],
'client_history',
[
"data-src" => "/admin/customer/clienthistory?clientinfo_uid={$value}",
"data-bs-toggle" => "modal",
"data-bs-target" => "#index_action_form",
"class" => "btn btn-outline btn-primary btn-circle",
"target" => "_self"
]
);
break;
case "LINE":
case "IP":
case "SERVER":
@ -122,10 +140,11 @@ class ServiceHelper extends CustomerHelper
break;
case 'billing_at':
if (array_key_exists('unPaids', $viewDatas)) {
$value .= array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids']) ? "<BR>미지급항목: " . $viewDatas['unPaids'][$viewDatas['entity']->getPK()] . "" : "";
if (array_key_exists($viewDatas['entity']->getPK(), $viewDatas['unPaids'])) {
$value .= "<div><a href=\"/admin/customer/payment?serviceinfo_uid={$viewDatas['entity']->getPK()}\">미지급: <span style=\"color:red;\">" . $viewDatas['unPaids'][$viewDatas['entity']->getPK()] . "</span>개</a></div>";
}
}
break;
default:
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
break;

View File

@ -33,6 +33,8 @@ class ServicePaymentHelper extends CustomerHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -51,6 +51,8 @@ class HomeHelper extends CommonHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -21,6 +21,8 @@ class MyLogHelper extends CommonHelper
if (in_array($field, $viewDatas['control']['filter_fields'])) {
if (array_key_exists($value, $viewDatas['control']['filter_optons'][$field])) {
$value = $viewDatas['control']['filter_optons'][$field][$value]->getTitle();
} else {
$value = "";
}
}
break;

View File

@ -0,0 +1,20 @@
<?php
return [
'title' => "고객History정보",
'label' => [
'clientinfo_uid' => "고객명",
'title' => "제목",
'description' => "상세정보",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "신청일",
'deleted_at' => "삭제일",
],
'DEFAULTS' => [
'status' => 'default'
],
"STATUS" => [
'default' => "사용중",
"pause" => "일시정지",
],
];

View File

@ -4,7 +4,7 @@ return [
'label' => [
'clientinfo_uid' => "고객",
'ownerinfo_uid' => "관리자",
'user_uid' => "등록",
'user_uid' => "작업",
'title' => "서비스명",
'type' => "서비스형식",
'location' => "위치",

View File

@ -16,6 +16,5 @@ return [
"STATUS" => [
'default' => "사용중",
"pause" => "일시정지",
'delete' => "삭제",
],
];

View File

@ -4,7 +4,7 @@ return [
'label' => [
'serviceinfo_uid' => "서비스",
'ownerinfo_uid' => "관리자",
'user_uid' => "결제",
'user_uid' => "작업",
'item_type' => "항목종류",
'item_uid' => "항목",
'billing_cycle' => "납부방식",

View File

@ -0,0 +1,44 @@
<?php
namespace App\Models\Customer;
use App\Entities\Customer\ClientHistoryEntity;
class ClientHistoryModel extends CustomerModel
{
const TABLE = "clientinfo_history";
const PK = "uid";
const TITLE = "title";
protected $table = self::TABLE;
protected $primaryKey = self::PK;
protected $returnType = ClientHistoryEntity::class;
protected $allowedFields = [
"clientinfo_uid",
"title",
"description",
"status",
"updated_at"
];
public function __construct()
{
parent::__construct();
}
public function getFormFieldRule(string $action, string $field): string
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
case "clientinfo_uid":
$rule = "required|numeric";
break;
case "title":
$rule = "required|trim|string";
break;
default:
$rule = parent::getFormFieldRule($action, $field);
break;
}
return $rule;
}
}

View File

@ -0,0 +1,57 @@
<?php
namespace App\Services\Customer;
use App\Entities\Customer\ClientHistoryEntity;
use App\Models\Customer\ClientHistoryModel;
class ClientHistoryService extends CustomerService
{
private ?ClientService $_clientService = null;
public function __construct()
{
parent::__construct();
$this->addClassName('ClientHistory');
}
public function getModelClass(): ClientHistoryModel
{
return new ClientHistoryModel();
}
public function getEntityClass(): ClientHistoryEntity
{
return new ClientHistoryEntity();
}
public function getFormFields(): array
{
return [
"clientinfo_uid",
"title",
"description",
];
}
public function getFilterFields(): array
{
return ["clientinfo_uid", 'status'];
}
public function getBatchJobFields(): array
{
return ['status'];
}
public function getIndexFields(): array
{
return ['clientinfo_uid', 'title', 'status', 'created_at'];
}
//FieldForm관련용
public function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case 'clientinfo_uid':
$options = $this->getClientService()->getEntities();
break;
default:
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
}
}

View File

@ -0,0 +1,64 @@
<?= $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, $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><?= $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 class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?></div>
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
</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() ?>