dbmsv2 init...1

This commit is contained in:
최준흠 2025-09-13 10:13:10 +09:00
parent 6e4843790d
commit 8033eee902
8 changed files with 27 additions and 259 deletions

View File

@ -40,10 +40,7 @@ class ServiceController extends CustomerController
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{ {
switch ($this->getService()->getAction()) { switch ($this->getService()->getAction()) {
// case 'create_form':
// case 'modify_form':
case 'view': case 'view':
case 'index':
$this->service = $this->getService(); $this->service = $this->getService();
$this->control = $this->getService()->getControlDatas(); $this->control = $this->getService()->getControlDatas();
$this->getService()->getHelper()->setViewDatas($this->getViewDatas()); $this->getService()->getHelper()->setViewDatas($this->getViewDatas());

View File

@ -3,7 +3,6 @@
namespace App\Controllers\Admin\Equipment; namespace App\Controllers\Admin\Equipment;
use App\Entities\Equipment\ServerEntity; use App\Entities\Equipment\ServerEntity;
use App\Helpers\Equipment\ServerHelper;
use App\Services\Equipment\ServerService; use App\Services\Equipment\ServerService;
use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
@ -32,7 +31,6 @@ class ServerController extends EquipmentController
{ {
switch ($this->getService()->getAction()) { switch ($this->getService()->getAction()) {
case 'view': case 'view':
case 'index':
$this->service = $this->getService(); $this->service = $this->getService();
$this->control = $this->getService()->getControlDatas(); $this->control = $this->getService()->getControlDatas();
$this->getService()->getHelper()->setViewDatas($this->getViewDatas()); $this->getService()->getHelper()->setViewDatas($this->getViewDatas());

View File

@ -70,6 +70,7 @@ class ServiceHelper extends CustomerHelper
break; break;
case 'serverinfo_uid': case 'serverinfo_uid':
$value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCode() : "지정된서버없음"; $value = array_key_exists('entity', $viewDatas) ? $viewDatas['entity']->getServerEntity()->getCode() : "지정된서버없음";
$value .= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partservice']);
break; break;
case 'billing_at': case 'billing_at':
if (array_key_exists('unPaids', $viewDatas)) { if (array_key_exists('unPaids', $viewDatas)) {

View File

@ -37,6 +37,10 @@ class ServerHelper extends EquipmentHelper
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>"; $value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['field_optons'][$field][$value]->getTitle() . "</a>";
} }
break; break;
case 'title':
$value = parent::getFieldView($field, $value, $viewDatas, $extras);
$value .= "<div>" . view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getPK(), 'types' => SERVERPART['SERVER_PARTTYPES']]) . "</div>";
break;
case 'manufactur_at': case 'manufactur_at':
case 'format_at': case 'format_at':
$value = $value ? date("Y-m-d", strtotime($value)) : ""; $value = $value ? date("Y-m-d", strtotime($value)) : "";

View File

@ -27,7 +27,6 @@ class ServiceService extends CustomerService
"location", "location",
"type", "type",
"clientinfo_uid", "clientinfo_uid",
"serverinfo_uid",
"billing_at", "billing_at",
"amount", "amount",
"start_at", "start_at",
@ -57,7 +56,6 @@ class ServiceService extends CustomerService
'billing_at', 'billing_at',
'amount', 'amount',
'status', 'status',
'user_uid',
'start_at', 'start_at',
'updated_at', 'updated_at',
]; ];
@ -70,7 +68,6 @@ class ServiceService extends CustomerService
'type', 'type',
'clientinfo_uid', 'clientinfo_uid',
'serverinfo_uid', 'serverinfo_uid',
'user_uid',
'status', 'status',
]; ];
} }

View File

@ -1,117 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->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">
<?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건:
<?php foreach ($viewDatas['control']['actionFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?>
</nav>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
</div>
</nav>
<?= form_close() ?>
<?= 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>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>/
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('serviceinfo_uid', lang("{$viewDatas['class_path']}.label.serviceinfo_uid"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('title', lang("{$viewDatas['class_path']}.label.title"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('price', lang("{$viewDatas['class_path']}.label.price"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('manufactur_at', lang("{$viewDatas['class_path']}.label.manufactur_at"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('format_at', lang("{$viewDatas['class_path']}.label.format_at"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('status', lang("{$viewDatas['class_path']}.label.status"), $viewDatas) ?>
</th>
<th class="index_head_short_column">부품정보</th>
<th class="index_head_short_column">작업</th>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', '', $viewDatas) ?></td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('serviceinfo_uid', $entity->getServiceInfoUID(), $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('title', $entity->getTitle(), $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('price', $entity->price, $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('manufactur_at', $entity->manufactur_at, $viewDatas) ?></div>
</td>
<td nowrap>
<div><?= $viewDatas['service']->getHelper()->getFieldView('format_at', $entity->format_at, $viewDatas) ?></div>
</td>
<td><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></td>
<td nowrap>
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getPK(), 'types' => SERVERPART['SERVER_PARTTYPES']]) ?>
</td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->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

@ -1,107 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->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">
<?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건:
<?php foreach ($viewDatas['control']['actionFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?>
</nav>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
</div>
</nav>
<?= form_close() ?>
<?= 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>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('site', lang("{$viewDatas['class_path']}.label.site"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('location', lang("{$viewDatas['class_path']}.label.location"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('type', lang("{$viewDatas['class_path']}.label.type"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('clientinfo_uid', lang("{$viewDatas['class_path']}.label.clientinfo_uid"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('serverinfo_uid', lang("{$viewDatas['class_path']}.label.serverinfo_uid"), $viewDatas) ?>/SWITCH/IP/OS
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('amount', lang("{$viewDatas['class_path']}.label.amount"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('billing_at', lang("{$viewDatas['class_path']}.label.billing_at"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('status', lang("{$viewDatas['class_path']}.label.status"), $viewDatas) ?>
</th>
<th class="index_head_short_column">
<?= $viewDatas['service']->getHelper()->getListLabel('start_at', lang("{$viewDatas['class_path']}.label.start_at"), $viewDatas) ?>
</th>
<!-- <th class="index_head_short_column"><?= $viewDatas['service']->getHelper()->getListLabel('user_uid', lang("{$viewDatas['class_path']}.label.user_uid"), $viewDatas) ?></th> -->
<th class="index_head_short_column">작업</th>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $entity->getStatus() === $entity::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $viewDatas['cnt'], $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('site', $entity->site, $viewDatas) ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('location', $entity->location, $viewDatas) ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('type', $entity->type, $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('clientinfo_uid', $entity->getClientInfoUID(), $viewDatas) ?></td>
<td nowrap>
<?= $viewDatas['service']->getHelper()->getFieldView('serverinfo_uid', $entity->getServerEntity()->getTitle() ?? "", $viewDatas) ?> /
<?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $entity->getServerEntity()->getPK(), 'types' => SERVERPART['SERVICE_PARTTYPES'], 'template' => 'partservice']) ?>
</td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('amount', $entity->amount, $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('billing_at', $entity->billing_at, $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('status', $entity->status, $viewDatas) ?></td>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('start_at', $entity->start_at, $viewDatas) ?></td>
<!-- <td nowrap><?= $viewDatas['service']->getHelper()->getFieldView('user_uid', $entity->user_uid, $viewDatas) ?></td> -->
<td nowrap>
<?= $viewDatas['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->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

@ -3,33 +3,28 @@
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alert($error) ?><?php endif ?> <?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alert($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div> <div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?> <table class="table table-bordered table-striped">
<div class="action_form"> <tr>
<table class="table table-bordered"> <th width="50%">서버정보</th>
<tr> <th>추가정보</th>
<th>서버정보</th> </tr>
<th>추가정보</th> <tr>
</tr> <td>
<tr> <table class="table table-bordered table-hover table-striped">
<td> <?php foreach ($viewDatas['control']['actionFields'] as $field): ?>
<table class="table table-bordered"> <tr>
<?php foreach ($viewDatas['control']['actionFields'] as $field): ?> <th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<tr> <td nowrap class="text-start">
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?>
<td nowrap class="text-start"> <span><?= validation_show_error($field); ?></span>
<?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field ?? null, $viewDatas) ?> </td>
<span><?= validation_show_error($field); ?></span> </tr>
</td> <?php endforeach; ?>
</tr> </table>
<?php endforeach; ?> </td>
</table> <td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getServerEntity()->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></td>
</td> </tr>
<td><?= view_cell("\App\Cells\Equipment\ServerPartCell::parttable", ['serverinfo_uid' => $viewDatas['entity']->getServerEntity()->getPK(), 'types' => SERVERPART['PARTTYPES']]) ?></td> </table>
</tr>
</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 class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>