trafficmonitor init...2

This commit is contained in:
최준흠 2025-11-08 15:18:23 +09:00
parent a632153947
commit 23004a7791
21 changed files with 262 additions and 298 deletions

View File

@ -2,11 +2,19 @@
namespace App\Controllers\Admin;
use App\Controllers\CommonController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\RedirectResponse;
use App\Entities\CommonEntity;
use App\Controllers\CommonController;
use CodeIgniter\Validation\Exceptions\ValidationException;
use CodeIgniter\HTTP\DownloadResponse;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Html;
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf;
abstract class AdminController extends CommonController
{
public const PATH = 'admin';
@ -19,4 +27,182 @@ abstract class AdminController extends CommonController
{
return self::PATH;
}
protected function create_form_process(array $formDatas = []): array
{
return $formDatas;
}
final public function create_form(): string
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$this->addViewDatas('formDatas', $this->create_form_process());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
session()->setFlashdata('message', $e->getMessage());
}
return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
}
abstract protected function create_process(): RedirectResponse;
final public function create(): RedirectResponse
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
return $this->create_process();
} catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
}
}
protected function modify_form_process($uid): CommonEntity
{
if (!$uid) {
throw new \Exception("계정 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof CommonEntity) {
throw new \Exception("{$uid}에 해당하는 계정을 찾을수 없습니다.");
}
return $entity;
}
final public function modify_form($uid): string
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$entity = $this->modify_form_process($uid);
$this->addViewDatas('entity', $entity);
} catch (\Exception $e) {
log_message('error', $e->getMessage());
session()->setFlashdata('message', $e->getMessage());
}
return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
}
abstract protected function modify_process($uid): RedirectResponse;
final public function modify($uid): RedirectResponse
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
return $this->modify_process($uid);
} catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
}
}
//리스트관련
//조건절 처리
protected function index_condition_process(): void
{
//Filter조건절 처리
$index_filters = [];
foreach ($this->service->getFormFilters() as $field) {
$value = $this->request->getVar($field) ?? null;
if ($value) {
$this->service->index_condition_filterField($field, $value);
$index_filters[$field] = $value;
}
}
$this->addViewDatas('index_filters', $index_filters);
//검색어조건절 처리
$index_word = $this->request->getVar('index_word');
if ($index_word !== null && $index_word !== '') {
$this->service->index_condition_filterWord($index_word);
}
$this->addViewDatas('index_word', $index_word);
//날자검색
$index_start = $this->request->getVar('index_start');
$index_end = $this->request->getVar('index_end');
if ($index_start !== null && $index_start !== '' && $index_end !== null && $index_end !== '') {
$this->service->index_condition_filterDate($index_start, $index_end);
}
$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);
// }
// //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());
// }
// }
}

View File

@ -33,28 +33,13 @@ class UserController extends AdminController
return parent::getFormRule($action, $field, $rule);
}
//Action작업관련
protected function create_form_process(): void
{
new UserDTO($this->request->getPost());
}
protected function create_process(): RedirectResponse
{
//요청 데이터를 DTO 객체로 변환
$dto = new UserDTO($this->request->getPost());
$entity = $this->service->create($dto);
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
return redirect()->to($redirect_url)->with('success', "{$entity->getTitle()} 계정 생성이 완료되었습니다.");
}
protected function modify_form_process($uid): void
{
if (!$uid) {
throw new \Exception("계정 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof UserEntity) {
throw new \Exception("{$uid}에 해당하는 계정을 찾을수 없습니다.");
}
$this->addViewDatas('entity', $entity);
return redirect()->to($redirect_url)->with('message', "{$entity->getTitle()} 계정 생성이 완료되었습니다.");
}
protected function modify_process($uid): RedirectResponse
{
@ -69,6 +54,6 @@ class UserController extends AdminController
$dto = new UserDTO($this->request->getPost());
$entity = $this->service->modify($entity, $dto);
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
return redirect()->to($redirect_url)->with('success', "{$entity->getTitle()} 계정 수정이 완료되었습니다.");
return redirect()->to($redirect_url)->with('message', "{$entity->getTitle()} 계정 수정이 완료되었습니다.");
}
}

View File

@ -23,25 +23,17 @@ abstract class AuthController extends CommonController
abstract protected function logout_process(): void;
//로그인화면
public function login_form_process(): void {}
final public function login_form(): string|RedirectResponse
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$this->login_form_process();
$this->action_render_process($action);
} catch (\Exception $e) {
$this->addViewDatas(self::ACTION_RESULT, 'error');
$this->addViewDatas(self::ACTION_MESSAGE, $e->getMessage());
//오류발생시 리디렉션 대신 폼 뷰를 다시 렌더링하도록 action_view_process 호출
log_message('error', $e->getMessage());
session()->setFlashdata('message', $e->getMessage());
}
return $this->action_result_process(
$this->getActionPaths(),
$action,
$this->getViewDatas()
);
return $this->action_render_process($this->getActionPaths(), $action, $this->getViewDatas());
}
//로그인처리
final public function login(): RedirectResponse
@ -51,15 +43,15 @@ abstract class AuthController extends CommonController
$this->action_init_process($action);
$this->login_process();
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
return redirect()->to($redirect_url)->with('success', MESSAGES['LOGIN']);
return redirect()->to($redirect_url)->with('message', MESSAGES['LOGIN']);
} catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
// return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('error', $e->getMessage());
return redirect()->back()->withInput()->with('message', $e->getMessage());
// return redirect()->to($this->getMyAuth()->popPreviousUrl())->with('message', $e->getMessage());
}
}
//로그아웃
@ -69,20 +61,10 @@ abstract class AuthController extends CommonController
$this->logout_process();
// 홈페이지로 리다이렉트
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? "/";
return redirect()->route($redirect_url)->with('error', MESSAGES['LOGOUT']);
return redirect()->route($redirect_url)->with('message', MESSAGES['LOGOUT']);
} catch (\Exception $e) {
log_message("error", $e->getMessage());
return redirect()->back()->withInput()->with('error', "로그아웃 중 오류가 발생했습니다.");
return redirect()->back()->withInput()->with('message', "로그아웃 중 오류가 발생했습니다.");
}
}
final protected function create_form_process(): void {}
final protected function create_process(): RedirectResponse
{
return redirect()->to('/');
}
final protected function modify_form_process($uid): void {}
final protected function modify_process($uid): RedirectResponse
{
return redirect()->to('/');
}
}

View File

@ -6,21 +6,13 @@ use App\Controllers\BaseController;
use App\DTOs\CertificationDTO;
use App\Libraries\AuthContext;
use App\Traits\LogTrait;
use CodeIgniter\HTTP\DownloadResponse;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use CodeIgniter\Validation\Exceptions\ValidationException;
use PhpOffice\PhpSpreadsheet\IOFactory;
use PhpOffice\PhpSpreadsheet\Reader\Html;
use PhpOffice\PhpSpreadsheet\Writer\Pdf\Mpdf;
use Psr\Log\LoggerInterface;
abstract class CommonController extends BaseController
{
use LogTrait;
const ACTION_RESULT = "action_result";
const ACTION_MESSAGE = "action_message";
private array $_action_paths = [];
private array $_viewDatas = [];
protected $service = null;
@ -87,17 +79,13 @@ abstract class CommonController extends BaseController
$this->addViewDatas('action', $action);
$this->addViewDatas('myCertification', $this->myCertification);
$this->addViewDatas('layout', $this->getLayout());
$this->addViewDatas('serviceForm', $this->service->getFormService());
$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(string $action): void
{
$this->addViewDatas('helper', $this->service->getHelper($action, $this->getViewDatas()));
}
protected function action_result_process(array $view_paths, string $view_file, array $viewDatas): string
protected function action_render_process(array $view_paths, string $view_file, array $viewDatas): string
{
$lastest_path = array_pop($view_paths); //paths는 마지막을 뺀 앞단까지만 남음
// ✅ 중간 안내 화면으로
@ -118,183 +106,4 @@ abstract class CommonController extends BaseController
helper(['form', __FUNCTION__]);
return view($full_path, ['viewDatas' => $view_datas]);
}
protected function create_form_process(): void {}
final public function create_form(): string
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$this->create_form_process();
$this->action_render_process($action);
// dd($this->getViewDatas());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
$this->addViewDatas(self::ACTION_RESULT, 'error');
$this->addViewDatas(self::ACTION_MESSAGE, $e->getMessage());
//오류발생시 리디렉션 대신 폼 뷰를 다시 렌더링하도록 action_view_process 호출
}
return $this->action_result_process(
$this->getActionPaths(),
$action,
$this->getViewDatas()
);
}
abstract protected function create_process(): RedirectResponse;
final public function create(): RedirectResponse
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
return $this->create_process();
} catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
}
}
abstract protected function modify_form_process($uid): void;
final public function modify_form($uid): string
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
$this->modify_form_process($uid);
$this->action_render_process($action);
// dd($this->getViewDatas());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
$this->addViewDatas(self::ACTION_RESULT, 'error');
$this->addViewDatas(self::ACTION_MESSAGE, $e->getMessage());
//오류발생시 리디렉션 대신 폼 뷰를 다시 렌더링하도록 action_view_process 호출
}
return $this->action_result_process(
$this->getActionPaths(),
$action,
$this->getViewDatas()
);
}
abstract protected function modify_process($uid): RedirectResponse;
final public function modify($uid): RedirectResponse
{
$action = __FUNCTION__;
try {
//초기화
$this->action_init_process($action);
return $this->modify_process($uid);
} catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
} catch (\Exception $e) {
log_message('error', $e->getMessage());
return redirect()->back()->withInput()->with('error', $e->getMessage());
}
}
//리스트관련
//조건절 처리
// protected function index_condition_process(): void
// {
// //Filter조건절 처리
// $index_filters = [];
// foreach ($this->service->getFormFilters() as $field) {
// $value = $this->request->getVar($field) ?? null;
// if ($value) {
// $this->service->index_condition_filterField($field, $value);
// $index_filters[$field] = $value;
// }
// }
// $this->index_filters = $$index_filters;
// //검색어조건절 처리
// $index_word = $this->request->getVar('index_word');
// if ($index_word !== null && $index_word !== '') {
// $this->service->index_condition_filterWord($index_word);
// }
// $this->index_word = $index_word;
// //날자검색
// $index_start = $this->request->getVar('index_start');
// $index_end = $this->request->getVar('index_end');
// if ($index_start !== null && $index_start !== '' && $index_end !== null && $index_end !== '') {
// $this->service->index_condition_filterDate($index_start, $index_end);
// }
// $this->service->setControlDatas('index_start', $index_start);
// $this->service->setControlDatas('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);
// }
// //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());
// }
// }
}

View File

@ -33,14 +33,11 @@ class AuthFilter implements FilterInterface
// 로그인 않했으면
if (!$authContext->isLoggedIn()) {
$authContext->pushCurrentUrl($request->getUri()->getPath() . ($request->getUri()->getQuery() ? "?" . $request->getUri()->getQuery() : ""));
return redirect()->to(URLS['LOGIN'])->with('error', '로그인을하셔야합니다.');
return redirect()->to(URLS['LOGIN'])->with('message', '로그인을하셔야합니다.');
}
//User Role 비교 // 회원 ROLES이 필요ROLE($arguments) 목록에 존재하지 않으면(ACL)
if (!$authContext->isAccessRole($arguments)) {
return redirect()->back()->with(
'error',
"회원[{$authContext->getName()}]님은 접속에 필요한 권한이 없습니다. "
);
return redirect()->back()->with('message', "회원[{$authContext->getName()}]님은 접속에 필요한 권한이 없습니다. ");
}
}

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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 class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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>
<!-- Layout Middle Start -->
<table class="layout_middle">

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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 class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), ['id' => 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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 class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<?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" />

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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 class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form">

View File

@ -1,6 +1,5 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if (session('error')): echo $viewDatas['control']['helper']->alertTrait(session('error')) ?><?php endif ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
@ -19,6 +18,7 @@
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= 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>
<?= $this->endSection() ?>

View File

@ -1,70 +1,61 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): echo $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/top'); ?></div>
<!-- Layout Middle Start -->
<?php
$control = $viewDatas['control'];
$layout = $control['layout'];
$layoutPath = LAYOUTS[$layout]['path'];
$helper = $control['helper'];
$layoutDir = "templates/{$layout}";
$classPath = $viewDatas['class_path'];
?>
<?php if ($message = session('message')): ?><?php endif ?>
<div class="layout_top"><?= $this->include("{$layoutPath}/top"); ?></div>
<table class="layout_middle">
<tr>
<td class="layout_left">
<!-- Layout Left Start -->
<?= $this->include(LAYOUTS[$viewDatas['control']['layout']]['path'] . '/left_menu'); ?>
<!-- Layout Left End -->
</td>
<td class="layout_left"><?= $this->include("{$layoutPath}/left_menu"); ?></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("{$layoutDir}/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/<?= $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 endforeach ?>
</nav>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_top"); ?>
</div>
</nav>
<?= form_close() ?>
<?= $this->include("{$layoutDir}/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 ($viewDatas['control']['formFields'] as $field): ?>
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['service']->getHelper()->getListLabel($field, lang("{$viewDatas['class_path']}.label.{$field}"), $viewDatas) ?></th>
<?php endforeach ?>
<?php foreach ($control['formFields'] as $field): ?><th data-rtc-resizable="<?= $field ?>"><?= $helper->getListLabel($field, lang("{$classPath}.label.{$field}"), $viewDatas) ?></th><?php endforeach ?>
<th class="index_head_short_column">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr <?= $viewDatas['entity']->getStatus() === $viewDatas['entity']::DEFAULT_STATUS ? "" : 'class="table-danger"' ?>>
<?php $num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
<td nowrap><?= $viewDatas['service']->getHelper()->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['control']['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === $entity::DEFAULT_STATUS;
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $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['service']->getHelper()->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['service']->getHelper()->getListButton('delete', '', $viewDatas) ?>
<?= $helper->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $helper->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("templates/{$viewDatas['control']['layout']}/index_content_bottom"); ?>
<?= $this->include("{$layoutDir}/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("{$layoutDir}/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("{$layoutPath}/bottom"); ?></div>
<?= $this->endSection() ?>

View File

@ -1,6 +1,5 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if (session('error')): echo $viewDatas['control']['helper']->alertTrait(session('error')) ?><?php endif ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['control']['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
@ -19,6 +18,7 @@
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= 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>
<?= $this->endSection() ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form">
@ -13,5 +13,6 @@
<?php endforeach; ?>
</table>
</div>
<?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?>
</div>
<?= $this->endSection() ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['control']['layout']]['path']) ?>
<?= $this->section('content') ?>
<?php if ($error = session('error')): 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">
<link href="/css/<?= $viewDatas['control']['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
<div class="action_form">

View File

@ -18,7 +18,7 @@
<button type="submit" class="btn-login">로그인</button>
<div class="login-options"><?= $viewDatas['sns_button'] ?? "" ?></div>
<?= form_close(); ?>
<?php if (session()->has('error')): ?><div class="alert alert-info text-start"><?= session('error') ?></div><?php endif; ?>
<?php if (session('message')): ?><div class="alert alert-info text-start"><?= session('message') ?></div><?php endif; ?>
</div>
</div>
</div>

View File

@ -23,7 +23,7 @@
</head>
<body>
<?php if ($error = session('error')): ?><?= $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<?php if ($error = session('message')): ?><?= $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<div class="middle"><?= $this->renderSection('content') ?></div>
</body>

View File

@ -23,7 +23,7 @@
</head>
<body>
<?php if ($error = session('error')): ?><?= $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<?php if ($error = session('message')): ?><?= $viewDatas['service']->getHelper()->alertTrait($error) ?><?php endif ?>
<?= $this->renderSection('content') ?></div>
</body>

View File

@ -0,0 +1,13 @@
<?= form_open(current_url(), ["method" => "get"]) ?>
<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 endforeach ?>
</nav>
<?= $this->include("{$layoutDir}/index_content_top"); ?>
</div>
</nav>
<?= form_close() ?>