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_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
//Default값 정의
define('DEFAULTS', [
'DELIMITER_FILE' => "||",
'DELIMITER_ROLE' => ","
]);
define('MESSAGES', [
'CREATED' => '생성되었습니다.',
'UPDATED' => '수정되였습니다.',
@ -397,3 +392,11 @@ define("ROLE", [
],
'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
{
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
{
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조건절 처리
$index_filters = [];
foreach ($this->service->getFormFilters() as $field) {
foreach ($this->service->getFormService()->getFormFilters($action) as $field) {
$value = $this->request->getVar($field) ?? null;
if ($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_end', $index_end);
}
// //PageNation 처리
// protected function index_pagenation_process($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full')
// {
// //Page, Per_page필요부분
// $this->page = (int) $this->request->getVar('page') ?: 1;
// $this->per_page = (int) $this->request->getVar('per_page') ?: intval(DEFAULT_LIST_PERPAGE ?? 20);
// // 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($this->page, $this->per_page, $this->total_count, $template, $segment, $pager_group);
// $this->page = $pager->getCurrentPage($pager_group);
// $this->total_page = $pager->getPageCount($pager_group);
// return $pager->links($pager_group, $template);
// }
//Index Option출력용
protected function index_pagenation_options_process(int $index_totalcount, int $index_perpage): array
{
$index_page_options = ["" => "줄수선택"];
for ($i = $index_perpage; $i <= $index_totalcount; $i += $index_perpage) {
$index_page_options[$i] = $i;
}
$index_page_options[$index_totalcount] = $index_totalcount;
return $index_page_options;
}
//PageNation 처리
protected function index_pagenation_process(int $index_totalcount, int $page, int $perpage, $pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): mixed
{
// 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출력 처리
// protected function index_pageOptions_process(): array
// {
// $page_options = ["" => "줄수선택"];
// for ($i = $this->per_page; $i <= $this->total_count; $i += $this->per_page) {
// $page_options[$i] = $i;
// }
// $page_options[$this->total_count] = $this->total_count;
// return $page_options;
// }
// //Entities처리
// protected function index_process(array $entities = []): array
// {
// foreach ($this->service->getEntities() as $entity) {
// $entities[] = $entity;
// }
// return $entities;
// }
// public function index(): RedirectResponse|string
// {
// try {
// $this->service->setAction(__FUNCTION__);
// $this->service->setFormFields();
// //전달값정의
// $this->service->setFormDatas($this->request->getGet());
// $this->service->setFormFilters();
// $this->service->setFormRules();
// $this->service->setFormOptions();
// //일괄작업용 Fields정의
// $this->service->setControlDatas('batchjob_fields', $this->service->getBatchjobFields());
// //일괄작업용 버튼정의
// $this->service->setControlDatas('batchjob_buttions', $this->service->getBatchjobButtons());
// helper(['form']);
// //Return Url정의
// $this->getMyAuth()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
// //조건절 처리
// $this->index_condition_process();
// //TotalCount (SoftDelete적용이 되려면 countAllResults를 사용해야함)
// $this->total_count = $this->service->getTotalCount();
// //Pagination 처리
// $this->pagination = $this->index_pagenation_process();
// //줄수 처리용
// $this->page_options = $this->index_pageOptions_process();
// //조건절 처리
// //OrcerBy , Limit 처리
// $this->order_field = $this->request->getVar('order_field');
// $this->order_value = $this->request->getVar('order_value');
// $this->service->setOrderBy($this->order_field, $this->order_value);
// $this->service->setLimit($this->per_page);
// $this->service->setOffset(($this->page - 1) * $this->per_page);
// $this->index_condition_process();
// $this->entities = $this->index_process();
// return $this->getResultSuccess();
// } catch (\Exception $e) {
// return $this->getResultFail($e->getMessage());
// }
// }
//Entities처리
protected function index_process(array $entities = []): array
{
foreach ($this->service->getEntities() as $entity) {
$entities[] = $entity;
}
return $entities;
}
public function index(): string
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$this->addViewDatas('uri', $this->request->getUri());
//Page, Per_page필요부분
$index_page = (int) $this->request->getVar('index_page') ?: 1;
$index_perpage = (int) $this->request->getVar('index_perpage') ?: intval(DEFAULTS['INDEX_PERPAGE']);
$this->addViewDatas('index_page', $index_page);
$this->addViewDatas('index_perpage', $index_perpage);
//index_totalcount
//조건절 처리 index_totalcount용
$this->index_condition_process($action);
$index_totalcount = $this->service->getindex_totalcount();
$this->addViewDatas('index_totalcount', $index_totalcount);
$this->addViewDatas('index_pagination', $this->index_pagenation_process($index_totalcount, $index_page, $index_perpage));
$this->addViewDatas('index_pagination_options', $this->index_pagenation_options_process($index_totalcount, $index_perpage));
//OrcerBy , Limit 처리
$order_field = $this->request->getVar('order_field');
$order_value = $this->request->getVar('order_value');
$this->service->setOrderBy($order_field, $order_value);
$this->addViewDatas('order_field', $order_field);
$this->addViewDatas('order_value', $order_value);
$this->service->setLimit($index_page);
$this->service->setOffset(($index_page - 1) * $index_perpage);
//List
//조건절 처리 List용
$this->index_condition_process($action);
$this->addViewDatas('entities', $this->index_process());
helper(['form']);
$this->addViewDatas('formDatas', $this->request->getGet());
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields());
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
} catch (\Exception $e) {
session()->setFlashdata('message', $e->getMessage());
}
//현재 URL을 세션에 저장
$this->getAuthContext()->pushCurrentUrl($this->request->getUri()->getPath() . ($this->request->getUri()->getQuery() ? "?" . $this->request->getUri()->getQuery() : ""));
return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
}
}

View File

@ -2,88 +2,24 @@
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 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)
{
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 public function getService(): ServiceService
final protected function getLayout(): string
{
if (!$this->_service) {
$this->_service = new ServiceService();
}
return $this->_service;
return 'empty';
}
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관련
public function index(): RedirectResponse|string
public function index(): string
{
$this->getService()->setAction(__FUNCTION__);
//기본전달값정의
$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();
return "준비중...";
}
}

View File

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

View File

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

View File

@ -16,11 +16,9 @@ abstract class CommonController extends BaseController
private array $_action_paths = [];
private array $_viewDatas = [];
protected $service = null;
protected $myCertification = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->myCertification = CertificationDTO::byAuthContext($this->getAuthContext());
}
final protected function getAuthContext(): AuthContext
{
@ -46,10 +44,6 @@ abstract class CommonController extends BaseController
return $this->_viewDatas[$key] ?? null;
}
//공통 필수기능
protected function getLayout(): string
{
return 'empty';
}
protected function doValidation(string $action): array
{
$dynamicRules = [];
@ -77,13 +71,8 @@ abstract class CommonController extends BaseController
protected function action_init_process(string $action): void
{
$this->addViewDatas('action', $action);
$this->addViewDatas('myCertification', $this->myCertification);
$this->addViewDatas('layout', $this->getLayout());
$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));
$this->addViewDatas('authContext', $this->getAuthContext());
$this->addViewDatas('classPath', $this->service->getClassPaths(false));
}
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_datas = [
'control' => $viewDatas,
...$viewDatas,
'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []],
];
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
{
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
{
return [

View File

@ -21,16 +21,16 @@ abstract class CommonForm
}
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);
}
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);
}
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
{
// 필터 옵션이 없으면 빈 배열로 초기화
if (!array_key_exists($field, $viewDatas['control']['formOptions'])) {
if (!array_key_exists($field, $viewDatas['formOptions'])) {
return ""; // 필터 옵션이 없으면 빈 문자열 반환
}
$extra = "";
@ -45,13 +45,13 @@ class CommonHelper
$html = "";
switch ($field) {
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' : '';
$isDisabled = "";
$attribute = "";
$label = "";
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;
}
foreach ($attributes as $attribute_name => $attribute_value) {
@ -71,8 +71,9 @@ class CommonHelper
{
switch ($field) {
default:
dd($viewDatas['formRules']);
// 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]);
break;
}
@ -99,13 +100,13 @@ class CommonHelper
]);
break;
case 'role':
if (!is_array($viewDatas['control']['formOptions'][$field])) {
if (!is_array($viewDatas['formOptions'][$field])) {
throw new \Exception(__METHOD__ . "에서 {$field}의 field_options가 array형태가 아닙니다.");
}
// 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 = [];
foreach ($viewDatas['control']['formOptions'][$field] as $key => $label) {
foreach ($viewDatas['formOptions'][$field] as $key => $label) {
if ($key !== '') { // 빈값은 제외
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
//form_check에는 "class" => "form-control" 쓰면 않되거나 form-check를 써야함
@ -140,7 +141,7 @@ class CommonHelper
]);
break;
default:
if (in_array($field, $viewDatas['control']['formFilters'])) {
if (in_array($field, $viewDatas['formFilters'])) {
if (str_contains($field, "_uid")) {
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
}
@ -160,14 +161,14 @@ class CommonHelper
{
switch ($field) {
case 'clientinfo_uid':
if (array_key_exists($value, $viewDatas['control']['formOptions'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['control']['formOptions'][$field][$value]->getTitle() . "</a>";
if (array_key_exists($value, $viewDatas['formOptions'][$field])) {
$value = "<a href=\"/admin/customer/client/detail/{$value}\">" . $viewDatas['formOptions'][$field][$value]->getTitle() . "</a>";
}
break;
case 'role':
$roles = [];
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
$roles[] = $viewDatas['control']['formOptions'][$field][$key] ?? "";
foreach ($value as $key) {
$roles[] = $viewDatas['formOptions'][$field][$key] ?? "";
}
$value = implode(" , ", $roles);
break;
@ -175,7 +176,7 @@ class CommonHelper
case 'content':
case 'detail':
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');
}
break;
@ -190,11 +191,11 @@ class CommonHelper
$value = $value ? date("Y-m-d", strtotime($value)) : "";
break;
default:
if (in_array($field, $viewDatas['control']['formFilters'])) {
if (in_array($field, $viewDatas['formFilters'])) {
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 {
$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;
@ -208,7 +209,7 @@ class CommonHelper
{
switch ($field) {
default:
if (in_array($field, $viewDatas['control']['formFilters'])) {
if (in_array($field, $viewDatas['formFilters'])) {
if (str_contains($field, "_uid")) {
$extras['class'] = array_key_exists('class', $extras) ? $extras['class'] . ' select-field' : 'select-field';
}
@ -216,7 +217,7 @@ class CommonHelper
$isAll = true;
$filter = $this->form_dropdown_common($field, $value, $viewDatas, $extras, $attributes, $isAll);
} 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;
}
@ -226,6 +227,7 @@ class CommonHelper
{
switch ($field) {
default:
// dd($viewDatas);
$label = $this->getFieldLabel($field, $label, $viewDatas, $extras);
if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) {
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
@ -235,7 +237,7 @@ class CommonHelper
$query .= "order_field={$field}&order_value=";
$query .= isset($viewDatas['order_value']) && $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$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;
}
return $label;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -45,7 +45,7 @@ class TrafficService extends CommonService
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));
// }

View File

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

View File

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

View File

@ -1,31 +1,31 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?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 -->
<table class="layout_middle">
<tr>
<td class="layout_left">
<!-- Layout Left Start -->
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
<!-- Layout Left End -->
</td>
<td class="layout_right">
<!-- Layout Right Start -->
<div class="layout_header"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_header"); ?></div>
<div class="layout_header"><?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?></div>
<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">
<?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건:
<?php foreach ($viewDatas['control']['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php foreach ($viewDatas['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?>
</nav>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_top"); ?>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
</div>
</nav>
<?= form_close() ?>
@ -34,7 +34,7 @@
<thead>
<tr>
<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>
<?php endforeach ?>
<th class="index_head_short_column">작업</th>
@ -43,10 +43,10 @@
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<tr <?= $viewDatas['entity']->getStatus() === DEFAULTS['STATUS'] ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['index_totalcount'] - (($viewDatas['index_page'] - 1) * $viewDatas['index_perpage'] + $cnt); ?>
<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>
<?php endforeach ?>
<td nowrap>
@ -58,13 +58,13 @@
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_bottom"); ?>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?>
</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>
</tr>
</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() ?>

View File

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

View File

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

View File

@ -1,17 +1,17 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<!-- Layout Right Start -->
<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">
<?= form_open(current_url(), ["method" => "get"]) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건:
<?php foreach ($viewDatas['control']['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['control']['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php foreach ($viewDatas['formFilters'] as $field): ?>
<?= $viewDatas['service']->getHelper()->getListFilter($field, $viewDatas['index_filters'][$field] ?? old($field), $viewDatas) ?>&nbsp;
<?php endforeach ?>
</nav>
</div>
@ -22,7 +22,7 @@
<thead>
<tr>
<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>
<?php endforeach ?>
<th class="index_head_short_column">작업</th>
@ -32,10 +32,10 @@
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<tr <?= $viewDatas['entity']->getStatus() === DEFAULTS['STATUS'] ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['index_totalcount'] - (($viewDatas['index_page'] - 1) * $viewDatas['index_perpage'] + $cnt); ?>
<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>
<?php endforeach ?>
<td nowrap>
@ -47,9 +47,9 @@
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_bottom"); ?>
<?= $this->include("templates/{$viewDatas['layout']}/index_content_bottom"); ?>
<?= form_close() ?>
</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() ?>

View File

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

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<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">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<tr>
<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>

View File

@ -1,15 +1,15 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('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']) ?>
<div class="action_form">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<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">
<?= $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>
</td>
</tr>
@ -19,6 +19,6 @@
<?= form_close(); ?>
</div>
<?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>
<?= $this->endSection() ?>

View File

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

View File

@ -1,30 +1,27 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?php
$control = $viewDatas['control'];
$layout = $control['layout'];
$layoutPath = LAYOUTS[$layout]['path'];
$helper = $control['helper'];
$layoutDir = "templates/{$layout}";
$classPath = $viewDatas['class_path'];
dd($viewDatas);
$layouts = LAYOUTS[$viewDatas['layout']];
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
?>
<?= $this->section('content') ?>
<?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">
<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">
<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">
<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">
<?= $this->include("{$layoutDir}/index_content_filter"); ?>
<?= $this->include("{$template}/index_content_filter"); ?>
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
<thead>
<tr>
<th class="index_head_short_column">번호</th>
<?php foreach ($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>
</tr>
</thead>
@ -33,29 +30,29 @@ $classPath = $viewDatas['class_path'];
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === $entity::DEFAULT_STATUS;
$isDefaultStatus = $entity->getStatus() === DEFAULTS['STATUS'];
$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 ?>>
<td nowrap><?= $helper->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($control['formFields'] as $field): ?><td><?= $helper->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['indexFields'] as $field): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $helper->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $helper->getListButton('delete', '', $viewDatas) ?>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("{$layoutDir}/index_content_bottom"); ?>
<?= $this->include("{$template}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</div>
<div class="layout_footer"><?= $this->include("{$layoutDir}/index_footer"); ?></div>
<div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
</td>
</tr>
</table>
<div class="layout_bottom"><?= $this->include("{$layoutPath}/bottom"); ?></div>
<div class="layout_bottom"><?= $this->include("{$layouts['path']}/bottom"); ?></div>
<?= $this->endSection() ?>

View File

@ -1,15 +1,15 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('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']) ?>
<div class="action_form">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<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">
<?= $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>
</td>
</tr>
@ -19,6 +19,6 @@
<?= form_close(); ?>
</div>
<?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>
<?= $this->endSection() ?>

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<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">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<tr>
<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>

View File

@ -1,11 +1,11 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('message')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<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">
<table class="table table-bordered">
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<tr>
<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>

View File

@ -1,31 +1,31 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= $this->section('content') ?>
<!-- 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 -->
<table class="layout_middle">
<tr>
<td class="layout_left">
<!-- Layout Left Start -->
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
<!-- Layout Left End -->
</td>
<td class="layout_right">
<!-- 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="col-8">
<?= $this->include("{$viewDatas['control']['layout']}/welcome/total_service"); ?>
<?= $this->include("{$viewDatas['control']['layout']}/welcome/new_service"); ?>
<?= $this->include("{$viewDatas['control']['layout']}/welcome/stock"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/total_service"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/new_service"); ?>
<?= $this->include("{$viewDatas['layout']}/welcome/stock"); ?>
</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>
<!-- Layout Right End -->
</td>
</tr>
</table>
<!-- Layout Middle End -->
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['control']['layout']}/index_footer"); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/bottom'); ?></div>
<div class=" layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
<?= $this->endSection() ?>

View File

@ -2,18 +2,18 @@
<html lang="ko">
<head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?>
<title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?>
<?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script>
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- 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:// -->
<!--[if lt IE 9]>

View File

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

View File

@ -1,3 +1,4 @@
<div class="accordion-item">
<a href="/admin/user"><?= ICONS['MEMBER'] ?> 계정 관리</a>
<a href="/admin/traffic"><?= ICONS['SETUP'] ?> 계정 관리</a>
</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 -->
<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;">
<div class="container-fluid">
<nav class="nav"><a class="navbar-brand" href="/admin">DBMS 관리</a></nav>
<ul class="nav justify-content-center">
<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>
<nav class="nav"><a class="navbar-brand" href="/admin">Traffic Monitor 관리</a></nav>
<ul class="nav justify-content-center"></ul>
<ul class="nav justify-content-end">
<li class="nav-item">
<?php if ($viewDatas['isLoggedIn']): ?>
<?php if ($authContext->isLoggedIn()): ?>
<div class="btn-group">
<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>
<ul class="dropdown-menu dropdown-menu-end">
<li><?= form_label(
@ -64,7 +21,7 @@
"modify",
[
"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-target" => "#modal_action_form"
]
@ -81,65 +38,4 @@
</li>
</ul>
</div>
</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 -->
</nav>

View File

@ -2,18 +2,18 @@
<html lang="ko">
<head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?>
<title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?>
<?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script>
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- 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:// -->
<!--[if lt IE 9]>

View File

@ -2,18 +2,18 @@
<html lang="ko">
<head>
<title><?= LAYOUTS[$viewDatas['control']['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['metas'] as $meta): ?>
<title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
<?php foreach (LAYOUTS[$viewDatas['layout']]['metas'] as $meta): ?>
<?= $meta ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['stylesheets'] as $stylesheet): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?>
<?php endforeach; ?>
<?php foreach (LAYOUTS[$viewDatas['control']['layout']]['javascripts'] as $javascript): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?>
<?php endforeach; ?>
<link href="/css/<?= $viewDatas['control']['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['control']['layout'] ?>.js"></script>
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.js"></script>
<!-- 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:// -->
<!--[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" />
<script src="/js/<?= $viewDatas['control']['layout'] ?>/form.js" referrerpolicy="origin"></script>
<link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<script src="/js/<?= $viewDatas['layout'] ?>/form.js" referrerpolicy="origin"></script>

View File

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

View File

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

View File

@ -1,11 +1,11 @@
<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"]) ?>
<button class="btn btn-outline-primary" type="submit">검색</button>
<?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?>
</nav>
<nav class="pageinfo nav justify-content-end">
Page:<?= $viewDatas['page'] ?? 1 ?>/<?= $viewDatas['total_page'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], ['onChange' => 'this.form.submit()']) ?>
/ :<?= $viewDatas['total_count'] ?>
Page:<?= $viewDatas['index_page'] ?? 1 ?>/<?= $viewDatas['index_totalpage'] ?>
<?= form_dropdown('index_perpage', $viewDatas['index_pagination_options'], $viewDatas['index_perpage'], ['onChange' => 'this.form.submit()']) ?>
/ :<?= $viewDatas['index_totalcount'] ?>
</nav>

View File

@ -1,3 +1,3 @@
<?= $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 -->

View File

@ -1,52 +1,7 @@
<ul class="nav nav-tabs">
<li class="nav-item">
<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>
</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>

View File

@ -10,7 +10,7 @@
<div class="modal-content">
<div class="modal-header">
<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>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" onClick="window.location.reload()"></button>
</div>