cfmgrv4 innit...1
This commit is contained in:
parent
045f243f20
commit
259761b597
@ -130,12 +130,7 @@ define('AUTH_FIELDS', [
|
|||||||
'TITLE' => 'title',
|
'TITLE' => 'title',
|
||||||
'ROLE' => 'role',
|
'ROLE' => 'role',
|
||||||
]);
|
]);
|
||||||
//DBAction
|
//메신저 관련
|
||||||
define('DB_ACTION', [
|
|
||||||
'CREATE' => 'create',
|
|
||||||
'MODIFY' => 'modify',
|
|
||||||
]);
|
|
||||||
|
|
||||||
define("MESSENGERS", [
|
define("MESSENGERS", [
|
||||||
"skype" => [
|
"skype" => [
|
||||||
"url" => "https://join.skype.com/invite/uKUgXfZThSQC",
|
"url" => "https://join.skype.com/invite/uKUgXfZThSQC",
|
||||||
@ -158,7 +153,6 @@ define("MESSENGERS", [
|
|||||||
"id" => '',
|
"id" => '',
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
|
|
||||||
//아이콘 및 Sound관련
|
//아이콘 및 Sound관련
|
||||||
define('ICONS', [
|
define('ICONS', [
|
||||||
'LOGO' => '<img src="/images/logo/android-icon-48x48.png">',
|
'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>',
|
'IMAGE_FILE' => '<i class="bi bi-file-earmark-image"></i>',
|
||||||
'GOOGLE' => '<i class="fa-brands fa-google"></i>',
|
'GOOGLE' => '<i class="fa-brands fa-google"></i>',
|
||||||
]);
|
]);
|
||||||
|
//배너관련
|
||||||
define('TOP_BANNER', [
|
define('TOP_BANNER', [
|
||||||
'default' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
'default' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
'aboutus' => '<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"/>',
|
'service' => '<img src="/images/banner/sub_visual3.jpg"/>',
|
||||||
'support' => '<img src="/images/banner/sub_visual4.jpg"/>',
|
'support' => '<img src="/images/banner/sub_visual4.jpg"/>',
|
||||||
]);
|
]);
|
||||||
|
//소리관련
|
||||||
define('AUDIOS', [
|
define('AUDIOS', [
|
||||||
'Alram_GetEmail' => '<object width=0 height=0 data="/sound/jarvis_email.mp3" type="audio/mpeg"></object>',
|
'Alram_GetEmail' => '<object width=0 height=0 data="/sound/jarvis_email.mp3" type="audio/mpeg"></object>',
|
||||||
]);
|
]);
|
||||||
|
//Layout관련
|
||||||
define('KEYWORD', '일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버 가상서버');
|
define('KEYWORD', '일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버 가상서버');
|
||||||
define('LAYOUTS', [
|
define('LAYOUTS', [
|
||||||
'empty' => [
|
'empty' => [
|
||||||
|
|||||||
@ -12,13 +12,13 @@ $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}
|
|||||||
//1. app/Filters/AuthFilter.php
|
//1. app/Filters/AuthFilter.php
|
||||||
//2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class]
|
//2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class]
|
||||||
$routes->get('/', 'Home::index');
|
$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->get('/', 'Home::index');
|
||||||
$routes->group('user', function ($routes) {
|
$routes->group('user', function ($routes) {
|
||||||
$routes->get('/', 'UserController::index');
|
$routes->get('/', 'UserController::index');
|
||||||
});
|
});
|
||||||
});
|
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Admin\Cloudflare'], function ($routes) {
|
||||||
$routes->group('cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], function ($routes) {
|
|
||||||
$routes->group('account', function ($routes) {
|
$routes->group('account', function ($routes) {
|
||||||
$routes->get('/', 'AccountController::index');
|
$routes->get('/', 'AccountController::index');
|
||||||
$routes->post('create', 'AccountController::create');
|
$routes->post('create', 'AccountController::create');
|
||||||
@ -32,3 +32,5 @@ $routes->group('cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], func
|
|||||||
$routes->post('create/(:uuid)', 'RecordController::create/$1');
|
$routes->post('create/(:uuid)', 'RecordController::create/$1');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
|||||||
21
app/Controllers/Admin/AdminController.php
Normal file
21
app/Controllers/Admin/AdminController.php
Normal 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();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Controllers\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -8,7 +8,6 @@ use CodeIgniter\HTTP\RequestInterface;
|
|||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
|
||||||
use App\Libraries\MyCloudflare\Account;
|
use App\Libraries\MyCloudflare\Account;
|
||||||
use App\Entities\Cloudflare\AccountEntity;
|
|
||||||
|
|
||||||
class AccountController extends CloudflareController
|
class AccountController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -16,10 +15,10 @@ class AccountController extends CloudflareController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Account";
|
$this->class_name = "Account";
|
||||||
$this->layout = LAYOUTS['admin'];
|
$this->class_path .= $this->class_name;
|
||||||
$this->title = lang("{$this->class_name}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_name);
|
helper($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getMyLibrary(): Account
|
final protected function getMyLibrary(): Account
|
||||||
{
|
{
|
||||||
@ -28,28 +27,13 @@ class AccountController extends CloudflareController
|
|||||||
}
|
}
|
||||||
return $this->_myLibrary;
|
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
|
protected function create_init(): void
|
||||||
{
|
{
|
||||||
|
$this->action = 'create';
|
||||||
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'type', 'status'];
|
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'authkey', 'type', 'status'];
|
||||||
$this->filter_fields = ['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);
|
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
|
||||||
}
|
}
|
||||||
// public function create_form(): RedirectResponse|string
|
// public function create_form(): RedirectResponse|string
|
||||||
@ -70,19 +54,17 @@ class AccountController extends CloudflareController
|
|||||||
$this->validateFormDatas();
|
$this->validateFormDatas();
|
||||||
return parent::create_process();
|
return parent::create_process();
|
||||||
}
|
}
|
||||||
|
public function index(): string
|
||||||
protected function index_init(): void
|
|
||||||
{
|
{
|
||||||
|
$this->action = 'index';
|
||||||
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
|
$this->fields = [$this->getMyLibrary()->getMyStorage()::TITLE, 'oldkey', 'type', 'status', 'updated_at', 'created_at'];
|
||||||
$this->filter_fields = ['type', 'status'];
|
$this->filter_fields = ['type', 'status'];
|
||||||
$this->action = DB_ACTION['CREATE'];
|
$this->batchjob_fields = ['status'];
|
||||||
|
$this->field_rules = $this->getFormFieldRules();
|
||||||
|
$this->field_options = $this->getFormFieldOptions();
|
||||||
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
|
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
}
|
|
||||||
public function index(): string
|
|
||||||
{
|
|
||||||
$this->index_init();
|
|
||||||
return parent::list_process();
|
return parent::list_process();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1,28 +1,25 @@
|
|||||||
<?php
|
<?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\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
abstract class CloudflareController extends AdminController
|
||||||
use App\Models\Cloudflare\API\RecordModel;
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
|
||||||
use App\Traits\AuthTrait;
|
|
||||||
abstract class CloudflareController extends MVController
|
|
||||||
{
|
{
|
||||||
use AuthTrait;
|
|
||||||
private $_accountModel = null;
|
private $_accountModel = null;
|
||||||
private $_zoneModel = null;
|
private $_zoneModel = null;
|
||||||
private $_recordModel = null;
|
private $_recordModel = null;
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name = "Cloudflare/";
|
$this->class_path .= "Cloudflare/";
|
||||||
$this->layout = LAYOUTS['admin'];
|
|
||||||
$this->session = $this->session_AuthTrait();
|
|
||||||
}
|
}
|
||||||
final protected function getAccountModel(): AccountModel
|
final protected function getAccountModel(): AccountModel
|
||||||
{
|
{
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Controllers\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -8,7 +8,6 @@ use CodeIgniter\HTTP\RequestInterface;
|
|||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
|
||||||
use App\Libraries\MyCloudflare\Record;
|
use App\Libraries\MyCloudflare\Record;
|
||||||
use App\Entities\Cloudflare\RecordEntity;
|
|
||||||
|
|
||||||
class RecordController extends CloudflareController
|
class RecordController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -18,9 +17,9 @@ class RecordController extends CloudflareController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Record";
|
$this->class_name = "Record";
|
||||||
$this->layout = LAYOUTS['admin'];
|
$this->class_path .= $this->class_name;
|
||||||
$this->title = lang("{$this->class_name}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_name);
|
helper($this->class_name);
|
||||||
}
|
}
|
||||||
final protected function getMyLibrary(): Record
|
final protected function getMyLibrary(): Record
|
||||||
@ -30,18 +29,18 @@ class RecordController extends CloudflareController
|
|||||||
}
|
}
|
||||||
return $this->_myLibrary;
|
return $this->_myLibrary;
|
||||||
}
|
}
|
||||||
protected function getFormFieldInputOption(string $field, array $options = []): array
|
protected function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case $this->getMyLibrary()->getMyStorage()::PARENT:
|
case $this->getMyLibrary()->getMyStorage()::PARENT:
|
||||||
$options = [
|
|
||||||
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택'
|
|
||||||
];
|
|
||||||
$this->getZoneModel()->where('status', DEFAULTS['STATUS']);
|
$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;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldInputOption($field, $options);
|
$options = parent::getFormFieldOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
@ -74,15 +73,11 @@ class RecordController extends CloudflareController
|
|||||||
}
|
}
|
||||||
protected function create_init(): void
|
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->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);
|
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
|
||||||
}
|
}
|
||||||
// public function create_form(): RedirectResponse|string
|
// public function create_form(): RedirectResponse|string
|
||||||
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace App\Controllers\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
@ -17,9 +17,9 @@ class ZoneController extends CloudflareController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Zone";
|
$this->class_name = "Zone";
|
||||||
$this->layout = LAYOUTS['admin'];
|
$this->class_path .= $this->class_name;
|
||||||
$this->title = lang("{$this->class_name}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_name);
|
helper($this->class_name);
|
||||||
}
|
}
|
||||||
final protected function getMyLibrary(): Zone
|
final protected function getMyLibrary(): Zone
|
||||||
@ -29,43 +29,22 @@ class ZoneController extends CloudflareController
|
|||||||
}
|
}
|
||||||
return $this->_myLibrary;
|
return $this->_myLibrary;
|
||||||
}
|
}
|
||||||
protected function getFormFieldInputOption(string $field, array $options = []): array
|
protected function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case $this->getMyLibrary()->getMyStorage()::PARENT:
|
case $this->getMyLibrary()->getMyStorage()::PARENT:
|
||||||
$options = [
|
|
||||||
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택'
|
|
||||||
];
|
|
||||||
$this->getAccountModel()->where('status', DEFAULTS['STATUS']);
|
$this->getAccountModel()->where('status', DEFAULTS['STATUS']);
|
||||||
$options = $this->getAccountModel()->getFormFieldInputOption($field, $options);
|
$options[$field] = [
|
||||||
break;
|
DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택',
|
||||||
case 'type':
|
...$this->getAccountModel()->getFormFieldOption($field, $options),
|
||||||
case 'proxied':
|
|
||||||
$options = [
|
|
||||||
DEFAULTS['EMPTY'] => lang("Cloudflare/Record.label." . $field) . ' 선택',
|
|
||||||
...lang("Cloudflare/Record.label." . strtoupper($field)),
|
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$options = parent::getFormFieldInputOption($field, $options);
|
$options = parent::getFormFieldOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
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
|
protected function getFormData(string $field): void
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
@ -100,16 +79,11 @@ class ZoneController extends CloudflareController
|
|||||||
}
|
}
|
||||||
protected function create_init(): void
|
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->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);
|
$this->getMyLibrary()->getMyStorage()->setAction($this->action);
|
||||||
}
|
}
|
||||||
// public function create_form(): RedirectResponse|string
|
// public function create_form(): RedirectResponse|string
|
||||||
@ -9,24 +9,24 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
abstract class CommonController extends BaseController
|
abstract class CommonController extends BaseController
|
||||||
{
|
{
|
||||||
private $_attributes = [];
|
private $_viewDatas = [];
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
}
|
}
|
||||||
final public function __get($name)
|
final public function __get($name)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($name, $this->_attributes)) {
|
if (!array_key_exists($name, $this->_viewDatas)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $this->_attributes[$name];
|
return $this->_viewDatas[$name];
|
||||||
}
|
}
|
||||||
final public function __set($name, $value): void
|
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;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,69 +17,40 @@ abstract class MVController extends CommonController
|
|||||||
abstract protected function getMyLibrary(): mixed;
|
abstract protected function getMyLibrary(): mixed;
|
||||||
abstract protected function create_process_submit(): void;
|
abstract protected function create_process_submit(): void;
|
||||||
abstract protected function modify_process_submit(): void;
|
abstract protected function modify_process_submit(): void;
|
||||||
//Field별 Form Input Option용
|
//Field별 Form Option용
|
||||||
protected function getFormFieldInputOption(string $field, array $options): array
|
protected function getFormFieldOption(string $field, array $options): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$options = [
|
$options[$field] = [
|
||||||
"" => lang($this->class_name . '.label.' . $field) . ' 선택',
|
"" => lang($this->class_path . '.label.' . $field) . ' 선택',
|
||||||
...lang($this->class_name . '.' . strtoupper($field)),
|
...lang($this->class_path . '.' . strtoupper($field)),
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// dd($options);
|
// dd($options);
|
||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
//Field별 Form Input용
|
final protected function getFormFieldOptions(array $options = []): array
|
||||||
protected function getFormFieldInput(string $field, string $value, array $inputs): array
|
|
||||||
{
|
{
|
||||||
switch ($field) {
|
foreach ($this->filter_fields as $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) {
|
|
||||||
if (is_array($field)) {
|
if (is_array($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
|
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;
|
return $options;
|
||||||
}
|
|
||||||
//전송된 데이터 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;
|
|
||||||
}
|
}
|
||||||
final protected function getFormFieldRules(array $rules = []): array
|
final protected function getFormFieldRules(array $rules = []): array
|
||||||
{
|
{
|
||||||
foreach ($this->fields as $field) {
|
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;
|
return $rules;
|
||||||
}
|
}
|
||||||
//전송된 데이터
|
//전송된 데이터
|
||||||
@ -140,12 +111,11 @@ abstract class MVController extends CommonController
|
|||||||
{
|
{
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
try {
|
try {
|
||||||
$this->forminputs = $this->getFormFieldInputs();
|
|
||||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return view(
|
return view(
|
||||||
strtolower($this->class_name) . "/create",
|
strtolower($this->class_path) . "/create",
|
||||||
['viewDatas' => $this->getAttributes()]
|
data: ['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
@ -173,12 +143,11 @@ abstract class MVController extends CommonController
|
|||||||
{
|
{
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
try {
|
try {
|
||||||
$this->forminputs = $this->getFormFieldInputs();
|
|
||||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return view(
|
return view(
|
||||||
strtolower($this->class_name) . "/modify",
|
strtolower($this->class_path) . "/modify",
|
||||||
['viewDatas' => $this->getAttributes()]
|
['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
@ -244,7 +213,7 @@ abstract class MVController extends CommonController
|
|||||||
{
|
{
|
||||||
//Page, Per_page필요부분
|
//Page, Per_page필요부분
|
||||||
$this->page = (int)$this->request->getVar('page') ?: 1;
|
$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("" => "줄수선택");
|
$page_options = array("" => "줄수선택");
|
||||||
for ($i = $this->per_page; $i <= $this->total_count; $i += $this->per_page) {
|
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());
|
// dd($this->getMyLibrary()->getMyStorage()->getLastQuery());
|
||||||
return $entitys;
|
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
|
public function list_process(): string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
//URL처리
|
//URL처리
|
||||||
$this->uri = $this->request->getUri();
|
$this->uri = $this->request->getUri();
|
||||||
//입력폼처리
|
|
||||||
$this->list_forminputs = $this->getFormFieldInputs();
|
|
||||||
//List Field Column처리
|
|
||||||
$this->list_field_columns = $this->list_field_columns();
|
|
||||||
|
|
||||||
//total 처리
|
//total 처리
|
||||||
$this->total_count = $this->list_total();
|
$this->total_count = $this->list_total();
|
||||||
//pagenation 처리
|
//pagenation 처리
|
||||||
@ -315,8 +264,8 @@ abstract class MVController extends CommonController
|
|||||||
//setting return_url to session flashdata
|
//setting return_url to session flashdata
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: "");
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: "");
|
||||||
return view(
|
return view(
|
||||||
strtolower($this->class_name) . "/index",
|
strtolower($this->class_path) . "/index",
|
||||||
['viewDatas' => $this->getAttributes()]
|
['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
|
|||||||
@ -11,7 +11,7 @@ class AccountEntity extends CommonEntity
|
|||||||
{
|
{
|
||||||
return "{$this->getPK()}|{$this->getTitle()}|{$this->getAuthKey()}|{$this->attributes['type']}|{$this->attributes['status']}";
|
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];
|
return $this->attributes[AccountModel::PK];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Entities\Cloudflare;
|
namespace App\Entities\Cloudflare;
|
||||||
|
|
||||||
use App\Models\Cloudflare\API\RecordModel;
|
use App\Models\Cloudflare\RecordModel;
|
||||||
use App\Entities\CommonEntity;
|
use App\Entities\CommonEntity;
|
||||||
|
|
||||||
class RecordEntity extends 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']}";
|
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];
|
return $this->attributes[RecordModel::PK];
|
||||||
}
|
}
|
||||||
|
|||||||
@ -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']}";
|
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];
|
return $this->attributes[ZoneModel::PK];
|
||||||
}
|
}
|
||||||
|
|||||||
137
app/Helpers/Admin/Cloudflare/Account_helper.php
Normal file
137
app/Helpers/Admin/Cloudflare/Account_helper.php
Normal 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(" ", $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;
|
||||||
|
}
|
||||||
67
app/Helpers/Admin/Cloudflare/Zone_helper.php
Normal file
67
app/Helpers/Admin/Cloudflare/Zone_helper.php
Normal 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(" ", $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;
|
||||||
|
}
|
||||||
@ -1 +0,0 @@
|
|||||||
<?php
|
|
||||||
@ -7,7 +7,7 @@ return [
|
|||||||
'authkey' => "인증Key",
|
'authkey' => "인증Key",
|
||||||
'oldkey' => "이전인증Key",
|
'oldkey' => "이전인증Key",
|
||||||
'title' => "인증명",
|
'title' => "인증명",
|
||||||
'type' => "가입방식",
|
'type' => "인증방식",
|
||||||
'status' => "상태",
|
'status' => "상태",
|
||||||
'updated_at' => "수정일",
|
'updated_at' => "수정일",
|
||||||
'created_at' => "작성일",
|
'created_at' => "작성일",
|
||||||
@ -4,18 +4,20 @@ namespace App\Libraries;
|
|||||||
|
|
||||||
abstract class CommonLibrary
|
abstract class CommonLibrary
|
||||||
{
|
{
|
||||||
private $_attributes = [];
|
private $_libraryDatas = [];
|
||||||
protected function __construct() {}
|
protected function __construct()
|
||||||
|
{
|
||||||
|
}
|
||||||
final public function __get($name)
|
final public function __get($name)
|
||||||
{
|
{
|
||||||
if (!array_key_exists($name, $this->_attributes)) {
|
if (!array_key_exists($name, $this->_libraryDatas)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return $this->_attributes[$name];
|
return $this->_libraryDatas[$name];
|
||||||
}
|
}
|
||||||
|
|
||||||
final public function __set($name, $value): void
|
final public function __set($name, $value): void
|
||||||
{
|
{
|
||||||
$this->_attributes[$name] = $value;
|
$this->_libraryDatas[$name] = $value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,10 +34,11 @@ class AccountModel extends CommonModel
|
|||||||
$rules[$field] = "required|valid_emailvalid_email|is_unique[cloudflareauth.id]";
|
$rules[$field] = "required|valid_emailvalid_email|is_unique[cloudflareauth.id]";
|
||||||
break;
|
break;
|
||||||
case "authkey":
|
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;
|
break;
|
||||||
case "oldkey":
|
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;
|
break;
|
||||||
case "type":
|
case "type":
|
||||||
$rules[$field] = "if_exist|in_list[standard,enterprise]";
|
$rules[$field] = "if_exist|in_list[standard,enterprise]";
|
||||||
@ -48,12 +49,12 @@ class AccountModel extends CommonModel
|
|||||||
}
|
}
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
public function getFormFieldInputOption(string $field, array $options = []): array
|
public function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$this->orderBy(self::TITLE, 'asc');
|
$this->orderBy(self::TITLE, 'asc');
|
||||||
$options = parent::getFormFieldInputOption($field, $options);
|
$options = parent::getFormFieldOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -30,7 +30,8 @@ class ZoneModel extends CommonModel
|
|||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case self::PARENT:
|
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;
|
break;
|
||||||
case self::TITLE:
|
case self::TITLE:
|
||||||
case "plan":
|
case "plan":
|
||||||
@ -50,15 +51,12 @@ class ZoneModel extends CommonModel
|
|||||||
}
|
}
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
public function getFormFieldInputOption(string $field, array $options = []): array
|
public function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "status":
|
|
||||||
$options[$field] = lang($this->class_name . '.' . strtoupper($field));
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$this->orderBy(self::TITLE, 'asc');
|
$this->orderBy(self::TITLE, 'asc');
|
||||||
$options = parent::getFormFieldInputOption($field, $options);
|
$options = parent::getFormFieldOption($field, $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $options;
|
return $options;
|
||||||
|
|||||||
@ -45,7 +45,7 @@ abstract class CommonModel extends Model
|
|||||||
protected $beforeDelete = [];
|
protected $beforeDelete = [];
|
||||||
protected $afterDelete = [];
|
protected $afterDelete = [];
|
||||||
|
|
||||||
private $_action = DB_ACTION["CREATE"];
|
private $_action = 'create';
|
||||||
protected function __construct()
|
protected function __construct()
|
||||||
{
|
{
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
@ -89,7 +89,7 @@ abstract class CommonModel extends Model
|
|||||||
//수동입력인경우
|
//수동입력인경우
|
||||||
if (!$this->useAutoIncrement) {
|
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] = "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 {
|
} else {
|
||||||
$rules[$field] = "required|numeric";
|
$rules[$field] = "required|numeric";
|
||||||
}
|
}
|
||||||
@ -99,10 +99,10 @@ abstract class CommonModel extends Model
|
|||||||
$rules[$field] = "required|string";
|
$rules[$field] = "required|string";
|
||||||
break;
|
break;
|
||||||
case "passwd":
|
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;
|
break;
|
||||||
case "confirmpassword":
|
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;
|
break;
|
||||||
case "email":
|
case "email":
|
||||||
$rules[$field] = "if_exist|trim|valid_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
|
final public function getFieldRules(array $fields, array $rules = []): array
|
||||||
{
|
{
|
||||||
foreach ($fields as $field) {
|
foreach ($fields as $field) {
|
||||||
|
if (is_array($field)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true));
|
||||||
|
}
|
||||||
$rules = $this->getFieldRule($field, $rules);
|
$rules = $this->getFieldRule($field, $rules);
|
||||||
}
|
}
|
||||||
return $rules;
|
return $rules;
|
||||||
}
|
}
|
||||||
public function getFormFieldInputOption(string $field, array $options = []): array
|
public function getFormFieldOption(string $field, array $options = []): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
@ -204,7 +207,7 @@ abstract class CommonModel extends Model
|
|||||||
final protected function create_process($entity, array $formDatas): mixed
|
final protected function create_process($entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
//Field에 맞는 Validation Rule 재정의
|
//Field에 맞는 Validation Rule 재정의
|
||||||
$this->setAction(DB_ACTION['CREATE']);
|
$this->setAction('create');
|
||||||
$this->setValidationRules($this->getFieldRules($this->allowedFields));
|
$this->setValidationRules($this->getFieldRules($this->allowedFields));
|
||||||
//저장하기 전에 데이터 값 변경이 필요한 Field
|
//저장하기 전에 데이터 값 변경이 필요한 Field
|
||||||
foreach (array_keys($formDatas) as $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
|
final protected function modify_process($entity, array $formDatas): mixed
|
||||||
{
|
{
|
||||||
//Field에 맞는 Validation Rule 재정의
|
//Field에 맞는 Validation Rule 재정의
|
||||||
$this->setAction(DB_ACTION['MODIFY']);
|
$this->setAction('modify');
|
||||||
$this->setValidationRules($this->getFieldRules($this->allowedFields));
|
$this->setValidationRules($this->getFieldRules($this->allowedFields));
|
||||||
//저장하기 전에 데이터 값 변경이 필요한 Field
|
//저장하기 전에 데이터 값 변경이 필요한 Field
|
||||||
foreach (array_keys($formDatas) as $field) {
|
foreach (array_keys($formDatas) as $field) {
|
||||||
|
|||||||
@ -5,9 +5,9 @@
|
|||||||
<table class="form table table-bordered table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= lang($viewDatas['class_name'] . '.label.' . $field) ?></td>
|
<td class="label"><?= getFieldLabel_AccountHelper($field, $viewDatas) ?></td>
|
||||||
<td class="column">
|
<td class="column">
|
||||||
<?= $viewDatas['forminputs'][$field] ?>
|
<?= getFieldForm_AccountHelper($field, old($field), $viewDatas) ?>
|
||||||
<?= validation_show_error($field); ?>
|
<?= validation_show_error($field); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
68
app/Views/admin/cloudflare/account/index.php
Normal file
68
app/Views/admin/cloudflare/account/index.php
Normal 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() ?>
|
||||||
@ -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() ?>
|
|
||||||
@ -6,10 +6,10 @@
|
|||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
<title><?= $viewDatas['title'] ?></title>
|
<title><?= $viewDatas['title'] ?></title>
|
||||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet): ?>
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
|
||||||
<?= $stylesheet ?>
|
<?= $stylesheet ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript): ?>
|
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
|
||||||
<?= $javascript ?>
|
<?= $javascript ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
@ -24,20 +24,16 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="layout">
|
<div class="layout">
|
||||||
<div class="head">
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/head'); ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/head'); ?>
|
|
||||||
</div>
|
|
||||||
<div class="center">
|
<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="content">
|
||||||
<div class="header"><?= $this->include('templates/admin/header'); ?></div>
|
<div class="header"><?= $this->include('templates/admin/header'); ?></div>
|
||||||
<div class="center"><?= $this->renderSection('content') ?></div>
|
<div class="center"><?= $this->renderSection('content') ?></div>
|
||||||
<div class="footer"><?= $this->include('templates/admin/footer'); ?></div>
|
<div class="footer"><?= $this->include('templates/admin/footer'); ?></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tail">
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/tail'); ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/tail'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
|
|||||||
@ -1,19 +1,41 @@
|
|||||||
<nav class="navbar navbar-expand-lg">
|
<nav class="head navbar navbar-expand-lg">
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
<nav class="nav">
|
<nav class="nav"><a class="navbar-brand" href="#">관리페이지</a></nav>
|
||||||
<a class="navbar-brand" href="#">관리페이지</a>
|
|
||||||
</nav>
|
|
||||||
<ul class="nav justify-content-center">
|
<ul class="nav justify-content-center">
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/head/make_password'); ?>
|
<?= ICONS['LOCK'] ?>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<ul class="nav justify-content-end">
|
<ul class="nav justify-content-end">
|
||||||
<li class="nav-item">
|
<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>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -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>
|
|
||||||
@ -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>
|
|
||||||
@ -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>
|
|
||||||
@ -6,9 +6,9 @@
|
|||||||
<div class="accordion-item" style="background-color: #eaeaea;">
|
<div class="accordion-item" style="background-color: #eaeaea;">
|
||||||
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
|
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/base'); ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/site'); ?>
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/site'); ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?>
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu/shoppingmall'); ?>
|
||||||
</div>
|
</div>
|
||||||
<div id="menu_button">메뉴열기</div>
|
<div id="menu_button">메뉴열기</div>
|
||||||
</div>
|
</div>
|
||||||
@ -0,0 +1,3 @@
|
|||||||
|
<nav class="tail navbar navbar-expand-lg">
|
||||||
|
|
||||||
|
</nav>
|
||||||
@ -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>
|
|
||||||
@ -15,25 +15,24 @@ body {
|
|||||||
background-color: #efefef;
|
background-color: #efefef;
|
||||||
/* border:1px solid blue; */
|
/* border:1px solid blue; */
|
||||||
}
|
}
|
||||||
div.layout > div.head {
|
div.layout > nav.head {
|
||||||
height: 51px;
|
height: 51px;
|
||||||
border: 1px solid gray;
|
border-top: 1px solid gray;
|
||||||
|
border-bottom: 1px solid gray;
|
||||||
background-color: #f8f9fa;
|
background-color: #f8f9fa;
|
||||||
}
|
}
|
||||||
div.layout > div.tail {
|
div.layout > nav.tail {
|
||||||
height: 51px;
|
height: 51px;
|
||||||
position: fixed;
|
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
background-color: lightgray;
|
background-color: silver;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.layout > div.center > div.content {
|
div.layout > div.center > div.content {
|
||||||
margin-top: 20px;
|
margin: 25px 0px 25px 25px;
|
||||||
margin-left: 25px;
|
|
||||||
margin-right: 20px;
|
|
||||||
}
|
}
|
||||||
div.layout > div.center > div.content > div.header {
|
div.layout > div.center > div.content > div.header {
|
||||||
/*content 헤더라인*/
|
/*content 헤더라인*/
|
||||||
|
|||||||
@ -1,72 +1,45 @@
|
|||||||
div#content{
|
|
||||||
color:black;
|
|
||||||
padding-top:20px;
|
|
||||||
margin-bottom:40px;
|
|
||||||
/* border-left:1px solid silver;
|
|
||||||
border-right:1px solid silver; */
|
|
||||||
}
|
|
||||||
/* div#content div.top{
|
|
||||||
border:1px solid red;
|
|
||||||
} */
|
|
||||||
|
|
||||||
/*페이지정보*/
|
|
||||||
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; */
|
|
||||||
}
|
|
||||||
/*검색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; */
|
|
||||||
}
|
|
||||||
/*Excel Icon*/
|
|
||||||
div#content div.top nav a{
|
|
||||||
border-radius:0px !important;
|
|
||||||
/* border:1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Table 부분 */
|
|
||||||
div#content table {
|
|
||||||
width:100%;
|
|
||||||
/* overflow-x: auto;
|
|
||||||
padding-top:5px;
|
|
||||||
padding-bottom:5px; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* insert,update,reply,view Form Page 관련 전용*/
|
/* insert,update,reply,view Form Page 관련 전용*/
|
||||||
div#content table.form tbody tr td.label{
|
table.form.tbody tr td.label {
|
||||||
width: 10%;
|
width: 10%;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding-right: 20px;
|
padding-right: 20px;
|
||||||
background-color: #e8ebe9;
|
background-color: #e8ebe9;
|
||||||
}
|
}
|
||||||
div#content table.form tbody tr td.column{
|
table.form tbody tr td.column {
|
||||||
height: 27px;
|
height: 27px;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
padding-left: 20px;
|
padding-left: 20px;
|
||||||
}
|
}
|
||||||
/* insert,update,reply,view Form Page 관련 전용*/
|
/* insert,update,reply,view Form Page 관련 전용*/
|
||||||
|
|
||||||
/* 상품 리스트 전용 */
|
/*검색*/
|
||||||
div#content table.product tr:first-child {
|
nav.index_top input[type="text"] {
|
||||||
border-top:2px solid black;
|
width: 200px;
|
||||||
border-bottom:1px solid silver;
|
height: 40px;
|
||||||
}
|
}
|
||||||
/* 상품 리스트 전용 */
|
/*검색submit*/
|
||||||
|
nav.index_top input[type="submit"] {
|
||||||
div#content table thead th{
|
font-size: 12px;
|
||||||
|
font-weight: bold;
|
||||||
|
width: 80px;
|
||||||
|
height: 40px;
|
||||||
|
color: white;
|
||||||
|
background-color: #555555;
|
||||||
|
}
|
||||||
|
/*페이지정보*/
|
||||||
|
nav.index_top nav.pageinfo {
|
||||||
|
float: right;
|
||||||
|
font-weight: bold;
|
||||||
|
border-color: 1px solid red;
|
||||||
|
}
|
||||||
|
/* Table 부분 */
|
||||||
|
table.index_table {
|
||||||
|
width: 100%;
|
||||||
|
/* overflow-x: auto;
|
||||||
|
padding-top:5px;
|
||||||
|
padding-bottom:5px; */
|
||||||
|
}
|
||||||
|
table.index_table thead th {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
@ -74,22 +47,31 @@ div#content table thead th{
|
|||||||
font-weight: bold;
|
font-weight: bold;
|
||||||
border-top: 2px solid black;
|
border-top: 2px solid black;
|
||||||
border-bottom: 1px solid silver;
|
border-bottom: 1px solid silver;
|
||||||
background-color:#F5F5F5;
|
background-color: #f5f5f5;
|
||||||
|
text-align: center;
|
||||||
/* border:1px solid silver; */
|
/* border:1px solid silver; */
|
||||||
}
|
}
|
||||||
|
div.index_bottom {
|
||||||
div#content div.bottom {
|
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
text-align:center;
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
div#content div.bottom ul.pagination {
|
|
||||||
|
div.index_bottom nav ul.pagination {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
}
|
}
|
||||||
div#content div.bottom ul.pagination li.page-item a{
|
div.index_bottom nav ul.pagination {
|
||||||
border:0px;
|
display: inline-block; /* ul이 줄바꿈이 되지 않도록 설정 */
|
||||||
border-radius:0px !important;
|
padding: 0;
|
||||||
background-color:#e8ebe9;
|
list-style: none; /* 기본 점 스타일 제거 (옵션) */
|
||||||
}
|
}
|
||||||
div#content div.bottom ul.pagination li.active a{
|
div.index_bottom nav ul.pagination li {
|
||||||
background-color:gray;
|
border: 1px solid red;
|
||||||
|
}
|
||||||
|
div.index_bottom nav ul.pagination li a {
|
||||||
|
padding: 8px;
|
||||||
|
}
|
||||||
|
div.index_bottom nav ul.pagination li.active a {
|
||||||
|
background-color: silver;
|
||||||
|
color: white;
|
||||||
|
font-size: 20px;
|
||||||
}
|
}
|
||||||
Loading…
Reference in New Issue
Block a user