trafficmonitor init...2

This commit is contained in:
choi.jh 2025-11-11 18:31:37 +09:00
parent f6d13afb24
commit 3668cfbcb8
32 changed files with 120 additions and 502 deletions

View File

@ -103,26 +103,16 @@ abstract class AdminController extends CommonController
return redirect()->back()->withInput()->with('message', $e->getMessage()); return redirect()->back()->withInput()->with('message', $e->getMessage());
} }
} }
protected function delete_process($uid): RedirectResponse abstract protected function delete_process($uid): array;
{
if (!$uid) {
throw new \Exception("계정 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof CommonEntity) {
throw new \Exception("{$uid}에 해당하는 계정을 찾을수 없습니다.");
}
$this->service->delete($uid);
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
return redirect()->to($redirect_url)->with('message', "{$entity->getTitle()} 계정 생성이 완료되었습니다.");
}
final public function delete($uid): RedirectResponse final public function delete($uid): RedirectResponse
{ {
$action = __FUNCTION__; $action = __FUNCTION__;
try { try {
//초기화 //초기화
$this->action_init_process($action); $this->action_init_process($action);
return $this->delete_process($uid); list($entity, $message) = $this->delete_process($uid);
$redirect_url = $this->getAuthContext()->popPreviousUrl() ?? implode(DIRECTORY_SEPARATOR, $this->getActionPaths());
return redirect()->to($redirect_url)->with('message', $message);
} catch (ValidationException $e) { } catch (ValidationException $e) {
// 검증 실패 시 폼으로 돌아가서 오류 메시지 표시 // 검증 실패 시 폼으로 돌아가서 오류 메시지 표시
log_message('error', $e->getMessage()); log_message('error', $e->getMessage());
@ -132,17 +122,7 @@ abstract class AdminController extends CommonController
return redirect()->back()->withInput()->with('message', $e->getMessage()); return redirect()->back()->withInput()->with('message', $e->getMessage());
} }
} }
protected function view_process($uid): CommonEntity abstract protected function view_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 view($uid): string final public function view($uid): string
{ {
$action = __FUNCTION__; $action = __FUNCTION__;

View File

@ -35,11 +35,9 @@ class CollectorController extends AdminController
break; break;
case 'index': case 'index':
$fields = [...$fields, 'created_at']; $fields = [...$fields, 'created_at'];
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -81,8 +79,20 @@ class CollectorController extends AdminController
$entity = $this->service->modify($uid, $dto); $entity = $this->service->modify($uid, $dto);
return array($entity, "{$entity->getTitle()} 수집정보 수정이 완료되었습니다."); return array($entity, "{$entity->getTitle()} 수집정보 수정이 완료되었습니다.");
} }
protected function delete_process($uid): array
{
$entity = $this->service->delete($uid);
return array($entity, "{$entity->getTitle()} 수집정보 삭제 완료되었습니다.");
}
protected function view_process($uid): CollectorEntity protected function view_process($uid): CollectorEntity
{ {
return parent::view_process($uid); if (!$uid) {
throw new \Exception("수집정보 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof CollectorEntity) {
throw new \Exception("{$uid}에 해당하는 수집정보를 찾을수 없습니다.");
}
return $entity;
} }
} }

View File

@ -35,11 +35,9 @@ class MylogController extends AdminController
break; break;
case 'index': case 'index':
$fields = [...$fields, 'created_at']; $fields = [...$fields, 'created_at'];
$this->addViewDatas('index_batchjobFields', $this->service->getFormService()->getBatchjobFields($filters));
$this->addViewDatas('index_batchjobButtions', $this->service->getFormService()->getBatchjobButtons());
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -81,8 +79,20 @@ class MylogController extends AdminController
$entity = $this->service->modify($uid, $dto); $entity = $this->service->modify($uid, $dto);
return array($entity, "{$entity->getTitle()} 로그 수정이 완료되었습니다."); return array($entity, "{$entity->getTitle()} 로그 수정이 완료되었습니다.");
} }
protected function delete_process($uid): array
{
$entity = $this->service->delete($uid);
return array($entity, "{$entity->getTitle()} 로그정보 삭제 완료되었습니다.");
}
protected function view_process($uid): MylogEntity protected function view_process($uid): MylogEntity
{ {
return parent::view_process($uid); if (!$uid) {
throw new \Exception("로그정보 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof MylogEntity) {
throw new \Exception("{$uid}에 해당하는 로그정보를 찾을수 없습니다.");
}
return $entity;
} }
} }

View File

@ -36,7 +36,7 @@ class TrafficController extends AdminController
$fields = [...$fields, 'created_at']; $fields = [...$fields, 'created_at'];
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -78,8 +78,20 @@ class TrafficController extends AdminController
$entity = $this->service->modify($uid, $dto); $entity = $this->service->modify($uid, $dto);
return array($entity, "{$entity->getTitle()} 트래픽정보 수정이 완료되었습니다."); return array($entity, "{$entity->getTitle()} 트래픽정보 수정이 완료되었습니다.");
} }
protected function delete_process($uid): array
{
$entity = $this->service->delete($uid);
return array($entity, "{$entity->getTitle()} 트래픽정보 삭제 완료되었습니다.");
}
protected function view_process($uid): TrafficEntity protected function view_process($uid): TrafficEntity
{ {
return parent::view_process($uid); if (!$uid) {
throw new \Exception("트래픽정보 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof TrafficEntity) {
throw new \Exception("{$uid}에 해당하는 트래픽정보를 찾을수 없습니다.");
}
return $entity;
} }
} }

View File

@ -37,7 +37,7 @@ class UserController extends AdminController
$fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at']; $fields = ['id', 'name', 'email', 'mobile', 'role', 'status', 'created_at'];
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -78,8 +78,20 @@ class UserController extends AdminController
$entity = $this->service->modify($uid, $dto); $entity = $this->service->modify($uid, $dto);
return array($entity, "{$entity->getTitle()} 계정 수정이 완료되었습니다."); return array($entity, "{$entity->getTitle()} 계정 수정이 완료되었습니다.");
} }
protected function delete_process($uid): array
{
$entity = $this->service->delete($uid);
return array($entity, "{$entity->getTitle()} 계정 삭제 완료되었습니다.");
}
protected function view_process($uid): UserEntity protected function view_process($uid): UserEntity
{ {
return parent::view_process($uid); if (!$uid) {
throw new \Exception("계정 번호가 정의 되지 않았습니다.");
}
$entity = $this->service->getEntity($uid);
if (!$entity instanceof UserEntity) {
throw new \Exception("{$uid}에 해당하는 계정을 찾을수 없습니다.");
}
return $entity;
} }
} }

View File

@ -19,6 +19,15 @@ abstract class AuthController extends CommonController
parent::initController($request, $response, $logger); parent::initController($request, $response, $logger);
$this->addActionPaths(self::PATH); $this->addActionPaths(self::PATH);
} }
protected function action_init_process(string $action): void
{
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
parent::action_init_process($action);
}
//로그인화면 //로그인화면
final public function login_form(): string|RedirectResponse final public function login_form(): string|RedirectResponse
{ {

View File

@ -29,7 +29,7 @@ class GoogleController extends AuthController
case 'login_form': case 'login_form':
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -37,12 +37,6 @@ class GoogleController extends AuthController
$this->service->getFormService()->setFormFilters($filters); $this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters); $this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setBatchjobFilters($filters); $this->service->getFormService()->setBatchjobFilters($filters);
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
} }
public function login_form_process(): void public function login_form_process(): void
{ {

View File

@ -34,7 +34,7 @@ class LocalController extends AuthController
case 'login_form': case 'login_form':
break; break;
default: default:
throw new \Exception("지원하지 않는 action입니다.({$action})"); throw new \Exception("[{$action}] 지원하지 않는 action입니다.");
// break; // break;
} }
$this->service->getFormService()->setFormFields($fields); $this->service->getFormService()->setFormFields($fields);
@ -42,12 +42,6 @@ class LocalController extends AuthController
$this->service->getFormService()->setFormFilters($filters); $this->service->getFormService()->setFormFilters($filters);
$this->service->getFormService()->setFormOptions($filters); $this->service->getFormService()->setFormOptions($filters);
$this->service->getFormService()->setBatchjobFilters($filters); $this->service->getFormService()->setBatchjobFilters($filters);
$this->addViewDatas('helper', $this->service->getHelper());
$this->addViewDatas('formFields', $this->service->getFormService()->getFormFields());
$this->addViewDatas('formRules', $this->service->getFormService()->getFormRules());
$this->addViewDatas('formFilters', $this->service->getFormService()->getFormFilters());
$this->addViewDatas('formOptions', $this->service->getFormService()->getFormOptions());
} }
//로그인처리 //로그인처리
protected function login_process(): UserEntity protected function login_process(): UserEntity

View File

@ -8,6 +8,7 @@ use App\Traits\LogTrait;
use CodeIgniter\HTTP\RedirectResponse; use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface; use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface; use CodeIgniter\HTTP\ResponseInterface;
use PhpParser\Node\Scalar\MagicConst\Dir;
use Psr\Log\LoggerInterface; use Psr\Log\LoggerInterface;
abstract class CommonController extends BaseController abstract class CommonController extends BaseController
@ -92,16 +93,19 @@ abstract class CommonController extends BaseController
// 'redirectUrl' => route_to('posts_list') // 'redirectUrl' => route_to('posts_list')
// ]); // ]);
// 중요한 작업 (결제 완료, 오류 등) → “로딩 페이지(View)”로 안내 후 JS redirect // 중요한 작업 (결제 완료, 오류 등) → “로딩 페이지(View)”로 안내 후 JS redirect
$full_path = implode(DIRECTORY_SEPARATOR, [ $full_path = implode(DIRECTORY_SEPARATOR, $view_paths);
...$view_paths, $final_path = $this->request->getVar('ActionTemplate');
$this->request->getVar('ActionTemplate') ?? $lastest_path, if ($final_path) {
$view_file $full_path .= DIRECTORY_SEPARATOR . $final_path;
]); }
// else {
// $full_path .= DIRECTORY_SEPARATOR. $lastest_path;
// }
$view_datas = [ $view_datas = [
...$viewDatas, ...$viewDatas,
'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []], 'forms' => ['attributes' => ['method' => "post",], 'hiddens' => []],
]; ];
helper(['form', __FUNCTION__]); helper(['form', __FUNCTION__]);
return view($full_path, ['viewDatas' => $view_datas]); return view($full_path . DIRECTORY_SEPARATOR . $view_file, ['viewDatas' => $view_datas]);
} }
} }

View File

@ -91,7 +91,7 @@ CREATE TABLE `trafficinfo` (
`created_at` timestamp NOT NULL DEFAULT current_timestamp(), `created_at` timestamp NOT NULL DEFAULT current_timestamp(),
`deleted_at` timestamp NULL DEFAULT NULL, `deleted_at` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`uid`) PRIMARY KEY (`uid`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='트래픽정보'; ) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8 COMMENT='트래픽정보';
/*!40101 SET character_set_client = @saved_cs_client */; /*!40101 SET character_set_client = @saved_cs_client */;
-- --
@ -100,6 +100,7 @@ CREATE TABLE `trafficinfo` (
LOCK TABLES `trafficinfo` WRITE; LOCK TABLES `trafficinfo` WRITE;
/*!40000 ALTER TABLE `trafficinfo` DISABLE KEYS */; /*!40000 ALTER TABLE `trafficinfo` DISABLE KEYS */;
INSERT INTO `trafficinfo` VALUES (1,'테스트13','P3413','IDC-JP','221.117.125.18','313','available',NULL,'2025-11-11 07:21:37',NULL),(2,'테스트12','P3412','IDC-JP','221.117.125.15','213','available',NULL,'2025-11-11 06:11:43',NULL);
/*!40000 ALTER TABLE `trafficinfo` ENABLE KEYS */; /*!40000 ALTER TABLE `trafficinfo` ENABLE KEYS */;
UNLOCK TABLES; UNLOCK TABLES;
@ -147,4 +148,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2025-11-10 17:22:27 -- Dump completed on 2025-11-11 16:45:17

View File

@ -114,19 +114,21 @@ abstract class CommonService
//CURD 결과처리용 //CURD 결과처리용
//DB 결과 처리 로직 통합 및 개선 //DB 결과 처리 로직 통합 및 개선
protected function handle_save_result(mixed $result, ?CommonEntity $entity = null): CommonEntity protected function handle_save_result(mixed $result, ?int $uid = null): CommonEntity
{ {
//최종 PK 값 결정 (insert/update 공통) //최종 PK 값 결정 (insert/update 공통)
$pk = $this->model->useAutoIncrement() && is_numeric($result) && (int)$result > 0 $pk = $this->model->useAutoIncrement() && is_numeric($result) && (int)$result > 0 ? (int)$result : $uid;
? (int)$result
: ($entity->{$this->model->primaryKey} ?? null); // PK가 없는 경우 null 처리
if (empty($pk)) { if (empty($pk)) {
// 모델의 insert/update가 실패했을 경우 에러 메시지를 포함하여 RuntimeException을 던집니다. // 모델의 insert/update가 실패했을 경우 에러 메시지를 포함하여 RuntimeException을 던집니다.
$errors = $this->model->errors(); $errors = $this->model->errors();
$errorMsg = is_array($errors) && !empty($errors) ? implode(", ", $errors) : "DB 작업 성공 후 PK를 확인할 수 없거나 모델 오류 발생."; $errorMsg = is_array($errors) && !empty($errors) ? implode(", ", $errors) : "DB 작업 성공 후 PK를 확인할 수 없거나 모델 오류 발생.";
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg); throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg);
} }
return $this->getEntity($pk); $entity = $this->getEntity($pk);
if (!$entity instanceof CommonEntity) {
throw new RuntimeException(__METHOD__ . "에서 오류발생: {$pk}에 해당하는 정보를 찾을수 없습니다.");
}
return $entity;
} }
//생성용 //생성용
@ -161,15 +163,16 @@ abstract class CommonService
if (!$entity instanceof CommonEntity) { if (!$entity instanceof CommonEntity) {
throw new \Exception(__METHOD__ . "에서 오류발생: {$uid}에 해당하는 정보을 찾을수 없습니다."); throw new \Exception(__METHOD__ . "에서 오류발생: {$uid}에 해당하는 정보을 찾을수 없습니다.");
} }
//PrimaryKey 필드는 수정에서 제외
unset($formDatas[$this->model->primaryKey]);
$result = $this->model->update($uid, $formDatas); $result = $this->model->update($uid, $formDatas);
if ($result === false) { if ($result === false) {
$errors = $this->model->errors(); $errors = $this->model->errors();
$errorMsg = is_array($errors) ? implode(", ", $errors) : "업데이트 작업이 실패했습니다."; $errorMsg = is_array($errors) ? implode(", ", $errors) : "업데이트 작업이 실패했습니다.";
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg); throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg);
} }
return $this->handle_save_result($result, $entity); return $this->handle_save_result($result, $uid);
} }
public function modify($uid, object $dto): CommonEntity public function modify($uid, object $dto): CommonEntity
{ {
$formDatas = (array)$dto; $formDatas = (array)$dto;
@ -179,8 +182,7 @@ abstract class CommonService
} }
return $this->modify_process($uid, $formDatas); return $this->modify_process($uid, $formDatas);
} }
protected function delete_process($uid): CommonEntity
protected function delete_process($uid): bool
{ {
if (!$uid) { if (!$uid) {
throw new \Exception("삭제에 필요한 PrimaryKey 가 정의 되지 않았습니다."); throw new \Exception("삭제에 필요한 PrimaryKey 가 정의 되지 않았습니다.");
@ -195,11 +197,9 @@ abstract class CommonService
$errorMsg = is_array($errors) ? implode(", ", $errors) : "모델 삭제 작업이 실패했습니다."; $errorMsg = is_array($errors) ? implode(", ", $errors) : "모델 삭제 작업이 실패했습니다.";
throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg); throw new RuntimeException(__METHOD__ . "에서 오류발생: " . $errorMsg);
} }
return $entity;
return $result;
} }
final public function delete($uid): CommonEntity
final public function delete($uid): bool
{ {
return $this->delete_process($uid); return $this->delete_process($uid);
} }

View File

@ -81,22 +81,31 @@ trait UtilTrait
return false; return false;
} }
final public function alertTrait(string $msg, $url = null) /**
* JavaScript Alert 페이지 이동 스크립트를 생성합니다.
* json_encode() 사용하여 메시지 특수 문자를 안전하게 이스케이프 처리합니다.
* * @param string $msg 브라우저 Alert에 표시할 메시지
* @param string|null $url Alert 이동할 URL (null: 이동 없음, 'close': 닫기)
* @return string HTML <script> 태그
*/
final public function alertTrait(string $msg, $url = null): string
{ {
$msg = preg_replace("/\r/", "\\r", $msg); $safeMsg = json_encode($msg, JSON_UNESCAPED_UNICODE | JSON_HEX_TAG);
$msg = preg_replace("/\n/", "\\n", $msg); $js = "alert({$safeMsg});";
$msg = preg_replace("/\'/", "\'", $msg);
$msg = preg_replace("/\"/", "\'", $msg);
$msg = "alert(\"{$msg}\");";
switch ($url) { switch ($url) {
case 'close': case 'close':
$msg .= "window.close();"; $js .= "window.close();";
break;
case null:
case '':
// 이동 없음
break; break;
default: default:
$msg .= $url ? "location.href=\"{$url}\";" : ""; $safeUrl = json_encode($url, JSON_UNESCAPED_UNICODE | JSON_HEX_TAG);
$js .= "location.href = {$safeUrl};";
break; break;
} }
return "<script type=\"text/javascript\">{$msg}</script>"; return "<script type=\"text/javascript\">{$js}</script>";
} }
final public function getPasswordStringTrait($length = 8, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789") final public function getPasswordStringTrait($length = 8, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")

View File

@ -1,59 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?php
$layouts = LAYOUTS[$viewDatas['layout']];
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
?>
<?= $this->section('content') ?>
<div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div>
<table class="layout_middle">
<tr>
<td class="layout_left"><?= $this->include("{$layouts['path']}/left_menu"); ?></td>
<td class="layout_right">
<div class="layout_header"><?= $this->include("{$template}/index_header"); ?></div>
<div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("{$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="text-center bg-light">번호</th>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<th class="text-center bg-light"><?= $viewDatas['helper']->getListLabel($field, $label, $viewDatas) ?></th>
<?php endforeach ?>
<th class="text-center bg-light">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === DEFAULTS['STATUS'];
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['index_totalcount'] - (($viewDatas['page'] - 1) * $viewDatas['perpage'] + $cnt);
?>
<tr <?= $rowClass ?>>
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("{$template}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</div>
<div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
</td>
</tr>
</table>
<div class="layout_bottom"><?= $this->include("{$layouts['path']}/bottom"); ?></div>
<?= $this->endSection() ?>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,17 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php if (session('message')): ?><div class="alert alert-danger text-start"><?= nl2br(session('message')) ?></div><?php endif; ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div> <div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,10 +1,10 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?php <?php
$layouts = LAYOUTS[$viewDatas['layout']]; $layouts = LAYOUTS[$viewDatas['layout']];
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}"; $template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
?> ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div> <div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div>
<table class="layout_middle"> <table class="layout_middle">
<tr> <tr>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div> <div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?> <?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,19 +0,0 @@
<table>
<thead>
<tr>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><th><?= $label ?></th><?php endforeach ?>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,17 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php if (session('message')): ?><div class="alert alert-danger text-start"><?= nl2br(session('message')) ?></div><?php endif; ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,19 +0,0 @@
<table>
<thead>
<tr>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><th><?= $label ?></th><?php endforeach ?>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>

View File

@ -1,59 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?php
$layouts = LAYOUTS[$viewDatas['layout']];
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
?>
<?= $this->section('content') ?>
<div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div>
<table class="layout_middle">
<tr>
<td class="layout_left"><?= $this->include("{$layouts['path']}/left_menu"); ?></td>
<td class="layout_right">
<div class="layout_header"><?= $this->include("{$template}/index_header"); ?></div>
<div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("{$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="text-center bg-light">번호</th>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<th class="text-center bg-light"><?= $viewDatas['helper']->getListLabel($field, $label, $viewDatas) ?></th>
<?php endforeach ?>
<th class="text-center bg-light">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === DEFAULTS['STATUS'];
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['index_totalcount'] - (($viewDatas['page'] - 1) * $viewDatas['perpage'] + $cnt);
?>
<tr <?= $rowClass ?>>
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("{$template}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</div>
<div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
</td>
</tr>
</table>
<div class="layout_bottom"><?= $this->include("{$layouts['path']}/bottom"); ?></div>
<?= $this->endSection() ?>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['formDatas'][$field] ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,19 +0,0 @@
<table>
<thead>
<tr>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><th><?= $label ?></th><?php endforeach ?>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php $viewDatas['entity'] = $entity; ?>
<tr>
<?php foreach ($viewDatas['formFields'] as $field): ?>
<td><?= $viewDatas['service']->getHelper()->getFieldView($field, $entity->$field, $viewDatas) ?></td>
<?php endforeach ?>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>

View File

@ -1,59 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?php
$layouts = LAYOUTS[$viewDatas['layout']];
$template = "templates" . DIRECTORY_SEPARATOR . "{$viewDatas['layout']}";
?>
<?= $this->section('content') ?>
<div class="layout_top"><?= $this->include("{$layouts['path']}/top"); ?></div>
<table class="layout_middle">
<tr>
<td class="layout_left"><?= $this->include("{$layouts['path']}/left_menu"); ?></td>
<td class="layout_right">
<div class="layout_header"><?= $this->include("{$template}/index_header"); ?></div>
<div id="container" class="layout_content">
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
<div class="index_body">
<?= $this->include("{$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="text-center bg-light">번호</th>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<th class="text-center bg-light"><?= $viewDatas['helper']->getListLabel($field, $label, $viewDatas) ?></th>
<?php endforeach ?>
<th class="text-center bg-light">작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entities'] as $entity): ?>
<?php
$viewDatas['entity'] = $entity;
$isDefaultStatus = $entity->getStatus() === DEFAULTS['STATUS'];
$rowClass = $isDefaultStatus ? "" : 'class="table-danger"';
$num = $viewDatas['index_totalcount'] - (($viewDatas['page'] - 1) * $viewDatas['perpage'] + $cnt);
?>
<tr <?= $rowClass ?>>
<td nowrap><?= $viewDatas['helper']->getListButton('modify', $num, $viewDatas) ?></td>
<?php foreach ($viewDatas['formFields'] as $field => $label): ?><td><?= $viewDatas['helper']->getFieldView($field, $entity->$field, $viewDatas) ?></td><?php endforeach ?>
<td nowrap>
<?= $viewDatas['helper']->getListButton('view', '', $viewDatas) ?>&nbsp;
<?= $viewDatas['helper']->getListButton('delete', '', $viewDatas) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<?= $this->include("{$template}/index_content_bottom"); ?>
<?= form_close() ?>
</div>
</div>
<div class="layout_footer"><?= $this->include("{$template}/index_footer"); ?></div>
</td>
</tr>
</table>
<div class="layout_bottom"><?= $this->include("{$layouts['path']}/bottom"); ?></div>
<?= $this->endSection() ?>

View File

@ -1,22 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start">
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?>
<div><?= validation_show_error($field); ?></div>
</td>
</tr>
<?php endforeach; ?>
</table>
<div class="text-center"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></div>
<?= form_close(); ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,17 +0,0 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?>
<div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<table class="table table-bordered">
<?php foreach ($viewDatas['formFields'] as $field => $label): ?>
<tr>
<th nowrap class="text-end bg-light" width="20%"><?= $viewDatas['helper']->getFieldLabel($field, $label, $viewDatas) ?></th>
<td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, old($field) ?? ($viewDatas['entity']->$field ?? null), $viewDatas) ?></td>
</tr>
<?php endforeach; ?>
</table>
<?php if (session('message')): ?><div class="alert alert-danger text-start"><?= nl2br(session('message')) ?></div><?php endif; ?>
<div class="form_bottom"><?= $this->include("templates/{$viewDatas['layout']}/form_content_bottom"); ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,6 +1,6 @@
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?> <?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : "" ?>
<?= $this->section('content') ?> <?= $this->section('content') ?>
<?= session('message') ? $viewDatas['helper']->alertTrait(session('message')) : ""; ?>
<div id="container" class="content"> <div id="container" class="content">
<div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div> <div class="form_top"><?= $this->include("templates/{$viewDatas['layout']}/form_content_top"); ?></div>
<table class="table table-bordered"> <table class="table table-bordered">