Automation init...4
This commit is contained in:
parent
522b170463
commit
d35a2124b8
@ -35,11 +35,11 @@ defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.
|
||||
*/
|
||||
defined('SECOND') || define('SECOND', 1);
|
||||
defined('MINUTE') || define('MINUTE', 60);
|
||||
defined('HOUR') || define('HOUR', 3600);
|
||||
defined('DAY') || define('DAY', 86400);
|
||||
defined('WEEK') || define('WEEK', 604800);
|
||||
defined('MONTH') || define('MONTH', 2_592_000);
|
||||
defined('YEAR') || define('YEAR', 31_536_000);
|
||||
defined('HOUR') || define('HOUR', 3600);
|
||||
defined('DAY') || define('DAY', 86400);
|
||||
defined('WEEK') || define('WEEK', 604800);
|
||||
defined('MONTH') || define('MONTH', 2_592_000);
|
||||
defined('YEAR') || define('YEAR', 31_536_000);
|
||||
defined('DECADE') || define('DECADE', 315_360_000);
|
||||
|
||||
/*
|
||||
@ -67,16 +67,16 @@ defined('DECADE') || define('DECADE', 315_360_000);
|
||||
| http://tldp.org/LDP/abs/html/exitcodes.html
|
||||
|
|
||||
*/
|
||||
defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors
|
||||
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
|
||||
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error
|
||||
defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
defined('EXIT_SUCCESS') || define('EXIT_SUCCESS', 0); // no errors
|
||||
defined('EXIT_ERROR') || define('EXIT_ERROR', 1); // generic error
|
||||
defined('EXIT_CONFIG') || define('EXIT_CONFIG', 3); // configuration error
|
||||
defined('EXIT_UNKNOWN_FILE') || define('EXIT_UNKNOWN_FILE', 4); // file not found
|
||||
defined('EXIT_UNKNOWN_CLASS') || define('EXIT_UNKNOWN_CLASS', 5); // unknown class
|
||||
defined('EXIT_UNKNOWN_METHOD') || define('EXIT_UNKNOWN_METHOD', 6); // unknown class member
|
||||
defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
|
||||
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
|
||||
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
||||
defined('EXIT_USER_INPUT') || define('EXIT_USER_INPUT', 7); // invalid user input
|
||||
defined('EXIT_DATABASE') || define('EXIT_DATABASE', 8); // database error
|
||||
defined('EXIT__AUTO_MIN') || define('EXIT__AUTO_MIN', 9); // lowest automatically-assigned error code
|
||||
defined('EXIT__AUTO_MAX') || define('EXIT__AUTO_MAX', 125); // highest automatically-assigned error code
|
||||
|
||||
/**
|
||||
* @deprecated Use \CodeIgniter\Events\Events::PRIORITY_LOW instead.
|
||||
@ -95,16 +95,16 @@ define('EVENT_PRIORITY_HIGH', 10);
|
||||
|
||||
//Default값 정의
|
||||
define('DEFAULTS', [
|
||||
'ROLE' => "guest",
|
||||
'STATUS' => "use",
|
||||
'EMPTY' => "",
|
||||
'PERPAGE' => 20,
|
||||
'ROLE' => "guest",
|
||||
'STATUS' => "use",
|
||||
'EMPTY' => "",
|
||||
'PERPAGE' => 20,
|
||||
'DELIMITER_FILE' => "||",
|
||||
'DELIMITER_ROLE' => ",",
|
||||
]);
|
||||
//URL
|
||||
define('URLS', [
|
||||
'LOGIN' => '/user/login',
|
||||
'LOGIN' => '/user/login',
|
||||
'SIGNUP' => '/user/signup',
|
||||
'LOGOUT' => '/user/logout',
|
||||
]);
|
||||
@ -122,14 +122,14 @@ define('ROLES', [
|
||||
define('SESSION_NAMES', [
|
||||
'RETURN_URL' => "return_url",
|
||||
'RETURN_MSG' => "return_message",
|
||||
'ISLOGIN' => "islogined",
|
||||
'AUTH' => 'auth',
|
||||
'ISLOGIN' => "islogined",
|
||||
'AUTH' => 'auth',
|
||||
]);
|
||||
//인증 관련
|
||||
define('AUTH_FIELDS', [
|
||||
'ID' => 'id',
|
||||
'ID' => 'id',
|
||||
'TITLE' => 'title',
|
||||
'ROLE' => 'role'
|
||||
'ROLE' => 'role',
|
||||
]);
|
||||
//DBAction
|
||||
define('DB_ACTION', [
|
||||
@ -138,63 +138,66 @@ define('DB_ACTION', [
|
||||
]);
|
||||
|
||||
define("MESSENGERS", [
|
||||
"skype" => [
|
||||
"url" => "https://join.skype.com/invite/uKUgXfZThSQC",
|
||||
"skype" => [
|
||||
"url" => "https://join.skype.com/invite/uKUgXfZThSQC",
|
||||
"icon" => '<img src="/images/common/top_skype.png" alt="스카이프">',
|
||||
"id" => ''
|
||||
"id" => '',
|
||||
],
|
||||
"discord" => [
|
||||
"url" => "https://discord.gg/k6nQg84N",
|
||||
"discord" => [
|
||||
"url" => "https://discord.gg/k6nQg84N",
|
||||
"icon" => '<img src="/images/common/discord.png" alt="디스코드">',
|
||||
"id" => ''
|
||||
"id" => '',
|
||||
],
|
||||
"telegram" => [
|
||||
"url" => "https://t.me/daemonidc",
|
||||
"telegram" => [
|
||||
"url" => "https://t.me/daemonidc",
|
||||
"icon" => '<img src="/images/common/telegram.png" alt="텔레그램">',
|
||||
"id" => '@daemonidc'
|
||||
"id" => '@daemonidc',
|
||||
],
|
||||
"kakaotalk" => [
|
||||
"url" => "https://t.me/daemonidc",
|
||||
"url" => "https://t.me/daemonidc",
|
||||
"icon" => '<img src="/images/common/kakaotalk.png" alt="카카오톡">',
|
||||
"id" => ''
|
||||
]
|
||||
"id" => '',
|
||||
],
|
||||
]);
|
||||
|
||||
//아이콘 및 Sound관련
|
||||
define('ICONS', [
|
||||
'LOGO' => '<img src="/images/logo/android-icon-48x48.png">',
|
||||
'LOGIN' => '<i class="bi bi-shield-check"></i>',
|
||||
'LOGOUT' => '<i class="bi bi-sign-stop-fill"></i>',
|
||||
'LOCK' => '<i class="bi bi-shield-lock"></i>',
|
||||
'NEW' => '<i class="bi bi-database-add"></i>',
|
||||
'REPLY' => '<i class="bi bi-arrow-return-right"></i>',
|
||||
'DELETE' => '<i class="bi bi-trash"></i>',
|
||||
'RELOAD' => '<i class="bi bi-repeat"></i>',
|
||||
'SETUP' => '<i class="bi bi-gear"></i>',
|
||||
'FLAG' => '<i class="bi bi-send"></i>',
|
||||
'SEARCH' => '<i class="bi bi-search"></i>',
|
||||
'EXCEL' => '<img src="/images/common/excel.png"/>',
|
||||
'HOME' => '<i class="bi bi-house-door-fill"></i>',
|
||||
'PLAY' => '<i class="bi bi-play-fill"></i>',
|
||||
'CART' => '<i class="bi bi-cart4"></i>',
|
||||
'CARD' => '<i class="bi bi-credit-card"></i>',
|
||||
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
|
||||
'UP' => '<i class="bi bi-arrow-up"></i>',
|
||||
'DOWN' => '<i class="bi bi-arrow-down"></i>',
|
||||
'LEFT' => '<i class="bi bi-arrow-left"></i>',
|
||||
'RIGHT' => '<i class="bi bi-arrow-right"></i>',
|
||||
'IMAGE_FILE' => '<i class="bi bi-file-earmark-image"></i>',
|
||||
'GOOGLE' => '<i class="fa-brands fa-google"></i>',
|
||||
'LOGO' => '<img src="/images/logo/android-icon-48x48.png">',
|
||||
'LOGIN' => '<i class="bi bi-shield-check"></i>',
|
||||
'LOGOUT' => '<i class="bi bi-sign-stop-fill"></i>',
|
||||
'HOME' => '<i class="bi bi-house"></i>',
|
||||
'MENU' => '<i class="bi bi-menu-button"></i>',
|
||||
'LOCK' => '<i class="bi bi-shield-lock"></i>',
|
||||
'NEW' => '<i class="bi bi-database-add"></i>',
|
||||
'REPLY' => '<i class="bi bi-arrow-return-right"></i>',
|
||||
'DELETE' => '<i class="bi bi-trash"></i>',
|
||||
'RELOAD' => '<i class="bi bi-repeat"></i>',
|
||||
'SETUP' => '<i class="bi bi-gear"></i>',
|
||||
'FLAG' => '<i class="bi bi-send"></i>',
|
||||
'SEARCH' => '<i class="bi bi-search"></i>',
|
||||
'EXCEL' => '<img src="/images/common/excel.png"/>',
|
||||
'HOME' => '<i class="bi bi-house-door-fill"></i>',
|
||||
'PLAY' => '<i class="bi bi-play-fill"></i>',
|
||||
'CART' => '<i class="bi bi-cart4"></i>',
|
||||
'CARD' => '<i class="bi bi-credit-card"></i>',
|
||||
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
|
||||
'DESKTOP' => '<i class="bi bi-pc-display-horizontal"></i>',
|
||||
'UP' => '<i class="bi bi-arrow-up"></i>',
|
||||
'DOWN' => '<i class="bi bi-arrow-down"></i>',
|
||||
'LEFT' => '<i class="bi bi-arrow-left"></i>',
|
||||
'RIGHT' => '<i class="bi bi-arrow-right"></i>',
|
||||
'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"/>',
|
||||
'member' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||
'hosting' => '<img src="/images/banner/sub_visual2.jpg"/>',
|
||||
'default' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||
'aboutus' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||
'member' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||
'hosting' => '<img src="/images/banner/sub_visual2.jpg"/>',
|
||||
'serverdevice' => '<img src="/images/banner/sub_visual3.jpg"/>',
|
||||
'service' => '<img src="/images/banner/sub_visual3.jpg"/>',
|
||||
'support' => '<img src="/images/banner/sub_visual4.jpg"/>',
|
||||
'service' => '<img src="/images/banner/sub_visual3.jpg"/>',
|
||||
'support' => '<img src="/images/banner/sub_visual4.jpg"/>',
|
||||
]);
|
||||
|
||||
define('AUDIOS', [
|
||||
@ -204,7 +207,7 @@ define('AUDIOS', [
|
||||
define('KEYWORD', '일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버 가상서버');
|
||||
define('LAYOUTS', [
|
||||
'empty' => [
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'empty',
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'empty',
|
||||
'stylesheets' => [
|
||||
'<link rel="icon" href="/favicon.ico">',
|
||||
'<link href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">',
|
||||
@ -212,14 +215,14 @@ define('LAYOUTS', [
|
||||
],
|
||||
'javascripts' => [
|
||||
'<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>',
|
||||
]
|
||||
],
|
||||
],
|
||||
'front' => [
|
||||
'title' => KEYWORD,
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'front',
|
||||
'title' => KEYWORD,
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'front',
|
||||
//'topmenus' => ['aboutus', 'hosting', 'serverdevice', 'service', 'support'],
|
||||
'topmenus' => ['aboutus', 'hosting', 'service', 'support'],
|
||||
'metas' => [
|
||||
'topmenus' => ['aboutus', 'hosting', 'service', 'support'],
|
||||
'metas' => [
|
||||
'<meta charset="utf-8">',
|
||||
'<meta http-equiv="X-UA-Compatible" content="IE=Edge">',
|
||||
'<meta name="viewport" id="viewport" content="width=1280">',
|
||||
@ -250,8 +253,8 @@ define('LAYOUTS', [
|
||||
],
|
||||
],
|
||||
'admin' => [
|
||||
'title' => '관리자화면',
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'admin',
|
||||
'title' => '관리자화면',
|
||||
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'admin',
|
||||
'stylesheets' => [
|
||||
'<link rel="icon" href="/favicon.ico">',
|
||||
'<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">',
|
||||
@ -268,6 +271,6 @@ define('LAYOUTS', [
|
||||
'<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>',
|
||||
'<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>',
|
||||
'<script src="/vendors/tinymce/tinymce/tinymce.js" referrerpolicy="origin"></script>',
|
||||
]
|
||||
],
|
||||
],
|
||||
]);
|
||||
|
||||
@ -41,7 +41,7 @@ abstract class BaseController extends Controller
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
* The creation of dynamic property is deprecated in PHP 8.2.
|
||||
*/
|
||||
protected $session;
|
||||
// protected $session;
|
||||
|
||||
/**
|
||||
* @return void
|
||||
|
||||
@ -3,12 +3,12 @@
|
||||
namespace App\Controllers\Cloudflare;
|
||||
|
||||
use App\Controllers\MVController;
|
||||
use App\Libraries\MyCloudflare\Account;
|
||||
use Psr\Log\LoggerInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
|
||||
use App\Libraries\MyCloudflare\Account;
|
||||
use App\Traits\AuthTrait;
|
||||
use App\Models\Cloudflare\AccountModel;
|
||||
use App\Entities\Cloudflare\AccountEntity;
|
||||
@ -20,9 +20,10 @@ class AccountController extends MVController
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->session = $this->session_AuthTrait();
|
||||
$this->class_name = 'Account';
|
||||
$this->view_path = 'cloudflare';
|
||||
$this->class_name = "Cloudflare/Account";
|
||||
$this->layout = LAYOUTS['admin'];
|
||||
$this->title = lang("{$this->class_name}.title");
|
||||
$this->session = $this->session_AuthTrait();
|
||||
helper($this->class_name);
|
||||
}
|
||||
final protected function getModel(): AccountModel
|
||||
@ -34,9 +35,9 @@ class AccountController extends MVController
|
||||
}
|
||||
protected function create_init(): void
|
||||
{
|
||||
$this->fields = [$this->getModel()::TITLE, 'apikey', 'status'];
|
||||
$this->fields = [$this->getModel()::TITLE, 'apikey', 'status'];
|
||||
$this->filter_fields = ['status'];
|
||||
$this->action = DB_ACTION["CREATE"];
|
||||
$this->action = DB_ACTION["CREATE"];
|
||||
$this->getModel()->setAction($this->action);
|
||||
}
|
||||
public function create_form(): RedirectResponse|string
|
||||
|
||||
@ -9,9 +9,9 @@ use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\RedirectResponse;
|
||||
use App\Traits\AuthTrait;
|
||||
|
||||
use App\Libraries\MyCloudflare\Zone;
|
||||
use App\Models\Cloudflare\ZoneModel;
|
||||
use App\Models\Cloudflare\AccountModel;
|
||||
use App\Libraries\MyCloudflare\Zone;
|
||||
use App\Entities\Cloudflare\ZoneEntity;
|
||||
|
||||
class ZoneController extends MVController
|
||||
@ -23,7 +23,7 @@ class ZoneController extends MVController
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->session = $this->session_AuthTrait();
|
||||
$this->class_name = 'Zone';
|
||||
$this->class_name = "Zone";
|
||||
helper($this->class_name);
|
||||
}
|
||||
final protected function getModel(): ZoneModel
|
||||
|
||||
@ -12,6 +12,7 @@ abstract class MVController extends CommonController
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
parent::initController($request, $response, $logger);
|
||||
helper('common');
|
||||
}
|
||||
abstract protected function create_init(): void;
|
||||
abstract protected function getModel(): mixed;
|
||||
@ -26,7 +27,7 @@ abstract class MVController extends CommonController
|
||||
}
|
||||
$options = [
|
||||
["" => lang($this->class_name . '.label.' . $field) . ' 선택'],
|
||||
lang($this->class_name . '.' . strtoupper($field))
|
||||
lang($this->class_name . '.' . strtoupper($field)),
|
||||
];
|
||||
break;
|
||||
}
|
||||
@ -69,7 +70,8 @@ abstract class MVController extends CommonController
|
||||
}
|
||||
switch ($field) {
|
||||
default:
|
||||
$rules[$field] = $this->_model->getFieldRule($field, $rules);;
|
||||
$rules[$field] = $this->_model->getFieldRule($field, $rules);
|
||||
;
|
||||
break;
|
||||
}
|
||||
return $rules;
|
||||
@ -116,8 +118,9 @@ abstract class MVController extends CommonController
|
||||
$this->create_init();
|
||||
$this->forminputs = $this->getFormFieldInputs();
|
||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
return view(
|
||||
$this->view_path . "/" . strtolower($this->class_name) . "/create",
|
||||
strtolower($this->class_name) . "/create",
|
||||
['viewDatas' => $this->getAttributes()]
|
||||
);
|
||||
} catch (\Exception $e) {
|
||||
@ -140,12 +143,12 @@ abstract class MVController extends CommonController
|
||||
}
|
||||
$entity = $this->create_process_submit();
|
||||
log_message("notice", __FUNCTION__ . "=>{$entity->getTitle()} 작업을 완료하였습니다.");
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
//Transaction Rollback
|
||||
$this->getModel()->transRollback();
|
||||
log_message("error", $e->getMessage());
|
||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage());
|
||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage());
|
||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return redirect()->back()->withInput();
|
||||
}
|
||||
|
||||
1
app/Helpers/Cloudflare/Account_helper.php
Normal file
1
app/Helpers/Cloudflare/Account_helper.php
Normal file
@ -0,0 +1 @@
|
||||
<?php
|
||||
223
app/Helpers/Common_helper.php
Normal file
223
app/Helpers/Common_helper.php
Normal file
@ -0,0 +1,223 @@
|
||||
<?php
|
||||
//로그인체크 한후 권한체크
|
||||
function isRole_CommonHelper(array $userRoles, $categoryEntity, $roleField = 'isaccess')
|
||||
{
|
||||
return in_array($categoryEntity->getRole($roleField), $userRoles);
|
||||
}
|
||||
|
||||
function getValueByKey_CommonHelper($key, array $attributes)
|
||||
{
|
||||
$options = array();
|
||||
$replace_attributes = array();
|
||||
foreach ($attributes as $idx => $value) {
|
||||
if ($idx == $key) {
|
||||
$replace_attributes[$idx] = $value;
|
||||
} else {
|
||||
array_push($options, $value);
|
||||
}
|
||||
}
|
||||
return array($replace_attributes, $options);
|
||||
}
|
||||
|
||||
function getRandomString_CommonHelper($length = 10, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||
{
|
||||
return substr(str_shuffle($characters), 0, $length);
|
||||
}
|
||||
function getPasswordString_CommonHelper($length = 8)
|
||||
{
|
||||
return getRandomString_CommonHelper($length, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?");
|
||||
} //
|
||||
|
||||
//byte값을 알아보기 쉽게 변환
|
||||
function getSizeForHuman_CommonHelper($bytes)
|
||||
{
|
||||
$ext = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||
$unitCount = 0;
|
||||
for (; $bytes > 1024; $unitCount++) {
|
||||
$bytes /= 1024;
|
||||
}
|
||||
return floor($bytes) . $ext[$unitCount];
|
||||
} //
|
||||
|
||||
//Proxy등을 통하여 Client_IP가 알수없는경우 실제사용자의 IP를 가져오기 위한것
|
||||
function getClientIP_CommonHelper($clientIP = false)
|
||||
{
|
||||
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
||||
$clientIP = $_SERVER['HTTP_CLIENT_IP'];
|
||||
} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||
} else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
|
||||
$clientIP = $_SERVER['HTTP_X_FORWARDED'];
|
||||
} else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
||||
$clientIP = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||
} else if (isset($_SERVER['HTTP_FORWARDED'])) {
|
||||
$clientIP = $_SERVER['HTTP_FORWARDED'];
|
||||
} else if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||
$clientIP = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
return $clientIP;
|
||||
} //
|
||||
|
||||
function isDomain_CommonHelper(string $domain): bool
|
||||
{
|
||||
$parttern_validation = '/((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])*/';
|
||||
return preg_match("$parttern_validation", $domain);
|
||||
}
|
||||
|
||||
function isIPAddress_CommonHelper(string $ip, $type = false): bool
|
||||
{
|
||||
switch ($type) {
|
||||
case 'ipv4':
|
||||
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
|
||||
break;
|
||||
case 'ipv6':
|
||||
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
|
||||
break;
|
||||
case 'all':
|
||||
return filter_var($ip, FILTER_VALIDATE_IP);
|
||||
break;
|
||||
default:
|
||||
return filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function isHost_CommonHelper(string $host): bool
|
||||
{
|
||||
$parttern_validation = '/[a-zA-Z0-9\.\/\?\:@\*\-_=#]/';
|
||||
return preg_match($parttern_validation, $host);
|
||||
}
|
||||
//(EX:192.168.1.0 -> 192.168.001.000)
|
||||
function convertIPV4toCIDR_CommonHelper($cidr)
|
||||
{
|
||||
$temps = explode(".", $cidr);
|
||||
return sprintf("%03d.%03d.%03d.%03d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
||||
} //
|
||||
//(EX:192.168.001.0000 -> 192.168.1.0)
|
||||
function convertCIDRtoIPV4_CommonHelper($ipv4)
|
||||
{
|
||||
$temps = explode(".", $ipv4);
|
||||
return sprintf("%d.%d.%d.%d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
||||
} //
|
||||
function isMobile_CommonHelper()
|
||||
{
|
||||
// Check the server headers to see if they're mobile friendly
|
||||
if (isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
|
||||
return true;
|
||||
}
|
||||
// If the http_accept header supports wap then it's a mobile too
|
||||
if (preg_match("/wap\.|\.wap/i", $_SERVER["HTTP_ACCEPT"])) {
|
||||
return true;
|
||||
}
|
||||
// Still no luck? Let's have a look at the user agent on the browser. If it contains
|
||||
// any of the following, it's probably a mobile device. Kappow!
|
||||
if (isset($_SERVER["HTTP_USER_AGENT"])) {
|
||||
$user_agents = array("midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
|
||||
foreach ($user_agents as $user_string) {
|
||||
if (preg_match("/" . $user_string . "/i", $_SERVER["HTTP_USER_AGENT"])) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
|
||||
if (preg_match("/iphone/i", $_SERVER["HTTP_USER_AGENT"])) {
|
||||
return false;
|
||||
}
|
||||
// None of the above? Then it's probably not a mobile device.
|
||||
return false;
|
||||
} //
|
||||
|
||||
function alert_CommonHelper(string $msg, $url = null)
|
||||
{
|
||||
$msg = preg_replace("/\r/", "\\r", $msg);
|
||||
$msg = preg_replace("/\n/", "\\n", $msg);
|
||||
$msg = preg_replace("/\'/", "\'", $msg);
|
||||
$msg = preg_replace("/\"/", "\'", $msg);
|
||||
$msg = "alert(\"{$msg}\");";
|
||||
switch ($url) {
|
||||
case 'close':
|
||||
$msg .= "window.close();";
|
||||
break;
|
||||
case 'back':
|
||||
$msg .= "history.back();";
|
||||
break;
|
||||
default:
|
||||
$msg .= $url ? "location.href=\"{$url}\";" : "";
|
||||
break;
|
||||
}
|
||||
return "<script type=\"text/javascript\">{$msg}</script>";
|
||||
} //
|
||||
|
||||
// STATUS가 use가 아닐때 option을 disabled되게 하기위함 (override form_dropdown)
|
||||
function form_dropdown_test($data = '', $options = [], $selected = [], $extra = ''): string
|
||||
{
|
||||
$defaults = [];
|
||||
if (is_array($data)) {
|
||||
if (isset($data['selected'])) {
|
||||
$selected = $data['selected'];
|
||||
unset($data['selected']); // select tags don't have a selected attribute
|
||||
}
|
||||
if (isset($data['options'])) {
|
||||
$options = $data['options'];
|
||||
unset($data['options']); // select tags don't use an options attribute
|
||||
}
|
||||
} else {
|
||||
$defaults = ['name' => $data];
|
||||
}
|
||||
|
||||
if (!is_array($selected)) {
|
||||
$selected = [$selected];
|
||||
}
|
||||
if (!is_array($options)) {
|
||||
$options = [$options];
|
||||
}
|
||||
|
||||
// If no selected state was submitted we will attempt to set it automatically
|
||||
if (empty($selected)) {
|
||||
if (is_array($data)) {
|
||||
if (isset($data['name'], $_POST[$data['name']])) {
|
||||
$selected = [$_POST[$data['name']]];
|
||||
}
|
||||
} elseif (isset($_POST[$data])) {
|
||||
$selected = [$_POST[$data]];
|
||||
}
|
||||
}
|
||||
|
||||
// Standardize selected as strings, like the option keys will be
|
||||
foreach ($selected as $key => $item) {
|
||||
$selected[$key] = (string) $item;
|
||||
}
|
||||
|
||||
$extra = stringify_attributes($extra);
|
||||
$multiple = (count($selected) > 1 && stripos($extra, 'multiple') === false) ? ' multiple="multiple"' : '';
|
||||
$form = '<select ' . rtrim(parse_form_attributes($data, $defaults)) . $extra . $multiple . ">\n";
|
||||
|
||||
foreach ($options as $key => $val) {
|
||||
// Keys should always be strings for strict comparison
|
||||
$key = (string) $key;
|
||||
|
||||
if (is_array($val)) {
|
||||
if (empty($val)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$form .= '<optgroup label="' . $key . "\">\n";
|
||||
|
||||
foreach ($val as $optgroupKey => $optgroupVal) {
|
||||
// Keys should always be strings for strict comparison
|
||||
$optgroupKey = (string) $optgroupKey;
|
||||
|
||||
$sel = in_array($optgroupKey, $selected, true) ? ' selected="selected"' : '';
|
||||
$form .= '<option value="' . $optgroupKey . '"' . $sel . '>' . $optgroupVal . "</option>\n";
|
||||
}
|
||||
|
||||
$form .= "</optgroup>\n";
|
||||
} else {
|
||||
$form .= '<option value="' . $key . '"'
|
||||
. (in_array($key, $selected, true) ? ' selected="selected"' : '') . '>'
|
||||
. $val . "</option>\n";
|
||||
}
|
||||
}
|
||||
|
||||
return $form . "</select>\n";
|
||||
}
|
||||
@ -1,24 +1,22 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div id="content">
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-striped">
|
||||
<tbody>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= lang($this->class_name . '.label.' . $field) ?></td>
|
||||
<td class="column">
|
||||
<?= $viewDatas['forminputs'][$field] ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
<?= form_close(); ?>
|
||||
</table>
|
||||
</div>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<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="column">
|
||||
<?= $viewDatas['forminputs'][$field] ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<tr>
|
||||
<td valign="bottom" colspan="2">
|
||||
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
|
||||
</td>
|
||||
</tr>
|
||||
<?= form_close(); ?>
|
||||
</table>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,49 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="ko">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||
<meta name="viewport" id="viewport" content="width=1280">
|
||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||
<?= $stylesheet ?>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript) : ?>
|
||||
<?= $javascript ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/admin.js"></script>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<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): ?>
|
||||
<?= $stylesheet ?>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript): ?>
|
||||
<?= $javascript ?>
|
||||
<?php endforeach; ?>
|
||||
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/admin.js"></script>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<title><?= $viewDatas['title'] ?></title>
|
||||
</head>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="head">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator'); ?>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<nav class="nav"></nav>
|
||||
<nav class="nav justify-content-center">
|
||||
<table id="layout">
|
||||
<tr>
|
||||
<td id="left" valign="top" width="160">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||
</td>
|
||||
<td id="body" valign="top" width="*">
|
||||
<?= $this->include('templates/admin/header'); ?>
|
||||
<?= $this->renderSection('content') ?>
|
||||
<?= $this->include('templates/admin/footer'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<nav class="nav justify-content-end"></nav>
|
||||
</div>
|
||||
</body>
|
||||
<body>
|
||||
<div class="layout">
|
||||
<div class="row">
|
||||
<div class="head col-12">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/head'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="background-color:white;">
|
||||
<div class="left_menu col-1">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||
</div>
|
||||
<div class="content col-11">
|
||||
<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=" row">
|
||||
<div class="tail col-12">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/tail'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
20
app/Views/layouts/admin/head.php
Normal file
20
app/Views/layouts/admin/head.php
Normal file
@ -0,0 +1,20 @@
|
||||
<nav class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<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'); ?>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/head/search'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav justify-content-end">
|
||||
<li class="nav-item">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/head/member_link'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
17
app/Views/layouts/admin/head/member_link.php
Normal file
17
app/Views/layouts/admin/head/member_link.php
Normal file
@ -0,0 +1,17 @@
|
||||
<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,10 +1,16 @@
|
||||
<!-- left menu start -->
|
||||
<link href="/css/admin/left_menu.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/admin/side_menu.js"></script>
|
||||
<div id="left_menu" class="shadow-lg rounded">
|
||||
<div class="accordion accordion-flush">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/site'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?>
|
||||
<div id="menu" onMouseOver="sideMenuToggle(this);" onMouseOut="sideMenuToggle(this);">
|
||||
<div id="menu_button"><?= ICONS['MENU'] ?>메뉴</div>
|
||||
<div id="left_menu" class="shadow-lg rounded">
|
||||
<div class="accordion accordion-flush">
|
||||
<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'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,12 +1,9 @@
|
||||
<div class="accordion-item" style="background-color: #eaeaea;">
|
||||
<h2><a href=" /admin"><i class="fa fa-home"></i>Main</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/user"><?= CLASS_ICONS['USER'] ?></i>계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/usersns"><?= CLASS_ICONS['USERSNS'] ?></i>SNS 계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>분류 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/user"></i>계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/usersns"></i>SNS 계정 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/category">분류 관리</a></h2>
|
||||
</div>
|
||||
@ -1,19 +1,20 @@
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-heading-Shoppingmall" aria-expanded="false" aria-controls="flush-heading-Shoppingmall"><b>상점관리</b></button>
|
||||
</h2>
|
||||
<div id="flush-heading-Shoppingmall" class="accordion-collapse collapse show" aria-labelledby="panelsStayOpen-heading-Shoppingmall">
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/device"><?= CLASS_ICONS['DEVICE'] ?>장비 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/product"><?= CLASS_ICONS['PRODUCT'] ?>상품 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/order"><?= CLASS_ICONS['ORDER'] ?></i>주문 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/billing"><?= CLASS_ICONS['BILLING'] ?></i>청구서 관리</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#flush-heading-Shoppingmall" aria-expanded="false"
|
||||
aria-controls="flush-heading-Shoppingmall"><b>상점관리</b></button>
|
||||
</h2>
|
||||
<div id="flush-heading-Shoppingmall" class="accordion-collapse collapse show"
|
||||
aria-labelledby="panelsStayOpen-heading-Shoppingmall">
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/device">장비 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/product">상품 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/order">주문 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/billing">청구서 관리</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,13 +1,13 @@
|
||||
<div class="accordion-item">
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-heading-Board" aria-expanded="false" aria-controls="flush-heading-Board"><b>사이트관리</b></button>
|
||||
</h2>
|
||||
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/board"><?= CLASS_ICONS['BOARD'] ?>게시글 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/sitepage"><?= CLASS_ICONS['SITEPAGE'] ?>SitePage 관리</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<h2 class="accordion-header">
|
||||
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse"
|
||||
data-bs-target="#flush-heading-Board" aria-expanded="false"
|
||||
aria-controls="flush-heading-Board"><b>사이트관리</b></button>
|
||||
</h2>
|
||||
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/board">게시글 관리</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/admin/sitepage">SitePage 관리</a></h2>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,4 +0,0 @@
|
||||
<div class="input-group custom-search-form" id="mkbutton2" style="width:170px;">
|
||||
<input type="text" class="form-control" value="<?= getPasswordString_CommonHelper() ?>" id="makePassword">
|
||||
<span class="input-group-btn" id="mkbutton"><button class="btn btn-default" type="button" id="totSearchBtn" onClick="window.location.reload();"><i class="fa fa-search"></i></button></span>
|
||||
</div>
|
||||
0
app/Views/layouts/admin/tail.php
Normal file
0
app/Views/layouts/admin/tail.php
Normal file
@ -1,20 +0,0 @@
|
||||
<nav class="navbar navbar-expand-lg navbar-light" style="background-color: #e3f2fd;">
|
||||
<div id="head" class="container-fluid">
|
||||
<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'] . '/top_navigator/make_password'); ?>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator/search'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
<ul class="nav justify-content-end">
|
||||
<li class="nav-item">
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator/member_link'); ?>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
@ -1,14 +0,0 @@
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($viewDatas[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>
|
||||
2
app/Views/layouts/front/head.php
Normal file
2
app/Views/layouts/front/head.php
Normal file
@ -0,0 +1,2 @@
|
||||
<?= $this->include($viewDatas['layout']['path'] . 'head/navigator'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . 'head/top_menu'); ?>
|
||||
44
app/Views/layouts/front/head/navigator.php
Normal file
44
app/Views/layouts/front/head/navigator.php
Normal file
@ -0,0 +1,44 @@
|
||||
<link href="/css/common/top_navigator.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<nav id="header" class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav class="nav">
|
||||
<span style="float:left;"><?= ICONS['LOGO'] ?></span>
|
||||
</nav>
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item">
|
||||
<a href="<?= MESSENGERS['skype']['url'] ?>"><?= MESSENGERS['skype']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['discord']['url'] ?>"><?= MESSENGERS['discord']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['telegram']['url'] ?>"><?= MESSENGERS['telegram']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['kakaotalk']['url'] ?>"><?= MESSENGERS['kakaotalk']['icon'] ?></a>
|
||||
<!-- <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="cart nav-item">
|
||||
<?= anchor('/front/order', ICONS['CART'], ["target" => "_self"]); ?>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($viewDatas[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>
|
||||
</div>
|
||||
</nav>
|
||||
1
app/Views/layouts/front/tail.php
Normal file
1
app/Views/layouts/front/tail.php
Normal file
@ -0,0 +1 @@
|
||||
<?= $this->include($viewDatas['layout']['path'] . 'tail/copyright'); ?>
|
||||
@ -7,7 +7,9 @@
|
||||
<div style="padding: 10px; margin: 10px;">
|
||||
<ul class=" nav nav-tabs" id="myTab" role="tablist">
|
||||
<li class="nav-item" role="presentation">
|
||||
<button class="nav-link active" id="companyinfo-tab" data-bs-toggle="tab" data-bs-target="#companyinfo" type="button" role="tab" aria-controls="companyinfo" aria-selected="true">
|
||||
<button class="nav-link active" id="companyinfo-tab" data-bs-toggle="tab"
|
||||
data-bs-target="#companyinfo" type="button" role="tab" aria-controls="companyinfo"
|
||||
aria-selected="true">
|
||||
회사소개</button>
|
||||
</li>
|
||||
<!-- <li class="nav-item" role="presentation">
|
||||
@ -20,22 +22,24 @@
|
||||
</li> -->
|
||||
</ul>
|
||||
<div class="tab-content" id="myTabContent">
|
||||
<div class="tab-pane fade show active" id="companyinfo" role="tabpanel" aria-labelledby="companyinfo-tab" style="height:150px; text-align:left;">
|
||||
<div class="tab-pane fade show active" id="companyinfo" role="tabpanel"
|
||||
aria-labelledby="companyinfo-tab" style="height:150px; text-align:left;">
|
||||
항상 빠르고 안전하고 저렴한 가격으로 고객님을 대신해서 구매대행을 진행할 수 있도록 하겠습니다.<BR>
|
||||
언제나 믿고 신뢰할 수 있는 르호봇이 되도록 노력하겠습니다.<BR>
|
||||
감사합니다.<BR>
|
||||
</div>
|
||||
<div class=" tab-pane fade" id="usageterms" role="tabpanel" aria-labelledby="usageterms-tab" style="height:150px; text-align:left;">
|
||||
<div class=" tab-pane fade" id="usageterms" role="tabpanel" aria-labelledby="usageterms-tab"
|
||||
style="height:150px; text-align:left;">
|
||||
이용약관
|
||||
</div>
|
||||
<div class="tab-pane fade" id="privacyhandling" role="tabpanel" aria-labelledby="privacyhandling-tab" style="height:150px; text-align:left;">
|
||||
<div class="tab-pane fade" id="privacyhandling" role="tabpanel"
|
||||
aria-labelledby="privacyhandling-tab" style="height:150px; text-align:left;">
|
||||
개인정보취급방침
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="address">
|
||||
<a href="<?= MESSENGERS['skype']['url'] ?>"><?= MESSENGERS['skype']['icon'] ?><?= MALLS['email'] ?></a><BR>
|
||||
Copyright(c) <?= MALLS['host_name'] ?> All Right Reserved.
|
||||
Copyright(c) All Right Reserved.
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -1,42 +0,0 @@
|
||||
<link href="/css/common/top_navigator.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<nav id="top_navigator" class="navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav class="nav">
|
||||
<span style="float:left;"><?= ICONS['LOGO'] ?></span>
|
||||
</nav>
|
||||
<ul class="nav justify-content-center">
|
||||
<li class="nav-item">
|
||||
<a href="<?= MESSENGERS['skype']['url'] ?>"><?= MESSENGERS['skype']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['discord']['url'] ?>"><?= MESSENGERS['discord']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['telegram']['url'] ?>"><?= MESSENGERS['telegram']['icon'] ?></a>
|
||||
<a href="<?= MESSENGERS['kakaotalk']['url'] ?>"><?= MESSENGERS['kakaotalk']['icon'] ?></a>
|
||||
<!-- <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="cart nav-item">
|
||||
<?= anchor('/front/order', ICONS['CART'], ["target" => "_self"]); ?>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($viewDatas[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>
|
||||
</div>
|
||||
</nav>
|
||||
@ -1,7 +1,8 @@
|
||||
<div class="footer"></div>
|
||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
||||
<div class="footer">
|
||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
//class가 calender인 inputbox용,날짜field용
|
||||
$(".calender").datepicker({
|
||||
changeYear: true,
|
||||
@ -10,13 +11,13 @@
|
||||
dateFormat: "yy-mm-dd"
|
||||
});
|
||||
//id가 batchjobuids_checkbox인 버튼을 클릭시 class가 batchjobuids_checkboxs인 checkbox용
|
||||
$('#batchjobuids_checkbox').click(function(event) {
|
||||
$('#batchjobuids_checkbox').click(function (event) {
|
||||
if (this.checked) {
|
||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
||||
$('.batchjobuids_checkboxs').each(function () { //loop checkbox
|
||||
$(this).prop('checked', true); //check
|
||||
});
|
||||
} else {
|
||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
||||
$('.batchjobuids_checkboxs').each(function () { //loop checkbox
|
||||
$(this).prop('checked', false); //uncheck
|
||||
});
|
||||
}
|
||||
@ -37,12 +38,12 @@
|
||||
automatic_uploads: false,
|
||||
images_upload_url: '/tinymce_upload.php',
|
||||
// images_upload_base_path: '/upload_images',
|
||||
images_upload_handler: function(blobInfo, success, failure) {
|
||||
images_upload_handler: function (blobInfo, success, failure) {
|
||||
var xhr, formData;
|
||||
xhr = new XMLHttpRequest();
|
||||
xhr.withCredentials = false;
|
||||
xhr.open('POST', '/tinymce_upload.php');
|
||||
xhr.onload = function() {
|
||||
xhr.onload = function () {
|
||||
var json;
|
||||
if (xhr.status != 200) {
|
||||
failure('HTTP Error: ' + xhr.status);
|
||||
|
||||
@ -1,9 +1,7 @@
|
||||
<nav class="header navbar navbar-expand-lg">
|
||||
<div class="container-fluid">
|
||||
<nav class="nav">
|
||||
<h4><?= $viewDatas['class_icon'] ?></i><?= $viewDatas['title'] ?></h4>
|
||||
</nav>
|
||||
<nav class="nav justify-content-center"></nav>
|
||||
<nav class="nav justify-content-end"></nav>
|
||||
</div>
|
||||
</nav>
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item">
|
||||
<span class="nav-link active" aria-current="page">
|
||||
<h4><?= ICONS['DESKTOP'] ?> <?= $viewDatas['title'] ?></h4>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
@ -4,50 +4,61 @@
|
||||
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
|
||||
* Updated :
|
||||
------------------------------------------------------------ */
|
||||
* {
|
||||
margin:0px;
|
||||
padding:0px;
|
||||
border:0px;
|
||||
font-size:14px;
|
||||
font: Arial;
|
||||
* {
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
/* #head{
|
||||
border:1px solid blue;
|
||||
} */
|
||||
#tail{
|
||||
text-align:center;
|
||||
/* border:1px solid green; */
|
||||
}
|
||||
#layout {
|
||||
width:100%;
|
||||
/* border:1px solid blue; */
|
||||
div.layout {
|
||||
height: 100vw; /* 화면 넓이의 100% */
|
||||
height: 100vh; /* 화면 높이의 100% */
|
||||
border: 1px solid red;
|
||||
background-color: #efefef;
|
||||
/* border:1px solid blue; */
|
||||
}
|
||||
|
||||
#layout #body{
|
||||
padding-left:10px;
|
||||
/* border:1px solid red; */
|
||||
div.layout > div.row > div.head {
|
||||
height: 51px;
|
||||
border: 1px solid blue;
|
||||
background-color: #e3f2fd;
|
||||
}
|
||||
|
||||
#layout #body nav.header{
|
||||
/*content 상단라인*/
|
||||
padding-top:40px;
|
||||
border-bottom:1px solid silver;
|
||||
div.layout > div.row > div.tail {
|
||||
height: 51px;
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
width: 100%;
|
||||
background-color: lightgray;
|
||||
text-align: center;
|
||||
padding: 10px;
|
||||
}
|
||||
#layout #body nav.header nav h4.title{
|
||||
font-size:26px;
|
||||
font-weight:bold;
|
||||
div.layout > div.row > div.left_menu {
|
||||
padding-left: 10px;
|
||||
border: 1px solid green;
|
||||
}
|
||||
#layout #body nav.header nav span.flow{
|
||||
color: gray;
|
||||
div.layout > div.row > div.content > div.header {
|
||||
/*content 헤더라인*/
|
||||
height: 50px;
|
||||
background-color: #e7e7e7;
|
||||
}
|
||||
#layout #body div.footer
|
||||
/*content 하단라인*/{
|
||||
height:20px;
|
||||
/* border-top:0px;
|
||||
border-left:1px solid silver;
|
||||
border-bottom:1px solid silver;
|
||||
border-right:1px solid silver;
|
||||
border-radius: 0px 0px 10px 10px;
|
||||
background-color:white; */
|
||||
div.layout > div.row > div.content > div.header > ul.nav {
|
||||
/*nav-tabs 헤더라인*/
|
||||
border-top: 1px solid red;
|
||||
border-left: 1px solid red;
|
||||
border-right: 1px solid red;
|
||||
border-radius: 10px 10px 0px 0px;
|
||||
}
|
||||
div.layout > div.row > div.content > div.center {
|
||||
/*content 부분*/
|
||||
height: 100%;
|
||||
padding: 10px;
|
||||
/* border: 1px solid red; */
|
||||
border-left: 1px solid red;
|
||||
border-right: 1px solid red;
|
||||
background-color: sivler;
|
||||
}
|
||||
div.layout > div.row > div.content div.footer {
|
||||
/*content 하단라인*/
|
||||
height: 20px;
|
||||
border-bottom: 1px solid red;
|
||||
border-radius: 0px 0px 10px 10px;
|
||||
}
|
||||
@ -1,20 +1,38 @@
|
||||
div#left_menu{
|
||||
position:fixed;
|
||||
z-index:100;
|
||||
width:160px;
|
||||
border:1px solid silver;
|
||||
div#menu {
|
||||
position: fixed;
|
||||
margin-top: 10px;
|
||||
z-index: 100;
|
||||
width: 20px;
|
||||
border: 1px solid #e7e7e7;
|
||||
padding: 0px;
|
||||
}
|
||||
div#menu > div#menu_button {
|
||||
float: right;
|
||||
height: 100px;
|
||||
width: 20px;
|
||||
cursor: ew-resize;
|
||||
border-radius: 0px 5px 5px 0px;
|
||||
border: 1px solid silver;
|
||||
background-color: #eaeaea;
|
||||
padding: 0px;
|
||||
}
|
||||
|
||||
div#left_menu div.accordion {
|
||||
/* display:none; */
|
||||
background-color: white;
|
||||
div#menu > div#left_menu {
|
||||
z-index: 100;
|
||||
width: 160px;
|
||||
border: 1px solid silver;
|
||||
display: none;
|
||||
}
|
||||
div#left_menu div.accordion div.accordion-item:hover {
|
||||
background-color: #e7e7e7;
|
||||
div#menu > div#left_menu > div.accordion {
|
||||
/* display:none; */
|
||||
background-color: white;
|
||||
}
|
||||
div#left_menu div.accordion div.accordion-item a{
|
||||
padding-left:10px;
|
||||
div#menu > div#left_menu > div.accordion > div.accordion-item:hover {
|
||||
background-color: #e7e7e7;
|
||||
}
|
||||
div#left_menu div.accordion div.accordion-collapse a{
|
||||
padding-left:30px;
|
||||
div#menu > div#left_menu > div.accordion > div.accordion-item > a {
|
||||
padding-left: 10px;
|
||||
}
|
||||
div#menu > div#left_menu > div.accordion > div.accordion-collapse > a {
|
||||
padding-left: 30px;
|
||||
}
|
||||
@ -1,9 +1,9 @@
|
||||
function sideMenuToggle (menu_id){
|
||||
var accordion = $(".accordion")[0];
|
||||
alert(accordion.clientWidth);
|
||||
// alert(accordion.clientWidth);
|
||||
if (accordion.clientWidth == 0){
|
||||
accordion.style.display = "block";
|
||||
$("#"+menu_id).css({ "width": '200px' })
|
||||
$("#"+menu_id).css({ "width": '250px' })
|
||||
$("#button"+menu_id).html("메뉴닫기");
|
||||
}
|
||||
else {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user