<?php

/*
 | --------------------------------------------------------------------
 | App Namespace
 | --------------------------------------------------------------------
 |
 | This defines the default Namespace that is used throughout
 | CodeIgniter to refer to the Application directory. Change
 | this constant to change the namespace that all application
 | classes should use.
 |
 | NOTE: changing this will require manually modifying the
 | existing namespaces of App\* namespaced-classes.
 */
defined('APP_NAMESPACE') || define('APP_NAMESPACE', 'App');

/*
 | --------------------------------------------------------------------------
 | Composer Path
 | --------------------------------------------------------------------------
 |
 | The path that Composer's autoload file is expected to live. By default,
 | the vendor folder is in the Root directory, but you can customize that here.
 */
defined('COMPOSER_PATH') || define('COMPOSER_PATH', ROOTPATH . 'vendor/autoload.php');

/*
 |--------------------------------------------------------------------------
 | Timing Constants
 |--------------------------------------------------------------------------
 |
 | Provide simple ways to work with the myriad of PHP functions that
 | require information to be in seconds.
 */
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('DECADE') || define('DECADE', 315_360_000);

/*
 | --------------------------------------------------------------------------
 | Exit Status Codes
 | --------------------------------------------------------------------------
 |
 | Used to indicate the conditions under which the script is exit()ing.
 | While there is no universal standard for error codes, there are some
 | broad conventions.  Three such conventions are mentioned below, for
 | those who wish to make use of them.  The CodeIgniter defaults were
 | chosen for the least overlap with these conventions, while still
 | leaving room for others to be defined in future versions and user
 | applications.
 |
 | The three main conventions used for determining exit status codes
 | are as follows:
 |
 |    Standard C/C++ Library (stdlibc):
 |       http://www.gnu.org/software/libc/manual/html_node/Exit-Status.html
 |       (This link also contains other GNU-specific conventions)
 |    BSD sysexits.h:
 |       http://www.gsp.com/cgi-bin/man.cgi?section=3&topic=sysexits
 |    Bash scripting:
 |       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_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

//choi.jh
define("KEYWORD", 'Titanium & Specialty Metals. Delivered with Precisio');
define('LAYOUTS', [
    'auth' => [
        'title' => KEYWORD,
        'path' => 'auth',
        'layout' => 'layouts/auth',
        'template' => 'templates/auth',
        'metas' => [
            '<meta charset="UTF-8">',
            '<meta name="viewport" content="width=device-width, initial-scale=1.0">',
            '<meta http-equiv="X-UA-Compatible" content="IE=Edge">',
            '<meta name="subject" content="Daemon IDC">',
            '<meta name="description" content="' . KEYWORD . '">',
            '<meta name="keywords" content="' . KEYWORD . '">',
            '<meta property="og:type" content="website">',
            '<meta property="og:title" content="Daemon IDC">',
            '<meta property="og:description" content="' . KEYWORD . '">',
        ],
        'stylesheets' => [
            '<link rel="icon" href="/favicon.ico">',
            '<link href="//cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">',
            '<link rel="stylesheet" href="/css/common/style.css" />',
        ],
        'javascripts' => [
            '<script src="//cdn.jsdelivr.net/npm/bootstrap@5.2.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>',
        ],
        'footerScripts' => []
    ],
    'front' => [
        'title' => KEYWORD,
        'path' => 'front',
        'layout' => 'layouts/front',
        'template' => 'templates/front',
        'topmenus' => ['aboutus', 'hosting', 'service', 'support'],
        'metas' => [
            '<meta charset="UTF-8">',
            '<meta name="viewport" content="width=device-width, initial-scale=1.0">',
            '<meta http-equiv="X-UA-Compatible" content="IE=Edge">',
            '<meta name="subject" content="Daemon IDC">',
            '<meta name="description" content="' . KEYWORD . '">',
            '<meta name="keywords" content="' . KEYWORD . '">',
            '<meta property="og:type" content="website">',
            '<meta property="og:title" content="Daemon IDC">',
            '<meta property="og:description" content="' . KEYWORD . '">',
        ],
        'stylesheets' => [
            '<link rel="icon" href="/favicon.ico">',
            '<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css">',
            '<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css">',
            '<link href="//fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700&family=Noto+Sans+KR:wght@300;400;500;700&display=swap" rel="stylesheet">',
            '<link rel="stylesheet" href="/css/common/style.css" />',
        ],
        'javascripts' => [
            '<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
            '<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>',
            '<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>',
            '<script src="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>',
        ],
        'footerScripts' => ['<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js"></script>']
    ],
    'admin' => [
        'title' => '관리자화면',
        'path' => 'admin',
        'layout' => 'layouts/admin',
        'template' => 'templates/admin',
        'metas' => [
            '<meta charset="UTF-8">',
            '<meta name="viewport" content="width=device-width, initial-scale=1.0">',
            '<meta http-equiv="X-UA-Compatible" content="IE=Edge">',
            '<meta name="subject" content="Daemon IDC">',
            '<meta name="description" content="' . KEYWORD . '">',
            '<meta name="keywords" content="' . KEYWORD . '">',
            '<meta property="og:type" content="website">',
            '<meta property="og:title" content="Daemon IDC">',
            '<meta property="og:description" content="' . KEYWORD . '">',
        ],
        'stylesheets' => [
            '<link rel="icon" href="/favicon.ico">',
            '<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
            '<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
            '<link rel="stylesheet" href="/assets/tagify/dist/tagify.css">',
            '<link rel="stylesheet" href="/css/common/style.css" />',
        ],
        'javascripts' => [
            '<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
            '<script src="//code.jquery.com/ui/1.12.1/jquery-ui.min.js" integrity="sha256-VazP97ZCwtekAsvgPBSUwPFKdrwD3unUfSGVYrahUqU=" crossorigin="anonymous"></script>',
            '<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>',
            '<script src="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>',
            '<script src="/assets/tinymce/tinymce.min.js" referrerpolicy="origin"></script>',
            '<script src="/assets/tagify/dist/tagify.js"></script>'
        ],
        'footerScripts' => []
    ],
]);

define('MESSAGES', [
    'CREATED' => '생성되었습니다.',
    'UPDATED' => '수정되였습니다.',
    'DELETED' => '삭제되였습니다.',
    'SUCCESS' => '작업이 성공적으로 완료되었습니다.',
    'FAILED' => '작업이 실패하였습니다.',
    'NOT_FOUND' => '데이터가 존재하지 않습니다.',
    'NOT_AUTH' => '권한이 없습니다.',
    'NOT_LOGIN' => '로그인이 필요합니다.',
    'NOT_MATCH' => '데이터가 일치하지 않습니다.',
    'NOT_EMPTY' => '데이터가 비어있습니다.',
    'NOT_UNIQUE' => '중복된 데이터가 존재합니다.',
    'NOT_DELETE' => '삭제할 수 없는 데이터가 존재합니다.',
    'NOT_UPDATE' => '수정할 수 없는 데이터가 존재합니다.',
    'NOT_CREATE' => '생성할 수 없는 데이터가 존재합니다.',
    'NOT_SYNC' => '동기화할 수 없는 데이터가 존재합니다.',
    'NOT_SYNC_RESULT' => '동기화 결과가 실패하였습니다.',
    'NOT_SYNC_SUCCESS' => '동기화 결과가 성공하였습니다.',
    'NOT_SYNC_ERROR' => '동기화 결과가 실패하였습니다.',
    'NOT_SYNC_NOTHING' => '동기화할 데이터가 없습니다.',
    'NOT_SYNC_NOTHING_RESULT' => '동기화 결과가 없습니다.',
    'NOT_SYNC_NOTHING_ERROR' => '동기화 결과가 없습니다.',
    'LOGIN' => '로그인 하셨습니다.',
    'LOGOUT' => '로그아웃 하셨습니다.'
]);
//URL
define('URLS', [
    'LOGIN' => '/auth/login',
    'GOOGLE_LOGIN' => '/auth/google_login',
    'SIGNUP' => '/auth/signup',
    'LOGOUT' => '/auth/logout',
]);
//SESSION 관련
define('SESSION_NAMES', [
    'RETURN_URL' => "return_url",
    'RETURN_MSG' => "return_message",
    'ISLOGIN' => "islogined",
    'AUTH' => 'auth',
]);
//메신저 관련
define("MESSENGERS", [
    "skype" => [
        "url" => "//join.skype.com/invite/uKUgXfZThSQC",
        "icon" => 'SKYPE',
        "id" => '',
    ],
    "discord" => [
        "url" => "//discord.gg/k6nQg84N",
        "icon" => 'DISCORD',
        "id" => '',
    ],
    "telegram" => [
        "url" => "//t.me/daemonidc",
        "icon" => 'TELEGRAM',
        "id" => '@daemonidc',
    ],
    "kakaotalk" => [
        "url" => "//t.me/daemonidc",
        "icon" => 'KAKAO',
        "id" => '',
    ],
]);
//아이콘 및 Sound관련
define('ICONS', [
    'ADD' => '➕',
    'LOGO' => '🖼️',
    'EXCEL' => '📊',
    'PDF' => '📄',
    'GOOGLE' => '🌐',
    'MEMBER' => '👤',
    'CLIENT' => '🤵',
    'LOGIN' => '🔑',
    'LOGOUT' => '🚪',
    'HOME' => '🏠',
    'MENU' => '☰',
    'NEW' => '🆕',
    'REPLY' => '↩️',
    'DATABASE' => '🗄️',
    'DISLIKE' => '👎',
    'LIKE' => '👍',
    'DOWNLOAD' => '⬇️',
    'UPLOAD' => '⬆️',
    'COPY' => '📋',
    'PASTE' => '📌',
    'EDIT' => '✏️',
    'VIEW' => '👁️',
    'VIEW_OFF' => '🙈',
    'PRINT' => '🖨️',
    'SAVE' => '✔️',
    'CANCEL' => '❌',
    'CLOSE' => '✖️',
    'CHART' => '📈',
    'CHECK' => '✔️',
    'CHECK_OFF' => '⬜',
    'CHECK_ON' => '☑️',
    'CHECK_ALL' => '📑',
    'CHECK_NONE' => '🚫',
    'CHECK_SOME' => '➖',
    'COUPON' => '🎟️',
    'HISTORY' => '🕘',
    'MODIFY' => '🔧',
    'MODIFY_ALL' => '🛠️',
    'BATCHJOB' => '⚙️',
    'DELETE' => '🗑️',
    'REBOOT' => '🔄',
    'RELOAD' => '🔁',
    'SETUP' => '⚙️',
    'FOLDER' => '📁',
    'FLAG' => '🚩',
    'SEARCH' => '🔍',
    'PLAY' => '▶️',
    'CART' => '🛒',
    'CARD' => '💳',
    'DEPOSIT' => '💰',
    'DESKTOP' => '🖥️',
    'DEVICE' => '📟',
    'UP' => '⬆️',
    'DOWN' => '⬇️',
    'LEFT' => '⬅️',
    'RIGHT' => '➡️',
    'IMAGE_FILE' => '🖼️',
    'CLOUD' => '☁️',
    'SIGNPOST' => '📌',
    'LOCK' => '🔒',
    'UNLOCK' => '🔓',
    'BOX' => '📦',
    'BOXS' => '📦📦',
    'ONETIME' => '1️⃣',
    'MONTH' => '📅',
    'EMAIL' => '✉️',
    'MAIL' => '📧',
    'PHONE' => '📞',
    'POINT' => '⭐',
    'ALRAM' => '🔔',
    'PAYMENT' => '💸',
    'LINK' => '🔗',
    'SALE_UP' => '📈',
    'SALE_DOWN' => '📉',
    'SERVICE' => '🛎️',
    'CONSOLE' => '>_',
    'SERVICE_ITEM' => '📦',
    'SERVICE_ITEM_LINE' => '🌐',
    'SERVICE_ITEM_IP' => '📍',
    'SERVICE_ITEM_SERVER' => '🖥️',
    'SERVICE_ITEM_CPU' => '⚙️',
    'SERVICE_ITEM_RAM' => '🧠',
    'SERVICE_ITEM_STORAGE' => '💾',
    'SERVICE_ITEM_SOFTWARE' => '💿',
    'SERVICE_ITEM_DOMAIN' => '🔗',
    'SERVICE_ITEM_OTHER' => '📎',
    'SERVER_ITEM_CPU' => '🔳',
    'SERVER_ITEM_RAM' => '📼',
    'SERVER_ITEM_DISK' => '🗄️',
    'SERVER_ITEM_SWITCH' => '🖧',
    'SERVER_ITEM_OS' => '🐧',
    'SERVER_ITEM_DB' => '📊',
    'SERVER_ITEM_DEFENCE' => '🛡️',
    'SERVER_ITEM_CS' => '🛡️',
    'SERVER_ITEM_SOFTWARE' => '💻',
    'SERVER_ITEM_IP' => '🌍',
    'SERVER_ITEM_ETC' => '➕',
]);

//STATUS
define("STATUS", [
    'AVAILABLE' => "available",
    'FORBIDDEN' => "forbidden",
    'OCCUPIED' => "occupied",
    'SUCCESS' => "success",
    'FAILED' => "fail",
    'PAUSE' => "pause",
    'TERMINATED' => "terminated",
    'WITHDRAWAL' => "withdrawal",
    'DEPOSIT' => "deposit",
    'PAID' => 'paid',
    'UNPAID' => 'unpaid',
]);

//ROLE
define("ROLE", [
    'USER' => [
        'MANAGER' => "manager",
        'CLOUDFLARE' => "cloudflare",
        'FIREWALL' => "firewall",
        'SECURITY' => "security",
        'DIRECTOR' => "director",
        'MASTER' => "master",
    ],
    'CLIENT' => [
        'USER' => 'user',
        'VIP' => 'vip',
        'RESELLER' => 'reseller',
    ],
]);

//Default값 정의
define('DEFAULTS', [
    'DELIMITER_PIPE' => "||",
    'DELIMITER_COMMA' => ",",
    'INDEX_PERPAGE' => 20,
    'STATUS' => STATUS['AVAILABLE']
]);

//게시판 관련
define("BOARD", [
    'CATEGORY' => [
        'NOTICE' => 'notice',
        'REQUESTTASK' => 'requesttask'
    ],
]);
//choi.jh