From dcb78a3745f745bbdb545dcde585e0820affe576 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=B5=9C=EC=A4=80=ED=9D=A0?= Date: Sun, 22 Sep 2024 23:04:57 +0900 Subject: [PATCH] Automation init...4 --- app/Config/Routes.php | 13 +- .../Cloudflare/AccountController.php | 6 +- app/Controllers/Cloudflare/ZoneController.php | 21 +- app/Controllers/MVController.php | 58 ++- app/Language/Cloudflare/API/Account.php | 22 ++ app/Language/Cloudflare/API/Record.php | 47 +++ app/Language/Cloudflare/API/Zone.php | 38 ++ app/Language/Mapurl.php | 16 + app/Language/User.php | 27 ++ .../MyCloudflare/old/CloudflareLibrary.php | 119 ------ .../old/Magictransit/AllowList.php | 103 ------ app/Libraries/MyCloudflare/old/Record_old.php | 127 ------- app/Libraries/MyCloudflare/old/Zone_old.php | 152 -------- app/Models/Cloudflare/AccountModel.php | 14 +- app/Models/Cloudflare/RecordModel.php | 6 +- app/Models/CommonModel.php | 12 +- app/Views/admin/user/index.php | 50 +++ app/Views/admin/user/insert.php | 24 ++ app/Views/admin/user/update.php | 24 ++ app/Views/admin/user/view.php | 19 + app/Views/admin/welcome_message.php | 5 + app/Views/cells/board/information.php | 5 + app/Views/cells/board/reference.php | 5 + .../cells/product/beremetal_calculator.php | 82 +++++ app/Views/cells/product/device.php | 43 +++ app/Views/cells/product/virtual.php | 30 ++ app/Views/cells/product/virtual_caculator.php | 87 +++++ app/Views/cloudflare/account/create.php | 24 ++ app/Views/cloudflare/account/index.php | 50 +++ app/Views/cloudflare/account/update.php | 24 ++ app/Views/cloudflare/account/view.php | 19 + app/Views/front/user/index.php | 41 +++ app/Views/front/user/insert.php | 24 ++ app/Views/front/user/login.php | 39 ++ app/Views/front/user/login_v1.php | 37 ++ app/Views/front/user/update.php | 24 ++ app/Views/front/welcome_message.php | 342 ++++++++++++++++++ app/Views/layouts/admin.php | 49 +++ app/Views/layouts/admin/left_menu.php | 10 + app/Views/layouts/admin/left_menu/base.php | 12 + .../layouts/admin/left_menu/shoppingmall.php | 19 + app/Views/layouts/admin/left_menu/site.php | 13 + app/Views/layouts/admin/make_password.php | 4 + app/Views/layouts/admin/top_navigator.php | 20 + .../admin/top_navigator/make_password.php | 5 + .../admin/top_navigator/member_link.php | 14 + .../layouts/admin/top_navigator/search.php | 4 + app/Views/layouts/common/copyright.php | 44 +++ app/Views/layouts/empty.php | 34 ++ app/Views/layouts/front.php | 41 +++ app/Views/layouts/front/left_menu.php | 14 + app/Views/layouts/front/top_menu.php | 37 ++ app/Views/layouts/front/top_navigator.php | 42 +++ app/Views/layouts/front_simple.php | 49 +++ app/Views/layouts/main.php | 71 ++++ app/Views/templates/Pagers/bootstrap_full.php | 34 ++ .../templates/Pagers/bootstrap_simple.php | 17 + app/Views/templates/admin/footer.php | 64 ++++ app/Views/templates/admin/header.php | 9 + app/Views/templates/admin/index_head.php | 12 + app/Views/templates/empty/footer.php | 2 + app/Views/templates/empty/header.php | 1 + app/Views/templates/front/footer.php | 35 ++ app/Views/templates/front/header.php | 11 + app/Views/templates/front/index_head.php | 14 + 65 files changed, 1925 insertions(+), 535 deletions(-) create mode 100644 app/Language/Cloudflare/API/Account.php create mode 100644 app/Language/Cloudflare/API/Record.php create mode 100644 app/Language/Cloudflare/API/Zone.php create mode 100644 app/Language/Mapurl.php create mode 100644 app/Language/User.php delete mode 100644 app/Libraries/MyCloudflare/old/CloudflareLibrary.php delete mode 100644 app/Libraries/MyCloudflare/old/Magictransit/AllowList.php delete mode 100644 app/Libraries/MyCloudflare/old/Record_old.php delete mode 100644 app/Libraries/MyCloudflare/old/Zone_old.php create mode 100644 app/Views/admin/user/index.php create mode 100644 app/Views/admin/user/insert.php create mode 100644 app/Views/admin/user/update.php create mode 100644 app/Views/admin/user/view.php create mode 100644 app/Views/admin/welcome_message.php create mode 100644 app/Views/cells/board/information.php create mode 100644 app/Views/cells/board/reference.php create mode 100644 app/Views/cells/product/beremetal_calculator.php create mode 100644 app/Views/cells/product/device.php create mode 100644 app/Views/cells/product/virtual.php create mode 100644 app/Views/cells/product/virtual_caculator.php create mode 100644 app/Views/cloudflare/account/create.php create mode 100644 app/Views/cloudflare/account/index.php create mode 100644 app/Views/cloudflare/account/update.php create mode 100644 app/Views/cloudflare/account/view.php create mode 100644 app/Views/front/user/index.php create mode 100644 app/Views/front/user/insert.php create mode 100644 app/Views/front/user/login.php create mode 100644 app/Views/front/user/login_v1.php create mode 100644 app/Views/front/user/update.php create mode 100644 app/Views/front/welcome_message.php create mode 100644 app/Views/layouts/admin.php create mode 100644 app/Views/layouts/admin/left_menu.php create mode 100644 app/Views/layouts/admin/left_menu/base.php create mode 100644 app/Views/layouts/admin/left_menu/shoppingmall.php create mode 100644 app/Views/layouts/admin/left_menu/site.php create mode 100644 app/Views/layouts/admin/make_password.php create mode 100644 app/Views/layouts/admin/top_navigator.php create mode 100644 app/Views/layouts/admin/top_navigator/make_password.php create mode 100644 app/Views/layouts/admin/top_navigator/member_link.php create mode 100644 app/Views/layouts/admin/top_navigator/search.php create mode 100644 app/Views/layouts/common/copyright.php create mode 100644 app/Views/layouts/empty.php create mode 100644 app/Views/layouts/front.php create mode 100644 app/Views/layouts/front/left_menu.php create mode 100644 app/Views/layouts/front/top_menu.php create mode 100644 app/Views/layouts/front/top_navigator.php create mode 100644 app/Views/layouts/front_simple.php create mode 100644 app/Views/layouts/main.php create mode 100644 app/Views/templates/Pagers/bootstrap_full.php create mode 100644 app/Views/templates/Pagers/bootstrap_simple.php create mode 100644 app/Views/templates/admin/footer.php create mode 100644 app/Views/templates/admin/header.php create mode 100644 app/Views/templates/admin/index_head.php create mode 100644 app/Views/templates/empty/footer.php create mode 100644 app/Views/templates/empty/header.php create mode 100644 app/Views/templates/front/footer.php create mode 100644 app/Views/templates/front/header.php create mode 100644 app/Views/templates/front/index_head.php diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 087d603..4e3e375 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -6,14 +6,11 @@ use CodeIgniter\Router\RouteCollection; * @var RouteCollection $routes */ - //추가 Custom RULE 만들때 : ex)UUID형식 $routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}'); - //authFilter는 추가적인 작업이 필요 //1. app/Filters/AuthFilter.php //2. Config/Filters.php -> $aliases = ['authFilter' => AuthFilter::class] - $routes->get('/', 'Home::index'); $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'authFilter:manager'], function ($routes) { $routes->get('/', 'Home::index'); @@ -35,3 +32,13 @@ $routes->group('mangboard', ['namespace' => 'App\Controllers\Mangboard'], functi $routes->cli('(:alpha)/(:any)/(:any)', 'CrawlerController::$1/$2'); }); }); +$routes->group(name: 'cloudflare', ['namespace' => 'App\Controllers\Cloudflare'], function ($routes) { + $routes->group('account', function ($routes) { + $routes->get('/', 'AccountController::index'); + $routes->get('/create', 'AccountController::create_form'); + }); + $routes->group('zone', function ($routes) { + $routes->get('/', 'ZoneController::index'); + $routes->get('/create', 'ZoneController::create_form'); + }); +}); diff --git a/app/Controllers/Cloudflare/AccountController.php b/app/Controllers/Cloudflare/AccountController.php index 159a03f..8ed7479 100644 --- a/app/Controllers/Cloudflare/AccountController.php +++ b/app/Controllers/Cloudflare/AccountController.php @@ -12,8 +12,6 @@ use CodeIgniter\HTTP\RedirectResponse; use App\Traits\AuthTrait; use App\Models\Cloudflare\AccountModel; use App\Entities\Cloudflare\AccountEntity; -use App\Libraries\MySocket\CloudflareSocket; - class AccountController extends MVController { @@ -24,9 +22,9 @@ class AccountController extends MVController parent::initController($request, $response, $logger); $this->session = $this->session_AuthTrait(); $this->class_name = 'Account'; + $this->view_path = 'Account'; helper($this->class_name); } - final protected function getModel(): AccountModel { if ($this->_model === null) { @@ -36,7 +34,7 @@ class AccountController extends MVController } protected function create_init(): void { - $this->fields = ['id', 'apikey']; + $this->fields = [$this->getModel()::TITLE, 'apikey', 'status']; $this->filter_fields = ['status']; $this->action = DB_ACTION["CREATE"]; $this->getModel()->setAction($this->action); diff --git a/app/Controllers/Cloudflare/ZoneController.php b/app/Controllers/Cloudflare/ZoneController.php index 1bad8bb..92fc2eb 100644 --- a/app/Controllers/Cloudflare/ZoneController.php +++ b/app/Controllers/Cloudflare/ZoneController.php @@ -11,11 +11,9 @@ use App\Traits\AuthTrait; use App\Models\Cloudflare\ZoneModel; use App\Models\Cloudflare\AccountModel; -use App\Libraries\MySocket\CloudflareSocket; use App\Libraries\MyCloudflare\Zone; use App\Entities\Cloudflare\ZoneEntity; - class ZoneController extends MVController { use AuthTrait; @@ -42,10 +40,25 @@ class ZoneController extends MVController } return $this->_accountModel; } + protected function getFormFieldOption(string $field, array $options = []): array + { + switch ($field) { + case ZoneModel::PARENT: + $options = [ + DEFAULTS['EMPTY'] => lang($this->_className . '.label.' . $field) . ' 선택' + ]; + $options = $this->getAccountModel()->getFilterFieldOption($field, $options); + break; + default: + $options = parent::getFormFieldOption($field, $options); + break; + } + return $options; + } protected function create_init(): void { - $this->fields = ['id', 'apikey']; - $this->filter_fields = ['status']; + $this->fields = [$this->getModel()::PARENT, $this->getModel()::TITLE, 'status', 'type']; + $this->filter_fields = [$this->getModel()::PARENT, 'status', 'type']; $this->action = 'create'; $this->getModel()->setAction($this->action); } diff --git a/app/Controllers/MVController.php b/app/Controllers/MVController.php index 1b4c8e8..e61218e 100644 --- a/app/Controllers/MVController.php +++ b/app/Controllers/MVController.php @@ -16,32 +16,51 @@ abstract class MVController extends CommonController abstract protected function create_init(): void; abstract protected function getModel(): mixed; //Field별 Form Option용 - protected function getFormFilterOption(string $filter_field, array $filter_options): array + protected function getFormFieldOption(string $field, array $options = []): array { - switch ($filter_field) { + switch ($field) { default: - $temps = lang($this->class_name . '.' . strtoupper($filter_field)); + $temps = lang($this->class_name . '.' . strtoupper($field)); if (!is_array($temps)) { - throw new \Exception(__FUNCTION__ . "에서 {$filter_field}의 데이터가 array가 아닙니다.\n" . var_export($temps, true)); + throw new \Exception(__FUNCTION__ . "에서 {$field}의 데이터가 array가 아닙니다.\n" . var_export($temps, true)); } - $filter_options[$filter_field] = [ - ["" => lang($this->class_name . '.label.' . $filter_field) . ' 선택'], - lang($this->class_name . '.' . strtoupper($filter_field)) + $options = [ + ["" => lang($this->class_name . '.label.' . $field) . ' 선택'], + lang($this->class_name . '.' . strtoupper($field)) ]; break; } - return $filter_options; + return $options; } - //Field별 Form Option용 - final public function getFormFilterOptions(array $filter_options = []): array + protected function getFormFieldInput(string $field, mixed $value, array $inputs = []): array { - foreach ($this->filter_fields as $filter_field) { - if (is_array($filter_field)) { - throw new \Exception(__FUNCTION__ . "에서 filter_field가 array 입니다.\n" . var_export($filter_field, true)); - } - $filter_options = $this->getFormFilterOption($filter_field, $filter_options); + switch ($field) { + case 'status': + $inputs[$field] = form_dropdown( + $field, + $this->getFormFieldOption($field), + $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 $filter_options; + return $inputs; + } + final public function getFormFieldInputs(array $inputs = []): array + { + foreach ($this->fields as $field) { + if (is_array($field)) { + throw new \Exception(__FUNCTION__ . "에서 field array 입니다.\n" . var_export($field, true)); + } + $inputs = $this->getFormFieldInput($field, old($field), $inputs); + } + return $inputs; } protected function getFormFieldRule(string $field, array $rules): array { @@ -95,9 +114,12 @@ abstract class MVController extends CommonController helper(['form']); try { $this->create_init(); - $this->create_form_process(); + $this->forminputs = $this->getFormFieldInputs(); $this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']); - return view("/{$this->class_name}/insert", ['attributes' => $this->getAttributes]); + return view( + $this->view_path . "/" . strtolower($this->class_name) . "/create", + ['viewDatas' => $this->getAttributes()] + ); } catch (\Exception $e) { log_message("error", $e->getMessage()); return redirect()->to($this->session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with(SESSION_NAMES['RETURN_MSG'], $e->getMessage()); diff --git a/app/Language/Cloudflare/API/Account.php b/app/Language/Cloudflare/API/Account.php new file mode 100644 index 0000000..0253a2d --- /dev/null +++ b/app/Language/Cloudflare/API/Account.php @@ -0,0 +1,22 @@ + "Account정보", + 'label' => [ + 'uid' => "번호", + 'id' => "인증ID", + 'apikey' => "인증Key", + 'oldkey' => "이전인증Key", + 'type' => "가입방식", + 'status' => "상태", + 'updated_at' => "수정일", + 'created_at' => "작성일" + ], + "TYPE" => [ + "standard" => "standard", + "enterprise" => "enterprise" + ], + "STATUS" => [ + "use" => "사용", + "unuse" => "사용않함", + ] +]; diff --git a/app/Language/Cloudflare/API/Record.php b/app/Language/Cloudflare/API/Record.php new file mode 100644 index 0000000..4024389 --- /dev/null +++ b/app/Language/Cloudflare/API/Record.php @@ -0,0 +1,47 @@ + "Record정보", + 'label' => [ + 'uid' => "번호", + 'zone_uid' => "도메인", + 'type' => "Type", + 'host' => "호스트명", + 'content' => "IP정보", + 'ttl' => "TTL", + 'proxiable' => "proxiable", + 'fixed' => "CDN잠금", + 'proxied' => "CDN기능", + 'locked' => "서비스", + 'updated_at' => "수정일", + 'created_at' => "작성일" + ], + "ZONE_UID" => [], + "TYPE" => [ + 'A' => 'A', + 'AAAA' => 'AAAA(ipv6)', + 'CNAME' => 'CNAME', + 'MX' => 'MX', + 'SRV' => 'SRV', + 'PTR' => 'PTR', + 'SPF' => 'SPF', + 'TXT' => 'TXT', + 'NS' => 'NS', + 'INFO' => 'INFO', + ], + "PROXIABLE" => [ + "on" => "사용", + "off" => "사용 않함", + ], + "FIXED" => [ + "on" => "사용", + "off" => "사용 않함", + ], + "PROXIED" => [ + "on" => "사용", + "off" => "사용 않함", + ], + "LOCKED" => [ + "on" => "운영중", + "off" => "잠김", + ], +]; diff --git a/app/Language/Cloudflare/API/Zone.php b/app/Language/Cloudflare/API/Zone.php new file mode 100644 index 0000000..2a077b5 --- /dev/null +++ b/app/Language/Cloudflare/API/Zone.php @@ -0,0 +1,38 @@ + "Zone정보", + 'label' => [ + 'uid' => "번호", + 'account_uid' => "계정", + 'domain' => "도메인", + 'name_servers' => "네임서버", + 'original_name_servers' => "이전네임서버", + 'plan' => "plan", + 'development_mode' => "개발모드", + 'ipv6' => "ipv6", + 'security_level' => "공격방어", + 'status' => "서비스", + 'updated_at' => "수정일", + 'created_at' => "작성일" + ], + "ACCOUNT_UID" => [ + ], + "DEVELOPMENT_MODE" => [ + "on" => "사용", + "off" => "사용않함", + ], + "IPV6" => [ + "on" => "사용", + "off" => "사용않함", + ], + "SECURITY_LEVEL" => [ + "under_attack" => "under_attack", + "medium" => "medium", + "low" => "low", + "essentially_off" => "essentially_off" + ], + "STATUS" => [ + "active" => "active", + "pending" => "pending", + ], +]; \ No newline at end of file diff --git a/app/Language/Mapurl.php b/app/Language/Mapurl.php new file mode 100644 index 0000000..32648f2 --- /dev/null +++ b/app/Language/Mapurl.php @@ -0,0 +1,16 @@ + "URL Mapping 정보", + 'label' => [ + 'uid' => "번호", + 'oldurl' => "기존URL", + 'newurl' => "신규URL", + 'status' => "상태", + 'updated_at' => "수정일", + 'created_at' => "작성일" + ], + "STATUS" => [ + "use" => "사용", + "unuse" => "사용않함", + ] +]; diff --git a/app/Language/User.php b/app/Language/User.php new file mode 100644 index 0000000..4647d0d --- /dev/null +++ b/app/Language/User.php @@ -0,0 +1,27 @@ + "계정정보", + 'label' => [ + 'uid' => "번호", + 'id' => "계정", + 'passwd' => "암호", + 'confirmpassword' => "암호확인", + 'email' => "메일", + 'role' => "권한", + 'name' => "이름", + 'status' => "상태", + 'updated_at' => "수정일", + 'created_at' => "작성일" + ], + "ROLE" => [ + "member" => "회원", + "manager" => "관리자", + "cloudflare" => "Cloudflare관리자", + "director" => "감독자", + "master" => "마스터" + ], + "STATUS" => [ + "use" => "사용", + "unuse" => "사용않함", + ] +]; diff --git a/app/Libraries/MyCloudflare/old/CloudflareLibrary.php b/app/Libraries/MyCloudflare/old/CloudflareLibrary.php deleted file mode 100644 index 191115e..0000000 --- a/app/Libraries/MyCloudflare/old/CloudflareLibrary.php +++ /dev/null @@ -1,119 +0,0 @@ -_parent = $parent; - $this->setAdapter(); - } - abstract public function getClassName(); - abstract protected function setAdapter(); - abstract protected function createEntity(\stdClass $cfResult); - abstract protected function getCFResults_List(int $page): array; - final protected static function getRequestCount() - { - return self::$_requestCount; - } - protected function setAdapter() - { - if (!is_null($this->_adapter)) { - throw new \Exception("Adapter가 이미 지정되었습니다."); - } - $apikey = new \Cloudflare\API\Auth\APIKey( - $this->getParent()->getAuthId(), - $this->getParent()->getAuthKey() - ); - $this->_adapter = new \Cloudflare\API\Adapter\Guzzle($apikey); - // throw new \Exception(var_export($this->_adapter, true)); - } - final protected function getAdapter(): \Cloudflare\API\Adapter\Guzzle - { - if (CF_REQUEST_MAX <= self::$_requestCount) { - log_message('warning', sprintf("--Cloudflare API Call %s초 대기 시작--", CF_REQUEST_WAITTIME)); - sleep(CF_REQUEST_WAITTIME); - self::$_requestCount = 0; - log_message('warning', sprintf("--Cloudflare API Call %s초 대기 종료--", CF_REQUEST_WAITTIME)); - } - self::$_requestCount++; - if (is_null($this->_adapter)) { - throw new \Exception("해당 Adapter가 없습니다."); - } - // throw new \Exception(var_export($this->_adapter, true)); - return $this->_adapter; - } - final public function getParent() - { - if (!isset($this->_parent)) { - throw new \Exception(__METHOD__ . "에서 오류발생: ParentEntity가 선언되지 않았습니다."); - } - return $this->_parent; - } - //reload관련 - //부모키를 기준으로 CF에 존재하지 않는 데이터 삭제용 - final protected function reload_delete(array $entitys) - { - $availableUids = array(); - if (count($entitys)) { - foreach ($entitys as $entity) { - array_push($availableUids, $entity->getPrimaryKey()); - } - $this->_model->where($this->_model::PARENT_FIELD, $this->getParent()->getPrimaryKey())->whereNotIn('uid', $availableUids)->delete(); - } else { - $this->_model->where($this->_model::PARENT_FIELD, $this->getParent()->getPrimaryKey())->delete(); - } - } - final protected function reload_entitys(array $cfResults): array - { - $entitys = array(); - if (count($cfResults)) { - $cnt = 1; - foreach ($cfResults as $cfResult) { - $entity = $this->getEntityByResult((object)$cfResult); - log_message("debug", "{$cnt}번째: {$entity->getTitle()} 저장"); - if (!$this->_model->save($entity)) { - log_message("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery()); - log_message("error", implode("\n", $this->_model->errors())); - throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true)); - } - array_push($entitys, $entity); - $cnt++; - } - } - return $entitys; - } - final protected function reload_cfResults(int $page_limit = 0) - { - $page = 1; //Page는 1부터 시작해야함 - $page_cnt = 1; - $cfResults = array(); - do { - $temp_cfResults = $this->getCFResults_List($page); - // throw new \Exception(var_export($temp_cfResults, true)); - $page = count($temp_cfResults) < CF_ADAPTER_PERPAGE_MAX ? 0 : $page + 1; - //Loop 갯수제한시 - if ($page_limit !== 0 && $page >= $page_limit + 1) { - $page = 0; - } - $cfResults = array_merge($cfResults, $temp_cfResults); - $page_cnt++; - } while (0 < $page); - return $cfResults; - } - - final public function reload(int $page_limit = 0): array - { - $cfResults = $this->reload_cfResults($page_limit); - log_message("notice", "-----{$this->getParent()->getTitle()} {$this->getClassName()} cfResult 처리[" . count($cfResults) . "개] 시작-----"); - $entitys = $this->reload_entitys($cfResults); - $this->reload_delete($entitys); - log_message("notice", "-----{$this->getParent()->getTitle()} {$this->getClassName()} DB 처리[" . count($entitys) . "개] 완료-----"); - return $entitys; - } -} diff --git a/app/Libraries/MyCloudflare/old/Magictransit/AllowList.php b/app/Libraries/MyCloudflare/old/Magictransit/AllowList.php deleted file mode 100644 index 1b9061a..0000000 --- a/app/Libraries/MyCloudflare/old/Magictransit/AllowList.php +++ /dev/null @@ -1,103 +0,0 @@ -_model = new \App\Models\Cloudflare\Magictransit\AllowListModel(); - } - public function setParentAuthEntity($parent_uid): void - { - $parent_entity = $this->getAccountModel()->getEntity($parent_uid); - $this->setParent($parent_entity); - $auth_entity = $this->getAuthModel()->getEntity($parent_entity->getParentFieldData()); - $this->setAuth($auth_entity); - } - public function getClassName() - { - return 'AllowList'; - } - protected function getEndPoint() - { - return is_null($this->_endPoint) ? "client/v4/accounts/{$this->getParent()->getPrimaryKey()}5/magic/advanced_tcp_protection/configs/allowlist" : $this->_endPoint; - } - public function getEntityByResult(\stdClass $cfResult): AllowListEntity - { - $entity = is_null($this->_entity) ? new AllowListEntity() : $this->_entity; - $entity->uid = $cfResult->id; - $entity->zone_uid = $this->getParent()->getPrimaryKey(); - $entity->description = $cfResult->description; - $entity->filter_id = $cfResult->filter->id; - $entity->filter_expression = isset($cfResult->filter->expression) && $cfResult->filter->expression ? $cfResult->filter->expression : ' '; - $entity->filter_paused = isset($cfResult->filter->paused) && $cfResult->filter->paused ? 'on' : 'off'; - $entity->action = $cfResult->action; - $entity->paused = $cfResult->paused ? 'off' : 'on'; - $entity->updated_at = $cfResult->modified_on; - $entity->created_at = $cfResult->created_on; - // parent::add_logs("notice","host:[{$cfResult->name}<>{$entity->description}] | proxied:[{$cfResult->proxied}<>{$entity->proxied}] | locked:[{$cfResult->locked}<>{$entity->locked}]"); - return $entity; - } - - // public function insert(){ } - public function update(AllowListEntity $entity, array $fieldDatas): AllowListEntity - { - $this->setParentAuthEntity($entity->getParentFieldData()); - - $isChanged = false; - foreach ($fieldDatas as $field => $value) { - if ($entity->$field != $value) { - $entity->$field = $value; - $isChanged = true; - } - } - if (!$isChanged) { - return $entity; - } - $rule = array_merge( - [ - 'id' => $entity->getPrimaryKey(), - 'filter' => [ - 'id' => $entity->filter_id, - 'expression' => $entity->filter_expression, - 'paused' => isset($entity->filter_paused) && $entity->filter_paused === 'on' ? true : false - ] - ], - [ - 'paused' => isset($entity->paused) && $entity->paused === 'on' ? false : true, - 'action' => $entity->action - ] - ); - if (!is_null($entity->description)) { - $rule['description'] = $entity->description; - } - - $cfResult = $this->getAdapter()->put('zones/' . $this->getParent()->getPrimaryKey() . '/AllowList/rules/' . $entity->getPrimaryKey(), $rule); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - return $this->getEntityByResult($cfResult->result); - } - // public function delete(){ } - public function sync(AllowListEntity $entity): AllowListEntity - { - $this->setParentAuthEntity($entity->getParentFieldData()); - - $cfResult = $this->getAdapter()->get('zones/' . $this->getParent()->getPrimaryKey() . '/AllowList/rules/' . $entity->getPrimaryKey()); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - return $this->getEntityByResult($cfResult->result); - } - protected function getCFResults_List(int $page): array - { - return $this->getEndPoint()->listAllowListRules($this->getParent()->getPrimaryKey(), $page, CF_ADAPTER_PERPAGE_MAX)->result; - } -} diff --git a/app/Libraries/MyCloudflare/old/Record_old.php b/app/Libraries/MyCloudflare/old/Record_old.php deleted file mode 100644 index c079cbb..0000000 --- a/app/Libraries/MyCloudflare/old/Record_old.php +++ /dev/null @@ -1,127 +0,0 @@ -_model = new \App\Models\Cloudflare\API\RecordModel(); - } - final protected function setAdapter() - { - if (!is_null($this->_adapter)) { - throw new \Exception("Adapter가 이미 지정되었습니다."); - } - $accountModel = new \App\Models\Cloudflare\API\AccountModel(); - $account = $accountModel->getEntity($this->getParent()->getParentFieldData()); - $authModel = new \App\Models\Cloudflare\API\AuthModel(); - $auth = $authModel->getEntity($account->getParentFieldData()); - $apikey = new \Cloudflare\API\Auth\APIKey($auth->getAuthId(), $auth->getAuthKey()); - $this->_adapter = new \Cloudflare\API\Adapter\Guzzle($apikey); - // throw new \Exception(var_export($this->_adapter, true)); - } - public function getClassName() - { - return 'Record'; - } - protected function getEntityByResult(\stdClass $cfResult): \App\Entities\Cloudflare\API\RecordEntity - { - // throw new \Exception(var_export($cfResult, true)); - $entity = is_null($this->_entity) ? new \App\Entities\Cloudflare\API\RecordEntity() : $this->_entity; - // throw new \Exception(var_export($cfResult, true)); - $entity->uid = $cfResult->id; - $entity->zone_uid = $cfResult->zone_id; - $entity->host = $cfResult->name; - $entity->type = $cfResult->type; - $entity->content = $cfResult->content; - $entity->ttl = (int) $cfResult->ttl; - $entity->proxiable = $cfResult->proxiable ? "on" : "off"; - $entity->proxied = $cfResult->proxied ? "on" : "off"; - $entity->locked = "on"; - if (isset($cfResult->locked) && $cfResult->locked) { - $entity->locked = "off"; - } - // $entity->updated_at = $cfResult->modified_on; - $entity->created_at = $cfResult->created_on; - // throw new \Exception(var_export($cfResult, true)); - return $entity; - } - - public function insert(array $fieldDatas): \App\Entities\Cloudflare\API\RecordEntity - { - //TTL값은 CDN(proxied)가 사용함일때는 무조건 1, 않함일때는 120이 적용 - $options = [ - 'name' => $fieldDatas['host'], - 'type' => $fieldDatas['type'], - 'content' => $fieldDatas['content'], - 'proxied' => isset($fieldDatas['proxied']) && $fieldDatas['proxied'] === 'on' ? true : false - ]; - // throw new \Exception(var_export($options, true)); - $cfResult = $this->getAdapter()->post('zones/' . $this->getParent()->getPrimaryKey() . '/dns_records', $options); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - $entity = $this->getEntityByResult($cfResult->result); - Log::add("warning", "Record API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $entity; - } - public function update(\App\Entities\Cloudflare\API\RecordEntity $entity, array $fieldDatas): \App\Entities\Cloudflare\API\RecordEntity - { - //TTL값은 CDN(proxied)가 사용함일때는 무조건 1, 않함일때는 120이 적용 - $options = [ - 'type' => isset($fieldDatas['type']) ? $fieldDatas['type'] : $entity->type, - 'name' => isset($fieldDatas['host']) ? $fieldDatas['host'] : $entity->host, - 'content' => isset($fieldDatas['content']) ? $fieldDatas['content'] : $entity->content, - 'proxied' => $entity->proxied == 'on' ? true : false, - 'ttl' => intval($entity->ttl) - ]; - //변경작업: 2024-08-09 - if (isset($fieldDatas['proxied']) && $fieldDatas['proxied'] === 'on') { - $options['proxied'] = true; - $options['ttl'] = 1; - } elseif (isset($fieldDatas['proxied']) && $fieldDatas['proxied'] === 'off') { - $options['proxied'] = false; - $options['ttl'] = 120; - } - //dd($options); - // throw new \Exception(var_export($fieldDatas, true) . "
" . var_export($options, true)); - $cfResult = $this->getAdapter()->put('zones/' . $this->getParent()->getPrimaryKey() . '/dns_records/' . $entity->getPrimaryKey(), $options); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - Log::add("warning", "Record API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $this->getEntityByResult($cfResult->result); - } - public function delete(\App\Entities\Cloudflare\API\RecordEntity $entity) - { - $cfResult = $this->getAdapter()->delete('zones/' . $this->getParent()->getPrimaryKey() . '/dns_records/' . $entity->getPrimaryKey()); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - Log::add("warning", "Record API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - } - public function sync(\App\Entities\Cloudflare\API\RecordEntity $entity): \App\Entities\Cloudflare\API\RecordEntity - { - $cfResult = $this->getAdapter()->get('zones/' . $this->getParent()->getPrimaryKey() . '/dns_records/' . $entity->getPrimaryKey()); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - Log::add("warning", "Record API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $this->getEntityByResult($cfResult->result); - } - protected function getCFResults_List(int $page): array - { - $this->_endPoint = is_null($this->_endPoint) ? new \Cloudflare\API\Endpoints\DNS($this->getAdapter()) : $this->_endPoint; - return $this->_endPoint->listRecords($this->getParent()->getPrimaryKey(), '', '', '', $page, CF_ADAPTER_PERPAGE_MAX)->result; - } -} diff --git a/app/Libraries/MyCloudflare/old/Zone_old.php b/app/Libraries/MyCloudflare/old/Zone_old.php deleted file mode 100644 index 7a39d7a..0000000 --- a/app/Libraries/MyCloudflare/old/Zone_old.php +++ /dev/null @@ -1,152 +0,0 @@ -_isGetSetting = $isGetSetting; - $this->_model = new \App\Models\Cloudflare\API\ZoneModel(); - } - final protected function setAdapter() - { - if (!is_null($this->_adapter)) { - throw new \Exception("Adapter가 이미 지정되었습니다."); - } - $authModel = new \App\Models\Cloudflare\API\AuthModel(); - $auth = $authModel->getEntity($this->getParent()->getParentFieldData()); - $apikey = new \Cloudflare\API\Auth\APIKey($auth->getAuthId(), $auth->getAuthKey()); - $this->_adapter = new \Cloudflare\API\Adapter\Guzzle($apikey); - // throw new \Exception(var_export($this->_adapter, true)); - } - public function getClassName() - { - return 'Zone'; - } - - //Cfzone에서 가져온 값을 zone에 setting - protected function getEntityByResult(\stdClass $cfResult): \App\Entities\Cloudflare\API\ZoneEntity - { - $entity = is_null($this->_entity) ? new \App\Entities\Cloudflare\API\ZoneEntity() : $this->_entity; - $entity->uid = $cfResult->id; - $entity->account_uid = $cfResult->account->id; - $entity->domain = $cfResult->name; - $entity->status = $cfResult->status; - //$entity->type = $cfResult->type; // full 이게있는데 뭔지 잘모름 - $entity->name_servers = 'none'; - if (isset($cfResult->name_servers)) { - $entity->name_servers = is_array($cfResult->name_servers) ? - implode(',', $cfResult->name_servers) : $cfResult->name_servers; - } - $entity->original_name_servers = 'none'; - if (isset($cfResult->original_name_servers)) { - $entity->original_name_servers = is_array($cfResult->original_name_servers) ? - implode(',', $cfResult->original_name_servers) : $cfResult->original_name_servers; - } - $entity->updated_at = $cfResult->modified_on; - $entity->created_at = $cfResult->created_on; - $entity->plan = $cfResult->plan->name; - return $this->_isGetSetting ? $this->getCFSetting($entity) : $entity; - } - - //Cfzone에서 가져온 값을 zone에 setting - final public function getCFSetting(\App\Entities\Cloudflare\API\ZoneEntity $entity): \App\Entities\Cloudflare\API\ZoneEntity - { - $cfResult = $this->getAdapter()->get('zones/' . $entity->getPrimaryKey() . '/settings/'); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(__FUNCTION__ . "에서 Call Error:\n" . var_export($cfResult, true)); - } - foreach ($cfResult->result as $cfResult) { - switch ($cfResult->id) { - case 'development_mode': - $entity->development_mode = $cfResult->value; - break; - case 'ipv6': - $entity->ipv6 = $cfResult->value; - break; - case 'security_level': - $entity->security_level = $cfResult->value; - break; - } - } - return $entity; - } - //Cfzone에 해당 키값 변경용 - final public function setCFSetting(\App\Entities\Cloudflare\API\ZoneEntity $entity, string $field, string $value): \App\Entities\Cloudflare\API\ZoneEntity - { - $cfResult = $this->getAdapter()->patch('zones/' . $entity->getPrimaryKey() . '/settings/' . $field, array('value' => $value)); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success || $cfResult->result->id !== $field) { - throw new \Exception(__FUNCTION__ . "에서 {$field}->{$value} 변경오류:\n" . var_export($cfResult, true)); - } - //최종 결과값은 body->result->id='필드명',body->result->value='on/off'이런식으로 받음 - $entity->$field = $cfResult->result->value; - Log::add("warning", "Zone API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $entity; - } - - public function insert(array $fieldDatas): \App\Entities\Cloudflare\API\ZoneEntity - { - //도메인생성을 위해 Cloudflare에 전송 - $options = [ - 'accountId' => $this->getParent()->getPrimaryKey(), - 'name' => $fieldDatas['domain'], - 'jump_start' => false, - ]; - $cfResult = $this->getAdapter()->post('zones/', $options); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - $entity = $this->getEntityByResult($cfResult->result); - //아래는 추가 셋팅 ipv6 TurnOFF , //Development mode TurnOFF - $entity = $this->setCFSetting($entity, 'ipv6', 'off'); - $entity = $this->setCFSetting($entity, 'development_mode', 'off'); - $entity = $this->setCFSetting($entity, 'security_level', 'medium'); - Log::add("warning", "Record API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $entity; - } - public function update(\App\Entities\Cloudflare\API\ZoneEntity $entity, array $fieldDatas): \App\Entities\Cloudflare\API\ZoneEntity - { - //ipv6 , //development_mode , //security_level - foreach ($fieldDatas as $field => $value) { - $entity = $this->setCFSetting($entity, $field, $value); - } - Log::add("warning", "API {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $entity; - } - public function delete(\App\Entities\Cloudflare\API\ZoneEntity $entity) - { - //Zone 삭제 - $cfResult = $this->getAdapter()->delete('zones/' . $entity->getPrimaryKey()); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - Log::add("warning", "Zone API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - } - public function sync(\App\Entities\Cloudflare\API\ZoneEntity $entity): \App\Entities\Cloudflare\API\ZoneEntity - { - $cfResult = $this->getAdapter()->get('zones/' . $entity->getPrimaryKey()); - $cfResult = json_decode($cfResult->getBody()); - if (!$cfResult->success) { - throw new \Exception(var_export($cfResult, true)); - } - Log::add("warning", "Zone API: {$entity->getTitle()} " . __FUNCTION__ . " 완료하였습니다."); - return $this->getEntityByResult($cfResult->result); - } - - protected function getCFResults_List(int $page): array - { - $this->_endPoint = is_null($this->_endPoint) ? new \Cloudflare\API\Endpoints\Zones($this->getAdapter()) : $this->_endPoint; - return $this->_endPoint->listZones('', '', $page, CF_ADAPTER_PERPAGE_MAX)->result; - } -} diff --git a/app/Models/Cloudflare/AccountModel.php b/app/Models/Cloudflare/AccountModel.php index 2c1f488..dfb8783 100644 --- a/app/Models/Cloudflare/AccountModel.php +++ b/app/Models/Cloudflare/AccountModel.php @@ -33,7 +33,7 @@ class AccountModel extends CommonModel $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}/]";; break; case "type": - $rules[$field] = "if_exist|trim|string"; + $rules[$field] = "if_exist|in_list[standard,enterprise]"; break; default: $rules = parent::getFieldRule($field, $rules); @@ -41,6 +41,17 @@ class AccountModel extends CommonModel } return $rules; } + public function getFormFieldOption(string $field, array $options = []): array + { + switch ($field) { + default: + $this->where('status', DEFAULTS['STATUS']); + $this->orderBy(self::TITLE, 'asc'); + $options = parent::getFormFieldOption($field, $options); + break; + } + return $options; + } public function getEntityByPK(int $uid): null | AccountEntity { $this->where($this->getPKField(), $uid); @@ -51,7 +62,6 @@ class AccountModel extends CommonModel $this->where($this->getTitleField(), $id); return $this->getEntity(); } - //create용 public function create(array $formDatas = []): AccountEntity { diff --git a/app/Models/Cloudflare/RecordModel.php b/app/Models/Cloudflare/RecordModel.php index c51e45c..0e4d895 100644 --- a/app/Models/Cloudflare/RecordModel.php +++ b/app/Models/Cloudflare/RecordModel.php @@ -16,7 +16,7 @@ class RecordModel extends Model protected $primaryKey = self::PK; protected $useAutoIncrement = false; protected $returnType = RecordEntity::class; //object,array,entity명::class - protected $allowedFields = [self::PK, self::PARENT, 'type', self::TITLE, 'content', 'ttl', 'proxiable', 'proxied', 'fixed', 'locked', 'updated_at', 'crated_at']; + protected $allowedFields = [self::PK, self::PARENT, self::TITLE, 'type', 'content', 'ttl', 'proxiable', 'proxied', 'fixed', 'locked', 'updated_at', 'crated_at']; protected $useTimestamps = true; public function __construct() @@ -35,9 +35,11 @@ class RecordModel extends Model break; case self::TITLE: case "content": - case "type": $rules[$field] = "required|trim|string"; break; + case "type": + $rules[$field] = "required|in_list[A,AAA,CNAME,MX,NS,PTR,SPF,TXT,SRV,INFO]"; + break; case "ttl": $rules[$field] = "if_exist|numeric"; break; diff --git a/app/Models/CommonModel.php b/app/Models/CommonModel.php index c0d32c8..a7c9021 100644 --- a/app/Models/CommonModel.php +++ b/app/Models/CommonModel.php @@ -130,6 +130,17 @@ abstract class CommonModel extends Model } return $rules; } + public function getFormFieldOption(string $field, array $options = []): array + { + switch ($field) { + default: + foreach ($this->getEntitys() as $entity) { + $options[$field][$entity->getPK()] = $entity->getTitle(); + } + break; + } + return $options; + } final public function getEntity(): array|object|null { return $this->asObject($this->returnType)->first(); @@ -138,7 +149,6 @@ abstract class CommonModel extends Model { return $this->asObject($this->returnType)->findAll(); } - //create , modify 직전 작업용 작업 final protected function convertEntityData(string $field, array $formDatas): mixed { diff --git a/app/Views/admin/user/index.php b/app/Views/admin/user/index.php new file mode 100644 index 0000000..4ba60b3 --- /dev/null +++ b/app/Views/admin/user/index.php @@ -0,0 +1,50 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+
+ "get")) ?> + + include('templates/admin/index_head') ?> + +
+ + + + + + + + + + + + + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)"> + + + + + + + + + +
#@
+ "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> + getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> + getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
+
+ + +
+ +
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/user/insert.php b/app/Views/admin/user/insert.php new file mode 100644 index 0000000..e834872 --- /dev/null +++ b/app/Views/admin/user/insert.php @@ -0,0 +1,24 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + + + + + + +
+ + +
"btn btn-outline btn-primary")); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/user/update.php b/app/Views/admin/user/update.php new file mode 100644 index 0000000..c673532 --- /dev/null +++ b/app/Views/admin/user/update.php @@ -0,0 +1,24 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + + + + + + +
+ $field ?: DEFAULTS['EMPTY'], $viewDatas) ?> + +
"btn btn-outline btn-primary")); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/user/view.php b/app/Views/admin/user/view.php new file mode 100644 index 0000000..69e8d92 --- /dev/null +++ b/app/Views/admin/user/view.php @@ -0,0 +1,19 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + +
+ + +
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/admin/welcome_message.php b/app/Views/admin/welcome_message.php new file mode 100644 index 0000000..3b71da9 --- /dev/null +++ b/app/Views/admin/welcome_message.php @@ -0,0 +1,5 @@ +extend('layouts/admin') ?> +section('content') ?> +include('templates/admin/header'); ?> +include('templates/admin/footer'); ?> +endSection() ?> \ No newline at end of file diff --git a/app/Views/cells/board/information.php b/app/Views/cells/board/information.php new file mode 100644 index 0000000..1f4d6b4 --- /dev/null +++ b/app/Views/cells/board/information.php @@ -0,0 +1,5 @@ + + +
+ + \ No newline at end of file diff --git a/app/Views/cells/board/reference.php b/app/Views/cells/board/reference.php new file mode 100644 index 0000000..1f4d6b4 --- /dev/null +++ b/app/Views/cells/board/reference.php @@ -0,0 +1,5 @@ + + +
+ + \ No newline at end of file diff --git a/app/Views/cells/product/beremetal_calculator.php b/app/Views/cells/product/beremetal_calculator.php new file mode 100644 index 0000000..69ec978 --- /dev/null +++ b/app/Views/cells/product/beremetal_calculator.php @@ -0,0 +1,82 @@ + + +
+ 'post', + "onsubmit" => 'return calculator()' + ]) ?> + + + + + + + + + + + getPrimaryKey()] = $entity->getTitleWithPrice(); + } + ?> + + + + + + + + + + + + + + +
가상서버 견적 계산기
+ $category, + 'class' => 'vhost_cellDatas', + 'onChange' => "calculator()" + ] + ) ?> +
결제일 + "결제일 선택"]; + for ($i = 1; $i <= 28; $i++) { + $paymentDayOptions[$i] = "매월 {$i}일"; + } + ?> + 'paymentday']); + ?> +
주문금액 + 0원 + "btn btn-outline btn-primary")); ?> +
+ + + getFlashdata('return_message') ? alert_CommonHelper($cellDatas['session']->getFlashdata('return_message')) : "" ?> +
\ No newline at end of file diff --git a/app/Views/cells/product/device.php b/app/Views/cells/product/device.php new file mode 100644 index 0000000..efc501c --- /dev/null +++ b/app/Views/cells/product/device.php @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + +
+ $productDevieceEntity) : ?> +
device_uid]->getTitle() ?>
+ +
+ $label) : ?> + + +
\ No newline at end of file diff --git a/app/Views/cells/product/virtual.php b/app/Views/cells/product/virtual.php new file mode 100644 index 0000000..e7d8e94 --- /dev/null +++ b/app/Views/cells/product/virtual.php @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/app/Views/cells/product/virtual_caculator.php b/app/Views/cells/product/virtual_caculator.php new file mode 100644 index 0000000..2118975 --- /dev/null +++ b/app/Views/cells/product/virtual_caculator.php @@ -0,0 +1,87 @@ + + +
+ 'post', + "onsubmit" => 'return calculator(' . $cellDatas['parts']['virtual']['default']['baserate'] . ')' + ]) ?> + + + + + + + + + + + + + + $attrs) : ?> + + + + + + + + + + + + + + +
가상서버 견적 계산기
기본요금 + +
+ + 할인가 * + $category, + 'class' => 'vhost_parts', + 'cost' => $attrs['cost'], + 'sale' => $attrs['sale'], + 'onChange' => "calculator(" . $cellDatas['parts']['virtual']['default']['baserate'] . ")" + ] + ) ?> + +
결제일 + "결제일 선택"]; + for ($i = 1; $i <= 28; $i++) { + $paymentDayOptions[$i] = "매월 {$i}일"; + } + ?> + 'paymentday']); + ?> +
주문금액 + 0원 + "btn btn-outline btn-primary")); ?> +
+ + + getFlashdata('return_message') ? alert_CommonHelper($cellDatas['session']->getFlashdata('return_message')) : "" ?> +
\ No newline at end of file diff --git a/app/Views/cloudflare/account/create.php b/app/Views/cloudflare/account/create.php new file mode 100644 index 0000000..fa9fd95 --- /dev/null +++ b/app/Views/cloudflare/account/create.php @@ -0,0 +1,24 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + + + + + + +
class_name . '.label.' . $field) ?> + + +
"btn btn-outline btn-primary")); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/cloudflare/account/index.php b/app/Views/cloudflare/account/index.php new file mode 100644 index 0000000..4ba60b3 --- /dev/null +++ b/app/Views/cloudflare/account/index.php @@ -0,0 +1,50 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+
+ "get")) ?> + + include('templates/admin/index_head') ?> + +
+ + + + + + + + + + + + + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)"> + + + + + + + + + +
#@
+ "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?> + getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> + getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
+
+ + +
+ +
+endSection() ?> \ No newline at end of file diff --git a/app/Views/cloudflare/account/update.php b/app/Views/cloudflare/account/update.php new file mode 100644 index 0000000..c673532 --- /dev/null +++ b/app/Views/cloudflare/account/update.php @@ -0,0 +1,24 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + + + + + + +
+ $field ?: DEFAULTS['EMPTY'], $viewDatas) ?> + +
"btn btn-outline btn-primary")); ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/cloudflare/account/view.php b/app/Views/cloudflare/account/view.php new file mode 100644 index 0000000..69e8d92 --- /dev/null +++ b/app/Views/cloudflare/account/view.php @@ -0,0 +1,19 @@ +extend('layouts/admin') ?> +section('content') ?> + +
+ + + + + + + + + +
+ + +
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/index.php b/app/Views/front/user/index.php new file mode 100644 index 0000000..66ba655 --- /dev/null +++ b/app/Views/front/user/index.php @@ -0,0 +1,41 @@ +extend('layouts/front') ?> +section('content') ?> + +
+
head) ?>
+
include('templates/front/index_head') ?>
+ + + + + + + + + + + + status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)"> + + + + + + + + +
#
+ + getPrimaryKey() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?> + getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?> + + + +
+
+ +
+ +
tail) ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/insert.php b/app/Views/front/user/insert.php new file mode 100644 index 0000000..db7c9b9 --- /dev/null +++ b/app/Views/front/user/insert.php @@ -0,0 +1,24 @@ +extend('layouts/front') ?> +section('content') ?> + +
+
head) ?>
+ + + + + + + + + + + +
+ + +
"btn btn-outline btn-primary")); ?>
+ +
tail) ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/login.php b/app/Views/front/user/login.php new file mode 100644 index 0000000..1f01f65 --- /dev/null +++ b/app/Views/front/user/login.php @@ -0,0 +1,39 @@ +extend('layouts/main') ?> +section('content') ?> + + +
+ +
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/login_v1.php b/app/Views/front/user/login_v1.php new file mode 100644 index 0000000..0124bd9 --- /dev/null +++ b/app/Views/front/user/login_v1.php @@ -0,0 +1,37 @@ +extend('layouts/main') ?> +section('content') ?> + + +
+ + +
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/user/update.php b/app/Views/front/user/update.php new file mode 100644 index 0000000..e4de5a0 --- /dev/null +++ b/app/Views/front/user/update.php @@ -0,0 +1,24 @@ +extend('layouts/front') ?> +section('content') ?> + +
+
head) ?>
+ + + + + + + + + + + +
+ $field ?: DEFAULTS['EMPTY']), $viewDatas) ?> + +
"btn btn-outline btn-primary")); ?>
+ +
tail) ?>
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/front/welcome_message.php b/app/Views/front/welcome_message.php new file mode 100644 index 0000000..82d40fd --- /dev/null +++ b/app/Views/front/welcome_message.php @@ -0,0 +1,342 @@ +extend('layouts/main') ?> +section('content') ?> + +
+ +
+ +
+
+

가상서버 안내 및 사양, 가격정보입니다.

+
+
+ + + + + + + + + + + + + + + + + +
4core
지원 서비스 문의
+
    +
  • 서비스 방어
  • +
  • DDOS 방어
  • +
  • 무료 SSL(Let's Encrypt)
  • +
  • 기본 OS 및 Application 설치
  • +
  • 내부 사설네트워크 추가
  • +
  • Backup/Restore,Snapshot
  • +
  • 공통 가상서버 Template
  • +
  • Online 스펙변경가능
  • +
  • 서비스 신청 후 1시간내 사용가능
  • +
  • OS(x64) : Linux , Windows 등 지원
  • +
+
+
    +
  • 웹호스팅의 제약으로인해, 단독서버호스팅으로 전환해야 하나,
    비용/관리 부분이 걱정되시는 분
  • +
  • 장비 구매/임대/유지 비용을 절감하고자 하는, 중/소 규모 서비스
  • +
  • 신규 사업 시작시 독자적인 사이트 운영이 필요하신 분
  • +
  • 사용량이 낮은 단독 서버호스팅 운영비용 절감이 필요하신 분
  • +
  • 비정기적 이벤트에 따른 일시적/한시적 서버환경이 필요하신 분
  • +
  • 최신 하드웨어에서 설치 불가한 구버전 운영체제를 이용하실 경우
  • +
+
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
VPS Basic(HP DL360Gen9)
VPS Basic(HP DL360Gen9)
VCPUXeon 4Core
RAM8G
SSD100G
기본임대료15만원 할인가 10만원 (공인IP,회선비 별도)
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + +
VPS Pro(HP DL360Gen9)
VPS Pro(HP DL360Gen9)
VCPUXeon 8Core
RAM16G
SSD150G
기본임대료25만원 할인가 15만원 (공인IP,회선비 별도)
+
+
+
+
+

단독서버 안내 및 사양, 가격정보입니다.

+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
4core
4core
CPUE5530
RAM8G
HDDSAS146G*4
임대료35만원 할인가 25만원 (회선비 별도)
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
8core
8core
CPUX5560*2
RAM16G
HDDSSD128G*2+SATA500G*2
임대료45만원 할인가 35만원 (회선비 별도)
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
12core
12core
CPUX5650*2
RAM16G
HDDSSD128G*2+SATA500G*2
임대료55만원 할인가 45만원 (회선비 별도)
+
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
20core
20core
CPUE2690v2*2
RAM32G
HDDSSD128G*2+SATA500G*2
임대료65만원 할인가 55만원 (회선비 별도)
+
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
    +
  • +
    +
    +
    고객센터
    +
    +
    +
    +
  • +
  • +
    +
    +
    자료실
    +
    +
    +
    +
  • +
  • +
    +
    +
    공지사항
    +
    +
    +
    +
  • +
+
+
+
+
+endSection() ?> \ No newline at end of file diff --git a/app/Views/layouts/admin.php b/app/Views/layouts/admin.php new file mode 100644 index 0000000..9b661e7 --- /dev/null +++ b/app/Views/layouts/admin.php @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + <?= $viewDatas['title'] ?> + + + + +
+ +
+ + + \ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu.php b/app/Views/layouts/admin/left_menu.php new file mode 100644 index 0000000..38be6ad --- /dev/null +++ b/app/Views/layouts/admin/left_menu.php @@ -0,0 +1,10 @@ + + + +
+
+ include($viewDatas['layout']['path'] . '/left_menu/base'); ?> + include($viewDatas['layout']['path'] . '/left_menu/site'); ?> + include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?> +
+
\ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/base.php b/app/Views/layouts/admin/left_menu/base.php new file mode 100644 index 0000000..3b2b965 --- /dev/null +++ b/app/Views/layouts/admin/left_menu/base.php @@ -0,0 +1,12 @@ +
+

Main

+
+
+

계정 관리

+
+
+

SNS 계정 관리

+
+
+

분류 관리

+
\ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/shoppingmall.php b/app/Views/layouts/admin/left_menu/shoppingmall.php new file mode 100644 index 0000000..b5c75e4 --- /dev/null +++ b/app/Views/layouts/admin/left_menu/shoppingmall.php @@ -0,0 +1,19 @@ +
+

+ +

+ +
\ No newline at end of file diff --git a/app/Views/layouts/admin/left_menu/site.php b/app/Views/layouts/admin/left_menu/site.php new file mode 100644 index 0000000..76c84c9 --- /dev/null +++ b/app/Views/layouts/admin/left_menu/site.php @@ -0,0 +1,13 @@ +
+

+ +

+ +
\ No newline at end of file diff --git a/app/Views/layouts/admin/make_password.php b/app/Views/layouts/admin/make_password.php new file mode 100644 index 0000000..23f0cc2 --- /dev/null +++ b/app/Views/layouts/admin/make_password.php @@ -0,0 +1,4 @@ +
+ + +
\ No newline at end of file diff --git a/app/Views/layouts/admin/top_navigator.php b/app/Views/layouts/admin/top_navigator.php new file mode 100644 index 0000000..9a55593 --- /dev/null +++ b/app/Views/layouts/admin/top_navigator.php @@ -0,0 +1,20 @@ + \ No newline at end of file diff --git a/app/Views/layouts/admin/top_navigator/make_password.php b/app/Views/layouts/admin/top_navigator/make_password.php new file mode 100644 index 0000000..cbb0baa --- /dev/null +++ b/app/Views/layouts/admin/top_navigator/make_password.php @@ -0,0 +1,5 @@ + \ No newline at end of file diff --git a/app/Views/layouts/admin/top_navigator/member_link.php b/app/Views/layouts/admin/top_navigator/member_link.php new file mode 100644 index 0000000..0750447 --- /dev/null +++ b/app/Views/layouts/admin/top_navigator/member_link.php @@ -0,0 +1,14 @@ + \ No newline at end of file diff --git a/app/Views/layouts/admin/top_navigator/search.php b/app/Views/layouts/admin/top_navigator/search.php new file mode 100644 index 0000000..d5a2c9f --- /dev/null +++ b/app/Views/layouts/admin/top_navigator/search.php @@ -0,0 +1,4 @@ + \ No newline at end of file diff --git a/app/Views/layouts/common/copyright.php b/app/Views/layouts/common/copyright.php new file mode 100644 index 0000000..4291a7c --- /dev/null +++ b/app/Views/layouts/common/copyright.php @@ -0,0 +1,44 @@ + + + + \ No newline at end of file diff --git a/app/Views/layouts/empty.php b/app/Views/layouts/empty.php new file mode 100644 index 0000000..2f23d0f --- /dev/null +++ b/app/Views/layouts/empty.php @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + <?= $viewDatas['title'] ?> + + + +
+ include('templates/empty/header'); ?> + renderSection('content') ?> + include('templates/empty/footer'); ?> +
+ + + \ No newline at end of file diff --git a/app/Views/layouts/front.php b/app/Views/layouts/front.php new file mode 100644 index 0000000..1b507c1 --- /dev/null +++ b/app/Views/layouts/front.php @@ -0,0 +1,41 @@ + + + + + + + + + + <?= $viewDatas['title'] ?> + + + + +
+ +
+ + + + \ No newline at end of file diff --git a/app/Views/layouts/front/left_menu.php b/app/Views/layouts/front/left_menu.php new file mode 100644 index 0000000..344a00b --- /dev/null +++ b/app/Views/layouts/front/left_menu.php @@ -0,0 +1,14 @@ + + +
+
+
-
+
parent]['entity']->getTitle() ?>
+
+ parent]['childs'] as $child) : ?> + + +
+ \ No newline at end of file diff --git a/app/Views/layouts/front/top_menu.php b/app/Views/layouts/front/top_menu.php new file mode 100644 index 0000000..ed58368 --- /dev/null +++ b/app/Views/layouts/front/top_menu.php @@ -0,0 +1,37 @@ + + \ No newline at end of file diff --git a/app/Views/layouts/front/top_navigator.php b/app/Views/layouts/front/top_navigator.php new file mode 100644 index 0000000..7b3fdd1 --- /dev/null +++ b/app/Views/layouts/front/top_navigator.php @@ -0,0 +1,42 @@ + + \ No newline at end of file diff --git a/app/Views/layouts/front_simple.php b/app/Views/layouts/front_simple.php new file mode 100644 index 0000000..7b64b3d --- /dev/null +++ b/app/Views/layouts/front_simple.php @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + <?= $viewDatas['title'] ?> + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git a/app/Views/layouts/main.php b/app/Views/layouts/main.php new file mode 100644 index 0000000..a5604fd --- /dev/null +++ b/app/Views/layouts/main.php @@ -0,0 +1,71 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + <?= $viewDatas['title'] ?> + + + + + +
+ + + +
+ + + + \ No newline at end of file diff --git a/app/Views/templates/Pagers/bootstrap_full.php b/app/Views/templates/Pagers/bootstrap_full.php new file mode 100644 index 0000000..8d0df7a --- /dev/null +++ b/app/Views/templates/Pagers/bootstrap_full.php @@ -0,0 +1,34 @@ +setSurroundCount(2); +?> + \ No newline at end of file diff --git a/app/Views/templates/Pagers/bootstrap_simple.php b/app/Views/templates/Pagers/bootstrap_simple.php new file mode 100644 index 0000000..e728703 --- /dev/null +++ b/app/Views/templates/Pagers/bootstrap_simple.php @@ -0,0 +1,17 @@ +setSurroundCount(0); +?> + \ No newline at end of file diff --git a/app/Views/templates/admin/footer.php b/app/Views/templates/admin/footer.php new file mode 100644 index 0000000..fd78f27 --- /dev/null +++ b/app/Views/templates/admin/footer.php @@ -0,0 +1,64 @@ + +getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?> + \ No newline at end of file diff --git a/app/Views/templates/admin/header.php b/app/Views/templates/admin/header.php new file mode 100644 index 0000000..eecf4e8 --- /dev/null +++ b/app/Views/templates/admin/header.php @@ -0,0 +1,9 @@ + \ No newline at end of file diff --git a/app/Views/templates/admin/index_head.php b/app/Views/templates/admin/index_head.php new file mode 100644 index 0000000..813b68d --- /dev/null +++ b/app/Views/templates/admin/index_head.php @@ -0,0 +1,12 @@ + + \ No newline at end of file diff --git a/app/Views/templates/empty/footer.php b/app/Views/templates/empty/footer.php new file mode 100644 index 0000000..1d48638 --- /dev/null +++ b/app/Views/templates/empty/footer.php @@ -0,0 +1,2 @@ + +getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?> \ No newline at end of file diff --git a/app/Views/templates/empty/header.php b/app/Views/templates/empty/header.php new file mode 100644 index 0000000..5b6637d --- /dev/null +++ b/app/Views/templates/empty/header.php @@ -0,0 +1 @@ +
\ No newline at end of file diff --git a/app/Views/templates/front/footer.php b/app/Views/templates/front/footer.php new file mode 100644 index 0000000..1da6eec --- /dev/null +++ b/app/Views/templates/front/footer.php @@ -0,0 +1,35 @@ + +getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?> + \ No newline at end of file diff --git a/app/Views/templates/front/header.php b/app/Views/templates/front/header.php new file mode 100644 index 0000000..e8aa951 --- /dev/null +++ b/app/Views/templates/front/header.php @@ -0,0 +1,11 @@ + \ No newline at end of file diff --git a/app/Views/templates/front/index_head.php b/app/Views/templates/front/index_head.php new file mode 100644 index 0000000..ef2a37b --- /dev/null +++ b/app/Views/templates/front/index_head.php @@ -0,0 +1,14 @@ + \ No newline at end of file