dbms_init...1

This commit is contained in:
choi.jh 2025-08-13 10:45:59 +09:00
parent 749afd83bc
commit 41cf819a7e
11 changed files with 185 additions and 67 deletions

View File

@ -49,6 +49,9 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('/', 'MyLogController::index');
$routes->get('view/(:num)', 'MyLogController::view/$1');
});
$routes->group('search', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
$routes->get('/', 'SearchController::index');
});
$routes->group('customer', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->group('client', ['namespace' => 'App\Controllers\Admin\Customer'], function ($routes) {
$routes->get('/', 'ClientController::index');

View File

@ -6,9 +6,11 @@ use App\Controllers\CommonController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Customer\ServiceService;
abstract class AdminController extends CommonController
{
private ?ServiceService $_serviceService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
@ -18,4 +20,22 @@ abstract class AdminController extends CommonController
$this->content_title = "관리자";
$this->helper = $this->getHelper();
}
//Service,ServicePaymentController사용
final public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
final protected function setFilterOptionsByItemType(): void
{
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
$this->setFieldRule($item_type, $this->getFormFieldRule($this->getAction(), $item_type));
$this->setFilterFieldOption($item_type, $this->getServiceService()->getFilterOptionsByItemType($item_type));
}
}
}

View File

@ -7,32 +7,12 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Services\Customer\ServiceService;
abstract class CustomerController extends AdminController
{
private ?ServiceService $_serviceService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
//Index,FieldForm관련
//Service,ServicePaymentController사용
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
final protected function setFilterOptionsByItemType(): void
{
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
foreach (SERVICE_ITEM_TYPES as $item_type => $label) {
$this->setFieldRule($item_type, $this->getFormFieldRule($this->getAction(), $item_type));
$this->setFilterFieldOption($item_type, $this->getServiceService()->getFilterOptionsByItemType($item_type));
}
}
}

View File

@ -9,11 +9,9 @@ use Psr\Log\LoggerInterface;
use App\Helpers\Customer\ServiceHistoryHelper;
use App\Services\Customer\ServiceHistoryService;
use App\Services\Customer\ServiceService;
class ServiceHistoryController extends CustomerController
{
private ?ServiceService $_serviceService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
@ -38,13 +36,6 @@ class ServiceHistoryController extends CustomerController
}
return $this->_helper;
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{

View File

@ -7,7 +7,6 @@ use App\Helpers\Customer\ServiceItemHelper;
use App\Services\Customer\ServiceItemService;
use App\Services\Customer\ServicePaymentService;
use App\Services\Customer\ServiceService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
@ -15,7 +14,6 @@ use Psr\Log\LoggerInterface;
class ServiceItemController extends CustomerController
{
private ?ServiceService $_serviceService = null;
private ?ServicePaymentService $_servicePaymentService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
@ -46,13 +44,6 @@ class ServiceItemController extends CustomerController
}
return $this->_helper;
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
public function getServicePaymentService(): ServicePaymentService
{
if (!$this->_servicePaymentService) {

View File

@ -9,7 +9,6 @@ use App\Helpers\Customer\ServicePaymentHelper;
use App\Libraries\LogCollector;
use App\Services\Customer\ServicePaymentService;
use App\Services\Customer\ServiceService;
use App\Services\Customer\ClientService;
use CodeIgniter\HTTP\RedirectResponse;
@ -19,7 +18,6 @@ use Psr\Log\LoggerInterface;
class ServicePaymentController extends CustomerController
{
private ?ServiceService $_serviceService = null;
private ?ClientService $_clientService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
@ -43,13 +41,6 @@ class ServicePaymentController extends CustomerController
}
return $this->_helper;
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
public function getClientService(): ClientService
{
if (!$this->_clientService) {

View File

@ -0,0 +1,84 @@
<?php
namespace App\Controllers\Admin;
use App\Helpers\Customer\ServiceHelper;
use App\Services\Customer\ServicePaymentService;
use App\Services\Customer\ServiceService;
use App\Services\Equipment\CodeService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class SearchController extends AdminController
{
private ?CodeService $_codeService = null;
private ?ServicePaymentService $_servicePaymentService = null;
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(): ServiceService
{
if (!$this->_service) {
$this->_service = new ServiceService();
}
return $this->_service;
}
public function getHelper(): ServiceHelper
{
if (!$this->_helper) {
$this->_helper = new ServiceHelper();
}
return $this->_helper;
}
public function getCodeService(): CodeService
{
if (!$this->_codeService) {
$this->_codeService = new CodeService();
}
return $this->_codeService;
}
public function getServicePaymentService(): ServicePaymentService
{
if (!$this->_servicePaymentService) {
$this->_servicePaymentService = new ServicePaymentService();
}
return $this->_servicePaymentService;
}
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 ?? 'search');
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
break;
}
return $result;
}
//Index,FieldForm관련
//List 관련
protected function index_process(): void
{
//LINE,IP,SERVER등 추가 FilterOption 셋팅용
$this->setFilterOptionsByItemType();
//부모함수처리
parent::index_process();
//추가처리
$entities = [];
foreach ($this->entities as $entity) {
//각각의 Item항목 정의
$entities[$entity->getPK()] = $this->getService()->setItemEntitiesByService($entity);
}
$this->entities = $entities;
}
}

View File

@ -14,7 +14,6 @@ use Psr\Log\LoggerInterface;
class Payment extends BaseController
{
private $_db;
private ?ServiceService $_serviceService = null;
private ?ServiceItemService $_servicItemeService = null;
private ?ServicePaymentService $_servicePaymentService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
@ -22,13 +21,6 @@ class Payment extends BaseController
parent::initController($request, $response, $logger);
$this->_db = \Config\Database::connect();
}
public function getServiceService(): ServiceService
{
if (!$this->_serviceService) {
$this->_serviceService = new ServiceService();
}
return $this->_serviceService;
}
public function getServiceItemService(): ServiceItemService
{
if (!$this->_servicItemeService) {

View File

@ -2,14 +2,14 @@
return [
'title' => "고객서비스정보",
'label' => [
'clientinfo_uid' => "고객",
'ownerinfo_uid' => "관리자",
'clientinfo_uid' => "총관리자",
'ownerinfo_uid' => "실고객",
'user_uid' => "작업자",
'code' => "서비스코드",
'type' => "서비스형식",
'location' => "위치",
'switchinfo_uid' => "스위치코드",
'codeinfo_uid' => "서버코드",
'switchinfo_uid' => "스위치정보",
'codeinfo_uid' => "장비번호",
'raid' => "RAID",
'billing_at' => "결제일",
'start_at' => "개통일",

View File

@ -0,0 +1,70 @@
<?= $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>
<tr>
<td colspan="<?= count($viewDatas['control']['index_fields']) + 2 ?>">
<table class="table table-bordered table-hover table-striped">
<tr><?php foreach (SERVICE_ITEM_TYPES as $item_type => $label): ?><th data-rtc-resizable="<?= $item_type ?>" nowrap><?= $viewDatas['helper']->getFieldLabel($item_type, $label, $viewDatas) ?></th><?php endforeach ?></tr>
<tr><?php foreach (SERVICE_ITEM_TYPES as $item_type => $label): ?><td class="text-nowrap"><?= $viewDatas['helper']->getFieldView($item_type, $entity->$item_type, $viewDatas) ?></td><?php endforeach ?></tr>
</table>
</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

@ -2,20 +2,16 @@
<nav class="navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="nav"><a class="navbar-brand" href="#">DBMS 관리</a></nav>
<?= form_open("/admin/search", ['method' => 'GET']) ?>
<ul class="nav justify-content-center">
<li class="nav-item">
<?= ICONS['LOCK'] ?>
<input type="text" name="customer" value="" placeholder="고객명검색" id="search_customer" class="form-control" />
</li>
<li class="nav-item">
<input type="text" value="<?= $viewDatas['helper']->getPasswordString() ?>"
id="makePassword">
<button type="submit" class="btn btn-default border border-dark"><?= ICONS['SEARCH'] ?></button>
</li>
<li class="nav-item">
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
onClick="window.location.reload();"><?= ICONS['SEARCH'] ?></button>
</li>
</ul>
<?= form_close(); ?>
<ul class="nav justify-content-end">
<li class="nav-item">
<?php if ($viewDatas['isLoggedIn']): ?>