cfmgrv4 innit...1

This commit is contained in:
최준흠 2024-09-25 19:45:42 +09:00
parent 045f243f20
commit 259761b597
37 changed files with 533 additions and 436 deletions

View File

@ -130,12 +130,7 @@ define('AUTH_FIELDS', [
'TITLE' => 'title',
'ROLE' => 'role',
]);
//DBAction
define('DB_ACTION', [
'CREATE' => 'create',
'MODIFY' => 'modify',
]);
//메신저 관련
define("MESSENGERS", [
"skype" => [
"url" => "https://join.skype.com/invite/uKUgXfZThSQC",
@ -158,7 +153,6 @@ define("MESSENGERS", [
"id" => '',
],
]);
//아이콘 및 Sound관련
define('ICONS', [
'LOGO' => '<img src="/images/logo/android-icon-48x48.png">',
@ -187,7 +181,7 @@ define('ICONS', [
'IMAGE_FILE' => '<i class="bi bi-file-earmark-image"></i>',
'GOOGLE' => '<i class="fa-brands fa-google"></i>',
]);
//배너관련
define('TOP_BANNER', [
'default' => '<img src="/images/banner/sub_visual1.jpg"/>',
'aboutus' => '<img src="/images/banner/sub_visual1.jpg"/>',
@ -197,11 +191,11 @@ define('TOP_BANNER', [
'service' => '<img src="/images/banner/sub_visual3.jpg"/>',
'support' => '<img src="/images/banner/sub_visual4.jpg"/>',
]);
//소리관련
define('AUDIOS', [
'Alram_GetEmail' => '<object width=0 height=0 data="/sound/jarvis_email.mp3" type="audio/mpeg"></object>',
]);
//Layout관련
define('KEYWORD', '일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버 가상서버');
define('LAYOUTS', [
'empty' => [

View File

@ -12,23 +12,25 @@ $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}
//1. app/Filters/AuthFilter.php
//2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class]
$routes->get('/', 'Home::index');
$routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'authFilter:manager'], function ($routes) {
// $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'authFilter:manager'], function ($routes) {
$routes->group('admin', ['namespace' => 'App\Controllers\Admin'], function ($routes) {
$routes->get('/', 'Home::index');
$routes->group('user', function ($routes) {
$routes->get('/', 'UserController::index');
});
});
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], function ($routes) {
$routes->group('account', function ($routes) {
$routes->get('/', 'AccountController::index');
$routes->post('create', 'AccountController::create');
});
$routes->group('zone', function ($routes) {
$routes->get('/', 'ZoneController::index');
$routes->post('create/(:uuid)', 'RecordController::create/$1');
});
$routes->group('record', function ($routes) {
$routes->get('/', 'RecordController::index');
$routes->post('create/(:uuid)', 'RecordController::create/$1');
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Admin\Cloudflare'], function ($routes) {
$routes->group('account', function ($routes) {
$routes->get('/', 'AccountController::index');
$routes->post('create', 'AccountController::create');
});
$routes->group('zone', function ($routes) {
$routes->get('/', 'ZoneController::index');
$routes->post('create/(:uuid)', 'RecordController::create/$1');
});
$routes->group('record', function ($routes) {
$routes->get('/', 'RecordController::index');
$routes->post('create/(:uuid)', 'RecordController::create/$1');
});
});
});

View File

@ -0,0 +1,21 @@
<?php
namespace App\Controllers\Admin;
use App\Controllers\MVController;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Traits\AuthTrait;
abstract class AdminController extends MVController
{
use AuthTrait;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_path = "Admin/";
$this->layout = "admin";
$this->session = $this->session_AuthTrait();
}
}

View File

@ -1,6 +1,6 @@
<?php
namespace App\Controllers\Cloudflare;
namespace App\Controllers\Admin\Cloudflare;
use Psr\Log\LoggerInterface;
use CodeIgniter\HTTP\ResponseInterface;
@ -8,7 +8,6 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\RedirectResponse;
use App\Libraries\MyCloudflare\Account;
use App\Entities\Cloudflare\AccountEntity;
class AccountController extends CloudflareController
{
@ -16,10 +15,10 @@ class AccountController extends CloudflareController
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_name .= "Account";
$this->layout = LAYOUTS['admin'];
$this->title = lang("{$this->class_name}.title");
helper($this->class_name);
$this->class_name = "Account";
$this->class_path .= $this->class_name;
$this->title = lang("{$this->class_path}.title");
helper($this->class_path);
}
final protected function getMyLibrary(): Account
{
@ -28,28 +27,13 @@ class AccountController extends CloudflareController
}
return $this->_myLibrary;
}
//Field별 Form Input용
protected function getFormFieldInput(string $field, string $value, array $inputs = []): array
{
switch ($field) {
case 'type':
$inputs[$field] = form_dropdown(
$field,
$this->getFormFieldInputOption($field, $inputs),
$value
);
break;
default:
$inputs = parent::getFormFieldInput($field, $value, $inputs);
break;
}
return $inputs;
}
protected function create_init(): void
{
$this->action = 'create';
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'type', 'status'];
$this->filter_fields = ['type', 'status'];
$this->action = DB_ACTION['CREATE'];
$this->field_rules = $this->getFormFieldRules();
$this->field_options = $this->getFormFieldOptions();
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
}
// public function create_form(): RedirectResponse|string
@ -70,19 +54,17 @@ class AccountController extends CloudflareController
$this->validateFormDatas();
return parent::create_process();
}
protected function index_init(): void
public function index(): string
{
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
$this->filter_fields = ['type', 'status'];
$this->action = DB_ACTION['CREATE'];
$this->action = 'index';
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
$this->filter_fields = ['type', 'status'];
$this->batchjob_fields = ['status'];
$this->field_rules = $this->getFormFieldRules();
$this->field_options = $this->getFormFieldOptions();
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
helper(['form']);
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
}
public function index(): string
{
$this->index_init();
return parent::list_process();
}
}

View File

@ -1,28 +1,25 @@
<?php
namespace App\Controllers\Cloudflare;
namespace App\Controllers\Admin\Cloudflare;
use App\Controllers\MVController;
use App\Controllers\Admin\AdminController;
use App\Models\Cloudflare\AccountModel;
use App\Models\Cloudflare\RecordModel;
use App\Models\Cloudflare\ZoneModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\Cloudflare\AccountModel;
use App\Models\Cloudflare\API\RecordModel;
use App\Models\Cloudflare\ZoneModel;
use App\Traits\AuthTrait;
abstract class CloudflareController extends MVController
abstract class CloudflareController extends AdminController
{
use AuthTrait;
private $_accountModel = null;
private $_zoneModel = null;
private $_recordModel = null;
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_name = "Cloudflare/";
$this->layout = LAYOUTS['admin'];
$this->session = $this->session_AuthTrait();
$this->class_path .= "Cloudflare/";
}
final protected function getAccountModel(): AccountModel
{

View File

@ -1,6 +1,6 @@
<?php
namespace App\Controllers\Cloudflare;
namespace App\Controllers\Admin\Cloudflare;
use Psr\Log\LoggerInterface;
use CodeIgniter\HTTP\ResponseInterface;
@ -8,7 +8,6 @@ use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\RedirectResponse;
use App\Libraries\MyCloudflare\Record;
use App\Entities\Cloudflare\RecordEntity;
class RecordController extends CloudflareController
{
@ -18,9 +17,9 @@ class RecordController extends CloudflareController
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_name .= "Record";
$this->layout = LAYOUTS['admin'];
$this->title = lang("{$this->class_name}.title");
$this->class_name = "Record";
$this->class_path .= $this->class_name;
$this->title = lang("{$this->class_path}.title");
helper($this->class_name);
}
final protected function getMyLibrary(): Record
@ -30,18 +29,18 @@ class RecordController extends CloudflareController
}
return $this->_myLibrary;
}
protected function getFormFieldInputOption(string $field, array $options = []): array
protected function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case $this->getMyLibrary()->getMyStorage()::PARENT:
$options = [
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택'
];
$this->getZoneModel()->where('status', DEFAULTS['STATUS']);
$options = $this->getZoneModel()->getFormFieldInputOption($field, $options);
$options[$field] = [
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택',
...$this->getZoneModel()->getFormFieldOption($field, $options),
];
break;
default:
$options = parent::getFormFieldInputOption($field, $options);
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
@ -74,15 +73,11 @@ class RecordController extends CloudflareController
}
protected function create_init(): void
{
$this->fields = [
$this->getMyLibrary()->getMyStorage()::PARENT,
'type',
'content',
'proxied',
'hosts',
];
$this->filter_fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'type', 'proxied'];
$this->action = 'create';
$this->fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'type', 'content', 'proxied', 'hosts'];
$this->filter_fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'type', 'proxied'];
$this->field_rules = $this->getFormFieldRules();
$this->field_options = $this->getFormFieldOptions();
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
}
// public function create_form(): RedirectResponse|string

View File

@ -1,6 +1,6 @@
<?php
namespace App\Controllers\Cloudflare;
namespace App\Controllers\Admin\Cloudflare;
use CodeIgniter\HTTP\RedirectResponse;
use CodeIgniter\HTTP\RequestInterface;
@ -17,9 +17,9 @@ class ZoneController extends CloudflareController
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
$this->class_name .= "Zone";
$this->layout = LAYOUTS['admin'];
$this->title = lang("{$this->class_name}.title");
$this->class_name = "Zone";
$this->class_path .= $this->class_name;
$this->title = lang("{$this->class_path}.title");
helper($this->class_name);
}
final protected function getMyLibrary(): Zone
@ -29,43 +29,22 @@ class ZoneController extends CloudflareController
}
return $this->_myLibrary;
}
protected function getFormFieldInputOption(string $field, array $options = []): array
protected function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case $this->getMyLibrary()->getMyStorage()::PARENT:
$options = [
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택'
];
$this->getAccountModel()->where('status', DEFAULTS['STATUS']);
$options = $this->getAccountModel()->getFormFieldInputOption($field, $options);
break;
case 'type':
case 'proxied':
$options = [
DEFAULTS['EMPTY'] => lang("Cloudflare/Record.label." . $field) . ' 선택',
...lang("Cloudflare/Record.label." . strtoupper($field)),
$options[$field] = [
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택',
...$this->getAccountModel()->getFormFieldOption($field, $options),
];
break;
default:
$options = parent::getFormFieldInputOption($field, $options);
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;
}
protected function getFormFieldRule(string $field, array $rules): array
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
default:
$rules[$field] = $this->getMyLibrary()->getMyStorage()->getFieldRule($field, $rules);
;
break;
}
return $rules;
}
//전송된 데이터
protected function getFormData(string $field): void
{
switch ($field) {
@ -100,16 +79,11 @@ class ZoneController extends CloudflareController
}
protected function create_init(): void
{
$this->fields = [
$this->getMyLibrary()->getMyStorage()::PARENT,
'domains',
'hosts',
'type',
'content',
'proxied',
];
$this->filter_fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'type', 'proxied'];
$this->action = 'create';
$this->fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'domains', 'hosts', 'type', 'content', 'proxied'];
$this->filter_fields = [$this->getMyLibrary()->getMyStorage()::PARENT, 'type', 'proxied'];
$this->field_rules = $this->getFormFieldRules();
$this->field_options = $this->getFormFieldOptions();
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
}
// public function create_form(): RedirectResponse|string

View File

@ -9,24 +9,24 @@ use Psr\Log\LoggerInterface;
abstract class CommonController extends BaseController
{
private $_attributes = [];
private $_viewDatas = [];
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
parent::initController($request, $response, $logger);
}
final public function __get($name)
{
if (!array_key_exists($name, $this->_attributes)) {
if (!array_key_exists($name, $this->_viewDatas)) {
return null;
}
return $this->_attributes[$name];
return $this->_viewDatas[$name];
}
final public function __set($name, $value): void
{
$this->_attributes[$name] = $value;
$this->_viewDatas[$name] = $value;
}
final public function getAttributes(): array
final public function getViewDatas(): array
{
return $this->_attributes;
return $this->_viewDatas;
}
}

View File

@ -17,69 +17,40 @@ abstract class MVController extends CommonController
abstract protected function getMyLibrary(): mixed;
abstract protected function create_process_submit(): void;
abstract protected function modify_process_submit(): void;
//Field별 Form Input Option용
protected function getFormFieldInputOption(string $field, array $options): array
//Field별 Form Option용
protected function getFormFieldOption(string $field, array $options): array
{
switch ($field) {
default:
$options = [
"" => lang($this->class_name . '.label.' . $field) . ' 선택',
...lang($this->class_name . '.' . strtoupper($field)),
$options[$field] = [
"" => lang($this->class_path . '.label.' . $field) . ' 선택',
...lang($this->class_path . '.' . strtoupper($field)),
];
break;
}
// dd($options);
return $options;
}
//Field별 Form Input용
protected function getFormFieldInput(string $field, string $value, array $inputs): array
final protected function getFormFieldOptions(array $options = []): array
{
switch ($field) {
case 'status':
$inputs[$field] = form_dropdown(
$field,
$this->getFormFieldInputOption($field, $inputs),
$value
);
break;
case 'updated_at':
case 'created_at':
$inputs[$field] = form_input($field, $value, ["class" => " calender"]);
break;
default:
$inputs[$field] = form_input($field, $value);
break;
}
return $inputs;
}
final protected function getFormFieldInputs(array $inputs = []): array
{
foreach ($this->fields as $field) {
foreach ($this->filter_fields as $field) {
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
}
$inputs = $this->getFormFieldInput($field, old($field) ?: DEFAULTS['EMPTY'], $inputs);
$options = $this->getFormFieldOption($field, $options);
}
return $inputs;
}
//전송된 데이터 Rule
protected function getFormFieldRule(string $field, array $rules): array
{
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
switch ($field) {
default:
$rules[$field] = $this->getMyLibrary()->getMyStorage()->getFieldRule($field, $rules);
break;
}
return $rules;
return $options;
}
final protected function getFormFieldRules(array $rules = []): array
{
foreach ($this->fields as $field) {
$rules = $this->getFormFieldRule($field, $rules);
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
}
$rules = $this->getMyLibrary()->getMyStorage()->getFieldRule($field, $rules);
}
// var_dump($rules);
// exit;
return $rules;
}
//전송된 데이터
@ -140,12 +111,11 @@ abstract class MVController extends CommonController
{
helper(['form']);
try {
$this->forminputs = $this->getFormFieldInputs();
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
return view(
strtolower($this->class_name) . "/create",
['viewDatas' => $this->getAttributes()]
strtolower($this->class_path) . "/create",
data: ['viewDatas' => $this->getViewDatas()]
);
} catch (\Exception $e) {
log_message("error", $e->getMessage());
@ -173,12 +143,11 @@ abstract class MVController extends CommonController
{
helper(['form']);
try {
$this->forminputs = $this->getFormFieldInputs();
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
return view(
strtolower($this->class_name) . "/modify",
['viewDatas' => $this->getAttributes()]
strtolower($this->class_path) . "/modify",
['viewDatas' => $this->getViewDatas()]
);
} catch (\Exception $e) {
log_message("error", $e->getMessage());
@ -244,7 +213,7 @@ abstract class MVController extends CommonController
{
//Page, Per_page필요부분
$this->page = (int)$this->request->getVar('page') ?: 1;
$this->per_page = (int)$this->request->getVar('per_page') ?: intval(getenv("default.list.per_page"));
$this->per_page = (int)$this->request->getVar('per_page') ?: intval(getenv("mvc.default.list.per_page"));
//줄수 처리용
$page_options = array("" => "줄수선택");
for ($i = $this->per_page; $i <= $this->total_count; $i += $this->per_page) {
@ -281,31 +250,11 @@ abstract class MVController extends CommonController
// dd($this->getMyLibrary()->getMyStorage()->getLastQuery());
return $entitys;
}
protected function list_field_columns(): array
{
$columns = [];
foreach ($this->fields as $field) {
$label = lang("{$this->class_name}.label.{$field}");
if ($field == $this->order_field) {
$label .= $this->order_value == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
$this->order_value = $this->order_value == 'DESC' ? "ASC" : "DESC";
} else {
$this->order_value = "ASC";
}
$columns[] = anchor(current_url() . "?order_field={$field}&order_value={$this->order_value}", $label);
}
return $columns;
}
public function list_process(): string
{
try {
//URL처리
$this->uri = $this->request->getUri();
//입력폼처리
$this->list_forminputs = $this->getFormFieldInputs();
//List Field Column처리
$this->list_field_columns = $this->list_field_columns();
//total 처리
$this->total_count = $this->list_total();
//pagenation 처리
@ -315,8 +264,8 @@ abstract class MVController extends CommonController
//setting return_url to session flashdata
$this->session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: "");
return view(
strtolower($this->class_name) . "/index",
['viewDatas' => $this->getAttributes()]
strtolower($this->class_path) . "/index",
['viewDatas' => $this->getViewDatas()]
);
} catch (\Exception $e) {
log_message("error", $e->getMessage());

View File

@ -11,7 +11,7 @@ class AccountEntity extends CommonEntity
{
return "{$this->getPK()}|{$this->getTitle()}|{$this->getAuthKey()}|{$this->attributes['type']}|{$this->attributes['status']}";
}
public function getPK(): int
public function getPK(): string
{
return $this->attributes[AccountModel::PK];
}

View File

@ -2,7 +2,7 @@
namespace App\Entities\Cloudflare;
use App\Models\Cloudflare\API\RecordModel;
use App\Models\Cloudflare\RecordModel;
use App\Entities\CommonEntity;
class RecordEntity extends CommonEntity
@ -11,7 +11,7 @@ class RecordEntity extends CommonEntity
{
return "{$this->getPK()}|{$this->getParent()}|{$this->getTitle()}|{$this->attributes['host']}|{$this->attributes['content']}|{$this->attributes['proxied']}|{$this->attributes['fixed']}|{$this->attributes['locked']}";
}
public function getPK(): int
public function getPK(): string
{
return $this->attributes[RecordModel::PK];
}

View File

@ -11,7 +11,7 @@ class ZoneEntity extends CommonEntity
{
return "{$this->getPK()}|{$this->getParent()}|{$this->getTitle()}|{$this->attributes['development_mode']}|{$this->attributes['ipv6']}|{$this->attributes['security_level']}";
}
public function getPK(): int
public function getPK(): string
{
return $this->attributes[ZoneModel::PK];
}

View File

@ -0,0 +1,137 @@
<?php
function getFieldLabel_AccountHelper(string $field, array $viewDatas, array $attributes = []): string
{
switch ($field) {
default:
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
$attributes = ['style="color:red";'];
}
$label = sprintf(
"<span %s>%s</span>",
implode(" ", $attributes),
lang("{$viewDatas['class_path']}.label.{$field}")
);
break;
}
return $label;
}
//header.php에서 getFieldForm_Helper사용
function getFieldForm_AccountHelper(string $field, mixed $value, array $viewDatas, array $attributes = []): string
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'user_uid':
$form = form_dropdown($field, $viewDatas['field_options'][$field], $value, [...$attributes, 'class' => "select-field"]);
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
// }
// return implode("&nbsp;", $checkboxs);
break;
case 'content':
case 'head':
case 'tail':
$form = form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case "type":
case "status":
$form = form_dropdown($field, $viewDatas['field_options'][$field], $value, $attributes);
break;
case 'id':
$form = form_input($field, $value, ["placeholder" => "예)sample@test.com", "style" => "width:60%; ::placeholder{color:silver; opacity: 1;}"]);
case 'name':
$form = form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{color:silver; opacity: 1;}"]);
break;
case 'updated_at':
case 'created_at':
$form = form_input($field, $value, ['class' => 'calender']);
break;
default:
$form = form_input($field, $value);
break;
}
return $form;
} //
function getFieldView_AccountHelper(string $field, mixed $entity, array $viewDatas, array $attributes = [])
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'category_uid':
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
foreach ($category_2depths as $key => $depth) {
if ($key == $depth) {
$value = $depth;
}
}
}
break;
case 'cost':
case 'price':
case 'sale':
$value = number_format(!$value ? 0 : $value) . "";
break;
case 'stock':
case 'view_cnt':
$value = number_format(!$value ? 0 : $value);
break;
case 'content':
$value = html_entity_decode($value);
break;
case 'updated_at':
case 'created_at':
$value = $value ? date("Y-m-d", strtotime($value)) : "";
break;
default:
if (in_array($field, $viewDatas['filter_fields']) && $value) {
$value = $viewDatas['field_options'][$field][$value];
}
break;
}
return $value;
} //
function getListHeaders_AccountHelper(string $field, array $viewDatas, array $attributes = []): string
{
$label = getFieldLabel_AccountHelper($field, $viewDatas, $attributes);
if ($field == $viewDatas['order_field']) {
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
}
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
$viewDatas['uri']->addQuery('order_field', $field);
$viewDatas['uri']->addQuery('order_value', $order_value);
$header = anchor((string)$viewDatas['uri'], $label);
switch ($field) {
case 'title':
$attributes = [...$attributes, "class=\"col-2\""];
break;
}
return sprintf("<th %s>%s</th>", implode(" ", $attributes), $header);
}
function getListColumns_AccountHelper(string $field, mixed $entity, array $viewDatas, array $attributes = []): string
{
switch ($field) {
case 'title':
case 'name':
$value = anchor(
current_url() . '/view/' . $entity->getPK(),
getFieldView_AccountHelper($field, $entity, $viewDatas),
["target" => "_self"]
);
break;
default:
if (in_array($field, $viewDatas['filter_fields'])) {
$attributes["onChange"] = sprintf(
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
current_url(),
$entity->getPK(),
$field,
$field
);
$value = getFieldForm_AccountHelper($field, $entity, $viewDatas, $attributes);
}
$value = getFieldView_AccountHelper($field, $entity, $viewDatas);
break;
}
return $value;
}

View File

@ -0,0 +1,67 @@
<?php
function getFieldLabel_ZoneHelper($field, array $viewDatas, array $attributes = []): string
{
switch ($field) {
default:
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
$attributes = ['style="color:red";'];
}
$label = sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
break;
}
return $label;
}
//header.php에서 getFieldForm_Helper사용
function getFieldForm_ZoneHelper($field, $value, array $viewDatas, array $attributes = [])
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'category_uid':
case 'user_uid':
$viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
// // return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
// foreach ($viewDatas['fieldFormOptions'][$field] as $key => $label) {
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
// }
// return implode("&nbsp;", $checkboxs);
break;
case 'title':
case 'name':
return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'content':
case 'head':
case 'tail':
return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case "status":
case "category":
$viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
break;
case 'updated_at':
case 'created_at':
return form_input($field, $value, ['class' => 'calender']);
break;
default:
return form_input($field, $value);
break;
}
} //
protected function list_field_columns(): array
{
$columns = [];
foreach ($this->fields as $field) {
$label = lang("{$this->class_path}.label.{$field}");
if ($field == $this->order_field) {
$label .= $this->order_value == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
$this->order_value = $this->order_value == 'DESC' ? "ASC" : "DESC";
} else {
$this->order_value = "ASC";
}
$columns[] = anchor(current_url() . "?order_field={$field}&order_value={$this->order_value}", $label);
}
return $columns;
}

View File

@ -1 +0,0 @@
<?php

View File

@ -7,7 +7,7 @@ return [
'authkey' => "인증Key",
'oldkey' => "이전인증Key",
'title' => "인증명",
'type' => "가입방식",
'type' => "인증방식",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일",

View File

@ -4,18 +4,20 @@ namespace App\Libraries;
abstract class CommonLibrary
{
private $_attributes = [];
protected function __construct() {}
private $_libraryDatas = [];
protected function __construct()
{
}
final public function __get($name)
{
if (!array_key_exists($name, $this->_attributes)) {
if (!array_key_exists($name, $this->_libraryDatas)) {
return null;
}
return $this->_attributes[$name];
return $this->_libraryDatas[$name];
}
final public function __set($name, $value): void
{
$this->_attributes[$name] = $value;
$this->_libraryDatas[$name] = $value;
}
}

View File

@ -34,10 +34,11 @@ class AccountModel extends CommonModel
$rules[$field] = "required|valid_emailvalid_email|is_unique[cloudflareauth.id]";
break;
case "authkey":
$rules[$field] = $rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";;
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
;
break;
case "oldkey":
$rules[$field] = $rules[$field] = "if_exist|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
$rules[$field] = "if_exist|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
break;
case "type":
$rules[$field] = "if_exist|in_list[standard,enterprise]";
@ -48,12 +49,12 @@ class AccountModel extends CommonModel
}
return $rules;
}
public function getFormFieldInputOption(string $field, array $options = []): array
public function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
default:
$this->orderBy(self::TITLE, 'asc');
$options = parent::getFormFieldInputOption($field, $options);
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;

View File

@ -30,7 +30,8 @@ class ZoneModel extends CommonModel
{
switch ($field) {
case self::PARENT:
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";;
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
;
break;
case self::TITLE:
case "plan":
@ -50,15 +51,12 @@ class ZoneModel extends CommonModel
}
return $rules;
}
public function getFormFieldInputOption(string $field, array $options = []): array
public function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
case "status":
$options[$field] = lang($this->class_name . '.' . strtoupper($field));
break;
default:
$this->orderBy(self::TITLE, 'asc');
$options = parent::getFormFieldInputOption($field, $options);
$options = parent::getFormFieldOption($field, $options);
break;
}
return $options;

View File

@ -45,7 +45,7 @@ abstract class CommonModel extends Model
protected $beforeDelete = [];
protected $afterDelete = [];
private $_action = DB_ACTION["CREATE"];
private $_action = 'create';
protected function __construct()
{
parent::__construct();
@ -89,7 +89,7 @@ abstract class CommonModel extends Model
//수동입력인경우
if (!$this->useAutoIncrement) {
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
$rules[$field] .= $this->getAction() == DB_ACTION["CREATE"] ? "|is_unique[{$this->table}.{$field}]" : "";
$rules[$field] .= $this->getAction() == "create" ? "|is_unique[{$this->table}.{$field}]" : "";
} else {
$rules[$field] = "required|numeric";
}
@ -99,10 +99,10 @@ abstract class CommonModel extends Model
$rules[$field] = "required|string";
break;
case "passwd":
$rules[$field] = $this->getAction() == DB_ACTION["CREATE"] ? "required" : "if_exist" . "|trim|string";
$rules[$field] = $this->getAction() == "create" ? "required" : "if_exist" . "|trim|string";
break;
case "confirmpassword":
$rules["confirmpassword"] = $this->getAction() == DB_ACTION["CREATE"] ? "required" : "if_exist" . "|trim|string|matches[passwd]";
$rules["confirmpassword"] = $this->getAction() == "create" ? "required" : "if_exist" . "|trim|string|matches[passwd]";
break;
case "email":
$rules[$field] = "if_exist|trim|valid_email";
@ -127,11 +127,14 @@ abstract class CommonModel extends Model
final public function getFieldRules(array $fields, array $rules = []): array
{
foreach ($fields as $field) {
if (is_array($field)) {
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
}
$rules = $this->getFieldRule($field, $rules);
}
return $rules;
}
public function getFormFieldInputOption(string $field, array $options = []): array
public function getFormFieldOption(string $field, array $options = []): array
{
switch ($field) {
default:
@ -204,7 +207,7 @@ abstract class CommonModel extends Model
final protected function create_process($entity, array $formDatas): mixed
{
//Field에 맞는 Validation Rule 재정의
$this->setAction(DB_ACTION['CREATE']);
$this->setAction('create');
$this->setValidationRules($this->getFieldRules($this->allowedFields));
//저장하기 전에 데이터 값 변경이 필요한 Field
foreach (array_keys($formDatas) as $field) {
@ -222,7 +225,7 @@ abstract class CommonModel extends Model
final protected function modify_process($entity, array $formDatas): mixed
{
//Field에 맞는 Validation Rule 재정의
$this->setAction(DB_ACTION['MODIFY']);
$this->setAction('modify');
$this->setValidationRules($this->getFieldRules($this->allowedFields));
//저장하기 전에 데이터 값 변경이 필요한 Field
foreach (array_keys($formDatas) as $field) {

View File

@ -5,9 +5,9 @@
<table class="form table table-bordered table-striped">
<?php foreach ($viewDatas['fields'] as $field): ?>
<tr>
<td class="label"><?= lang($viewDatas['class_name'] . '.label.' . $field) ?></td>
<td class="label"><?= getFieldLabel_AccountHelper($field, $viewDatas) ?></td>
<td class="column">
<?= $viewDatas['forminputs'][$field] ?>
<?= getFieldForm_AccountHelper($field, old($field), $viewDatas) ?>
<?= validation_show_error($field); ?>
</td>
</tr>

View File

@ -0,0 +1,68 @@
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
<?= $this->section('content') ?>
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
<?= form_open(current_url(), array("method" => "get")) ?>
<nav class="index_top navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="condition nav">
조건검색:<?php foreach ($viewDatas['filter_fields'] as $field): ?><?= getFieldForm_AccountHelper($field, old($viewDatas[$field]), $viewDatas) ?><?php endforeach ?>
</nav>
<nav class="search nav justify-content-center">
검색어:<?= form_input('word', $viewDatas['word']) ?>
검색일:<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
<?= form_submit('', '검색하기') ?>
<?= anchor(current_url() . '/excel?' . $viewDatas['uri']->getQuery(), ICONS['EXCEL'], ["target" => "_self"]) ?>
</nav>
<nav class="pageinfo nav justify-content-center">
페이지정보 : <?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?>
/ :<?= $viewDatas['total_count'] ?>
</nav>
</div>
</nav>
<?= form_close() ?>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="index_table table table-bordered table-hover table-striped">
<thead>
<tr>
<th>번호</th>
<?php foreach ($viewDatas['fields'] as $field): ?>
<?= getListHeaders_AccountHelper($field, $viewDatas) ?>
<?php endforeach ?>
<th>작업</th>
</tr>
</thead>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entitys'] as $entity): ?>
<tr id="<?= $entity->getPK() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
<td class="text-center text-wrap">
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPK()}", "name" => "batchjob_uids[]", "value" => $entity->getPK(), "class" => "batchjobuids_checkboxs"]); ?>
<?= anchor(current_url() . '/update/' . $entity->getPK(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
</td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= getListColumns_AccountHelper($field, $entity, $viewDatas) ?></td>
<?php endforeach ?>
<td>
<?= anchor(current_url() . '/delete/' . $entity->getPK(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<div class=" index_bottom">
<ul class="nav justify-content-center">
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
<?= getFieldForm_AccountHelper($field, old($viewDatas[$field]), $viewDatas) ?>
<?php endforeach ?>
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")) ?></li>
<li class="nav-item">
<?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
</li>
</ul>
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<?= $this->endSection() ?>

View File

@ -1,56 +0,0 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
<div class="top container-fluid">
<?= form_open(current_url(), array("method" => "get")) ?>
<nav class="nav">
조건검색:<?php foreach ($viewDatas['filter_fields'] as $field): ?><?= $viewDatas['list_forminputs'][$field] ?><?php endforeach ?>
</nav>
<?= $this->include('templates/admin/index_head') ?>
<?= form_close() ?>
</div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-hover">
<thead>
<tr>
<th>#</th>
<?php foreach ($viewDatas['list_field_columns'] as $column): ?>
<th><?= $column ?></th>
<?php endforeach ?>
<th>@</th>
</tr>
</thead>
<?= dd($viewDatas['list_field_columns']) ?>
<tbody>
<?php $cnt = 0 ?>
<?php foreach ($viewDatas['entitys'] as $entity): ?>
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
<td nowarp>
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
</td>
<?php foreach ($viewDatas['fields'] as $field): ?>
<td><?= getFieldIndex_Row_UserHelper_Admin($field, $entity, $viewDatas) ?></td>
<?php endforeach ?>
<td>
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
</td>
</tr>
<?php $cnt++ ?>
<?php endforeach ?>
</tbody>
</table>
<div class="bottom">
<ul class="nav justify-content-center">
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($viewDatas['batchjobFilters'] as $field): ?>
<?= getFieldFilter_UserHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?><?php endforeach ?>
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")) ?></li>
<li class="nav-item">
<?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
</li>
</ul>
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<?= $this->endSection() ?>

View File

@ -6,10 +6,10 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
<title><?= $viewDatas['title'] ?></title>
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
<?= $stylesheet ?>
<?php endforeach; ?>
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript): ?>
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
<?= $javascript ?>
<?php endforeach; ?>
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
@ -24,20 +24,16 @@
<body>
<div class="layout">
<div class="head">
<?= $this->include($viewDatas['layout']['path'] . '/head'); ?>
</div>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/head'); ?>
<div class="center">
<div class="left_menu"><?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?></div>
<div class="left_menu"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?></div>
<div class="content">
<div class="header"><?= $this->include('templates/admin/header'); ?></div>
<div class="center"><?= $this->renderSection('content') ?></div>
<div class="footer"><?= $this->include('templates/admin/footer'); ?></div>
</div>
</div>
<div class="tail">
<?= $this->include($viewDatas['layout']['path'] . '/tail'); ?>
</div>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/tail'); ?>
</div>
</body>

View File

@ -1,19 +1,41 @@
<nav class="navbar navbar-expand-lg">
<nav class="head navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="nav">
<a class="navbar-brand" href="#">관리페이지</a>
</nav>
<nav class="nav"><a class="navbar-brand" href="#">관리페이지</a></nav>
<ul class="nav justify-content-center">
<li class="nav-item">
<?= $this->include($viewDatas['layout']['path'] . '/head/make_password'); ?>
<?= ICONS['LOCK'] ?>
</li>
<li class="nav-item">
<?= $this->include($viewDatas['layout']['path'] . '/head/search'); ?>
<input type="text" class="form-control" value="<?= getPasswordString_CommonHelper() ?>" id="makePassword">
</li>
<li class="nav-item">
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
onClick="window.location.reload();"><?= ICONS['SEARCH'] ?></button>
</li>
<li class="nav-item">
<form class="d-flex me-20" role="search">
<input class="form-control" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>
</li>
</ul>
<ul class="nav justify-content-end">
<li class="nav-item">
<?= $this->include($viewDatas['layout']['path'] . '/head/member_link'); ?>
<?php if ($viewDatas['session']->get(SESSION_NAMES['ISLOGIN'])): ?>
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<?= ICONS['LOGIN'] ?> <?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item"
href="/front/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="<?= URLS['LOGOUT'] ?>"><?= ICONS['LOGOUT'] ?>Logout</a></li>
</ul>
<?php else: ?><a class="nav-link dropdown-toggle" href="<?= URLS['LOGIN'] ?>"
role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
</li>
</ul>
</div>

View File

@ -1,5 +0,0 @@
<ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
<li class="nav-item"><?= ICONS['LOCK'] ?></li>
<li class="nav-item"><input type="text" class="form-control" value="<?= getPasswordString_CommonHelper() ?>" id="makePassword"></li>
<li class="nav-item"><button class="btn btn-default border border-dark" type="button" id="totSearchBtn" onClick="window.location.reload();"><?= ICONS['SEARCH'] ?></button></li>
</ul>

View File

@ -1,17 +0,0 @@
<li class="nav-item dropdown">
<?php if ($viewDatas['session']->get(SESSION_NAMES['ISLOGIN'])): ?>
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
<?= ICONS['LOGIN'] ?> <?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
</a>
<ul class="dropdown-menu dropdown-menu-end">
<li><a class="dropdown-item"
href="/front/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a>
</li>
<li>
<hr class="dropdown-divider">
</li>
<li><a class="dropdown-item" href="<?= URLS['LOGOUT'] ?>"><?= ICONS['LOGOUT'] ?>Logout</a></li>
</ul>
<?php else: ?><a class="nav-link dropdown-toggle" href="<?= URLS['LOGIN'] ?>"
role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
</li>

View File

@ -1,4 +0,0 @@
<form class="d-flex me-20" role="search">
<input class="form-control" type="search" placeholder="Search" aria-label="Search">
<button class="btn btn-outline-success" type="submit">Search</button>
</form>

View File

@ -6,9 +6,9 @@
<div class="accordion-item" style="background-color: #eaeaea;">
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
</div>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/site'); ?>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/base'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/site'); ?>
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/shoppingmall'); ?>
</div>
<div id="menu_button">메뉴열기</div>
</div>

View File

@ -0,0 +1,3 @@
<nav class="tail navbar navbar-expand-lg">
</nav>

View File

@ -1,12 +0,0 @@
<nav class="nav justify-content-end">
검색어:<?= form_input('word', $viewDatas['word']) ?>
검색일:<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
<?= form_submit('', '검색하기') ?>
<?= anchor(current_url() . '/excel?' . $viewDatas['uri']->getQuery(), ICONS['EXCEL'], ["target" => "_self"]) ?>
</nav>
<nav class="nav justify-content-end">
<span class="pageinfo">
페이지정보 : <?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?> / 총:<?= $viewDatas['total_count'] ?>
</span>
</nav>

View File

@ -15,25 +15,24 @@ body {
background-color: #efefef;
/* border:1px solid blue; */
}
div.layout > div.head {
div.layout > nav.head {
height: 51px;
border: 1px solid gray;
border-top: 1px solid gray;
border-bottom: 1px solid gray;
background-color: #f8f9fa;
}
div.layout > div.tail {
div.layout > nav.tail {
height: 51px;
position: fixed;
bottom: 0;
left: 0;
width: 100%;
background-color: lightgray;
background-color: silver;
text-align: center;
padding: 10px;
}
div.layout > div.center > div.content {
margin-top: 20px;
margin-left: 25px;
margin-right: 20px;
margin: 25px 0px 25px 25px;
}
div.layout > div.center > div.content > div.header {
/*content 헤더라인*/

View File

@ -1,95 +1,77 @@
div#content{
color:black;
padding-top:20px;
margin-bottom:40px;
/* border-left:1px solid silver;
border-right:1px solid silver; */
/* insert,update,reply,view Form Page 관련 전용*/
table.form.tbody tr td.label {
width: 10%;
text-align: right;
padding-right: 20px;
background-color: #e8ebe9;
}
/* div#content div.top{
border:1px solid red;
} */
table.form tbody tr td.column {
height: 27px;
text-align: left;
padding-left: 20px;
}
/* insert,update,reply,view Form Page 관련 전용*/
/*페이지정보*/
div#content div.top nav span.pageinfo{
font-weight:bold;
}
/*검색*/
div#content div.top nav input[type=text]{
width:200px;
height:40px;
border-radius:0px !important;
/* border:1px solid red; */
nav.index_top input[type="text"] {
width: 200px;
height: 40px;
}
/*검색submit*/
div#content div.top nav input[type=submit]{
font-size:12px;
font-weight:bold;
width:80px;
height:40px;
color:white;
border-radius:0px !important;
background-color:#555555;
/* border:1px solid red; */
nav.index_top input[type="submit"] {
font-size: 12px;
font-weight: bold;
width: 80px;
height: 40px;
color: white;
background-color: #555555;
}
/*Excel Icon*/
div#content div.top nav a{
border-radius:0px !important;
/* border:1px solid red; */
/*페이지정보*/
nav.index_top nav.pageinfo {
float: right;
font-weight: bold;
border-color: 1px solid red;
}
/* Table 부분 */
div#content table {
width:100%;
/* overflow-x: auto;
padding-top:5px;
padding-bottom:5px; */
table.index_table {
width: 100%;
/* overflow-x: auto;
padding-top:5px;
padding-bottom:5px; */
}
table.index_table thead th {
white-space: nowrap;
padding-top: 15px;
padding-bottom: 15px;
font-size: 16px;
font-weight: bold;
border-top: 2px solid black;
border-bottom: 1px solid silver;
background-color: #f5f5f5;
text-align: center;
/* border:1px solid silver; */
}
div.index_bottom {
padding-top: 15px;
/* border: 1px solid red; */
}
/* insert,update,reply,view Form Page 관련 전용*/
div#content table.form tbody tr td.label{
width:10%;
text-align:right;
padding-right:20px;
background-color:#e8ebe9;
div.index_bottom nav ul.pagination {
margin-top: 20px;
}
div#content table.form tbody tr td.column{
height:27px;
text-align:left;
padding-left:20px;
div.index_bottom nav ul.pagination {
display: inline-block; /* ul이 줄바꿈이 되지 않도록 설정 */
padding: 0;
list-style: none; /* 기본 점 스타일 제거 (옵션) */
}
/* insert,update,reply,view Form Page 관련 전용*/
/* 상품 리스트 전용 */
div#content table.product tr:first-child {
border-top:2px solid black;
border-bottom:1px solid silver;
div.index_bottom nav ul.pagination li {
border: 1px solid red;
}
/* 상품 리스트 전용 */
div#content table thead th{
white-space: nowrap;
padding-top:15px;
padding-bottom:15px;
font-size: 16px;
font-weight:bold;
border-top:2px solid black;
border-bottom:1px solid silver;
background-color:#F5F5F5;
/* border:1px solid silver; */
div.index_bottom nav ul.pagination li a {
padding: 8px;
}
div#content div.bottom {
padding-top:15px;
text-align:center;
div.index_bottom nav ul.pagination li.active a {
background-color: silver;
color: white;
font-size: 20px;
}
div#content div.bottom ul.pagination {
margin-top:20px;
}
div#content div.bottom ul.pagination li.page-item a{
border:0px;
border-radius:0px !important;
background-color:#e8ebe9;
}
div#content div.bottom ul.pagination li.active a{
background-color:gray;
}