trafficmonitor init...2

This commit is contained in:
최준흠 2025-11-09 00:10:01 +09:00
parent 23004a7791
commit ef9f4d1ea9
49 changed files with 328 additions and 618 deletions

View File

@ -78,11 +78,6 @@ defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
//Default값 정의
define('DEFAULTS', [
'DELIMITER_FILE' => "||",
'DELIMITER_ROLE' => ","
]);
define('MESSAGES', [ define('MESSAGES', [
'CREATED' => '생성되었습니다.', 'CREATED' => '생성되었습니다.',
'UPDATED' => '수정되였습니다.', 'UPDATED' => '수정되였습니다.',
@ -397,3 +392,11 @@ define("ROLE", [
], ],
'CLIENT' => [], 'CLIENT' => [],
]); ]);
//Default값 정의
define('DEFAULTS', [
'DELIMITER_FILE' => "||",
'DELIMITER_ROLE' => ",",
'INDEX_PERPAGE' => 20,
'STATUS' => STATUS['AVAILABLE']
]);

View File

@ -25,9 +25,33 @@ abstract class AdminController extends CommonController
} }
final protected function getLayout(): string final protected function getLayout(): string
{ {
return self::PATH; return 'admin';
}
protected function action_init_process(string $action): void
{
parent::action_init_process($action);
$this->addViewDatas('layout', $this->getLayout());
$this->addViewDatas('helper', $this->service->getHelper($action, $this->getViewDatas()));
switch ($action) {
case 'create_form':
case 'create':
case 'modify_form':
case 'modify':
case 'view':
$formFields = $this->service->getFormService()->getFormFields($action);
$this->addViewDatas('formFields', $formFields);
break;
default:
$formField = $this->service->getFormService()->getIndexFields($action);
$this->addViewDatas('indexFields', $formField);
break;
}
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action));
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action, $formFields));
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action, $formFields));
$this->addViewDatas('batchjobFields', $this->service->getFormService()->getBatchjobFields($action));
$this->addViewDatas('batchjobButtons', $this->service->getFormService()->getBatchjobButtons($action));
} }
protected function create_form_process(array $formDatas = []): array protected function create_form_process(array $formDatas = []): array
{ {
return $formDatas; return $formDatas;
@ -106,11 +130,11 @@ abstract class AdminController extends CommonController
} }
//리스트관련 //리스트관련
//조건절 처리 //조건절 처리
protected function index_condition_process(): void protected function index_condition_process(string $action): void
{ {
//Filter조건절 처리 //Filter조건절 처리
$index_filters = []; $index_filters = [];
foreach ($this->service->getFormFilters() as $field) { foreach ($this->service->getFormService()->getFormFilters($action) as $field) {
$value = $this->request->getVar($field) ?? null; $value = $this->request->getVar($field) ?? null;
if ($value) { if ($value) {
$this->service->index_condition_filterField($field, $value); $this->service->index_condition_filterField($field, $value);
@ -133,76 +157,77 @@ abstract class AdminController extends CommonController
$this->addViewDatas('index_start', $index_start); $this->addViewDatas('index_start', $index_start);
$this->addViewDatas('index_end', $index_end); $this->addViewDatas('index_end', $index_end);
} }
// //PageNation 처리 //Index Option출력용
// protected function index_pagenation_process($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full') protected function index_pagenation_options_process(int $index_totalcount, int $index_perpage): array
// { {
// //Page, Per_page필요부분 $index_page_options = ["" => "줄수선택"];
// $this->page = (int) $this->request->getVar('page') ?: 1; for ($i = $index_perpage; $i <= $index_totalcount; $i += $index_perpage) {
// $this->per_page = (int) $this->request->getVar('per_page') ?: intval(DEFAULT_LIST_PERPAGE ?? 20); $index_page_options[$i] = $i;
// // 1.Views/Pagers/에 bootstrap_full.php,bootstrap_simple.php 생성 }
// // 2.app/Config/Pager.php/$templates에 'bootstrap_full => 'Pagers\bootstrap_full', $index_page_options[$index_totalcount] = $index_totalcount;
// // 'bootstrap_simple' => 'Pagers\bootstrap_simple', 추가 return $index_page_options;
// $pager = service("pager"); }
// $pager->makeLinks($this->page, $this->per_page, $this->total_count, $template, $segment, $pager_group); //PageNation 처리
// $this->page = $pager->getCurrentPage($pager_group); protected function index_pagenation_process(int $index_totalcount, int $page, int $perpage, $pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): mixed
// $this->total_page = $pager->getPageCount($pager_group); {
// return $pager->links($pager_group, $template); // 1.Views/Pagers/에 bootstrap_full.php,bootstrap_simple.php 생성
// } // 2.app/Config/Pager.php/$templates에 'bootstrap_full => 'Pagers\bootstrap_full',
// 'bootstrap_simple' => 'Pagers\bootstrap_simple', 추가
$pager = service("pager");
$pager->makeLinks($page, $perpage, $index_totalcount, $template, $segment, $pager_group);
// $index_page = $pager->getCurrentPage($pager_group);
$this->addViewDatas('index_totalpage', $pager->getPageCount($pager_group));
return $pager->links($pager_group, $template);
}
// //Page출력 처리 // //Page출력 처리
// protected function index_pageOptions_process(): array //Entities처리
// { protected function index_process(array $entities = []): array
// $page_options = ["" => "줄수선택"]; {
// for ($i = $this->per_page; $i <= $this->total_count; $i += $this->per_page) { foreach ($this->service->getEntities() as $entity) {
// $page_options[$i] = $i; $entities[] = $entity;
// } }
// $page_options[$this->total_count] = $this->total_count; return $entities;
// return $page_options; }
// } public function index(): string
// //Entities처리 {
// protected function index_process(array $entities = []): array $action = __FUNCTION__;
// { try {
// foreach ($this->service->getEntities() as $entity) { //초기화
// $entities[] = $entity; $this->action_init_process($action);
// } $this->addViewDatas('uri', $this->request->getUri());
// return $entities; //Page, Per_page필요부분
// } $index_page = (int) $this->request->getVar('index_page') ?: 1;
// public function index(): RedirectResponse|string $index_perpage = (int) $this->request->getVar('index_perpage') ?: intval(DEFAULTS['INDEX_PERPAGE']);
// { $this->addViewDatas('index_page', $index_page);
// try { $this->addViewDatas('index_perpage', $index_perpage);
// $this->service->setAction(__FUNCTION__); //index_totalcount
// $this->service->setFormFields(); //조건절 처리 index_totalcount용
// //전달값정의 $this->index_condition_process($action);
// $this->service->setFormDatas($this->request->getGet()); $index_totalcount = $this->service->getindex_totalcount();
// $this->service->setFormFilters(); $this->addViewDatas('index_totalcount', $index_totalcount);
// $this->service->setFormRules(); $this->addViewDatas('index_pagination', $this->index_pagenation_process($index_totalcount, $index_page, $index_perpage));
// $this->service->setFormOptions(); $this->addViewDatas('index_pagination_options', $this->index_pagenation_options_process($index_totalcount, $index_perpage));
// //일괄작업용 Fields정의 //OrcerBy , Limit 처리
// $this->service->setControlDatas('batchjob_fields', $this->service->getBatchjobFields()); $order_field = $this->request->getVar('order_field');
// //일괄작업용 버튼정의 $order_value = $this->request->getVar('order_value');
// $this->service->setControlDatas('batchjob_buttions', $this->service->getBatchjobButtons()); $this->service->setOrderBy($order_field, $order_value);
// helper(['form']); $this->addViewDatas('order_field', $order_field);
// //Return Url정의 $this->addViewDatas('order_value', $order_value);
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : "")); $this->service->setLimit($index_page);
// //조건절 처리 $this->service->setOffset(($index_page - 1) * $index_perpage);
// $this->index_condition_process(); //List
// //TotalCount (SoftDelete적용이 되려면 countAllResults를 사용해야함) //조건절 처리 List용
// $this->total_count = $this->service->getTotalCount(); $this->index_condition_process($action);
// //Pagination 처리 $this->addViewDatas('entities', $this->index_process());
// $this->pagination = $this->index_pagenation_process(); helper(['form']);
// //줄수 처리용 $this->addViewDatas('formDatas', $this->request->getGet());
// $this->page_options = $this->index_pageOptions_process(); $this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields());
// //조건절 처리 $this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
// //OrcerBy , Limit 처리 } catch (\Exception $e) {
// $this->order_field = $this->request->getVar('order_field'); session()->setFlashdata('message', $e->getMessage());
// $this->order_value = $this->request->getVar('order_value'); }
// $this->service->setOrderBy($this->order_field, $this->order_value); //현재 URL을 세션에 저장
// $this->service->setLimit($this->per_page); $this->getAuthContext()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
// $this->service->setOffset(($this->page - 1) * $this->per_page); return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
// $this->index_condition_process(); }
// $this->entities = $this->index_process();
// return $this->getResultSuccess();
// } catch (\Exception $e) {
// return $this->getResultFail($e->getMessage());
// }
// }
} }

View File

@ -2,88 +2,24 @@
namespace App\Controllers\Admin; namespace App\Controllers\Admin;
use App\Services\BoardService;
use App\Services\Customer\ServiceService;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\RequestInterface;
use App\Controllers\CommonController;
class Home extends AdminController class Home extends CommonController
{ {
private $_service = null;
private ?BoardService $_boardService = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{ {
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
$this->content_title = lang("{$this->getService()->getClassPath()}.title");
$this->class_path .= $this->getService()->getClassPath();
$this->uri_path .= strtolower($this->getService()->getClassPath('/')) . '/';
$this->view_path .= 'welcome' . DIRECTORY_SEPARATOR;
} }
final protected function getLayout(): string
final public function getService(): ServiceService
{ {
if (!$this->_service) { return 'empty';
$this->_service = new ServiceService();
}
return $this->_service;
} }
final public function getBoardService(): BoardService
{
if (!$this->_boardService) {
$this->_boardService = new BoardService();
}
return $this->_boardService;
}
protected function getResultSuccess(string $message = MESSAGES["SUCCESS"], ?string $actionTemplate = null): RedirectResponse|string
{
switch ($this->getService()->getAction()) {
case 'index':
$this->service = $this->getService();
$this->control = $this->getService()->getControlDatas();
$this->getService()->getHelper()->setViewDatas($this->getViewDatas());
$actionTemplate = $this->request->getVar('ActionTemplate') ?? $actionTemplate;
if ($actionTemplate) {
$view_file = $this->view_path . $actionTemplate . DIRECTORY_SEPARATOR . $this->getService()->getAction();
} else {
$view_file = $this->view_path . $this->getService()->getAction();
}
$result = view($view_file, ['viewDatas' => $this->getViewDatas()]);
break;
default:
$result = parent::getResultSuccess($message, $actionTemplate);
}
return $result;
}
//Index,FieldForm관련 //Index,FieldForm관련
public function index(): RedirectResponse|string public function index(): string
{ {
$this->getService()->setAction(__FUNCTION__); return "준비중...";
//기본전달값정의
$this->getService()->setFormDatas($this->request->getGet());
$this->getService()->setFormFields();
$this->getService()->setFormFilters();
$this->getService()->setFormRules();
$this->getService()->setFormOptions();
//요청업무
$this->boardRequestTaskCount = $this->getBoardService()->getRequestTaskCount($this->getMyAuth()->getUIDByAuthInfo());
//Total 서버 현황
//interval을 기준으로 최근 신규 서비스정보 가져오기
$this->interval = intval($this->request->getVar('interval') ?? SERVICE['NEW_INTERVAL']);
$this->newServiceEntities = $this->getService()->getNewServiceEntities($this->interval);
$this->newServiceCount = count($this->newServiceEntities);
//서비스별 미납 Count
$unPaidTotalCount = $unPaidTotalAmount = 0;
foreach (array_values($this->getService()->getPaymentService()->getUnPaids('serviceinfo_uid')) as $unPaid) {
$unPaidTotalCount += $unPaid['cnt'];
$unPaidTotalAmount += $unPaid['amount'];
}
$this->unPaidTotalCount = $unPaidTotalCount;
$this->unPaidTotalAmount = $unPaidTotalAmount;
helper(['form']);
return $this->getResultSuccess();
} }
} }

View File

@ -36,7 +36,7 @@ class TrafficController extends CommonController
$formDatas['type'] = 'normal'; $formDatas['type'] = 'normal';
$formDatas['billing_at'] = date("Y-m-d"); $formDatas['billing_at'] = date("Y-m-d");
$formDatas['start_at'] = date("Y-m-d"); $formDatas['start_at'] = date("Y-m-d");
$formDatas['status'] = TrafficEntity::DEFAULT_STATUS; $formDatas['status'] = DEFAULTS['STATUS'];
//viewData처리 //viewData처리
$this->action = __FUNCTION__; $this->action = __FUNCTION__;
$this->formFields = $this->service->getFormFields(); $this->formFields = $this->service->getFormFields();

View File

@ -6,11 +6,8 @@ use App\DTOs\UserDTO;
use App\Entities\UserEntity; use App\Entities\UserEntity;
use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Validation;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
use App\Services\UserService;
class UserController extends AdminController class UserController extends AdminController
{ {

View File

@ -16,11 +16,9 @@ abstract class CommonController extends BaseController
private array $_action_paths = []; private array $_action_paths = [];
private array $_viewDatas = []; private array $_viewDatas = [];
protected $service = null; protected $service = null;
protected $myCertification = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger) public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{ {
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
$this->myCertification = CertificationDTO::byAuthContext($this->getAuthContext());
} }
final protected function getAuthContext(): AuthContext final protected function getAuthContext(): AuthContext
{ {
@ -46,10 +44,6 @@ abstract class CommonController extends BaseController
return $this->_viewDatas[$key] ?? null; return $this->_viewDatas[$key] ?? null;
} }
//공통 필수기능 //공통 필수기능
protected function getLayout(): string
{
return 'empty';
}
protected function doValidation(string $action): array protected function doValidation(string $action): array
{ {
$dynamicRules = []; $dynamicRules = [];
@ -77,13 +71,8 @@ abstract class CommonController extends BaseController
protected function action_init_process(string $action): void protected function action_init_process(string $action): void
{ {
$this->addViewDatas('action', $action); $this->addViewDatas('action', $action);
$this->addViewDatas('myCertification', $this->myCertification); $this->addViewDatas('authContext', $this->getAuthContext());
$this->addViewDatas('layout', $this->getLayout()); $this->addViewDatas('classPath', $this->service->getClassPaths(false));
$this->addViewDatas('helper', $this->service->getHelper($action, $this->getViewDatas()));
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields($action));
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters($action));
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules($action));
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions($action));
} }
protected function action_render_process(array $view_paths, string $view_file, array $viewDatas): string protected function action_render_process(array $view_paths, string $view_file, array $viewDatas): string
{ {
@ -100,7 +89,7 @@ abstract class CommonController extends BaseController
$view_file $view_file
]); ]);
$view_datas = [ $view_datas = [
'control' => $viewDatas, ...$viewDatas,
'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []], 'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []],
]; ];
helper(['form', __FUNCTION__]); helper(['form', __FUNCTION__]);

View File

@ -1,37 +0,0 @@
<?php
namespace App\DTOs;
use App\Libraries\AuthContext;
use CodeIgniter\Entity\Entity; // DTO가 Entity를 상속받지 않는 경우, 필요한 경우 CommonDTO 또는 Entity 상속을 유지합니다.
class CertificationDTO extends Entity // DTO가 Entity를 상속받는 것으로 가정합니다.
{
// 💡 role의 타입을 ?string에서 ?array로 변경합니다.
public ?string $uid = null;
public ?bool $isLogin = null;
public ?string $name = null;
public ?array $role = null;
public function __construct(array $datas = [])
{
parent::__construct();
foreach ($datas as $key => $value) {
if (property_exists($this, $key)) {
$this->{$key} = $value;
}
}
}
//인증 정보
public static function byAuthContext(AuthContext $authContext): self
{
return new self(
[
'isLogin' => $authContext->isLoggedIn(),
'uid' => $authContext->getUID(),
'name' => $authContext->getName(),
'role' => $authContext->getRole(), //배열(array|null)을 반환합니다.
]
);
}
}

View File

@ -5,4 +5,17 @@ namespace App\DTOs;
abstract class CommonDTO abstract class CommonDTO
{ {
public function __construct() {} public function __construct() {}
public function __get(string $name)
{
// 1. 속성이 클래스에 실제로 존재하는지 확인
if (property_exists($this, $name)) {
// 2. 속성이 존재하면 값을 반환 (PHP 7.4 이상의 타입 속성 덕분에 null 병합 연산자 사용 불필요)
return $this->{$name};
}
// 3. 속성이 존재하지 않으면 오류 발생 (일반적인 Entity/DTO 접근 방식)
throw new \BadMethodCallException(
"Undefined property or method: " . static::class . "::{$name}"
);
}
} }

View File

@ -28,6 +28,15 @@ class UserDTO extends CommonDTO
} }
} }
} }
public function __get(string $name)
{
// 'role' 속성을 요청했을 때만 특별히 처리
if ($name === 'role' && is_string($this->role)) {
return explode(DEFAULTS["DELIMITER_ROLE"], $this->role);
}
return parent::__get($name);
}
public function toArray(): array public function toArray(): array
{ {
return [ return [

View File

@ -21,16 +21,16 @@ abstract class CommonForm
} }
return $this->_attributes[$key]; return $this->_attributes[$key];
} }
final public function getFormRules(string $action, array $rules = [], ?array $fields = null): array final public function getFormRules(string $action, array $fields, array $rules = []): array
{ {
foreach ($fields ?? $this->getFormFields($action) as $field) { foreach ($fields as $field) {
$rules = $this->getFormRule($action, $field, $rules); $rules = $this->getFormRule($action, $field, $rules);
} }
return $rules; return $rules;
} }
final public function getFormOptions(string $action, array $options = [], ?array $fields = null): array final public function getFormOptions(string $action, array $fields, array $options = []): array
{ {
foreach ($fields ?? $this->getFormFilters($action) as $field) { foreach ($fields as $field) {
$options = $this->getFormOption($action, $field, $options); $options = $this->getFormOption($action, $field, $options);
} }
return $options; return $options;

View File

@ -25,7 +25,7 @@ class CommonHelper
final public function form_dropdown_common(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = [], bool $isAll = false): string final public function form_dropdown_common(string $field, mixed $value, array $viewDatas, array $extras = [], array $attributes = [], bool $isAll = false): string
{ {
// 필터 옵션이 없으면 빈 배열로 초기화 // 필터 옵션이 없으면 빈 배열로 초기화
if (!array_key_exists($field, $viewDatas['control']['formOptions'])) { if (!array_key_exists($field, $viewDatas['formOptions'])) {
return ""; // 필터 옵션이 없으면 빈 문자열 반환 return ""; // 필터 옵션이 없으면 빈 문자열 반환
} }
$extra = ""; $extra = "";
@ -45,13 +45,13 @@ class CommonHelper
$html = ""; $html = "";
switch ($field) { switch ($field) {
default: default:
foreach ($viewDatas['control']['formOptions'][$field] as $option_key => $option_value) { foreach ($viewDatas['formOptions'][$field] as $option_key => $option_value) {
$isSelected = $option_key == $value ? ' selected' : ''; $isSelected = $option_key == $value ? ' selected' : '';
$isDisabled = ""; $isDisabled = "";
$attribute = ""; $attribute = "";
$label = ""; $label = "";
if ($option_value instanceof CommonEntity) { if ($option_value instanceof CommonEntity) {
if ($option_key != $value && $option_value->getStatus() != $option_value::DEFAULT_STATUS && !$isAll) { if ($option_key != $value && $option_value->getStatus() != DEFAULTS['STATUS'] && !$isAll) {
continue; continue;
} }
foreach ($attributes as $attribute_name => $attribute_value) { foreach ($attributes as $attribute_name => $attribute_value) {
@ -71,8 +71,9 @@ class CommonHelper
{ {
switch ($field) { switch ($field) {
default: default:
dd($viewDatas['formRules']);
// required가 있으면 class 추가 // required가 있으면 class 추가
$extras = (strpos($viewDatas['control']['formRules'][$field], 'required') !== false) ? ["class" => "text-danger", "required" => "", ...$extras] : $extras; $extras = (strpos($viewDatas['formRules'][$field], 'required') !== false) ? ["class" => "text-danger", "required" => "", ...$extras] : $extras;
$label = $label ?: form_label(lang("{$this->getAttribute('class_path')}.label.{$field}"), $field, ['class' => 'form-label-sm', ...$extras]); $label = $label ?: form_label(lang("{$this->getAttribute('class_path')}.label.{$field}"), $field, ['class' => 'form-label-sm', ...$extras]);
break; break;
} }
@ -99,13 +100,13 @@ class CommonHelper
]); ]);
break; break;
case 'role': case 'role':
if (!is_array($viewDatas['control']['formOptions'][$field])) { if (!is_array($viewDatas['formOptions'][$field])) {
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다."); throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
} }
// create, modify, create_form, modify_form일때 checkbox로 표시 // create, modify, create_form, modify_form일때 checkbox로 표시
if (in_array($viewDatas['control']['action'], ['create_form', 'modify_form'])) { if (in_array($viewDatas['action'], ['create_form', 'modify_form'])) {
$forms = []; $forms = [];
foreach ($viewDatas['control']['formOptions'][$field] as $key => $label) { foreach ($viewDatas['formOptions'][$field] as $key => $label) {
if ($key !== '') { // 빈값은 제외 if ($key !== '') { // 빈값은 제외
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value); $values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함 //form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
@ -140,7 +141,7 @@ class CommonHelper
]); ]);
break; break;
default: default:
if (in_array($field, $viewDatas['control']['formFilters'])) { if (in_array($field, $viewDatas['formFilters'])) {
if (str_contains($field, "_uid")) { if (str_contains($field, "_uid")) {
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
} }
@ -160,14 +161,14 @@ class CommonHelper
{ {
switch ($field) { switch ($field) {
case 'clientinfo_uid': case 'clientinfo_uid':
if (array_key_exists($value, $viewDatas['control']['formOptions'][$field])) { if (array_key_exists($value, $viewDatas['formOptions'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['formOptions'][$field][$value]->getTitle() . "</a>"; $value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['formOptions'][$field][$value]->getTitle() . "</a>";
} }
break; break;
case 'role': case 'role':
$roles = []; $roles = [];
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) { foreach ($value as $key) {
$roles[] = $viewDatas['control']['formOptions'][$field][$key] ?? ""; $roles[] = $viewDatas['formOptions'][$field][$key] ?? "";
} }
$value = implode(" , ", $roles); $value = implode(" , ", $roles);
break; break;
@ -175,7 +176,7 @@ class CommonHelper
case 'content': case 'content':
case 'detail': case 'detail':
case 'history': case 'history':
if (in_array($viewDatas['control']['action'], ['view', 'index'])) { if (in_array($viewDatas['action'], ['view', 'index'])) {
$value = html_entity_decode($value, ENT_QUOTES, 'UTF-8'); $value = html_entity_decode($value, ENT_QUOTES, 'UTF-8');
} }
break; break;
@ -190,11 +191,11 @@ class CommonHelper
$value = $value ? date("Y-m-d", strtotime($value)) : ""; $value = $value ? date("Y-m-d", strtotime($value)) : "";
break; break;
default: default:
if (in_array($field, $viewDatas['control']['formFilters'])) { if (in_array($field, $viewDatas['formFilters'])) {
if (str_contains($field, "_uid")) { if (str_contains($field, "_uid")) {
$value = array_key_exists($value, $viewDatas['control']['formOptions'][$field]) && $viewDatas['control']['formOptions'][$field][$value] ? $viewDatas['control']['formOptions'][$field][$value]->getTitle() : ""; $value = array_key_exists($value, $viewDatas['formOptions'][$field]) && $viewDatas['formOptions'][$field][$value] ? $viewDatas['formOptions'][$field][$value]->getTitle() : "";
} else { } else {
$value = array_key_exists($value, $viewDatas['control']['formOptions'][$field]) ? $viewDatas['control']['formOptions'][$field][$value] : ""; $value = array_key_exists($value, $viewDatas['formOptions'][$field]) ? $viewDatas['formOptions'][$field][$value] : "";
} }
} }
break; break;
@ -208,7 +209,7 @@ class CommonHelper
{ {
switch ($field) { switch ($field) {
default: default:
if (in_array($field, $viewDatas['control']['formFilters'])) { if (in_array($field, $viewDatas['formFilters'])) {
if (str_contains($field, "_uid")) { if (str_contains($field, "_uid")) {
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field'; $extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
} }
@ -216,7 +217,7 @@ class CommonHelper
$isAll = true; $isAll = true;
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes, $isAll); $filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes, $isAll);
} else { } else {
$filter = array_key_exists($value, $viewDatas['control']['formOptions'][$field]) ? $viewDatas['control']['formOptions'][$field][$value] : ""; $filter = array_key_exists($value, $viewDatas['formOptions'][$field]) ? $viewDatas['formOptions'][$field][$value] : "";
} }
break; break;
} }
@ -226,6 +227,7 @@ class CommonHelper
{ {
switch ($field) { switch ($field) {
default: default:
// dd($viewDatas);
$label = $this->getFieldLabel($field, $label, $viewDatas, $extras); $label = $this->getFieldLabel($field, $label, $viewDatas, $extras);
if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) { if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) {
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"]; $label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
@ -235,7 +237,7 @@ class CommonHelper
$query .= "order_field={$field}&order_value="; $query .= "order_field={$field}&order_value=";
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC"; $query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$label = anchor(current_url() . "?" . $query, $label); $label = anchor(current_url() . "?" . $query, $label);
form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']); form_dropdown('index_perpage', $viewDatas['index_pagination_options'], $viewDatas['index_perpage'], ['onChange' => 'this.form.submit()']);
break; break;
} }
return $label; return $label;

View File

@ -16,7 +16,7 @@ class HomeHelper extends CommonHelper
{ {
switch ($field) { switch ($field) {
case 'type': case 'type':
$value = $viewDatas['control']['formOptions'][$field][$value]; $value = $viewDatas['formOptions'][$field][$value];
break; break;
case 'amount': case 'amount':
$value = number_format($value) . ""; $value = number_format($value) . "";

View File

@ -18,16 +18,16 @@ class UserHelper extends CommonHelper
$form = form_password($field, "", [...$extras]); $form = form_password($field, "", [...$extras]);
break; break;
case 'role': case 'role':
//$viewDatas['control']['entity']->$field에서 getRole()로 캐스팅이 되지 않아서 대체함 //$viewDatas['entity']->$field에서 getRole()로 캐스팅이 되지 않아서 대체함
if (($viewDatas['control']['entity'] ?? null) instanceof UserEntity) { if (($viewDatas['entity'] ?? null) instanceof UserEntity) {
$value = $viewDatas['control']['entity']->getRole(); $value = $viewDatas['entity']->getRole();
} }
$currentRoles = is_array($value) $currentRoles = is_array($value)
? array_map('strtolower', array_map('trim', $value)) ? array_map('strtolower', array_map('trim', $value))
: []; : [];
$form = ''; $form = '';
//체크박스를 순회하며 생성 //체크박스를 순회하며 생성
foreach ($viewDatas['control']['formOptions']['role'] as $key => $label) { foreach ($viewDatas['formOptions']['role'] as $key => $label) {
$checked = in_array(strtolower(trim($key)), $currentRoles); $checked = in_array(strtolower(trim($key)), $currentRoles);
$form .= '<label class="me-3">'; $form .= '<label class="me-3">';
// form_checkbox에 들어가는 값($key)은 원본 값을 유지(저장용). // form_checkbox에 들어가는 값($key)은 원본 값을 유지(저장용).

View File

@ -67,7 +67,7 @@ abstract class GoogleSocket extends MySocket
} }
} }
//상태가 use(승인완료)가 아니라면 //상태가 use(승인완료)가 아니라면
if ($entity->getStatus() !== $entity::DEFAULT_STATUS) { if ($entity->getStatus() !== DEFAULTS['STATUS']) {
throw new PageNotFoundException(message: "{$entity->getSite()}{$entity->getEmail()}:{$entity->getTitle()}님은 {$entity->status}입니다 "); throw new PageNotFoundException(message: "{$entity->getSite()}{$entity->getEmail()}:{$entity->getTitle()}님은 {$entity->status}입니다 ");
} }
return $entity; return $entity;

View File

@ -16,6 +16,7 @@ use CodeIgniter\Validation\Exceptions\ValidationException;
*/ */
abstract class AuthService abstract class AuthService
{ {
protected $title = null;
private ?AuthContext $_authContext = null; private ?AuthContext $_authContext = null;
private array $_classPaths = []; private array $_classPaths = [];
protected $formServiceInstance = null; protected $formServiceInstance = null;

View File

@ -10,6 +10,7 @@ use RuntimeException;
abstract class CommonService abstract class CommonService
{ {
private array $_classPaths = []; private array $_classPaths = [];
protected $title = null;
protected $formServiceInstance = null; protected $formServiceInstance = null;
protected $helperInstance = null; protected $helperInstance = null;
protected function __construct(protected CommonModel $model) {} protected function __construct(protected CommonModel $model) {}
@ -164,7 +165,7 @@ abstract class CommonService
return $this->delete_process($uid); return $this->delete_process($uid);
} }
//Index용 //Index용
final public function getTotalCount(): int final public function getindex_totalcount(): int
{ {
return $this->model->countAllResults(false); return $this->model->countAllResults(false);
} }

View File

@ -45,7 +45,7 @@ class TrafficService extends CommonService
return $this->helperInstance; return $this->helperInstance;
} }
//필수함수 //필수함수
// public function getNewServiceEntities(int $interval, string $status = ServiceEntity::DEFAULT_STATUS): array // public function getNewServiceEntities(int $interval, string $status = DEFAULTS['STATUS']): array
// { // {
// return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status)); // return $this->getEntities(sprintf("start_at >= NOW()-INTERVAL {$interval} DAY AND status = '%s'", $status));
// } // }

View File

@ -1,16 +1,16 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['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']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['service']->getHelper()->getFieldForm($field, old($field) ?? ($viewDatas['control']['formDatas'][$field] ?? null), $viewDatas) ?> <?= $viewDatas['service']->getHelper()->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span> <span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
@ -19,6 +19,6 @@
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div> <div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,7 +1,7 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<th><?= lang("{$viewDatas['class_path']}.label.{$field}") ?></th> <th><?= lang("{$viewDatas['class_path']}.label.{$field}") ?></th>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
@ -11,7 +11,7 @@
<?php foreach ($viewDatas['entities'] as $entity): ?> <?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?> <?php $viewDatas['entity'] = $entity; ?>
<tr> <tr>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>

View File

@ -1,31 +1,31 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/top'); ?></div> <div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
<!-- Layout Middle Start --> <!-- Layout Middle Start -->
<table class="layout_middle"> <table class="layout_middle">
<tr> <tr>
<td class="layout_left"> <td class="layout_left">
<!-- Layout Left Start --> <!-- Layout Left Start -->
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu'); ?> <?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
<!-- Layout Left End --> <!-- Layout Left End -->
</td> </td>
<td class="layout_right"> <td class="layout_right">
<!-- Layout Right Start --> <!-- Layout Right Start -->
<div class="layout_header"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_header"); ?></div> <div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
<div id="container" class="layout_content"> <div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body"> <div class="index_body">
<?= form_open(current_url(), ["method" => "get"]) ?> <?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg"> <nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid"> <div class="container-fluid">
<nav class="condition nav"> <nav class="condition nav">
조건: 조건:
<?php foreach ($viewDatas['control']['formFilters'] as $field): ?> <?php foreach ($viewDatas['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp; <?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?> <?php endforeach ?>
</nav> </nav>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_top"); ?> <?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
</div> </div>
</nav> </nav>
<?= form_close() ?> <?= form_close() ?>
@ -34,7 +34,7 @@
<thead> <thead>
<tr> <tr>
<th class="index_head_short_column">번호</th> <th class="index_head_short_column">번호</th>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['service']->getHelper()->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['service']->getHelper()->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<?php endforeach ?> <?php endforeach ?>
<th class="index_head_short_column">작업</th> <th class="index_head_short_column">작업</th>
@ -43,10 +43,10 @@
<?php $cnt = 0 ?> <?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?> <?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?> <?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>> <tr <?= $viewDatas['entity']->getStatus() === DEFAULTS['STATUS'] ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?> <?php $num = $viewDatas['index_totalcount'] - (($viewDatas['index_page'] - 1) * $viewDatas['index_perpage'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td> <td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
<td nowrap> <td nowrap>
@ -58,13 +58,13 @@
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_bottom"); ?> <?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?> <?= form_close() ?>
</div> </div>
</div> </div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_footer"); ?></div> <div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
</td> </td>
</tr> </tr>
</table> </table>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/bottom'); ?></div> <div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,12 +1,12 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div> <div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), ['id' => 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?> <?= form_open(current_url(), ['id' => 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
@ -19,6 +19,6 @@
<div class="text-center"><?= form_submit("", '수정', ["class" => "btn btn-outline btn-primary"]) ?></div> <div class="text-center"><?= form_submit("", '수정', ["class" => "btn btn-outline btn-primary"]) ?></div>
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,16 +1,16 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['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']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['service']->getHelper()->getFieldForm($field, old($field) ?? ($viewDatas['control']['formDatas'][$field] ?? null), $viewDatas) ?> <?= $viewDatas['service']->getHelper()->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span> <span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
@ -19,6 +19,6 @@
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div> <div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,17 +1,17 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<!-- Layout Right Start --> <!-- Layout Right Start -->
<div id="container" class="layout_content"> <div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body"> <div class="index_body">
<?= form_open(current_url(), ["method" => "get"]) ?> <?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg"> <nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid"> <div class="container-fluid">
<nav class="condition nav"> <nav class="condition nav">
조건: 조건:
<?php foreach ($viewDatas['control']['formFilters'] as $field): ?> <?php foreach ($viewDatas['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp; <?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?> <?php endforeach ?>
</nav> </nav>
</div> </div>
@ -22,7 +22,7 @@
<thead> <thead>
<tr> <tr>
<th class="index_head_short_column">번호</th> <th class="index_head_short_column">번호</th>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['service']->getHelper()->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['service']->getHelper()->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<?php endforeach ?> <?php endforeach ?>
<th class="index_head_short_column">작업</th> <th class="index_head_short_column">작업</th>
@ -32,10 +32,10 @@
<?php $cnt = 0 ?> <?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?> <?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?> <?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>> <tr <?= $viewDatas['entity']->getStatus() === DEFAULTS['STATUS'] ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?> <?php $num = $viewDatas['index_totalcount'] - (($viewDatas['index_page'] - 1) * $viewDatas['index_perpage'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td> <td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td> <td nowrap><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
<td nowrap> <td nowrap>
@ -47,9 +47,9 @@
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_bottom"); ?> <?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?> <?= form_close() ?>
</div> </div>
</div> </div>
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_footer"); ?></div> <div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,12 +1,12 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['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']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
@ -19,6 +19,6 @@
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div> <div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td> <td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td>

View File

@ -1,15 +1,15 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['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']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['control']['helper']->getFieldLabel($field, "", $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, "", $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['control']['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['formDatas'][$field] ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span> <span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
@ -19,6 +19,6 @@
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?> <?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,7 +1,7 @@
<table> <table>
<thead> <thead>
<tr> <tr>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<th><?= lang("{$viewDatas['class_path']}.label.{$field}") ?></th> <th><?= lang("{$viewDatas['class_path']}.label.{$field}") ?></th>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>
@ -11,7 +11,7 @@
<?php foreach ($viewDatas['entities'] as $entity): ?> <?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?> <?php $viewDatas['entity'] = $entity; ?>
<tr> <tr>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td> <td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?> <?php endforeach ?>
</tr> </tr>

View File

@ -1,30 +1,27 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php <?php
$control = $viewDatas['control']; dd($viewDatas);
$layout = $control['layout']; $layouts = LAYOUTS[$viewDatas['layout']];
$layoutPath = LAYOUTS[$layout]['path']; $template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
$helper = $control['helper'];
$layoutDir = "templates/{$layout}";
$classPath = $viewDatas['class_path'];
?> ?>
<?= $this->section('content') ?>
<?php if ($message = session('message')): ?><?php endif ?> <?php if ($message = session('message')): ?><?php endif ?>
<div class="layout_top"><?= $this->include("{$layoutPath}/top"); ?></div> <div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div>
<table class="layout_middle"> <table class="layout_middle">
<tr> <tr>
<td class="layout_left"><?= $this->include("{$layoutPath}/left_menu"); ?></td> <td class="layout_left"><?= $this->include("{$layouts['path']}/left_menu"); ?></td>
<td class="layout_right"> <td class="layout_right">
<div class="layout_header"><?= $this->include("{$layoutDir}/index_header"); ?></div> <div class="layout_header"><?= $this->include("{$template}/index_header"); ?></div>
<div id="container" class="layout_content"> <div id="container" class="layout_content">
<link href="/css/<?= $layout ?>/index.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body"> <div class="index_body">
<?= $this->include("{$layoutDir}/index_content_filter"); ?> <?= $this->include("{$template}/index_content_filter"); ?>
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?> <?= 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"> <table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
<thead> <thead>
<tr> <tr>
<th class="index_head_short_column">번호</th> <th class="index_head_short_column">번호</th>
<?php foreach ($control['formFields'] as $field): ?><th data-rtc-resizable="<?= $field ?>"><?= $helper->getListLabel($field, lang("{$classPath}.label.{$field}"), $viewDatas) ?></th><?php endforeach ?> <?php foreach ($viewDatas['indexFields'] as $field): ?><th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, lang("{$viewDatas['classPath']}.label.{$field}"), $viewDatas) ?></th><?php endforeach ?>
<th class="index_head_short_column">작업</th> <th class="index_head_short_column">작업</th>
</tr> </tr>
</thead> </thead>
@ -33,29 +30,29 @@ $classPath = $viewDatas['class_path'];
<?php foreach ($viewDatas['entities'] as $entity): ?> <?php foreach ($viewDatas['entities'] as $entity): ?>
<?php <?php
$viewDatas['entity'] = $entity; $viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === $entity::DEFAULT_STATUS; $isDefaultStatus = $entity->getStatus() === DEFAULTS['STATUS'];
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"'; $rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); $num = $viewDatas['index_totalcount'] - (($viewDatas['index_page'] - 1) * $viewDatas['index_perpage'] + $cnt);
?> ?>
<tr <?= $rowClass ?>> <tr <?= $rowClass ?>>
<td nowrap><?= $helper->getListButton('modify', $num, $viewDatas) ?></td> <td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($control['formFields'] as $field): ?><td><?= $helper->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?> <?php foreach ($viewDatas['indexFields'] as $field): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap> <td nowrap>
<?= $helper->getListButton('view', '', $viewDatas) ?>&nbsp; <?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $helper->getListButton('delete', '', $viewDatas) ?> <?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td> </td>
</tr> </tr>
<?php $cnt++ ?> <?php $cnt++ ?>
<?php endforeach ?> <?php endforeach ?>
</tbody> </tbody>
</table> </table>
<?= $this->include("{$layoutDir}/index_content_bottom"); ?> <?= $this->include("{$template}/index_content_bottom"); ?>
<?= form_close() ?> <?= form_close() ?>
</div> </div>
</div> </div>
<div class="layout_footer"><?= $this->include("{$layoutDir}/index_footer"); ?></div> <div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
</td> </td>
</tr> </tr>
</table> </table>
<div class="layout_bottom"><?= $this->include("{$layoutPath}/bottom"); ?></div> <div class="layout_bottom"><?= $this->include("{$layouts['path']}/bottom"); ?></div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,15 +1,15 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['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']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end"><?= $viewDatas['control']['helper']->getFieldLabel($field, "", $viewDatas) ?></th> <th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, "", $viewDatas) ?></th>
<td nowrap class="text-start"> <td nowrap class="text-start">
<?= $viewDatas['control']['helper']->getFieldForm($field, old($field) ?? ($viewDatas['control']['entity']->$field ?? null), $viewDatas) ?> <?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
<span><?= validation_show_error($field); ?></span> <span><?= validation_show_error($field); ?></span>
</td> </td>
</tr> </tr>
@ -19,6 +19,6 @@
<?= form_close(); ?> <?= form_close(); ?>
</div> </div>
<?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?> <?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_bottom"); ?></div> <div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div> </div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td> <td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td>

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?> <?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div id="container" class="content"> <div id="container" class="content">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form"> <div class="action_form">
<table class="table table-bordered"> <table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?> <?php foreach ($viewDatas['formFields'] as $field): ?>
<tr> <tr>
<th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th> <th nowrap class="text-end" width="20%"><?= $viewDatas['service']->getHelper()->getFieldLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td> <td nowrap class="text-start"><?= $viewDatas['service']->getHelper()->getFieldView($field, $viewDatas['entity']->$field, $viewDatas) ?></td>

View File

@ -1,31 +1,31 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<!-- Layout Middle Start --> <!-- Layout Middle Start -->
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/top'); ?></div> <div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
<!-- Layout Middle Start --> <!-- Layout Middle Start -->
<table class="layout_middle"> <table class="layout_middle">
<tr> <tr>
<td class="layout_left"> <td class="layout_left">
<!-- Layout Left Start --> <!-- Layout Left Start -->
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu'); ?> <?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
<!-- Layout Left End --> <!-- Layout Left End -->
</td> </td>
<td class="layout_right"> <td class="layout_right">
<!-- Layout Right Start --> <!-- Layout Right Start -->
<?= $this->include("{$viewDatas['control']['layout']}/welcome/banner"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/banner"); ?>
<div class="row align-items-start mt-3"> <div class="row align-items-start mt-3">
<div class="col-8"> <div class="col-8">
<?= $this->include("{$viewDatas['control']['layout']}/welcome/total_service"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/total_service"); ?>
<?= $this->include("{$viewDatas['control']['layout']}/welcome/new_service"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/new_service"); ?>
<?= $this->include("{$viewDatas['control']['layout']}/welcome/stock"); ?> <?= $this->include("{$viewDatas['layout']}/welcome/stock"); ?>
</div> </div>
<div class="col-4"><?= $this->include("{$viewDatas['control']['layout']}/welcome/mylog"); ?></div> <div class="col-4"><?= $this->include("{$viewDatas['layout']}/welcome/mylog"); ?></div>
</div> </div>
<!-- Layout Right End --> <!-- Layout Right End -->
</td> </td>
</tr> </tr>
</table> </table>
<!-- Layout Middle End --> <!-- Layout Middle End -->
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_footer"); ?></div> <div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/bottom'); ?></div> <div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<?= $this->endSection() ?> <?= $this->endSection() ?>

View File

@ -2,18 +2,18 @@
<html lang="ko"> <html lang="ko">
<head> <head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title> <title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?> <?= $meta ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?> <?= $stylesheet ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?> <?= $javascript ?>
<?php endforeach; ?> <?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script> <script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// --> <!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>

View File

@ -1,16 +1,12 @@
<!-- left menu start --> <!-- left menu start -->
<link href="/css/<?= $viewDatas['control']['layout'] ?>/left_menu.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/left_menu.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>/left_menu.js"></script> <script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/left_menu.js"></script>
<div id="left_menu" onMouseOver="sideMenuToggle(this);" onMouseOut="sideMenuToggle(this);"> <div id="left_menu" onMouseOver="sideMenuToggle(this);" onMouseOut="sideMenuToggle(this);">
<div id="accordion" class="accordion accordion-flush"> <div id="accordion" class="accordion accordion-flush">
<div class="main"> <div class="main">
<a href="/admin"><?= ICONS["HOME"] ?> Main</a> <a href="/admin"><?= ICONS["HOME"] ?> Main</a>
</div> </div>
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu/base'); ?> <?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/base'); ?>
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu/board'); ?>
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu/customer'); ?>
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu/equipment'); ?>
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu/part'); ?>
</div> </div>
<div id="menu_button">메뉴열기</div> <div id="menu_button">메뉴열기</div>
</div> </div>

View File

@ -1,3 +1,4 @@
<div class="accordion-item"> <div class="accordion-item">
<a href="/admin/user"><?= ICONS['MEMBER'] ?> 계정 관리</a> <a href="/admin/user"><?= ICONS['MEMBER'] ?> 계정 관리</a>
<a href="/admin/traffic"><?= ICONS['SETUP'] ?> 계정 관리</a>
</div> </div>

View File

@ -1,14 +0,0 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-board" aria-expanded="true"
aria-controls="flush-board"><b><?= ICONS['DEVICE'] ?>게시판관리 </b>
</button>
</h2>
<div id="flush-board" class="accordion-collapse collapse" aria-labelledby="flush-board">
<div class="accordion-item">
<a href="/admin/board?category=<?= BOARD['CATEGORY']['NOTICE'] ?>"><?= ICONS['SERVICE_ITEM_LINE'] ?>공지사항</a>
</div>
<div class="accordion-item">
<a href="/admin/board?category=<?= BOARD['CATEGORY']['REQUESTTASK'] ?>"><?= ICONS['SERVICE_ITEM_SERVER'] ?>요청업무</a>
</div>
</div>

View File

@ -1,17 +0,0 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-client" aria-expanded="false"
aria-controls="flush-client"><b><?= ICONS['CLOUD'] ?> 고객관리 </b>
</button>
</h2>
<div id="flush-client" class="accordion-collapse collapse" aria-labelledby="flush-client">
<div class="accordion-item">
<a href="/admin/customer/client"><?= ICONS['SIGNPOST'] ?>고객정보</a>
</div>
<div class="accordion-item">
<a href="/admin/customer/service"><?= ICONS['SERVICE'] ?> 서비스내역</a>
</div>
<div class="accordion-item">
<a href="/admin/customer/payment?status=<?= STATUS['UNPAID'] ?>"><?= ICONS['PAYMENT'] ?> 결제내역</a>
</div>
</div>

View File

@ -1,14 +0,0 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-equipment" aria-expanded="true"
aria-controls="flush-equipment"><b><?= ICONS['DEVICE'] ?> 장비관리 </b>
</button>
</h2>
<div id="flush-equipment" class="accordion-collapse collapse" aria-labelledby="flush-equipment">
<div class="accordion-item">
<a href="/admin/equipment/line"><?= ICONS['SERVICE_ITEM_LINE'] ?>회선정보</a>
</div>
<div class="accordion-item">
<a href="/admin/equipment/server"><?= ICONS['SERVICE_ITEM_SERVER'] ?>Server정보</a>
</div>
</div>

View File

@ -1,29 +0,0 @@
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
data-bs-target="#flush-part" aria-expanded="true"
aria-controls="flush-part"><b><?= ICONS['DEVICE'] ?> 파트관리 </b>
</button>
</h2>
<div id="flush-part" class="accordion-collapse collapse" aria-labelledby="flush-part">
<div class="accordion-item">
<a href="/admin/part/switch"><?= ICONS['SETUP'] ?>SWITCH정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/ip"><?= ICONS['SERVICE_ITEM_IP'] ?>IP정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/cs"><?= ICONS['SERVICE_ITEM_DEFENCE'] ?>CS정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/cpu"><?= ICONS['SERVER_ITEM_CPU'] ?>CPU정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/ram"><?= ICONS['SERVER_ITEM_RAM'] ?>RAM정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/disk"><?= ICONS['SERVER_ITEM_DISK'] ?>DISK정보</a>
</div>
<div class="accordion-item">
<a href="/admin/part/software"><?= ICONS['SERVER_ITEM_SOFTWARE'] ?>Software정보</a>
</div>
</div>

View File

@ -1,62 +1,19 @@
<?php
// dd($viewDatas);
$classPath = $viewDatas['classPath'];
$authContext = $viewDatas['authContext'];
?>
<!-- top start --> <!-- top start -->
<style>
/* dropdown 크기 및 스크롤 개선 */
#noticeList {
max-height: 300px;
overflow-y: auto;
}
</style>
<nav class="navbar navbar-expand-lg fixed-top" style="background-color:#E7E7E7; border-top:1px solid darkgray; border-bottom:1px solid darkgray;"> <nav class="navbar navbar-expand-lg fixed-top" style="background-color:#E7E7E7; border-top:1px solid darkgray; border-bottom:1px solid darkgray;">
<div class="container-fluid"> <div class="container-fluid">
<nav class="nav"><a class="navbar-brand" href="/admin">DBMS 관리</a></nav> <nav class="nav"><a class="navbar-brand" href="/admin">Traffic Monitor 관리</a></nav>
<ul class="nav justify-content-center"> <ul class="nav justify-content-center"></ul>
<li class="nav-item"><?= view_cell("\App\Cells\SearchCell::client", []) ?></li>
<li class="nav-item">
<?= form_open("/admin/search", ['method' => 'GET', 'class' => 'd-flex gap-2']) ?>
<input type="text" name="keyword" placeholder="고객명/IP/서버명/기타 검색" id="search_keyword" class="form-control" />
<button type="submit" class="btn btn-default border border-dark"><?= ICONS['SEARCH'] ?></button>
<?= form_close(); ?>
</li>
<li class="nav-item" style="background-color:white; margin-left:20px; font-size:12px;">
<!-- 🔔 공지 영역 -->
<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="noticeDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
🔔 공지사항 <span id="notice-count" class="badge bg-danger">0</span>
</a>
<ol class="dropdown-menu dropdown-menu-end" aria-labelledby="noticeDropdown" id="noticeList">
<li class="dropdown-item text-muted">불러오는 ...</li>
</ol>
</li>
</ul>
<!-- 🔔 공지 영역 -->
</li>
<li class="nav-item" style="background-color:white; margin-left:20px; font-size:12px;">
<!-- 🔔 업무요청 영역 -->
<ul class="navbar-nav ms-auto">
<li class="nav-item dropdown">
<a class="nav-link dropdown-toggle" href="#" id="requesttaskDropdown" role="button" data-bs-toggle="dropdown" aria-expanded="false">
🔔 업무요청 <span id="requesttask-count" class="badge bg-danger">0</span>
</a>
<ol class="dropdown-menu dropdown-menu-end" aria-labelledby="requesttaskDropdown" id="requesttaskList">
<li class="dropdown-item text-muted">불러오는 ...</li>
</ol>
</li>
</ul>
<!-- 🔔 업무요청 영역 -->
</li>
<li class="nav-item" style="background-color:white; margin-left:20px; font-size:12px;">
📋:클립보드COPY , 📌:실서비스서버 , ✔️:대체서버->실서비스서버 교체 , 🔄:대체서버등록 , <?= ICONS['MONTH'] ?>:월비용 , <?= ICONS['ONETIME'] ?>:일회성<BR>
<?= ICONS['SERVER_ITEM_SWITCH'] ?>:스위치 , <?= ICONS['SERVER_ITEM_IP'] ?>:IP , <?= ICONS['SERVER_ITEM_OS'] ?>:OS , <?= ICONS['SERVER_ITEM_SOFTWARE'] ?>:소프트웨어 , <?= ICONS['SERVER_ITEM_CS'] ?>:CS ,
<?= ICONS['SERVER_ITEM_CPU'] ?>:CPU , <?= ICONS['SERVER_ITEM_RAM'] ?>:RAM , <?= ICONS['SERVER_ITEM_DISK'] ?>:DISK
</li>
</ul>
<ul class="nav justify-content-end"> <ul class="nav justify-content-end">
<li class="nav-item"> <li class="nav-item">
<?php if ($viewDatas['isLoggedIn']): ?> <?php if ($authContext->isLoggedIn()): ?>
<div class="btn-group"> <div class="btn-group">
<button type="button" class="btn btn-outline-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"> <button type="button" class="btn btn-outline-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<b><?= ICONS['LOGIN'] . $viewDatas['myAuthName'] ?></b> <b><?= ICONS['LOGIN'] . $authContext->getName() ?></b>
</button> </button>
<ul class="dropdown-menu dropdown-menu-end"> <ul class="dropdown-menu dropdown-menu-end">
<li><?= form_label( <li><?= form_label(
@ -64,7 +21,7 @@
"modify", "modify",
[ [
"class" => "dropdown-item form-label-sm", "class" => "dropdown-item form-label-sm",
"data-src" => "/admin/user/profile/" . $viewDatas['myAuthUID'], "data-src" => "/admin/user/profile/" . $authContext->getUID(),
"data-bs-toggle" => "modal", "data-bs-toggle" => "modal",
"data-bs-target" => "#modal_action_form" "data-bs-target" => "#modal_action_form"
] ]
@ -82,64 +39,3 @@
</ul> </ul>
</div> </div>
</nav> </nav>
<script>
//전체검색용
document.addEventListener('DOMContentLoaded', () => {
const params = new URLSearchParams(location.search);
const keyword = params.get('keyword');
if (keyword)
document.querySelector('input[name="keyword"]').value = keyword;
});
//공지사항용
document.addEventListener("DOMContentLoaded", function() {
async function loadNotices() {
try {
const res = await fetch("/admin/board/notice?category=<?= BOARD['CATEGORY']['NOTICE'] ?>");
const notices = await res.json();
const notice_list = document.getElementById("noticeList");
const notice_count = document.getElementById("notice-count");
notice_list.innerHTML = "";
if (notices.length === 0) {
notice_list.innerHTML = '<li class="dropdown-item text-muted">공지 없음</li>';
return;
}
notice_count.innerHTML = notices.length;
notices.forEach(n => {
const item = document.createElement("li");
item.classList.add("dropdown-item");
item.innerHTML = `<small class="text-muted">[${n.user}/${n.created_at}]</small> ${n.title}<br>`;
notice_list.appendChild(item);
});
} catch (err) {
console.error("공지 불러오기 실패:", err);
}
}
async function loadrequesttasks() {
try {
const res = await fetch("/admin/board/reqeusttask?category=<?= BOARD['CATEGORY']['REQUESTTASK'] ?>");
const requesttasks = await res.json();
const requesttask_list = document.getElementById("requesttaskList");
const requesttask_count = document.getElementById("requesttask-count");
requesttask_list.innerHTML = "";
if (requesttasks.length === 0) {
requesttask_list.innerHTML = '<li class="dropdown-item text-muted">업무요청 없음</li>';
return;
}
requesttask_count.innerHTML = requesttasks.length;
requesttasks.forEach(n => {
const item = document.createElement("li");
item.classList.add("dropdown-item");
item.innerHTML = `<small class="text-muted">[${n.user}/${n.created_at}]</small> ${n.title}<br>`;
requesttask_list.appendChild(item);
});
} catch (err) {
console.error("공지 불러오기 실패:", err);
}
}
loadNotices(); // 최초 로드
loadrequesttasks(); // 최초 로드
setInterval(loadNotices, 10000); // 10초마다 갱신
setInterval(loadrequesttasks, 10000); // 10초마다 갱신
});
</script>
<!-- top end -->

View File

@ -2,18 +2,18 @@
<html lang="ko"> <html lang="ko">
<head> <head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title> <title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?> <?= $meta ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?> <?= $stylesheet ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?> <?= $javascript ?>
<?php endforeach; ?> <?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script> <script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// --> <!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>

View File

@ -2,18 +2,18 @@
<html lang="ko"> <html lang="ko">
<head> <head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title> <title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?> <?= $meta ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?> <?= $stylesheet ?>
<?php endforeach; ?> <?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?> <?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?> <?= $javascript ?>
<?php endforeach; ?> <?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script> <script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries --> <!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!-- WARNING: Respond.js doesn' t work if you view the page via file:// --> <!-- WARNING: Respond.js doesn' t work if you view the page via file:// -->
<!--[if lt IE 9]> <!--[if lt IE 9]>

View File

@ -1,2 +1,2 @@
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" /> <link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/js/<?= $viewDatas['control']['layout'] ?>/form.js" referrerpolicy="origin"></script> <script src="/js/<?= $viewDatas['layout'] ?>/form.js" referrerpolicy="origin"></script>

View File

@ -1,15 +1,15 @@
<div class="index_batchjob"> <div class="index_batchjob">
<ul class="nav justify-content-center"> <ul class="nav justify-content-center">
<li class="nav-item"><?= $viewDatas['service']->getHelper()->getListButton('create', '', $viewDatas) ?></li> <li class="nav-item"><?= $viewDatas['helper']->getListButton('create', '', $viewDatas) ?></li>
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li> <li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?> <?php foreach ($viewDatas['batchjobFields'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>&nbsp; <?= $viewDatas['helper']->getListFilter($field, null, $viewDatas, ['data-batchjob' => 'true']) ?>&nbsp;
<?php endforeach ?> <?php endforeach ?>
<?php foreach ($viewDatas['control']['batchjob_buttions'] as $action => $label): ?> <?php foreach ($viewDatas['batchjobButtons'] as $action => $label): ?>
<li class="nav-item"><?= $viewDatas['service']->getHelper()->getListButton($action, $label, $viewDatas) ?></li> <li class="nav-item"><?= $viewDatas['helper']->getListButton($action, $label, $viewDatas) ?></li>
<?php endforeach ?> <?php endforeach ?>
</ul> </ul>
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div> <div class=" index_pagination"><?= $viewDatas['index_pagination'] ?></div>
</div> </div>
<script> <script>
//이 스크립트를 사용하려면 Form 안에 아래 Tag필요 //이 스크립트를 사용하려면 Form 안에 아래 Tag필요
@ -17,7 +17,7 @@
function submitBatchJob() { function submitBatchJob() {
var validate = false; var validate = false;
//batchjob용 선택사항 검증 //batchjob용 선택사항 검증
<?php foreach ($viewDatas['control']['batchjob_fields'] as $field): ?> <?php foreach ($viewDatas['batchjobFields'] as $field): ?>
var element = document.querySelector('[name="<?= $field ?>"][data-batchjob="true"]'); var element = document.querySelector('[name="<?= $field ?>"][data-batchjob="true"]');
if (element && element.value !== "") { if (element && element.value !== "") {
validate = true; validate = true;

View File

@ -2,12 +2,12 @@
<nav class="index_top navbar navbar-expand-lg"> <nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid"> <div class="container-fluid">
<nav class="condition nav">조건: <nav class="condition nav">조건:
<?php foreach ($control['formFilters'] as $field): ?> <?php foreach ($viewDatas['formFilters'] as $field): ?>
<?php $filterValue = $control['index_filters'][$field] ?? old($field); ?> <?php $filterValue = $viewDatas['index_filters'][$field] ?? old($field); ?>
<?= $helper->getListFilter($field, $filterValue, $viewDatas) ?>&nbsp; <?= $viewDatas['helper']->getListFilter($field, $filterValue, $viewDatas) ?>&nbsp;
<?php endforeach ?> <?php endforeach ?>
</nav> </nav>
<?= $this->include("{$layoutDir}/index_content_top"); ?> <?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
</div> </div>
</nav> </nav>
<?= form_close() ?> <?= form_close() ?>

View File

@ -1,11 +1,11 @@
<nav class="search nav justify-content-center"> <nav class="search nav justify-content-center">
검색어:<?= form_input('index_word', $viewDatas['control']['index_word'] ?? "") ?> 검색어:<?= form_input('index_word', $viewDatas['index_word'] ?? "") ?>
검색일:<?= form_input('index_start', $viewDatas['index_start'] ?? "", ["class" => "calender"]) ?>~<?= form_input('index_end', $viewDatas['index_end'] ?? "", ["class" => "calender"]) ?> 검색일:<?= form_input('index_start', $viewDatas['index_start'] ?? "", ["class" => "calender"]) ?>~<?= form_input('index_end', $viewDatas['index_end'] ?? "", ["class" => "calender"]) ?>
<button class="btn btn-outline-primary" type="submit">검색</button> <button class="btn btn-outline-primary" type="submit">검색</button>
<?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?> <?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?>
</nav> </nav>
<nav class="pageinfo nav justify-content-end"> <nav class="pageinfo nav justify-content-end">
Page:<?= $viewDatas['page'] ?? 1 ?>/<?= $viewDatas['total_page'] ?> Page:<?= $viewDatas['index_page'] ?? 1 ?>/<?= $viewDatas['index_totalpage'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']) ?> <?= form_dropdown('index_perpage', $viewDatas['index_pagination_options'], $viewDatas['index_perpage'], ['onChange' => 'this.form.submit()']) ?>
/ :<?= $viewDatas['total_count'] ?> / :<?= $viewDatas['index_totalcount'] ?>
</nav> </nav>

View File

@ -1,3 +1,3 @@
<?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?> <?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_iframe')); ?>
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>/index.js"></script> <script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
<!-- Layout Right End --> <!-- Layout Right End -->

View File

@ -1,52 +1,7 @@
<ul class="nav nav-tabs"> <ul class="nav nav-tabs">
<li class="nav-item"> <li class="nav-item">
<span class="nav-item navbar-brand" aria-current="page"> <span class="nav-item navbar-brand" aria-current="page">
<h4>&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= $viewDatas['content_title'] ?>&nbsp;&nbsp;</h4> <h4>&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= lang("{$viewDatas['classPath']}.title") ?>&nbsp;&nbsp;</h4>
</span> </span>
</li> </li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/client">고객정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/account">예치금정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/coupon">쿠폰정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/point">포인트정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/service">서비스정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/customer/payment?status=<?= STATUS['UNPAID'] ?>">결제정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/equipment/server">서버정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/equipment/line">회선정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/ip">IP정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/switch">SWITCH정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cs">CS정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/cpu">CPU정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/ram">RAM정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/disk">DISK정보</a></span>
</li>
<li class="nav-item">
<span class="nav-link active" aria-current="page" style="cursor:pointer;"><a href="/admin/part/software">SOFTWARE정보</a></span>
</li>
</ul> </ul>

View File

@ -10,7 +10,7 @@
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title" id="iframe_modal_label"> <h5 class="modal-title" id="iframe_modal_label">
&nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= $viewDatas['content_title'] ?>&nbsp;&nbsp; &nbsp;&nbsp;<?= ICONS['DESKTOP'] ?> <?= lang("{$viewDatas['classPath']}.title") ?>&nbsp;&nbsp;
</h5> </h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onClick="window.location.reload()"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onClick="window.location.reload()"></button>
</div> </div>