servermgrv2 init...
This commit is contained in:
parent
7add84d1f1
commit
2e1fdd2ce5
20
.gitignore
vendored
20
.gitignore
vendored
@ -70,6 +70,17 @@ writable/HPILO/*
|
|||||||
writable/Excel/*
|
writable/Excel/*
|
||||||
!writable/Excel/index.html
|
!writable/Excel/index.html
|
||||||
|
|
||||||
|
#mapurl 결과물
|
||||||
|
public/mapurl/index.html
|
||||||
|
|
||||||
|
#upload 파일
|
||||||
|
public/uploads/*
|
||||||
|
public/upload_images/*
|
||||||
|
|
||||||
|
#leftmenu 파일
|
||||||
|
layouts/front/left_menu/*
|
||||||
|
layouts/main/board.php
|
||||||
|
|
||||||
#-------------------------
|
#-------------------------
|
||||||
# User Guide Temp Files
|
# User Guide Temp Files
|
||||||
#-------------------------
|
#-------------------------
|
||||||
@ -129,11 +140,4 @@ nb-configuration.xml
|
|||||||
|
|
||||||
/results/
|
/results/
|
||||||
/phpunit*.xml
|
/phpunit*.xml
|
||||||
/.phpunit.*.cache
|
/.phpunit.*.cache
|
||||||
|
|
||||||
#mapurl 결과물
|
|
||||||
public/mapurl/index.html
|
|
||||||
|
|
||||||
#upload 파일
|
|
||||||
public/uploads/*
|
|
||||||
public/upload_images/*
|
|
||||||
@ -144,7 +144,39 @@ define('LAYOUTS', [
|
|||||||
'<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></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.min.js" referrerpolicy="origin"></script>',
|
'<script src="/vendors/tinymce/tinymce/tinymce.min.js" referrerpolicy="origin"></script>',
|
||||||
]
|
]
|
||||||
]
|
],
|
||||||
|
'main' => [
|
||||||
|
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'main',
|
||||||
|
'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 href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">',
|
||||||
|
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
|
||||||
|
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
|
||||||
|
'<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/boxicons@latest/css/boxicons.min.css" />',
|
||||||
|
'<link rel="stylesheet" href="/css/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.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.min.js" referrerpolicy="origin"></script>',
|
||||||
|
]
|
||||||
|
],
|
||||||
|
]);
|
||||||
|
|
||||||
|
//URL
|
||||||
|
define('URLS', [
|
||||||
|
'LOGIN' => '/front/user/login',
|
||||||
|
'SIGNUP' => '/front/user/signup',
|
||||||
|
'LOGOUT' => '/front/user/logout',
|
||||||
|
'Order' => '/front/order',
|
||||||
|
'addCart' => '/front/order/addCart',
|
||||||
|
'cancelCart' => '/front/order/cancelCart',
|
||||||
|
'cardPayment' => '/front/order/payment/card',
|
||||||
|
'depositPayment' => '/front/order/payment/deposit',
|
||||||
]);
|
]);
|
||||||
//SESSION 관련
|
//SESSION 관련
|
||||||
define('SESSION_NAMES', [
|
define('SESSION_NAMES', [
|
||||||
@ -154,16 +186,8 @@ define('SESSION_NAMES', [
|
|||||||
'CART' => 'cart'
|
'CART' => 'cart'
|
||||||
]);
|
]);
|
||||||
define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']);
|
define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']);
|
||||||
//Category관련 Role Fields
|
//월이용권 상품의 Category번호
|
||||||
define('CATEGORY_ROLE_FIELDS', [
|
define('RENTAL_PRODUCT_CATEGORYS', [5, 8]);
|
||||||
'ACCESS' => 'isaccess',
|
|
||||||
'READ' => 'isread',
|
|
||||||
'WRITE' => 'iswrite',
|
|
||||||
'REPLY' => 'isreply',
|
|
||||||
'UPLOAD' => 'isupload',
|
|
||||||
'DONWLOAD' => 'isdownload',
|
|
||||||
]);
|
|
||||||
|
|
||||||
//인증 관련
|
//인증 관련
|
||||||
define('AUTH_ADAPTERS', [
|
define('AUTH_ADAPTERS', [
|
||||||
'Local' => [
|
'Local' => [
|
||||||
@ -189,7 +213,7 @@ define('PATHS', [
|
|||||||
]);
|
]);
|
||||||
foreach (PATHS as $key => $path) {
|
foreach (PATHS as $key => $path) {
|
||||||
if (!is_dir($path)) {
|
if (!is_dir($path)) {
|
||||||
mkdir($path, 0640);
|
mkdir($path, 0755);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -205,19 +229,39 @@ define('ICONS', [
|
|||||||
'SETUP' => '<i class="bi bi-gear"></i>',
|
'SETUP' => '<i class="bi bi-gear"></i>',
|
||||||
'FLAG' => '<i class="bi bi-send"></i>',
|
'FLAG' => '<i class="bi bi-send"></i>',
|
||||||
'SEARCH' => '<i class="bi bi-search"></i>',
|
'SEARCH' => '<i class="bi bi-search"></i>',
|
||||||
'EXCEL' => '<i class="bi bi-file-excel"></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>',
|
'IMAGE_FILE' => '<i class="bi bi-file-earmark-image"></i>',
|
||||||
]);
|
]);
|
||||||
define('CLASS_ICONS', [
|
define('CLASS_ICONS', [
|
||||||
'USER' => '<i class="bi bi-person-vcard"></i>',
|
'USER' => '<i class="bi bi-person-vcard"></i>',
|
||||||
'USERSNS' => '<i class="bi bi-globe"></i>',
|
'USERSNS' => '<i class="bi bi-globe"></i>',
|
||||||
'BOARDCONFIG' => '<i class="bi bi-gear"></i>',
|
|
||||||
'BOARD' => '<i class="bi bi-pencil-square"></i>',
|
'BOARD' => '<i class="bi bi-pencil-square"></i>',
|
||||||
|
'SITEPAGE' => '<i class="bi bi-body-text"></i>',
|
||||||
'CATEGORY' => '<i class="bi bi-boxes"></i>',
|
'CATEGORY' => '<i class="bi bi-boxes"></i>',
|
||||||
'PRODUCT' => '<i class="bi bi-box2"></i>',
|
'PRODUCT' => '<i class="bi bi-box2"></i>',
|
||||||
'CART' => '<i class="bi bi-cart4"></i>',
|
|
||||||
'ORDER' => '<i class="bi bi-clipboard-check"></i>',
|
'ORDER' => '<i class="bi bi-clipboard-check"></i>',
|
||||||
'BILLING' => '<i class="bi bi-cash-coin"></i>',
|
'CART' => '<i class="bi bi-cart4"></i>',
|
||||||
|
'CARD' => '<i class="bi bi-credit-card"></i>',
|
||||||
|
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
|
||||||
|
]);
|
||||||
|
define('CLASS_TOP_BANNER', [
|
||||||
|
'USER' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
|
'USERSNS' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
|
'ORDER' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
|
'CARD' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
|
'DEPOSIT' => '<img src="/images/banner/sub_visual1.jpg"/>',
|
||||||
|
'PRODUCT' => '<img src="/images/banner/sub_visual2.jpg"/>',
|
||||||
|
'SITEPAGE' => '<img src="/images/banner/sub_visual3.jpg"/>',
|
||||||
|
'BOARD' => '<img src="/images/banner/sub_visual4.jpg"/>',
|
||||||
]);
|
]);
|
||||||
define('AUDIOS', [
|
define('AUDIOS', [
|
||||||
'Alram_GetEmail' => '<object width=0 height=0 data="/sound/jarvis_email.mp3" type="audio/mpeg"></object>',
|
'Alram_GetEmail' => '<object width=0 height=0 data="/sound/jarvis_email.mp3" type="audio/mpeg"></object>',
|
||||||
@ -225,11 +269,12 @@ define('AUDIOS', [
|
|||||||
|
|
||||||
//Default값 정의
|
//Default값 정의
|
||||||
define('DEFAULTS', [
|
define('DEFAULTS', [
|
||||||
|
'ORDER_CATEGORY' => getenv('default.order_category') ?: 11,
|
||||||
|
'USER_CATEGORY' => getenv('default.user_category') ?: 22,
|
||||||
'ROLE' => getenv('default.role') ?: "guest",
|
'ROLE' => getenv('default.role') ?: "guest",
|
||||||
'STATUS' => getenv('default.status') ?: "use",
|
'STATUS' => getenv('default.status') ?: "use",
|
||||||
'EMPTY' => getenv('default.empty') ?: "",
|
'EMPTY' => getenv('default.empty') ?: "",
|
||||||
'PERPAGE' => getenv('default.perpage') ?: 20,
|
'PERPAGE' => getenv('default.perpage') ?: 20,
|
||||||
'HIERARCHY_GRPDEPTH' => getenv('default.hierarchy_grpdepth') ?: 20,
|
|
||||||
'DELIMITER_FILE' => getenv('default.delimiter.file') ?: "||",
|
'DELIMITER_FILE' => getenv('default.delimiter.file') ?: "||",
|
||||||
'DELIMITER_ROLE' => getenv('default.delimiter.role') ?: ",",
|
'DELIMITER_ROLE' => getenv('default.delimiter.role') ?: ",",
|
||||||
]);
|
]);
|
||||||
|
|||||||
@ -35,10 +35,6 @@ $routes->setAutoRoute(false);
|
|||||||
$routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
|
$routes->addPlaceholder('uuid', '[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}');
|
||||||
|
|
||||||
$routes->get('/', 'Home::index');
|
$routes->get('/', 'Home::index');
|
||||||
$routes->get('/login', 'AuthController::login');
|
|
||||||
$routes->post('/signup', 'AuthController::signup/local');
|
|
||||||
$routes->get('/signup/(:alpha)', 'AuthController::signup/$1');
|
|
||||||
$routes->get('/logout', 'AuthController::logout');
|
|
||||||
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
|
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
|
||||||
});
|
});
|
||||||
// authGuard는 App\Config\Filters.php의 $aliases에 선언한 이름이어야 함
|
// authGuard는 App\Config\Filters.php의 $aliases에 선언한 이름이어야 함
|
||||||
@ -95,10 +91,16 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
$routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($routes) {
|
||||||
$routes->group('user', ['namespace' => 'App\Controllers\Front', 'filter' => 'authFilter:user'], static function ($routes) {
|
$routes->group('user', static function ($routes) {
|
||||||
$routes->get('update/(:uuid)', 'UserController::update_form/$1');
|
$routes->get('', 'UserController::index', ['filter' => 'authFilter:user']);
|
||||||
$routes->post('update/(:uuid)', 'UserController::update/R1');
|
$routes->get('insert', 'UserController::insert_form');
|
||||||
$routes->get('view/(:uuid)', 'UserController::view/$1');
|
$routes->post('insert', 'UserController::insert');
|
||||||
|
$routes->get('update/(:uuid)', 'UserController::update_form/$1', ['filter' => 'authFilter:user']);
|
||||||
|
$routes->post('update/(:uuid)', 'UserController::update/$1', ['filter' => 'authFilter:user']);
|
||||||
|
$routes->get('login', 'UserController::login_form');
|
||||||
|
$routes->post('login', 'UserController::login/local');
|
||||||
|
$routes->get('signup/(:alpha)', 'UserController::login/$1');
|
||||||
|
$routes->get('logout', 'UserController::logout', ['filter' => 'authFilter:user']);
|
||||||
});
|
});
|
||||||
$routes->group('board', static function ($routes) {
|
$routes->group('board', static function ($routes) {
|
||||||
$routes->get('', 'BoardController::index');
|
$routes->get('', 'BoardController::index');
|
||||||
@ -113,6 +115,9 @@ $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($rou
|
|||||||
$routes->get('delete/(:num)', 'BoardController::delete/$1');
|
$routes->get('delete/(:num)', 'BoardController::delete/$1');
|
||||||
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
|
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
|
||||||
});
|
});
|
||||||
|
$routes->group('sitepage', static function ($routes) {
|
||||||
|
$routes->get('', 'SitepageController::index');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
/*
|
/*
|
||||||
* --------------------------------------------------------------------
|
* --------------------------------------------------------------------
|
||||||
|
|||||||
@ -13,6 +13,7 @@ abstract class AdminController extends BaseController
|
|||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath = 'admin/';
|
$this->_viewPath = 'admin/';
|
||||||
|
$this->_viewDatas['control'] = 'admin';
|
||||||
$this->_viewDatas['layout'] = LAYOUTS['admin'];
|
$this->_viewDatas['layout'] = LAYOUTS['admin'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,20 +2,25 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Controllers\Trait\UpDownloadTrait;
|
||||||
use App\Models\BoardModel;
|
use App\Models\BoardModel;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use App\Controllers\Trait\UpDownloadTrait;
|
|
||||||
|
|
||||||
class BoardController extends AdminController
|
class BoardController extends AdminController
|
||||||
{
|
{
|
||||||
use UpDownloadTrait;
|
use UpDownloadTrait;
|
||||||
|
private $_category_notice = 3;
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new BoardModel();
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new BoardModel();
|
||||||
|
$this->_viewDatas['className'] = 'Board';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);;
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
@ -46,12 +51,11 @@ class BoardController extends AdminController
|
|||||||
protected function getFieldFormData(string $field, $entity = null): array
|
protected function getFieldFormData(string $field, $entity = null): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'passwd':
|
|
||||||
$this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field);
|
|
||||||
$this->_viewDatas['fieldDatas']['confirmpassword'] = $this->request->getVar('confirmpassword');
|
|
||||||
break;
|
|
||||||
case 'board_file':
|
case 'board_file':
|
||||||
$this->_viewDatas['fieldDatas'][$field] = $this->upload_file_procedure($field);
|
$file = $this->upload_file_procedure($field);
|
||||||
|
if (!is_null($file)) {
|
||||||
|
$this->_viewDatas['fieldDatas'][$field] = $file;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return parent::getFieldFormData($field, $entity);
|
return parent::getFieldFormData($field, $entity);
|
||||||
@ -59,4 +63,59 @@ class BoardController extends AdminController
|
|||||||
}
|
}
|
||||||
return $this->_viewDatas['fieldDatas'];
|
return $this->_viewDatas['fieldDatas'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private function build_notice()
|
||||||
|
{
|
||||||
|
$entitys = $this->_model->getEntitys(['category_uid' => $this->_category_notice, 'status' => DEFAULTS['STATUS']]);
|
||||||
|
$temps = array("<ul>");
|
||||||
|
foreach ($entitys as $entity) {
|
||||||
|
array_push($temps, sprintf(
|
||||||
|
"<li><a href=\"/front/board/view/%s?category=3\">%s</a><span>%s</span></li>",
|
||||||
|
$entity->getPrimaryKey(),
|
||||||
|
$entity->getTitle(),
|
||||||
|
$entity->created_at ? str_split($entity->created_at, 10)[0] : "",
|
||||||
|
));
|
||||||
|
}
|
||||||
|
array_push($temps, "</ul>");
|
||||||
|
// echo var_export($temps, true);
|
||||||
|
// exit;
|
||||||
|
file_put_contents(APPPATH . 'Views' . "/layouts/main/board.php", implode("\n", $temps));
|
||||||
|
}
|
||||||
|
|
||||||
|
//Insert관련
|
||||||
|
protected function insert_process()
|
||||||
|
{
|
||||||
|
$entity = parent::insert_process();
|
||||||
|
if ($entity->category_uid == $this->_category_notice) {
|
||||||
|
$this->build_notice();
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
|
//Update관련
|
||||||
|
protected function update_process($entity)
|
||||||
|
{
|
||||||
|
$entity = parent::update_process($entity);
|
||||||
|
if ($entity->category_uid == $this->_category_notice) {
|
||||||
|
$this->build_notice();
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
|
//Toggle관련
|
||||||
|
protected function toggle_process($entity)
|
||||||
|
{
|
||||||
|
$entity = parent::toggle_process($entity);
|
||||||
|
if ($entity->category_uid == $this->_category_notice) {
|
||||||
|
$this->build_notice();
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
|
//Delete 관련
|
||||||
|
protected function delete_process($entity)
|
||||||
|
{
|
||||||
|
$entity = parent::delete_process($entity);
|
||||||
|
if ($entity->category_uid->$this->_category_notice) {
|
||||||
|
$this->build_notice();
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,8 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Controllers\Trait\UpDownloadTrait;
|
||||||
|
use App\Entities\CategoryEntity;
|
||||||
use App\Models\CategoryModel;
|
use App\Models\CategoryModel;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -9,24 +11,29 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
class CategoryController extends AdminController
|
class CategoryController extends AdminController
|
||||||
{
|
{
|
||||||
|
use UpDownloadTrait;
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new CategoryModel();
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new CategoryModel();
|
||||||
|
$this->_viewDatas['className'] = 'Category';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "head", "tail",
|
"status", "head", "tail",
|
||||||
];
|
];
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return [
|
return [
|
||||||
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"status", "created_at"
|
"status", "created_at"
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
@ -47,39 +54,67 @@ class CategoryController extends AdminController
|
|||||||
return parent::getFieldBatchFilters();
|
return parent::getFieldBatchFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
// private function build_leftmenu()
|
private function write_leftmenu($old_category, array $categorys)
|
||||||
// {
|
{
|
||||||
// $categorys = $this->_model->getEntitys(['status' => DEFAULTS['STATUS']]);
|
//신규 대분류인경우 기존 카테고리 메뉴 만들기
|
||||||
// $leftmenu = view($this->_viewPath . '/leftmenu', ['categorys' => $categorys]);
|
// $categorys = array_reverse($categorys); //중분류의 경우 나중에 넣은것이 먼저되므로 reverse해서 처리
|
||||||
// file_put_contents(APPPATH . 'Views' . '/layouts/front/left_menu/leftmenu.php', $leftmenu);
|
foreach ($categorys as $category) {
|
||||||
// }
|
$viewDatas = [
|
||||||
|
'className' => $this->_viewDatas['className'],
|
||||||
|
'category' => $category,
|
||||||
|
'parent_category' => $old_category,
|
||||||
|
'sibling_categorys' => $categorys
|
||||||
|
];
|
||||||
|
$leftmenu = view($this->_viewPath . '/leftmenu_template', ['viewDatas' => $viewDatas]);
|
||||||
|
file_put_contents(APPPATH . 'Views' . "/layouts/front/left_menu/leftmenu_{$category->getPrimaryKey()}.php", $leftmenu);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private function build_leftmenu()
|
||||||
|
{
|
||||||
|
$old_category = null;
|
||||||
|
$categorys = array();
|
||||||
|
foreach ($this->_model->getEntitys(['status' => DEFAULTS['STATUS']]) as $entity) {
|
||||||
|
if ($entity->getHierarchy_Depth() == 1) {
|
||||||
|
if (is_null($old_category)) {
|
||||||
|
$old_category = $entity;
|
||||||
|
} else if ($old_category->getPrimaryKey() != $entity->getPrimaryKey()) {
|
||||||
|
$this->write_leftmenu($old_category, $categorys);
|
||||||
|
$old_category = $entity;
|
||||||
|
$categorys = array();
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
array_push($categorys, $entity);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->write_leftmenu($old_category, $categorys);
|
||||||
|
}
|
||||||
|
|
||||||
// //Insert관련
|
//Insert관련
|
||||||
// protected function insert_process()
|
protected function insert_process()
|
||||||
// {
|
{
|
||||||
// $entity = parent::insert_process();
|
$entity = parent::insert_process();
|
||||||
// $this->build_leftmenu();
|
$this->build_leftmenu();
|
||||||
// return $entity;
|
return $entity;
|
||||||
// }
|
}
|
||||||
// //Update관련
|
//Update관련
|
||||||
// protected function update_process($entity)
|
protected function update_process($entity)
|
||||||
// {
|
{
|
||||||
// $entity = parent::update_process($entity);
|
$entity = parent::update_process($entity);
|
||||||
// $this->build_leftmenu();
|
$this->build_leftmenu();
|
||||||
// return $entity;
|
return $entity;
|
||||||
// }
|
}
|
||||||
// //Reply관련
|
//Reply관련
|
||||||
// protected function reply_process($entity)
|
protected function reply_process($entity)
|
||||||
// {
|
{
|
||||||
// $entity = parent::reply_process($entity);
|
$entity = parent::reply_process($entity);
|
||||||
// $this->build_leftmenu();
|
$this->build_leftmenu();
|
||||||
// return $entity;
|
return $entity;
|
||||||
// }
|
}
|
||||||
// //Delete 관련
|
//Delete 관련
|
||||||
// protected function delete_process($entity)
|
protected function delete_process($entity)
|
||||||
// {
|
{
|
||||||
// $entity = parent::delete_process($entity);
|
$entity = parent::delete_process($entity);
|
||||||
// $this->build_leftmenu();
|
$this->build_leftmenu();
|
||||||
// return $entity;
|
return $entity;
|
||||||
// }
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,12 +9,36 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
class Home extends Controller
|
class Home extends Controller
|
||||||
{
|
{
|
||||||
|
private $_session = null;
|
||||||
|
private $_viewDatas = array();
|
||||||
|
private $_viewPath = "admin/";
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
$this->_viewDatas['control'] = 'admin';
|
||||||
|
$this->_viewDatas['title'] = '쇼핑몰관리툴페이지';
|
||||||
|
$this->_viewDatas['layout'] = LAYOUTS['admin'];
|
||||||
|
$this->_session = \Config\Services::session();
|
||||||
|
$this->_viewDatas['session'] = $this->_session;
|
||||||
|
$this->_viewDatas['className'] = 'MAIN';
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS['USER'];
|
||||||
|
helper("Common");
|
||||||
|
// echo var_export($this->_viewDatas['layout'], true);
|
||||||
|
// exit;
|
||||||
|
//사용자 기본 Role 지정
|
||||||
|
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false;
|
||||||
|
$this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]];
|
||||||
|
if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
|
||||||
|
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = true;
|
||||||
|
$this->_viewDatas['auth'] = $this->_session->get(SESSION_NAMES['AUTH']);
|
||||||
|
$currentRoles = explode(DEFAULTS['DELIMITER_ROLE'], $this->_viewDatas['auth'][AUTH_FIELDS['ROLE']]);
|
||||||
|
$this->_viewDatas['currentRoles'] = is_array($currentRoles) ? $currentRoles : [DEFAULTS["ROLE"]];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('admin/welcome_message');
|
return view($this->_viewPath . 'welcome_message', ['viewDatas' => $this->_viewDatas]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
47
app/Controllers/Admin/SitepageController.php
Normal file
47
app/Controllers/Admin/SitepageController.php
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Models\SitepageModel;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
class SitepageController extends AdminController
|
||||||
|
{
|
||||||
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
|
{
|
||||||
|
parent::initController($request, $response, $logger);
|
||||||
|
$this->_model = new SitepageModel();
|
||||||
|
$this->_viewDatas['className'] = 'Sitepage';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getFields(string $action = ""): array
|
||||||
|
{
|
||||||
|
$fields = ["category_uid", 'title', "status", "content"];
|
||||||
|
switch ($action) {
|
||||||
|
case "index":
|
||||||
|
case "excel":
|
||||||
|
return ["category_uid", "user_uid", 'title', "status", "created_at"];
|
||||||
|
break;
|
||||||
|
case "view":
|
||||||
|
return ["category_uid", "user_uid", 'title', "status", "created_at", "content"];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return $fields;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function getFieldFilters(): array
|
||||||
|
{
|
||||||
|
return ["category_uid", "user_uid", "status"];
|
||||||
|
}
|
||||||
|
public function getFieldBatchFilters(): array
|
||||||
|
{
|
||||||
|
return parent::getFieldBatchFilters();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -11,43 +11,32 @@ class UserController extends AdminController
|
|||||||
{
|
{
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new UserModel();
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new UserModel();
|
||||||
|
$this->_viewDatas['className'] = 'User';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Field별 Form Datas 처리용
|
|
||||||
protected function getFieldFormData(string $field, $entity = null): array
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
case 'passwd':
|
|
||||||
$passwd = $this->request->getVar($field) ?: false;
|
|
||||||
$confirmpassword = $this->request->getVar('confirmpassword') ?: false;
|
|
||||||
if ($passwd && $confirmpassword) {
|
|
||||||
$this->_viewDatas['fieldDatas'][$field] = $passwd;
|
|
||||||
$this->_viewDatas['fieldDatas']['confirmpassword'] = $confirmpassword;
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return parent::getFieldFormData($field, $entity);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $this->_viewDatas['fieldDatas'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = ["id", "passwd", 'name', "email", "role", "status"];
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
|
case 'insert':
|
||||||
|
return ["id", "passwd", 'name', "email", "phone", "mobile", "role", "status"];
|
||||||
|
break;
|
||||||
|
case 'update':
|
||||||
|
return ["passwd", 'name', "email", "phone", "mobile", "role", "status"];
|
||||||
|
break;
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return ["id", 'name', "email", "role", "status", 'created_at'];
|
return ["id", 'name', "email", "phone", "mobile", "role", "status", 'created_at'];
|
||||||
break;
|
break;
|
||||||
case "view":
|
case "view":
|
||||||
return ["id", 'name', "email", "role", "status", 'updated_at', 'created_at'];
|
return ["id", 'name', "email", "phone", "mobile", "role", "status", 'updated_at', 'created_at'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return $fields;
|
return [];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,9 +11,13 @@ class UserSNSController extends AdminController
|
|||||||
{
|
{
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new UserSNSModel();
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new UserSNSModel();
|
||||||
|
$this->_viewDatas['className'] = 'UserSNS';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
}
|
}
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
|
|||||||
@ -58,13 +58,7 @@ abstract class BaseController extends Controller
|
|||||||
// Preload any models, libraries, etc, here.
|
// Preload any models, libraries, etc, here.
|
||||||
// E.g.: $this->session = \Config\Services::session();
|
// E.g.: $this->session = \Config\Services::session();
|
||||||
$this->_session = \Config\Services::session();
|
$this->_session = \Config\Services::session();
|
||||||
$this->_viewDatas['layout'] = LAYOUTS['empty'];
|
|
||||||
$this->_viewDatas['session'] = $this->_session;
|
$this->_viewDatas['session'] = $this->_session;
|
||||||
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
|
|
||||||
$this->_viewDatas['className'] = $this->_model->getClassName();
|
|
||||||
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_model->getClassName())];
|
|
||||||
helper($this->_model->getClassName());
|
|
||||||
|
|
||||||
//사용자 기본 Role 지정
|
//사용자 기본 Role 지정
|
||||||
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false;
|
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false;
|
||||||
$this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]];
|
$this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]];
|
||||||
@ -78,16 +72,61 @@ abstract class BaseController extends Controller
|
|||||||
|
|
||||||
abstract public function getFields(string $action): array;
|
abstract public function getFields(string $action): array;
|
||||||
abstract public function getFieldFilters(): array;
|
abstract public function getFieldFilters(): array;
|
||||||
|
//Field별 Rule용
|
||||||
|
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
$rules = $this->_model->getFieldRule($field, $rules, $action);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
final public function getFieldRules(array $fields, string $action = ""): array
|
||||||
|
{
|
||||||
|
$rules = array();
|
||||||
|
foreach ($fields as $field) {
|
||||||
|
$rules = $this->getFieldRule($field, $rules, $action);
|
||||||
|
}
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
public function getFieldBatchFilters(): array
|
public function getFieldBatchFilters(): array
|
||||||
{
|
{
|
||||||
return $this->getFieldFilters();
|
return $this->getFieldFilters();
|
||||||
}
|
}
|
||||||
|
//Field별 Form Option용
|
||||||
|
public function getFieldFormOption(string $field): array
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
$options = $this->_model->getFieldFOrmOption($field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!is_array($options)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 {$this->_viewDatas['className']}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
|
||||||
|
}
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
final public function getFieldFormOptions(array $fields): array
|
||||||
|
{
|
||||||
|
$fieldFormOptions = array();
|
||||||
|
foreach ($fields as $field) {
|
||||||
|
if (!is_string($field)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 {$this->_viewDatas['className']}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true));
|
||||||
|
}
|
||||||
|
$fieldFormOptions[$field] = $this->getFieldFormOption($field);
|
||||||
|
}
|
||||||
|
return $fieldFormOptions;
|
||||||
|
}
|
||||||
//Field별 Form Datas 처리용
|
//Field별 Form Datas 처리용
|
||||||
protected function getFieldFormData(string $field, $entity = null): array
|
protected function getFieldFormData(string $field, $entity = null): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
$this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field);
|
$value = $this->request->getVar($field);
|
||||||
|
if (!is_null($value)) {
|
||||||
|
$this->_viewDatas['fieldDatas'][$field] = $value;
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $this->_viewDatas['fieldDatas'];
|
return $this->_viewDatas['fieldDatas'];
|
||||||
@ -105,10 +144,10 @@ abstract class BaseController extends Controller
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
$this->_viewDatas['fields'] = $fields ?: $this->getFields($action);
|
$this->_viewDatas['fields'] = $fields ?: $this->getFields($action);
|
||||||
$this->_viewDatas['fieldRules'] = $this->_model->getFieldRules($this->_viewDatas['fields'], $action);
|
$this->_viewDatas['fieldRules'] = $this->getFieldRules($this->_viewDatas['fields'], $action);
|
||||||
$this->_viewDatas['fieldFilters'] = $this->getFieldFilters();
|
$this->_viewDatas['fieldFilters'] = $this->getFieldFilters();
|
||||||
$this->_viewDatas['batchjobFilters'] = $this->getFieldBatchFilters();
|
$this->_viewDatas['batchjobFilters'] = $this->getFieldBatchFilters();
|
||||||
$this->_viewDatas['fieldFormOptions'] = $this->_model->getFieldFormOptions($this->_viewDatas['fieldFilters']);
|
$this->_viewDatas['fieldFormOptions'] = $this->getFieldFormOptions($this->_viewDatas['fieldFilters']);
|
||||||
return $this->_viewDatas;
|
return $this->_viewDatas;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -206,11 +245,17 @@ abstract class BaseController extends Controller
|
|||||||
$this->_viewDatas['fieldDatas'] = array();
|
$this->_viewDatas['fieldDatas'] = array();
|
||||||
foreach ($this->_viewDatas['fields'] as $field) {
|
foreach ($this->_viewDatas['fields'] as $field) {
|
||||||
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field, $entity);
|
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field, $entity);
|
||||||
//보안문제,사용자정보의 update시 암호를 변경하지 않느경우를 위해
|
}
|
||||||
if ($field != 'passwd') {
|
//변견된 데이터 Log로 남기기
|
||||||
|
foreach ($this->_viewDatas['fieldDatas'] as $field => $value) {
|
||||||
|
if ($field != "passwd") { //보안위험성이 있으므로 passwd는 Log에 남기지 않는다.
|
||||||
log_message(
|
log_message(
|
||||||
"info",
|
"info",
|
||||||
"{$field} : {$entity->$field} => " . var_export($this->_viewDatas['fieldDatas'][$field])
|
sprintf(
|
||||||
|
"{$field} 변경: ---원본--\n%s\n---변경---\n%s",
|
||||||
|
$entity->$field,
|
||||||
|
var_export($value, true)
|
||||||
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -263,7 +308,14 @@ abstract class BaseController extends Controller
|
|||||||
}
|
}
|
||||||
protected function reply_validate($entity)
|
protected function reply_validate($entity)
|
||||||
{
|
{
|
||||||
$this->update_validate($entity);
|
if (!$this->validate($this->_viewDatas['fieldRules'])) {
|
||||||
|
throw new \Exception("{$this->_viewDatas['title']}의 검증 오류발생\n" . implode("\n", $this->validator->getErrors()));
|
||||||
|
}
|
||||||
|
//fieldData 적용
|
||||||
|
$this->_viewDatas['fieldDatas'] = array();
|
||||||
|
foreach ($this->_viewDatas['fields'] as $field) {
|
||||||
|
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field, $entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function reply_process($entity)
|
protected function reply_process($entity)
|
||||||
{
|
{
|
||||||
@ -292,11 +344,18 @@ abstract class BaseController extends Controller
|
|||||||
//Toggle 관련
|
//Toggle 관련
|
||||||
protected function toggle_validate($entity)
|
protected function toggle_validate($entity)
|
||||||
{
|
{
|
||||||
$this->update_validate($entity);
|
if (!$this->validate($this->_viewDatas['fieldRules'])) {
|
||||||
|
throw new \Exception("{$this->_viewDatas['title']}의 검증 오류발생\n" . implode("\n", $this->validator->getErrors()));
|
||||||
|
}
|
||||||
|
//fieldData 적용
|
||||||
|
$this->_viewDatas['fieldDatas'] = array();
|
||||||
|
foreach ($this->_viewDatas['fields'] as $field) {
|
||||||
|
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field, $entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function toggle_process($entity)
|
protected function toggle_process($entity)
|
||||||
{
|
{
|
||||||
return $this->update_process($entity);
|
return $this->_model->modify($entity, $this->_viewDatas['fieldDatas']);
|
||||||
}
|
}
|
||||||
public function toggle($uid, string $field)
|
public function toggle($uid, string $field)
|
||||||
{
|
{
|
||||||
@ -319,21 +378,29 @@ abstract class BaseController extends Controller
|
|||||||
//Batchjob 관련
|
//Batchjob 관련
|
||||||
protected function batchjob_validate($entity)
|
protected function batchjob_validate($entity)
|
||||||
{
|
{
|
||||||
$this->update_validate($entity);
|
if (!$this->validate($this->_viewDatas['fieldRules'])) {
|
||||||
|
throw new \Exception("{$this->_viewDatas['title']}의 검증 오류발생\n" . implode("\n", $this->validator->getErrors()));
|
||||||
|
}
|
||||||
|
//fieldData 적용
|
||||||
|
$this->_viewDatas['fieldDatas'] = array();
|
||||||
|
foreach ($this->_viewDatas['fields'] as $field) {
|
||||||
|
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field, $entity);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
protected function batchjob_process($entity)
|
protected function batchjob_process($entity)
|
||||||
{
|
{
|
||||||
return $this->update_process($entity);
|
return $this->_model->modify($entity, $this->_viewDatas['fieldDatas']);
|
||||||
}
|
}
|
||||||
public function batchjob()
|
public function batchjob()
|
||||||
{
|
{
|
||||||
$msg = "";
|
$msg = "";
|
||||||
|
$uids = array();
|
||||||
$entitys = array();
|
$entitys = array();
|
||||||
$batchjobs = array();
|
$batchjobs = array();
|
||||||
try {
|
try {
|
||||||
//fields 해당하는 field중 선택된 값이 있는경우만 fields로 정의
|
//fields 해당하는 field중 선택된 값이 있는경우만 fields로 정의
|
||||||
$fields = array();
|
$fields = array();
|
||||||
foreach ($this->_model->getFieldBatchFilters() as $field) {
|
foreach ($this->getFieldBatchFilters() as $field) {
|
||||||
if ($this->request->getVar($field)) {
|
if ($this->request->getVar($field)) {
|
||||||
array_push($fields, $field);
|
array_push($fields, $field);
|
||||||
}
|
}
|
||||||
@ -377,6 +444,7 @@ abstract class BaseController extends Controller
|
|||||||
count($entitys),
|
count($entitys),
|
||||||
count($uids) - count($entitys),
|
count($uids) - count($entitys),
|
||||||
__FUNCTION__,
|
__FUNCTION__,
|
||||||
|
$e->getMessage()
|
||||||
);
|
);
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
@ -449,7 +517,7 @@ abstract class BaseController extends Controller
|
|||||||
$this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
|
$this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
|
||||||
$this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
|
$this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
|
||||||
$this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
|
$this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
|
||||||
$this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'uid';
|
$this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'created_at';
|
||||||
$this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
|
$this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
|
||||||
$this->_model->setCondition(
|
$this->_model->setCondition(
|
||||||
$filterFields,
|
$filterFields,
|
||||||
@ -515,6 +583,7 @@ abstract class BaseController extends Controller
|
|||||||
//모델 처리
|
//모델 처리
|
||||||
$this->_viewDatas['entitys'] = $this->index_getEntitys();
|
$this->_viewDatas['entitys'] = $this->index_getEntitys();
|
||||||
// echo $this->_model->getLastQuery();
|
// echo $this->_model->getLastQuery();
|
||||||
|
// exit;
|
||||||
// log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery());
|
// log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery());
|
||||||
//setting return_url to session flashdata
|
//setting return_url to session flashdata
|
||||||
helper(['form']);
|
helper(['form']);
|
||||||
@ -535,7 +604,7 @@ abstract class BaseController extends Controller
|
|||||||
//Header용
|
//Header용
|
||||||
$column = 'A';
|
$column = 'A';
|
||||||
foreach ($viewDatas['fields'] as $field) {
|
foreach ($viewDatas['fields'] as $field) {
|
||||||
$sheet->setCellValue($column++ . '1', lang($this->_model->getClassName() . '.label.' . $field));
|
$sheet->setCellValue($column++ . '1', lang($this->_viewDatas['className'] . '.label.' . $field));
|
||||||
}
|
}
|
||||||
//본문용
|
//본문용
|
||||||
$line = 2;
|
$line = 2;
|
||||||
@ -585,6 +654,8 @@ abstract class BaseController extends Controller
|
|||||||
throw new \Exception("첨부파일이 확인되지 않습니다.");
|
throw new \Exception("첨부파일이 확인되지 않습니다.");
|
||||||
}
|
}
|
||||||
$entity = $this->download_process($entity);
|
$entity = $this->download_process($entity);
|
||||||
|
echo "TEST";
|
||||||
|
exit;
|
||||||
list($filename, $uploaded_filename) = explode(DEFAULTS['DELIMITER_FILE'], $entity->$field);
|
list($filename, $uploaded_filename) = explode(DEFAULTS['DELIMITER_FILE'], $entity->$field);
|
||||||
if (!is_file(PATHS['UPLOAD'] . "/" . $uploaded_filename)) {
|
if (!is_file(PATHS['UPLOAD'] . "/" . $uploaded_filename)) {
|
||||||
throw new \Exception("파일이 확인되지 않습니다.\n" . PATHS['UPLOAD'] . "/" . $uploaded_filename);
|
throw new \Exception("파일이 확인되지 않습니다.\n" . PATHS['UPLOAD'] . "/" . $uploaded_filename);
|
||||||
|
|||||||
@ -11,9 +11,15 @@ class BoardController extends FrontController
|
|||||||
{
|
{
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new BoardModel($this->getFields());
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new BoardModel();
|
||||||
|
$this->_viewDatas['className'] = 'Board';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
|
// echo var_export($this->_viewDatas['layout'], true);
|
||||||
|
// exit;
|
||||||
}
|
}
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
@ -21,7 +27,7 @@ class BoardController extends FrontController
|
|||||||
switch ($action) {
|
switch ($action) {
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return ['title', "board_file", "view_cnt", "created_at"];
|
return ['title', "board_file", "created_at", "view_cnt"];
|
||||||
break;
|
break;
|
||||||
case "view":
|
case "view":
|
||||||
return ['title', "board_file", "view_cnt", "created_at", "content"];
|
return ['title', "board_file", "view_cnt", "created_at", "content"];
|
||||||
@ -39,19 +45,12 @@ class BoardController extends FrontController
|
|||||||
{
|
{
|
||||||
return parent::getFieldBatchFilters();
|
return parent::getFieldBatchFilters();
|
||||||
}
|
}
|
||||||
//Field별 Form Datas 처리용
|
|
||||||
protected function getFieldFormData(string $field, $entity = null): array
|
//권한체크
|
||||||
|
protected function isRole($action)
|
||||||
{
|
{
|
||||||
switch ($field) {
|
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||||
case 'passwd':
|
parent::isRole($action);
|
||||||
$this->_viewDatas['fieldDatas'][$field] = $this->request->getVar($field);
|
|
||||||
$this->_viewDatas['fieldDatas']['confirmpassword'] = $this->request->getVar('confirmpassword');
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
return parent::getFieldFormData($field, $entity);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $this->_viewDatas['fieldDatas'];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Insert관련
|
//Insert관련
|
||||||
@ -75,31 +74,42 @@ class BoardController extends FrontController
|
|||||||
protected function update_form_process($entity)
|
protected function update_form_process($entity)
|
||||||
{
|
{
|
||||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
||||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid != $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||||
}
|
}
|
||||||
return parent::update_form_process($entity);
|
//권한체크
|
||||||
|
$this->isRole('update');
|
||||||
|
$entity = parent::update_form_process($entity);
|
||||||
|
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||||
|
'category' => $this->_category
|
||||||
|
]];
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function update_process($entity)
|
protected function update_process($entity)
|
||||||
{
|
{
|
||||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
||||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid != $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||||
}
|
}
|
||||||
return parent::update_process($entity);
|
return parent::update_process($entity);
|
||||||
}
|
}
|
||||||
//Reply관련
|
//Reply관련($entity는 부모의것임을 주의)
|
||||||
protected function reply_form_process($entity)
|
protected function reply_form_process($entity)
|
||||||
{
|
{
|
||||||
//권한체크
|
//권한체크
|
||||||
$this->isRole('reply', $entity);
|
$this->isRole('reply');
|
||||||
return parent::reply_form_process($entity);
|
$entity = parent::reply_form_process($entity);
|
||||||
|
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||||
|
'category_uid' => $entity->category_uid,
|
||||||
|
'category' => $this->_category
|
||||||
|
]];
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
//Delete 관련
|
//Delete 관련
|
||||||
protected function delete_process($entity)
|
protected function delete_process($entity)
|
||||||
{
|
{
|
||||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 삭제 시도 방지용
|
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 삭제 시도 방지용
|
||||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->user_uid == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||||
}
|
}
|
||||||
return parent::delete_process($entity);
|
return parent::delete_process($entity);
|
||||||
@ -108,17 +118,24 @@ class BoardController extends FrontController
|
|||||||
protected function view_process($entity)
|
protected function view_process($entity)
|
||||||
{
|
{
|
||||||
//권한체크
|
//권한체크
|
||||||
$this->isRole('view', $entity);
|
$this->isRole('view');
|
||||||
//조회수 올리기
|
//조회수 올리기
|
||||||
$this->_model->addViewCount($entity);
|
$entity = $this->_model->addViewCount($entity);
|
||||||
return parent::view_process($entity);
|
$entity = parent::view_process($entity);
|
||||||
|
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||||
|
'category' => $this->_category
|
||||||
|
]];
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
//Index관련
|
//Index관련
|
||||||
protected function index_process()
|
protected function index_process()
|
||||||
{
|
{
|
||||||
//권한체크
|
//권한체크
|
||||||
$this->isRole('index');
|
$this->isRole('index');
|
||||||
return parent::index_process();
|
parent::index_process();
|
||||||
|
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => [
|
||||||
|
'category' => $this->_category
|
||||||
|
]];
|
||||||
}
|
}
|
||||||
//Category 및 Status 조건추가
|
//Category 및 Status 조건추가
|
||||||
protected function index_setCondition()
|
protected function index_setCondition()
|
||||||
|
|||||||
@ -3,10 +3,10 @@
|
|||||||
namespace App\Controllers\Front;
|
namespace App\Controllers\Front;
|
||||||
|
|
||||||
use App\Controllers\BaseController;
|
use App\Controllers\BaseController;
|
||||||
|
use App\Models\CategoryModel;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use App\Models\CategoryModel;
|
|
||||||
|
|
||||||
abstract class FrontController extends BaseController
|
abstract class FrontController extends BaseController
|
||||||
{
|
{
|
||||||
@ -15,7 +15,8 @@ abstract class FrontController extends BaseController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= 'front/';
|
$this->_viewPath = 'front/';
|
||||||
|
$this->_viewDatas['control'] = 'front';
|
||||||
$this->_viewDatas['layout'] = LAYOUTS['front'];
|
$this->_viewDatas['layout'] = LAYOUTS['front'];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -25,28 +26,29 @@ abstract class FrontController extends BaseController
|
|||||||
}
|
}
|
||||||
|
|
||||||
//권한체크
|
//권한체크
|
||||||
final protected function isRole($action, $entity = null)
|
protected function isRole($action)
|
||||||
{
|
{
|
||||||
$this->_category = !is_null($entity) ? $entity->getCategory_Uid() : ($this->request->getVar('category') ?: throw new \Exception("범주를 지정하지 않으셨습니다."));
|
$this->_category ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
|
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category]);
|
||||||
|
$this->_viewDatas['parent_category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_viewDatas['category']->getHierarchy_ParentUID()]);
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'insert':
|
case 'insert':
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['WRITE'];
|
$category_field = getenv("category.role.{$action}") ?: 'iswrite';
|
||||||
break;
|
break;
|
||||||
case 'reply':
|
case 'reply':
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['REPLY'];
|
$category_field = getenv("category.role.{$action}") ?: 'isreply';
|
||||||
break;
|
break;
|
||||||
case 'view':
|
case 'view':
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['READ'];
|
$category_field = getenv("category.role.{$action}") ?: 'isread';
|
||||||
break;
|
break;
|
||||||
case 'upload':
|
case 'upload':
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['UPLOAD'];
|
$category_field = getenv("category.role.{$action}") ?: 'isupload';
|
||||||
break;
|
break;
|
||||||
case 'download':
|
case 'download':
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['DONWLOAD'];
|
$category_field = getenv("category.role.{$action}") ?: 'isdownload';
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$category_field = CATEGORY_ROLE_FIELDS['ACCESS'];
|
$category_field = getenv("category.role.{$action}") ?: 'isdaccess';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
//사용자가 Category에서 해당 게시판의 해당권한이 있는지 확인
|
//사용자가 Category에서 해당 게시판의 해당권한이 있는지 확인
|
||||||
@ -55,13 +57,13 @@ abstract class FrontController extends BaseController
|
|||||||
$this->_viewDatas['category'],
|
$this->_viewDatas['category'],
|
||||||
$category_field,
|
$category_field,
|
||||||
)) {
|
)) {
|
||||||
echo var_export($this->_viewDatas['currentRoles'], true);
|
// echo var_export($this->_viewDatas['currentRoles'], true);
|
||||||
echo "<HR>";
|
// echo "<HR>";
|
||||||
echo var_export($this->_viewDatas['category'], true);
|
// echo var_export($this->_viewDatas['category'], true);
|
||||||
echo "<HR>";
|
// echo "<HR>";
|
||||||
echo "field->", $action . ":" . $category_field;
|
// echo "field->", $action . ":" . $category_field;
|
||||||
exit;
|
// exit;
|
||||||
throw new \Exception("고객님은 " . lang($this->getCategoryModel()->getClassName() . ".label." . $category_field) . "이 없습니다.");
|
throw new \Exception("고객님은 " . lang("Category.label." . $category_field) . "이 없습니다.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
67
app/Controllers/Front/SitepageController.php
Normal file
67
app/Controllers/Front/SitepageController.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Controllers\Front;
|
||||||
|
|
||||||
|
use App\Models\SitepageModel;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
|
class SitepageController extends FrontController
|
||||||
|
{
|
||||||
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
|
{
|
||||||
|
parent::initController($request, $response, $logger);
|
||||||
|
$this->_model = new SitepageModel();
|
||||||
|
$this->_viewDatas['className'] = 'Sitepage';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
|
}
|
||||||
|
public function getFields(string $action = ""): array
|
||||||
|
{
|
||||||
|
$fields = ["content"];
|
||||||
|
switch ($action) {
|
||||||
|
case "index":
|
||||||
|
case "excel":
|
||||||
|
return ['title', "created_at"];
|
||||||
|
break;
|
||||||
|
case "view":
|
||||||
|
return ['title', "created_at", "content"];
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return $fields;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function getFieldFilters(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
public function getFieldBatchFilters(): array
|
||||||
|
{
|
||||||
|
return parent::getFieldBatchFilters();
|
||||||
|
}
|
||||||
|
|
||||||
|
//권한체크
|
||||||
|
protected function isRole($action)
|
||||||
|
{
|
||||||
|
$this->_category = $this->request->getVar('category') ?: throw new \Exception("분류를 지정하지 않으셨습니다.");
|
||||||
|
parent::isRole($action);
|
||||||
|
}
|
||||||
|
//Index관련
|
||||||
|
protected function index_process()
|
||||||
|
{
|
||||||
|
//권한체크
|
||||||
|
$this->isRole('index');
|
||||||
|
return parent::index_process();
|
||||||
|
}
|
||||||
|
//Category 및 Status 조건추가
|
||||||
|
protected function index_setCondition()
|
||||||
|
{
|
||||||
|
$this->_model->where("category_uid", $this->_viewDatas['category']->getPrimaryKey());
|
||||||
|
$this->_model->where("status", DEFAULTS['STATUS']);
|
||||||
|
parent::index_setCondition();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Front;
|
namespace App\Controllers\Front;
|
||||||
|
|
||||||
|
use App\Libraries\Adapter\Auth\Auth as AuthAdapter;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -9,11 +10,37 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
class UserController extends FrontController
|
class UserController extends FrontController
|
||||||
{
|
{
|
||||||
|
private $_adapters = array();
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
$this->_model = new UserModel();
|
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
$this->_model = new UserModel();
|
||||||
|
$this->_viewDatas['className'] = 'User';
|
||||||
|
$this->_viewPath .= strtolower($this->_viewDatas['className']);
|
||||||
|
$this->_viewDatas['title'] = lang($this->_viewDatas['className'] . '.title');
|
||||||
|
$this->_viewDatas['class_icon'] = CLASS_ICONS[strtoupper($this->_viewDatas['className'])];
|
||||||
|
helper($this->_viewDatas['className']);
|
||||||
|
|
||||||
|
$this->initAdapters();
|
||||||
|
//Default 회원정보 Category
|
||||||
|
$this->_category = DEFAULTS['USER_CATEGORY'];
|
||||||
|
$this->isRole('index');
|
||||||
|
}
|
||||||
|
|
||||||
|
private function initAdapters()
|
||||||
|
{
|
||||||
|
foreach (array_keys(AUTH_ADAPTERS) as $adapter) {
|
||||||
|
$this->getAdapter($adapter);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private function getAdapter(string $site): AuthAdapter
|
||||||
|
{
|
||||||
|
$site = ucfirst($site);
|
||||||
|
if (!array_key_exists($site, $this->_adapters)) {
|
||||||
|
$adapterClass = sprintf("\App\Libraries\Adapter\Auth\%sAuth", $site);
|
||||||
|
$this->_adapters[$site] = new $adapterClass($site, AUTH_ADAPTERS[$site]['DEBUG']);
|
||||||
|
}
|
||||||
|
return $this->_adapters[$site];
|
||||||
}
|
}
|
||||||
|
|
||||||
//Field별 Form Datas 처리용
|
//Field별 Form Datas 처리용
|
||||||
@ -33,50 +60,82 @@ class UserController extends FrontController
|
|||||||
|
|
||||||
public function getFields(string $action = ""): array
|
public function getFields(string $action = ""): array
|
||||||
{
|
{
|
||||||
$fields = ["id", "passwd", 'name', "email", "role", "status"];
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
|
case 'insert':
|
||||||
|
return ["id", "passwd", 'name', "email", "phone", "mobile"];
|
||||||
|
break;
|
||||||
|
case 'update':
|
||||||
|
return ["passwd", 'name', "email", "phone", "mobile"];
|
||||||
|
break;
|
||||||
case "index":
|
case "index":
|
||||||
case "excel":
|
case "excel":
|
||||||
return ["id", 'name', "email", "role", "status", 'created_at'];
|
return ["id", 'name', "email", "phone", "mobile", 'created_at'];
|
||||||
break;
|
break;
|
||||||
case "view":
|
case "view":
|
||||||
return ["id", 'name', "email", "role", "status", 'updated_at', 'created_at'];
|
return ["id", 'name', "email", "phone", "mobile", 'updated_at', 'created_at'];
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
return $fields;
|
return [];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function getFieldFilters(): array
|
public function getFieldFilters(): array
|
||||||
{
|
{
|
||||||
return ["role", "status"];
|
return [];
|
||||||
}
|
}
|
||||||
public function getFieldBatchFilters(): array
|
public function getFieldBatchFilters(): array
|
||||||
{
|
{
|
||||||
return parent::getFieldBatchFilters();
|
return parent::getFieldBatchFilters();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function insert_validate()
|
//Insert관련
|
||||||
|
protected function insert_process()
|
||||||
{
|
{
|
||||||
$rules = [];
|
//Role이 반드시 있어야 하기때문에
|
||||||
foreach ($this->_viewDatas['fieldRules'] as $field => $rule) {
|
$this->_viewDatas['fieldDatas']['role'] = DEFAULTS['ROLE'] . ',user';
|
||||||
switch ($field) {
|
return parent::insert_process();
|
||||||
case 'role':
|
}
|
||||||
$rules[$field . '.*'] = $rule;
|
|
||||||
break;
|
//Index관련
|
||||||
default:
|
//사용자 UID 조건추가
|
||||||
$rules[$field] = $rule;
|
protected function index_setCondition()
|
||||||
break;
|
{
|
||||||
}
|
$this->_model->where("uid", $this->_viewDatas['auth'][AUTH_FIELDS['ID']]);
|
||||||
|
parent::index_setCondition();
|
||||||
|
}
|
||||||
|
|
||||||
|
//추가기능
|
||||||
|
public function login_form()
|
||||||
|
{
|
||||||
|
foreach ($this->_adapters as $key => $adapter) {
|
||||||
|
$this->_viewDatas['login_buttons'][$key] = $adapter->getAuthButton();
|
||||||
}
|
}
|
||||||
//fieldData Rule 검사
|
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
if (!$this->validate($rules)) {
|
helper(['form']);
|
||||||
throw new \Exception("{$this->_viewDatas['title']}의 검증 오류발생\n" . implode("\n", $this->validator->getErrors()));
|
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
}
|
return view($this->_viewPath . '/login' . $this->request->getVar('v') ?: '', ['viewDatas' => $this->_viewDatas]);
|
||||||
//fieldData 적용
|
}
|
||||||
$this->_viewDatas['fieldDatas'] = array();
|
|
||||||
foreach ($this->_viewDatas['fields'] as $field) {
|
public function login(string $site)
|
||||||
$this->_viewDatas['fieldDatas'] = $this->getFieldFormData($field);
|
{
|
||||||
|
try {
|
||||||
|
//각 Adapter별 인층체크 후 Session에 인증정보 설정
|
||||||
|
$this->getAdapter($site)->setFormDatas($this->request->getVar());
|
||||||
|
$this->getAdapter($site)->execute();
|
||||||
|
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
$this->_session->setFlashdata('return_message', $e->getMessage());
|
||||||
|
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
|
return redirect()->back()->withInput();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function logout()
|
||||||
|
{
|
||||||
|
//로그인 여부 확인후 Session에 Login 정보 삭제
|
||||||
|
if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
|
||||||
|
session_destroy();
|
||||||
|
}
|
||||||
|
return redirect()->route('/');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace App\Controllers;
|
namespace App\Controllers;
|
||||||
|
|
||||||
|
use App\Entities\CategoryEntity;
|
||||||
use CodeIgniter\Controller;
|
use CodeIgniter\Controller;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -9,12 +10,36 @@ use Psr\Log\LoggerInterface;
|
|||||||
|
|
||||||
class Home extends Controller
|
class Home extends Controller
|
||||||
{
|
{
|
||||||
|
private $_session = null;
|
||||||
|
private $_viewDatas = array();
|
||||||
|
private $_viewPath = "";
|
||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
|
$this->_viewDatas['control'] = 'main';
|
||||||
|
$this->_viewDatas['title'] = '쇼핑몰페이지';
|
||||||
|
$this->_viewDatas['layout'] = LAYOUTS['main'];
|
||||||
|
$this->_session = \Config\Services::session();
|
||||||
|
$this->_viewDatas['session'] = $this->_session;
|
||||||
|
$this->_viewDatas['className'] = 'MAIN';
|
||||||
|
// echo var_export($this->_viewDatas['layout'], true);
|
||||||
|
// exit;
|
||||||
|
//사용자 기본 Role 지정
|
||||||
|
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = false;
|
||||||
|
$this->_viewDatas['currentRoles'] = [DEFAULTS["ROLE"]];
|
||||||
|
if ($this->_session->get(SESSION_NAMES['ISLOGIN'])) {
|
||||||
|
$this->_viewDatas[SESSION_NAMES['ISLOGIN']] = true;
|
||||||
|
$this->_viewDatas['auth'] = $this->_session->get(SESSION_NAMES['AUTH']);
|
||||||
|
$currentRoles = explode(DEFAULTS['DELIMITER_ROLE'], $this->_viewDatas['auth'][AUTH_FIELDS['ROLE']]);
|
||||||
|
$this->_viewDatas['currentRoles'] = is_array($currentRoles) ? $currentRoles : [DEFAULTS["ROLE"]];
|
||||||
|
}
|
||||||
|
//Default 회원정보 Category
|
||||||
|
$this->_viewDatas['category'] = new CategoryEntity(['uid' => 1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public function index()
|
public function index()
|
||||||
{
|
{
|
||||||
return view('welcome_message');
|
return view($this->_viewPath . 'welcome_message', ['viewDatas' => $this->_viewDatas]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,7 +7,7 @@ use CodeIgniter\HTTP\Files\UploadedFile;
|
|||||||
trait UpDownloadTrait
|
trait UpDownloadTrait
|
||||||
{
|
{
|
||||||
//Upload FIle관련
|
//Upload FIle관련
|
||||||
private function upDownload_file_process(UploadedFile $upfile): string
|
private function upDownload_file_process(UploadedFile $upfile): ?string
|
||||||
{
|
{
|
||||||
$filename = null;
|
$filename = null;
|
||||||
$uploaded_filename = null;
|
$uploaded_filename = null;
|
||||||
@ -17,10 +17,12 @@ trait UpDownloadTrait
|
|||||||
$upfile->move(PATHS['UPLOAD'], $uploaded_filename);
|
$upfile->move(PATHS['UPLOAD'], $uploaded_filename);
|
||||||
//move시 중복된파일명이 있다면 파일명이 바뀌므로 여기서 한번더 파일명 확인 필요
|
//move시 중복된파일명이 있다면 파일명이 바뀌므로 여기서 한번더 파일명 확인 필요
|
||||||
$uploaded_filename = $upfile->getName();
|
$uploaded_filename = $upfile->getName();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return $filename . DEFAULTS['DELIMITER_FILE'] . $uploaded_filename;
|
return $filename . DEFAULTS['DELIMITER_FILE'] . $uploaded_filename;
|
||||||
}
|
}
|
||||||
public function upload_file_procedure(string $field): string
|
public function upload_file_procedure(string $field): ?string
|
||||||
{
|
{
|
||||||
return $this->upload_file_process($this->request->getFile($field));
|
return $this->upload_file_process($this->request->getFile($field));
|
||||||
}
|
}
|
||||||
@ -32,7 +34,10 @@ trait UpDownloadTrait
|
|||||||
if ($upfiles = $this->request->getFiles()) {
|
if ($upfiles = $this->request->getFiles()) {
|
||||||
foreach ($upfiles[$field] as $upfile) {
|
foreach ($upfiles[$field] as $upfile) {
|
||||||
if ($upfile->isValid() && !$upfile->hasMoved()) {
|
if ($upfile->isValid() && !$upfile->hasMoved()) {
|
||||||
array_push($files, $this->upload_file_process($upfile));
|
$file = $this->upload_file_process($upfile);
|
||||||
|
if (!is_null($file)) {
|
||||||
|
array_push($files, $file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -46,7 +51,7 @@ trait UpDownloadTrait
|
|||||||
->resize($x, $y, true, 'height')
|
->resize($x, $y, true, 'height')
|
||||||
->save(PATHS['UPLOAD_IMAGE'] . $uploaded_filename);
|
->save(PATHS['UPLOAD_IMAGE'] . $uploaded_filename);
|
||||||
}
|
}
|
||||||
private function upload_image_process(UploadedFile $upfile): string
|
private function upload_image_process(UploadedFile $upfile): ?string
|
||||||
{
|
{
|
||||||
//참고:https://www.positronx.io/codeigniter-resize-image-with-image-manipulation-tutorial/
|
//참고:https://www.positronx.io/codeigniter-resize-image-with-image-manipulation-tutorial/
|
||||||
$filename = null;
|
$filename = null;
|
||||||
@ -60,11 +65,13 @@ trait UpDownloadTrait
|
|||||||
$upfile->move(PATHS['UPLOAD_IMAGE'], $uploaded_filename);
|
$upfile->move(PATHS['UPLOAD_IMAGE'], $uploaded_filename);
|
||||||
//move시 중복된파일명이 있다면 파일명이 바뀌므로 여기서 한번더 파일명 확인 필요
|
//move시 중복된파일명이 있다면 파일명이 바뀌므로 여기서 한번더 파일명 확인 필요
|
||||||
$uploaded_filename = $upfile->getName();
|
$uploaded_filename = $upfile->getName();
|
||||||
|
} else {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
return $filename . DEFAULTS['DELIMITER_FILE'] . $uploaded_filename;
|
return $filename . DEFAULTS['DELIMITER_FILE'] . $uploaded_filename;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function upload_image_procedure(string $field): string
|
public function upload_image_procedure(string $field): ?string
|
||||||
{
|
{
|
||||||
return $this->upload_image_process($this->request->getFile($field));
|
return $this->upload_image_process($this->request->getFile($field));
|
||||||
}
|
}
|
||||||
@ -76,7 +83,10 @@ trait UpDownloadTrait
|
|||||||
if ($upfiles = $this->request->getFiles()) {
|
if ($upfiles = $this->request->getFiles()) {
|
||||||
foreach ($upfiles[$field] as $upfile) {
|
foreach ($upfiles[$field] as $upfile) {
|
||||||
if ($upfile->isValid() && !$upfile->hasMoved()) {
|
if ($upfile->isValid() && !$upfile->hasMoved()) {
|
||||||
array_push($files, $this->upload_image_process($upfile));
|
$file = $this->upload_image_process($upfile);
|
||||||
|
if (!is_null($file)) {
|
||||||
|
array_push($files, $file);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,6 +7,8 @@ CREATE TABLE baseproject.tw_user (
|
|||||||
passwd varchar(100) NOT NULL,
|
passwd varchar(100) NOT NULL,
|
||||||
name varchar(20) NOT NULL COMMENT "사용자명",
|
name varchar(20) NOT NULL COMMENT "사용자명",
|
||||||
email varchar(50) NOT NULL,
|
email varchar(50) NOT NULL,
|
||||||
|
phone varchar(20) NULL COMMENT '연락처',
|
||||||
|
mobile varchar(20) NULL COMMENT '핸드폰',
|
||||||
role varchar(255) NOT NULL DEFAULT 'user' COMMENT '사용자등급',
|
role varchar(255) NOT NULL DEFAULT 'user' COMMENT '사용자등급',
|
||||||
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
||||||
updated_at timestamp NULL DEFAULT NULL,
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
@ -50,7 +52,9 @@ CREATE TABLE baseproject.tw_category (
|
|||||||
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
name varchar(255) NOT NULL COMMENT '범주명',
|
parent_uid int(10) UNSIGNED NULL COMMENT '부모UID',
|
||||||
|
name varchar(255) NOT NULL COMMENT '분류명',
|
||||||
|
linkurl varchar(100) NOT NULL DEFAULT '/front/board' COMMENT 'Front Link URL',
|
||||||
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
||||||
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
||||||
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
||||||
@ -64,7 +68,7 @@ CREATE TABLE baseproject.tw_category (
|
|||||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
deleted_at timestamp NULL DEFAULT NULL,
|
deleted_at timestamp NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (uid)
|
PRIMARY KEY (uid)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='범주';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='분류';
|
||||||
|
|
||||||
DROP TABLE IF EXISTS baseproject.tw_board;
|
DROP TABLE IF EXISTS baseproject.tw_board;
|
||||||
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
|
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
|
||||||
@ -78,7 +82,8 @@ CREATE TABLE baseproject.tw_board (
|
|||||||
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
|
parent_uid int(10) UNSIGNED NULL COMMENT '부모UID',
|
||||||
|
category_uid int(10) UNSIGNED NOT NULL COMMENT '분류 UID',
|
||||||
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
||||||
title varchar(255) NOT NULL COMMENT '제목',
|
title varchar(255) NOT NULL COMMENT '제목',
|
||||||
content text NOT NULL COMMENT '내용',
|
content text NOT NULL COMMENT '내용',
|
||||||
@ -92,4 +97,20 @@ CREATE TABLE baseproject.tw_board (
|
|||||||
PRIMARY KEY (uid),
|
PRIMARY KEY (uid),
|
||||||
CONSTRAINT FOREIGN KEY (category_uid) REFERENCES tw_category (uid),
|
CONSTRAINT FOREIGN KEY (category_uid) REFERENCES tw_category (uid),
|
||||||
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시물 정보';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시물 정보';
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS baseproject.tw_sitepage;
|
||||||
|
CREATE TABLE baseproject.tw_sitepage (
|
||||||
|
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
category_uid int(10) UNSIGNED NOT NULL COMMENT '분류 UID',
|
||||||
|
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
||||||
|
title varchar(255) NOT NULL COMMENT '제목',
|
||||||
|
content text NOT NULL COMMENT '내용',
|
||||||
|
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용, unuse: 사용않함 등등',
|
||||||
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
|
deleted_at timestamp NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (uid),
|
||||||
|
CONSTRAINT FOREIGN KEY (category_uid) REFERENCES tw_category (uid),
|
||||||
|
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사이트페이지 정보';
|
||||||
@ -7,6 +7,8 @@ CREATE TABLE servermgr.tw_user (
|
|||||||
passwd varchar(100) NOT NULL,
|
passwd varchar(100) NOT NULL,
|
||||||
name varchar(20) NOT NULL COMMENT "사용자명",
|
name varchar(20) NOT NULL COMMENT "사용자명",
|
||||||
email varchar(50) NOT NULL,
|
email varchar(50) NOT NULL,
|
||||||
|
phone varchar(20) NULL COMMENT '연락처',
|
||||||
|
mobile varchar(20) NULL COMMENT '핸드폰',
|
||||||
role varchar(255) NOT NULL DEFAULT 'user' COMMENT '사용자등급',
|
role varchar(255) NOT NULL DEFAULT 'user' COMMENT '사용자등급',
|
||||||
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함',
|
||||||
updated_at timestamp NULL DEFAULT NULL,
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
@ -50,7 +52,9 @@ CREATE TABLE servermgr.tw_category (
|
|||||||
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
name varchar(255) NOT NULL COMMENT '범주명',
|
parent_uid int(10) UNSIGNED NULL COMMENT '부모UID',
|
||||||
|
name varchar(255) NOT NULL COMMENT '분류명',
|
||||||
|
linkurl varchar(100) NOT NULL DEFAULT '/front/board' COMMENT 'Front Link URL',
|
||||||
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
|
||||||
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
|
||||||
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
|
||||||
@ -64,7 +68,7 @@ CREATE TABLE servermgr.tw_category (
|
|||||||
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
deleted_at timestamp NULL DEFAULT NULL,
|
deleted_at timestamp NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (uid)
|
PRIMARY KEY (uid)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='범주';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='분류';
|
||||||
|
|
||||||
DROP TABLE IF EXISTS servermgr.tw_board;
|
DROP TABLE IF EXISTS servermgr.tw_board;
|
||||||
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
|
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
|
||||||
@ -78,7 +82,8 @@ CREATE TABLE servermgr.tw_board (
|
|||||||
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
|
||||||
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
|
||||||
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
|
||||||
category_uid int(10) UNSIGNED NOT NULL COMMENT '범주 UID',
|
parent_uid int(10) UNSIGNED NULL COMMENT '부모UID',
|
||||||
|
category_uid int(10) UNSIGNED NOT NULL COMMENT '분류 UID',
|
||||||
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
||||||
title varchar(255) NOT NULL COMMENT '제목',
|
title varchar(255) NOT NULL COMMENT '제목',
|
||||||
content text NOT NULL COMMENT '내용',
|
content text NOT NULL COMMENT '내용',
|
||||||
@ -94,6 +99,22 @@ CREATE TABLE servermgr.tw_board (
|
|||||||
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시물 정보';
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시물 정보';
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS servermgr.tw_sitepage;
|
||||||
|
CREATE TABLE servermgr.tw_sitepage (
|
||||||
|
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||||
|
category_uid int(10) UNSIGNED NOT NULL COMMENT '분류 UID',
|
||||||
|
user_uid varchar(36) NULL COMMENT '작성자 정보',
|
||||||
|
title varchar(255) NOT NULL COMMENT '제목',
|
||||||
|
content text NOT NULL COMMENT '내용',
|
||||||
|
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용, unuse: 사용않함 등등',
|
||||||
|
updated_at timestamp NULL DEFAULT NULL,
|
||||||
|
created_at timestamp NOT NULL DEFAULT current_timestamp(),
|
||||||
|
deleted_at timestamp NULL DEFAULT NULL,
|
||||||
|
PRIMARY KEY (uid),
|
||||||
|
CONSTRAINT FOREIGN KEY (category_uid) REFERENCES tw_category (uid),
|
||||||
|
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사이트페이지 정보';
|
||||||
|
|
||||||
DROP TABLE IF EXISTS servermgr.tw_hpilo;
|
DROP TABLE IF EXISTS servermgr.tw_hpilo;
|
||||||
|
|
||||||
CREATE TABLE
|
CREATE TABLE
|
||||||
|
|||||||
@ -6,6 +6,14 @@ use CodeIgniter\Entity\Entity;
|
|||||||
|
|
||||||
abstract class BaseEntity extends Entity
|
abstract class BaseEntity extends Entity
|
||||||
{
|
{
|
||||||
abstract public function getPrimaryKey();
|
|
||||||
abstract public function getTitle(): string;
|
abstract public function getTitle(): string;
|
||||||
|
final public function getPrimaryKey()
|
||||||
|
{
|
||||||
|
return $this->attributes['uid'];
|
||||||
|
}
|
||||||
|
//조화수관련 Field전용
|
||||||
|
final public function getViews($field = 'view_cnt')
|
||||||
|
{
|
||||||
|
return $this->attributes[$field];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,4 +16,8 @@ abstract class BaseHierarchyEntity extends BaseEntity
|
|||||||
{
|
{
|
||||||
return $this->attributes['grpdepth'];
|
return $this->attributes['grpdepth'];
|
||||||
}
|
}
|
||||||
|
final public function getHierarchy_ParentUID()
|
||||||
|
{
|
||||||
|
return $this->attributes['parent_uid'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -9,42 +9,26 @@ class BoardEntity extends BaseHierarchyEntity
|
|||||||
protected $casts = [];
|
protected $casts = [];
|
||||||
|
|
||||||
//기본기능
|
//기본기능
|
||||||
public function getPrimaryKey()
|
|
||||||
{
|
|
||||||
return $this->attributes['uid'];
|
|
||||||
}
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['title'];
|
return $this->attributes['title'];
|
||||||
}
|
}
|
||||||
public function getStatus(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
public function getCategory_Uid()
|
|
||||||
{
|
|
||||||
return $this->attributes['category_uid'];
|
|
||||||
}
|
|
||||||
public function getUser_Uid()
|
|
||||||
{
|
|
||||||
return $this->attributes['user_uid'];
|
|
||||||
}
|
|
||||||
public function getPassword()
|
public function getPassword()
|
||||||
{
|
{
|
||||||
return $this->attributes['passwd'];
|
return $this->attributes['passwd'];
|
||||||
}
|
}
|
||||||
public function getViews()
|
//파일관련 Field전용
|
||||||
|
final public function getFileDownload($url, $field = "upload_file")
|
||||||
{
|
{
|
||||||
return $this->attributes['view_cnt'];
|
if (is_null($this->attributes[$field])) {
|
||||||
}
|
return "";
|
||||||
public function getBoardFile()
|
}
|
||||||
{
|
$files = explode(DEFAULTS['DELIMITER_FILE'], $this->attributes[$field]);
|
||||||
return $this->attributes['board_file'];
|
return anchor(
|
||||||
}
|
$url,
|
||||||
public function getBoardFileName()
|
ICONS['IMAGE_FILE'] . $files[0],
|
||||||
{
|
["target" => "_self"]
|
||||||
return explode(DEFAULTS['DELIMITER_FILE'], $this->getBoardFile())[1];
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,8 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Entities;
|
namespace App\Entities;
|
||||||
|
|
||||||
use App\Entities\Trait\HierarchyTrait;
|
|
||||||
|
|
||||||
class CategoryEntity extends BaseHierarchyEntity
|
class CategoryEntity extends BaseHierarchyEntity
|
||||||
{
|
{
|
||||||
protected $datamap = [];
|
protected $datamap = [];
|
||||||
@ -11,28 +9,12 @@ class CategoryEntity extends BaseHierarchyEntity
|
|||||||
protected $casts = [];
|
protected $casts = [];
|
||||||
|
|
||||||
//기본기능
|
//기본기능
|
||||||
public function getPrimaryKey()
|
|
||||||
{
|
|
||||||
return $this->attributes['uid'];
|
|
||||||
}
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['name'];
|
return $this->attributes['name'];
|
||||||
}
|
}
|
||||||
public function getStatus(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
public function getHead()
|
//CommonHelper에서 사용
|
||||||
{
|
|
||||||
return $this->attributes['head'];
|
|
||||||
}
|
|
||||||
public function getTail()
|
|
||||||
{
|
|
||||||
return $this->attributes['tail'];
|
|
||||||
}
|
|
||||||
public function getRole($field = 'isaccess')
|
public function getRole($field = 'isaccess')
|
||||||
{
|
{
|
||||||
return array_key_exists(
|
return array_key_exists(
|
||||||
|
|||||||
17
app/Entities/SitepageEntity.php
Normal file
17
app/Entities/SitepageEntity.php
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entities;
|
||||||
|
|
||||||
|
class SitepageEntity extends BaseEntity
|
||||||
|
{
|
||||||
|
protected $datamap = [];
|
||||||
|
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
|
||||||
|
protected $casts = [];
|
||||||
|
|
||||||
|
//기본기능
|
||||||
|
public function getTitle(): string
|
||||||
|
{
|
||||||
|
return $this->attributes['title'];
|
||||||
|
}
|
||||||
|
//추가기능
|
||||||
|
}
|
||||||
@ -9,25 +9,11 @@ class UserEntity extends BaseEntity
|
|||||||
protected $casts = [];
|
protected $casts = [];
|
||||||
|
|
||||||
//기본기능
|
//기본기능
|
||||||
public function getPrimaryKey()
|
|
||||||
{
|
|
||||||
return $this->attributes['uid'];
|
|
||||||
}
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['name'];
|
return $this->attributes['name'];
|
||||||
}
|
}
|
||||||
public function getStatus(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
public function getRole()
|
|
||||||
{
|
|
||||||
return $this->attributes['role'];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPassword()
|
public function getPassword()
|
||||||
{
|
{
|
||||||
return $this->attributes['passwd'];
|
return $this->attributes['passwd'];
|
||||||
|
|||||||
@ -9,18 +9,9 @@ class UserSNSEntity extends BaseEntity
|
|||||||
protected $casts = [];
|
protected $casts = [];
|
||||||
|
|
||||||
//기본기능
|
//기본기능
|
||||||
public function getPrimaryKey()
|
|
||||||
{
|
|
||||||
return $this->attributes['uid'];
|
|
||||||
}
|
|
||||||
public function getTitle(): string
|
public function getTitle(): string
|
||||||
{
|
{
|
||||||
return $this->attributes['name'];
|
return $this->attributes['name'];
|
||||||
}
|
}
|
||||||
public function getStatus(): string
|
|
||||||
{
|
|
||||||
return $this->attributes['status'];
|
|
||||||
}
|
|
||||||
|
|
||||||
//추가기능
|
//추가기능
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,7 +30,7 @@ class AuthFilter implements FilterInterface
|
|||||||
$auth = session()->get(SESSION_NAMES['AUTH']);
|
$auth = session()->get(SESSION_NAMES['AUTH']);
|
||||||
// 회원 ROLES이 필요ROLE($arguments[0]) 목록에 존재하지 않으면(ACL)
|
// 회원 ROLES이 필요ROLE($arguments[0]) 목록에 존재하지 않으면(ACL)
|
||||||
if (!in_array($arguments[0], explode(DEFAULTS['DELIMITER_ROLE'], $auth[AUTH_FIELDS['ROLE']]))) {
|
if (!in_array($arguments[0], explode(DEFAULTS['DELIMITER_ROLE'], $auth[AUTH_FIELDS['ROLE']]))) {
|
||||||
return redirect()->to('/login')->with(
|
return redirect()->to(URLS['LOGIN'])->with(
|
||||||
'return_message',
|
'return_message',
|
||||||
sprintf(
|
sprintf(
|
||||||
"%s,%s회원님은 접속에 필요한 권한[%s]이 없습니다. ",
|
"%s,%s회원님은 접속에 필요한 권한[%s]이 없습니다. ",
|
||||||
@ -42,7 +42,7 @@ class AuthFilter implements FilterInterface
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
session()->setFlashdata(SESSION_NAMES['RETURN_URL'], $request->getUri()->getPath() . '?' . $request->getUri()->getQuery());
|
session()->setFlashdata(SESSION_NAMES['RETURN_URL'], $request->getUri()->getPath() . '?' . $request->getUri()->getQuery());
|
||||||
return redirect()->to('/login')->with('return_message', '로그인을하셔야합니다.');
|
return redirect()->to(URLS['LOGIN'])->with('return_message', '로그인을하셔야합니다.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -73,28 +73,18 @@ function getFieldView_BoardHelper($field, $entity, array $viewDatas)
|
|||||||
}
|
}
|
||||||
return $value;
|
return $value;
|
||||||
break;
|
break;
|
||||||
case 'title':
|
|
||||||
case 'name':
|
|
||||||
$reply = anchor(
|
|
||||||
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
|
||||||
ICONS['REPLY'],
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
$view = anchor(
|
|
||||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
|
||||||
$value,
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
return sprintf(
|
|
||||||
"<div style=\"text-align:left; padding-left:%spx\">%s %s</div>",
|
|
||||||
$entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH'],
|
|
||||||
$reply,
|
|
||||||
$view
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'board_file':
|
case 'board_file':
|
||||||
case 'upload_file':
|
case 'upload_file':
|
||||||
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
|
return $entity->getFileDownload(
|
||||||
|
base_url() .
|
||||||
|
$viewDatas['control'] .
|
||||||
|
"/board/download/{$field}/{$entity->getPrimaryKey()}" .
|
||||||
|
'?category=' . $viewDatas['category']->getPrimaryKey(),
|
||||||
|
$field
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'photo':
|
||||||
|
return $entity->getFileImage('middle', $field);
|
||||||
break;
|
break;
|
||||||
case 'view_cnt':
|
case 'view_cnt':
|
||||||
return number_format(!$value ? 0 : $value);
|
return number_format(!$value ? 0 : $value);
|
||||||
@ -121,22 +111,79 @@ function getFieldFilter_BoardHelper($field, $value, array $viewDatas)
|
|||||||
function getFieldIndex_Column_BoardHelper($field, array $viewDatas)
|
function getFieldIndex_Column_BoardHelper($field, array $viewDatas)
|
||||||
{
|
{
|
||||||
$label = lang("{$viewDatas['className']}.label.{$field}");
|
$label = lang("{$viewDatas['className']}.label.{$field}");
|
||||||
$label = $field == $viewDatas['order_field'] ? sprintf('%s <i class="fa fa-arrow-%s"></i>', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
|
if ($field == $viewDatas['order_field']) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS['UP'] : ICONS['DOWN'];
|
||||||
|
}
|
||||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $value);
|
||||||
|
$columnData = anchor($viewDatas['uri'], $label);
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return sprintf("<th class='col-4'>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return sprintf("<th>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} //
|
} //
|
||||||
|
//Front용
|
||||||
function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
$depth = " ";
|
||||||
|
for ($i = 1; $i < $entity->getHierarchy_Depth(); $i++) {
|
||||||
|
$depth .= " ";
|
||||||
|
}
|
||||||
|
$reply = anchor(
|
||||||
|
current_url() . '/reply/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(),
|
||||||
|
ICONS['REPLY'],
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
$view = anchor(
|
||||||
|
current_url() . '/view/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(),
|
||||||
|
$value,
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
return sprintf("%s%s %s", $depth, $reply, $view);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return getFieldView_BoardHelper($field, $entity, $viewDatas);
|
return getFieldView_BoardHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
|
|
||||||
|
//Admin용
|
||||||
function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
$depth = " ";
|
||||||
|
for ($i = 1; $i < $entity->getHierarchy_Depth(); $i++) {
|
||||||
|
$depth .= " ";
|
||||||
|
}
|
||||||
|
$reply = anchor(
|
||||||
|
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
||||||
|
ICONS['REPLY'],
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
$view = anchor(
|
||||||
|
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||||
|
$value,
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
return sprintf("%s%s %s", $depth, $reply, $view);
|
||||||
|
break;
|
||||||
|
case 'board_file':
|
||||||
|
case 'upload_file':
|
||||||
|
return $entity->getFileDownload(base_url() . $viewDatas['control'] . '/board', $field);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['fieldFilters'])) {
|
if (in_array($field, $viewDatas['fieldFilters'])) {
|
||||||
$attributes["onChange"] = sprintf(
|
$attributes["onChange"] = sprintf(
|
||||||
@ -148,7 +195,7 @@ function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas):
|
|||||||
);
|
);
|
||||||
return getFieldForm_BoardHelper($field, $entity->$field, $viewDatas, $attributes);
|
return getFieldForm_BoardHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||||
}
|
}
|
||||||
return getFieldView_BoardHelper($field, $entity, $viewDatas);
|
return getFieldIndex_Row_BoardHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
@ -40,10 +40,15 @@ function getFieldForm_CategoryHelper($field, $value, array $viewDatas, array $at
|
|||||||
case 'content':
|
case 'content':
|
||||||
case 'head':
|
case 'head':
|
||||||
case 'tail':
|
case 'tail':
|
||||||
return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
return form_textarea(
|
||||||
|
$field,
|
||||||
|
html_entity_decode($value),
|
||||||
|
['class' => 'editor', 'rows' => '20', 'cols' => '100']
|
||||||
|
);
|
||||||
break;
|
break;
|
||||||
case 'upload_file':
|
case 'upload_file':
|
||||||
case 'board_file':
|
case 'board_file':
|
||||||
|
case 'photo':
|
||||||
return form_upload($field);
|
return form_upload($field);
|
||||||
break;
|
break;
|
||||||
case 'view_cnt':
|
case 'view_cnt':
|
||||||
@ -67,29 +72,6 @@ function getFieldView_CategoryHelper($field, $entity, array $viewDatas)
|
|||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'title':
|
|
||||||
case 'name':
|
|
||||||
$reply = anchor(
|
|
||||||
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
|
||||||
ICONS['REPLY'],
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
$view = anchor(
|
|
||||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
|
||||||
$value,
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
return sprintf(
|
|
||||||
"<div style=\"text-align:left; padding-left:%spx\">%s %s</div>",
|
|
||||||
$entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH'],
|
|
||||||
$reply,
|
|
||||||
$view
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'board_file':
|
|
||||||
case 'upload_file':
|
|
||||||
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
|
|
||||||
break;
|
|
||||||
case 'view_cnt':
|
case 'view_cnt':
|
||||||
return number_format(!$value ? 0 : $value);
|
return number_format(!$value ? 0 : $value);
|
||||||
break;
|
break;
|
||||||
@ -115,11 +97,25 @@ function getFieldFilter_CategoryHelper($field, $value, array $viewDatas)
|
|||||||
function getFieldIndex_Column_CategoryHelper($field, array $viewDatas)
|
function getFieldIndex_Column_CategoryHelper($field, array $viewDatas)
|
||||||
{
|
{
|
||||||
$label = lang("{$viewDatas['className']}.label.{$field}");
|
$label = lang("{$viewDatas['className']}.label.{$field}");
|
||||||
$label = $field == $viewDatas['order_field'] ? sprintf('%s <i class="fa fa-arrow-%s"></i>', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
|
if ($field == $viewDatas['order_field']) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS['UP'] : ICONS['DOWN'];
|
||||||
|
}
|
||||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $value);
|
||||||
|
$columnData = anchor($viewDatas['uri'], $label);
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return sprintf("<th class='col-2'>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return sprintf("<th>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} //
|
} //
|
||||||
|
|
||||||
|
//Front용
|
||||||
function getFieldIndex_Row_CategoryHelper($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_CategoryHelper($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
@ -128,9 +124,29 @@ function getFieldIndex_Row_CategoryHelper($field, $entity, array $viewDatas): st
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
|
//Admin용
|
||||||
function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
$depth = " ";
|
||||||
|
for ($i = 1; $i < $entity->getHierarchy_Depth(); $i++) {
|
||||||
|
$depth .= " ";
|
||||||
|
}
|
||||||
|
$reply = anchor(
|
||||||
|
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
||||||
|
ICONS['REPLY'],
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
$view = anchor(
|
||||||
|
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||||
|
$value,
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
return sprintf("%s%s %s", $depth, $reply, $view);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
if (in_array($field, $viewDatas['fieldFilters'])) {
|
if (in_array($field, $viewDatas['fieldFilters'])) {
|
||||||
$attributes["onChange"] = sprintf(
|
$attributes["onChange"] = sprintf(
|
||||||
@ -142,7 +158,7 @@ function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewData
|
|||||||
);
|
);
|
||||||
return getFieldForm_CategoryHelper($field, $entity->$field, $viewDatas, $attributes);
|
return getFieldForm_CategoryHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||||
}
|
}
|
||||||
return getFieldView_CategoryHelper($field, $entity, $viewDatas);
|
return getFieldIndex_Row_CategoryHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
@ -148,17 +148,6 @@ function alert_CommonHelper(string $msg, $url = null)
|
|||||||
return "<script type=\"text/javascript\">{$msg}</script>";
|
return "<script type=\"text/javascript\">{$msg}</script>";
|
||||||
} //
|
} //
|
||||||
|
|
||||||
function imageSubmit_CommonHelper(string $src, array $attributes = [])
|
|
||||||
{
|
|
||||||
return form_input([
|
|
||||||
'type' => 'image',
|
|
||||||
'src' => base_url() . $src,
|
|
||||||
'name' => array_key_exists('name', $attributes) ? $attributes['name'] : "",
|
|
||||||
'value' => array_key_exists('value', $attributes) ? $attributes['value'] : "",
|
|
||||||
...$attributes,
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// STATUS가 use가 아닐때 option을 disabled되게 하기위함 (override form_dropdown)
|
// STATUS가 use가 아닐때 option을 disabled되게 하기위함 (override form_dropdown)
|
||||||
function form_dropdown_test($data = '', $options = [], $selected = [], $extra = ''): string
|
function form_dropdown_test($data = '', $options = [], $selected = [], $extra = ''): string
|
||||||
{
|
{
|
||||||
|
|||||||
161
app/Helpers/Sitepage_helper.php
Normal file
161
app/Helpers/Sitepage_helper.php
Normal file
@ -0,0 +1,161 @@
|
|||||||
|
<?php
|
||||||
|
function getFieldLabel_SitepageHelper($field, array $viewDatas): string
|
||||||
|
{
|
||||||
|
$attributes = [];
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||||
|
$attributes = ['style="color:red";'];
|
||||||
|
}
|
||||||
|
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//header.php에서 getFieldForm_Helper사용
|
||||||
|
function getFieldForm_SitepageHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case "category_uid":
|
||||||
|
case "user_uid":
|
||||||
|
$viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
|
||||||
|
return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
|
||||||
|
break;
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return form_input($field, $value, ["placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||||
|
break;
|
||||||
|
case 'passwd':
|
||||||
|
return sprintf(
|
||||||
|
"%s %s %s",
|
||||||
|
form_password($field, DEFAULTS['EMPTY']),
|
||||||
|
lang("{$viewDatas['className']}.label.confirmpassword"),
|
||||||
|
form_password('confirmpassword', DEFAULTS['EMPTY']),
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'content':
|
||||||
|
case 'head':
|
||||||
|
case 'tail':
|
||||||
|
return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||||
|
break;
|
||||||
|
case 'upload_file':
|
||||||
|
case 'board_file':
|
||||||
|
return form_upload($field);
|
||||||
|
break;
|
||||||
|
case 'view_cnt':
|
||||||
|
return form_input($field, $value, ['type' => 'number']);
|
||||||
|
break;
|
||||||
|
case "status":
|
||||||
|
$viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
|
||||||
|
return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, $attributes);
|
||||||
|
break;
|
||||||
|
case 'updated_at':
|
||||||
|
case 'created_at':
|
||||||
|
return form_input($field, $value, ['class' => 'calender']);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return form_input($field, $value);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //
|
||||||
|
|
||||||
|
function getFieldView_SitepageHelper($field, $entity, array $viewDatas)
|
||||||
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case 'category_uid':
|
||||||
|
foreach (array_values($viewDatas['fieldFormOptions'][$field]) as $category_2depths) {
|
||||||
|
foreach ($category_2depths as $key => $label) {
|
||||||
|
if ($key == $value) {
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
break;
|
||||||
|
case 'view_cnt':
|
||||||
|
return number_format(!$value ? 0 : $value);
|
||||||
|
break;
|
||||||
|
case 'content':
|
||||||
|
return html_entity_decode($value);
|
||||||
|
break;
|
||||||
|
case 'updated_at':
|
||||||
|
case 'created_at':
|
||||||
|
return $value ? str_split($value, 10)[0] : "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //
|
||||||
|
|
||||||
|
function getFieldFilter_SitepageHelper($field, $value, array $viewDatas)
|
||||||
|
{
|
||||||
|
$viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
|
||||||
|
return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, ['class' => "select-field"]);
|
||||||
|
} //
|
||||||
|
|
||||||
|
function getFieldIndex_Column_SitepageHelper($field, array $viewDatas)
|
||||||
|
{
|
||||||
|
$label = lang("{$viewDatas['className']}.label.{$field}");
|
||||||
|
if ($field == $viewDatas['order_field']) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS['UP'] : ICONS['DOWN'];
|
||||||
|
}
|
||||||
|
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $value);
|
||||||
|
$columnData = anchor($viewDatas['uri'], $label);
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return sprintf("<th class='col-4'>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return sprintf("<th>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //
|
||||||
|
|
||||||
|
//Front용
|
||||||
|
function getFieldIndex_Row_SitepageHelper($field, $entity, array $viewDatas): string
|
||||||
|
{
|
||||||
|
//front쪽은 table을 사용하지 않음 주의
|
||||||
|
switch ($field) {
|
||||||
|
case 'content':
|
||||||
|
return getFieldView_SitepageHelper($field, $entity, $viewDatas);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return getFieldView_SitepageHelper($field, $entity, $viewDatas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //
|
||||||
|
|
||||||
|
//Admin용
|
||||||
|
function getFieldIndex_Row_SitepageHelper_Admin($field, $entity, array $viewDatas): string
|
||||||
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return anchor(
|
||||||
|
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||||
|
$value,
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (in_array($field, $viewDatas['fieldFilters'])) {
|
||||||
|
$attributes["onChange"] = sprintf(
|
||||||
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
|
current_url(),
|
||||||
|
$entity->getPrimaryKey(),
|
||||||
|
$field,
|
||||||
|
$field
|
||||||
|
);
|
||||||
|
return getFieldForm_SitepageHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||||
|
}
|
||||||
|
//front쪽은 table을 사용하지 않음 주의
|
||||||
|
return getFieldIndex_Row_SitepageHelper($field, $entity, $viewDatas);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} //
|
||||||
@ -71,21 +71,6 @@ function getFieldView_UserSNSHelper($field, $entity, array $viewDatas)
|
|||||||
}
|
}
|
||||||
return $categorys[$value];
|
return $categorys[$value];
|
||||||
break;
|
break;
|
||||||
case 'title':
|
|
||||||
case 'name':
|
|
||||||
return anchor(
|
|
||||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
|
||||||
$value,
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'board_file':
|
|
||||||
case 'upload_file':
|
|
||||||
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
|
|
||||||
break;
|
|
||||||
case 'view_cnt':
|
|
||||||
return number_format(!$value ? 0 : $value);
|
|
||||||
break;
|
|
||||||
case 'content':
|
case 'content':
|
||||||
return html_entity_decode($value);
|
return html_entity_decode($value);
|
||||||
break;
|
break;
|
||||||
@ -108,19 +93,43 @@ function getFieldFilter_UserSNSHelper($field, $value, array $viewDatas)
|
|||||||
function getFieldIndex_Column_UserSNSHelper($field, array $viewDatas)
|
function getFieldIndex_Column_UserSNSHelper($field, array $viewDatas)
|
||||||
{
|
{
|
||||||
$label = lang("{$viewDatas['className']}.label.{$field}");
|
$label = lang("{$viewDatas['className']}.label.{$field}");
|
||||||
$label = $field == $viewDatas['order_field'] ? sprintf('%s <i class="fa fa-arrow-%s"></i>', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
|
if ($field == $viewDatas['order_field']) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS['UP'] : ICONS['DOWN'];
|
||||||
|
}
|
||||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $value);
|
||||||
|
$columnData = anchor($viewDatas['uri'], $label);
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return sprintf("<th class='col-1'>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return sprintf("<th>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} //
|
} //
|
||||||
|
|
||||||
|
//Front용
|
||||||
function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return anchor(
|
||||||
|
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||||
|
$value,
|
||||||
|
["target" => "_self"]
|
||||||
|
);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
|
return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
|
//Admin용
|
||||||
function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
@ -135,7 +144,7 @@ function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas
|
|||||||
);
|
);
|
||||||
return getFieldForm_UserSNSHelper($field, $entity->$field, $viewDatas, $attributes);
|
return getFieldForm_UserSNSHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||||
}
|
}
|
||||||
return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
|
return getFieldIndex_Row_UserSNSHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
@ -77,18 +77,6 @@ function getFieldView_UserHelper($field, $entity, array $viewDatas)
|
|||||||
{
|
{
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'title':
|
|
||||||
case 'name':
|
|
||||||
return anchor(
|
|
||||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
|
||||||
$value,
|
|
||||||
["target" => "_self"]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case 'board_file':
|
|
||||||
case 'upload_file':
|
|
||||||
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . "/download/{$field}/{$entity->getPrimaryKey()}", ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], ["target" => "_self"]);
|
|
||||||
break;
|
|
||||||
case 'view_cnt':
|
case 'view_cnt':
|
||||||
return number_format(!$value ? 0 : $value);
|
return number_format(!$value ? 0 : $value);
|
||||||
break;
|
break;
|
||||||
@ -114,24 +102,41 @@ function getFieldFilter_UserHelper($field, $value, array $viewDatas)
|
|||||||
function getFieldIndex_Column_UserHelper($field, array $viewDatas)
|
function getFieldIndex_Column_UserHelper($field, array $viewDatas)
|
||||||
{
|
{
|
||||||
$label = lang("{$viewDatas['className']}.label.{$field}");
|
$label = lang("{$viewDatas['className']}.label.{$field}");
|
||||||
$label = $field == $viewDatas['order_field'] ? sprintf('%s <i class="fa fa-arrow-%s"></i>', $label, $viewDatas['order_value'] == 'ASC' ? "up" : "down") : $label;
|
if ($field == $viewDatas['order_field']) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS['UP'] : ICONS['DOWN'];
|
||||||
|
}
|
||||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $value);
|
||||||
|
$columnData = anchor($viewDatas['uri'], $label);
|
||||||
|
switch ($field) {
|
||||||
|
case 'title':
|
||||||
|
case 'name':
|
||||||
|
return sprintf("<th class='col-2'>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return sprintf("<th>%s</th>", $columnData);
|
||||||
|
break;
|
||||||
|
}
|
||||||
} //
|
} //
|
||||||
|
|
||||||
|
//Front용
|
||||||
function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
default:
|
default:
|
||||||
return getFieldView_UserHelper($field, $entity, $viewDatas);
|
return getFieldView_UserHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
|
|
||||||
|
//Admin용
|
||||||
function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas): string
|
function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas): string
|
||||||
{
|
{
|
||||||
|
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'role':
|
case 'role':
|
||||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
// $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
|
// $viewDatas['fieldFormOptions'][$field] = [DEFAULTS['EMPTY'] => lang("{$viewDatas['className']}.label.{$field}") . " 선택", ...$viewDatas['fieldFormOptions'][$field]];
|
||||||
// return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
|
// return form_dropdown($field, $viewDatas['fieldFormOptions'][$field], $value, [...$attributes, 'class' => "select-field"]);
|
||||||
// return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
|
// return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
|
||||||
@ -151,7 +156,7 @@ function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas):
|
|||||||
);
|
);
|
||||||
return getFieldForm_UserHelper($field, $entity->$field, $viewDatas, $attributes);
|
return getFieldForm_UserHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||||
}
|
}
|
||||||
return getFieldView_UserHelper($field, $entity, $viewDatas);
|
return getFieldIndex_Row_UserHelper($field, $entity, $viewDatas);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} //
|
} //
|
||||||
@ -6,7 +6,7 @@ return [
|
|||||||
'grpno' => "그룹번호",
|
'grpno' => "그룹번호",
|
||||||
'grpord' => "부모번호",
|
'grpord' => "부모번호",
|
||||||
'grpdpt' => "그룸Depth",
|
'grpdpt' => "그룸Depth",
|
||||||
'category_uid' => "범주",
|
'category_uid' => "분류",
|
||||||
'user_uid' => "작성자",
|
'user_uid' => "작성자",
|
||||||
'title' => "제목",
|
'title' => "제목",
|
||||||
'content' => "내용",
|
'content' => "내용",
|
||||||
|
|||||||
@ -1,14 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
$roles = [
|
$roles = [
|
||||||
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
|
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
|
||||||
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
|
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자",
|
||||||
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
|
'director' => '감독자', 'master' => "마스터",
|
||||||
];
|
];
|
||||||
return [
|
return [
|
||||||
'title' => "범주 정보",
|
'title' => "분류 정보",
|
||||||
'label' => [
|
'label' => [
|
||||||
'uid' => "번호",
|
'uid' => "번호",
|
||||||
'name' => "범주제목",
|
'name' => "분류제목",
|
||||||
|
'linkurl' => "LinkURL",
|
||||||
|
'photo' => "이미지",
|
||||||
'isaccess' => "접속권한",
|
'isaccess' => "접속권한",
|
||||||
'isread' => "읽기권한",
|
'isread' => "읽기권한",
|
||||||
'iswrite' => "쓰기권한",
|
'iswrite' => "쓰기권한",
|
||||||
|
|||||||
15
app/Language/ko/Sitepage.php
Normal file
15
app/Language/ko/Sitepage.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
return [
|
||||||
|
'title' => "사이트페이지 정보",
|
||||||
|
'label' => [
|
||||||
|
'uid' => "번호",
|
||||||
|
'category_uid' => "분류",
|
||||||
|
'user_uid' => "작성자",
|
||||||
|
'title' => "제목",
|
||||||
|
'content' => "내용",
|
||||||
|
'status' => "상태",
|
||||||
|
'updated_at' => "수정일",
|
||||||
|
'created_at' => "작성일"
|
||||||
|
],
|
||||||
|
'STATUS' => ['use' => '사용', 'unuse' => '사용않함'],
|
||||||
|
];
|
||||||
@ -1,8 +1,8 @@
|
|||||||
<?php
|
<?php
|
||||||
$roles = [
|
$roles = [
|
||||||
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
|
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
|
||||||
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
|
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자",
|
||||||
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
|
'director' => '감독자', 'master' => "마스터",
|
||||||
];
|
];
|
||||||
return [
|
return [
|
||||||
'title' => '회원 정보',
|
'title' => '회원 정보',
|
||||||
@ -12,6 +12,8 @@ return [
|
|||||||
'passwd' => '암호',
|
'passwd' => '암호',
|
||||||
'confirmpassword' => '암호확인',
|
'confirmpassword' => '암호확인',
|
||||||
'email' => '메일',
|
'email' => '메일',
|
||||||
|
'phone' => '연락처',
|
||||||
|
'mobile' => '휴대폰',
|
||||||
'role' => '권한',
|
'role' => '권한',
|
||||||
'name' => '이름',
|
'name' => '이름',
|
||||||
'status' => '상태',
|
'status' => '상태',
|
||||||
|
|||||||
82
app/Libraries/Adapter/API/API.php
Normal file
82
app/Libraries/Adapter/API/API.php
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\API;
|
||||||
|
|
||||||
|
use App\Libraries\Adapter\Adapter;
|
||||||
|
|
||||||
|
// 참고:https://github.com/SyntaxPhoenix/iloclient
|
||||||
|
abstract class API extends Adapter
|
||||||
|
{
|
||||||
|
private $_url = null;
|
||||||
|
private $_method = "GET";
|
||||||
|
private $_datas = array();
|
||||||
|
private $_headers = array('Content-Type: application/json; charset=utf-8');
|
||||||
|
protected $_channel = null;
|
||||||
|
protected $_serverInfo = array();
|
||||||
|
protected $_accountInfo = array();
|
||||||
|
protected $_debug = false;
|
||||||
|
protected function __construct($debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
}
|
||||||
|
abstract protected function getChannel();
|
||||||
|
abstract protected function execute_process(): object;
|
||||||
|
|
||||||
|
final public function setURL(string $url)
|
||||||
|
{
|
||||||
|
$this->_url = $url;
|
||||||
|
}
|
||||||
|
final public function getURL(): string
|
||||||
|
{
|
||||||
|
return $this->_url;
|
||||||
|
}
|
||||||
|
final public function setMethod(string $method)
|
||||||
|
{
|
||||||
|
$this->_method = $method;
|
||||||
|
}
|
||||||
|
final public function getMethod(): string
|
||||||
|
{
|
||||||
|
return $this->_method;
|
||||||
|
}
|
||||||
|
final public function setDatas(array $datas)
|
||||||
|
{
|
||||||
|
$this->_datas = $datas;
|
||||||
|
}
|
||||||
|
final public function getDatas(): array
|
||||||
|
{
|
||||||
|
return $this->_datas;
|
||||||
|
}
|
||||||
|
final public function setHeader($key, $value, $delimiter = ":")
|
||||||
|
{
|
||||||
|
array_push($this->_headers, "{$key}{$delimiter} {$value}");
|
||||||
|
}
|
||||||
|
final public function getHeaders(): array
|
||||||
|
{
|
||||||
|
return $this->_headers;
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function setServerInfo($ip, $port)
|
||||||
|
{
|
||||||
|
$this->_serverInfo['ip'] = $ip;
|
||||||
|
$this->_serverInfo['port'] = $port;
|
||||||
|
}
|
||||||
|
final protected function getServerInfo($scheme = "https://", $delimeter = ":"): string
|
||||||
|
{
|
||||||
|
return $scheme . $this->_serverInfo['ip'] . $delimeter . $this->_serverInfo['port'];
|
||||||
|
}
|
||||||
|
final public function setAccountInfo($id, $password)
|
||||||
|
{
|
||||||
|
$this->_serverInfo['id'] = $id;
|
||||||
|
$this->_serverInfo['password'] = $password;
|
||||||
|
}
|
||||||
|
final protected function getAccountInfo($authType = 'basic'): array
|
||||||
|
{
|
||||||
|
//type: basic , digest
|
||||||
|
return array($this->_serverInfo['id'], $this->_serverInfo['password'], $authType);
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function execute(): object
|
||||||
|
{
|
||||||
|
return $this->execute_process();
|
||||||
|
}
|
||||||
|
}
|
||||||
209
app/Libraries/Adapter/API/CurlAPI.php
Normal file
209
app/Libraries/Adapter/API/CurlAPI.php
Normal file
@ -0,0 +1,209 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\API;
|
||||||
|
|
||||||
|
// 참고:
|
||||||
|
// https://techhub.hpe.com/eginfolib/servers/docs/HPRestfultool/iLo4/data_model_reference.html
|
||||||
|
// https://github.com/SyntaxPhoenix/iloclient
|
||||||
|
class CurlAPI extends API
|
||||||
|
{
|
||||||
|
public function __construct($debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
}
|
||||||
|
private function debugging($response)
|
||||||
|
{
|
||||||
|
if (!$this->_debug) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
if ($response === false) {
|
||||||
|
log_message('error', curl_error($this->getChannel()));
|
||||||
|
}
|
||||||
|
$info = curl_getinfo($this->getChannel());
|
||||||
|
log_message('debug', var_export($info, true));
|
||||||
|
log_message('debug', var_export($this->getDatas(), true));
|
||||||
|
log_message('debug', "{$info['total_time']}초, url:{$info['url']}, return:{$info['http_code']}");
|
||||||
|
switch ($info['http_code']) {
|
||||||
|
case 100:
|
||||||
|
log_message('debug', "{$info['http_code']} Continue");
|
||||||
|
break;
|
||||||
|
case 101:
|
||||||
|
log_message('debug', "{$info['http_code']} Switching Protocols");
|
||||||
|
break;
|
||||||
|
case 200:
|
||||||
|
log_message('debug', "{$info['http_code']} OK");
|
||||||
|
break;
|
||||||
|
case 201:
|
||||||
|
log_message('debug', "{$info['http_code']} Created");
|
||||||
|
break;
|
||||||
|
case 202:
|
||||||
|
log_message('debug', "{$info['http_code']} Accepted");
|
||||||
|
break;
|
||||||
|
case 203:
|
||||||
|
log_message('debug', "{$info['http_code']} Non-Authoritative Information");
|
||||||
|
break;
|
||||||
|
case 204:
|
||||||
|
log_message('debug', "{$info['http_code']} No Content");
|
||||||
|
break;
|
||||||
|
case 205:
|
||||||
|
log_message('debug', "{$info['http_code']} Reset Content");
|
||||||
|
break;
|
||||||
|
case 206:
|
||||||
|
log_message('debug', "{$info['http_code']} Partial Content");
|
||||||
|
break;
|
||||||
|
case 300:
|
||||||
|
log_message('debug', "{$info['http_code']} Multiple Choices");
|
||||||
|
break;
|
||||||
|
case 301:
|
||||||
|
log_message('debug', "{$info['http_code']} Moved Permanently");
|
||||||
|
break;
|
||||||
|
case 302:
|
||||||
|
log_message('debug', "{$info['http_code']} Found");
|
||||||
|
break;
|
||||||
|
case 303:
|
||||||
|
log_message('debug', "{$info['http_code']} See Other");
|
||||||
|
break;
|
||||||
|
case 304:
|
||||||
|
log_message('debug', "{$info['http_code']} Not Modified");
|
||||||
|
break;
|
||||||
|
case 305:
|
||||||
|
log_message('debug', "{$info['http_code']} Use Proxy");
|
||||||
|
break;
|
||||||
|
case 306:
|
||||||
|
log_message('debug', "{$info['http_code']} (Unused)");
|
||||||
|
break;
|
||||||
|
case 307:
|
||||||
|
log_message('debug', "{$info['http_code']} Temporary Redirect");
|
||||||
|
break;
|
||||||
|
case 400:
|
||||||
|
log_message('debug', "{$info['http_code']} Bad Request");
|
||||||
|
break;
|
||||||
|
case 401:
|
||||||
|
log_message('debug', "{$info['http_code']} Unauthorized");
|
||||||
|
break;
|
||||||
|
case 402:
|
||||||
|
log_message('debug', "{$info['http_code']} Payment Required");
|
||||||
|
break;
|
||||||
|
case 403:
|
||||||
|
log_message('debug', "{$info['http_code']} Forbidden");
|
||||||
|
break;
|
||||||
|
case 404:
|
||||||
|
log_message('debug', "{$info['http_code']} Not Found");
|
||||||
|
break;
|
||||||
|
case 405:
|
||||||
|
log_message('debug', "{$info['http_code']} Method Not Allowed");
|
||||||
|
break;
|
||||||
|
case 406:
|
||||||
|
log_message('debug', "{$info['http_code']} Not Acceptable");
|
||||||
|
break;
|
||||||
|
case 407:
|
||||||
|
log_message('debug', "{$info['http_code']} Proxy Authentication Required");
|
||||||
|
break;
|
||||||
|
case 408:
|
||||||
|
log_message('debug', "{$info['http_code']} Request Timeout");
|
||||||
|
break;
|
||||||
|
case 409:
|
||||||
|
log_message('debug', "{$info['http_code']} Conflict");
|
||||||
|
break;
|
||||||
|
case 410:
|
||||||
|
log_message('debug', "{$info['http_code']} Gone");
|
||||||
|
break;
|
||||||
|
case 411:
|
||||||
|
log_message('debug', "{$info['http_code']} Length Required");
|
||||||
|
break;
|
||||||
|
case 412:
|
||||||
|
log_message('debug', "{$info['http_code']} Precondition Failed");
|
||||||
|
break;
|
||||||
|
case 413:
|
||||||
|
log_message('debug', "{$info['http_code']} Request Entity Too Large");
|
||||||
|
break;
|
||||||
|
case 414:
|
||||||
|
log_message('debug', "{$info['http_code']} Request-URI Too Long");
|
||||||
|
break;
|
||||||
|
case 415:
|
||||||
|
log_message('debug', "{$info['http_code']} Unsupported Media Type");
|
||||||
|
break;
|
||||||
|
case 416:
|
||||||
|
log_message('debug', "{$info['http_code']} Requested Range Not Satisfiable");
|
||||||
|
break;
|
||||||
|
case 417:
|
||||||
|
log_message('debug', "{$info['http_code']} Expectation Failed");
|
||||||
|
break;
|
||||||
|
case 500:
|
||||||
|
log_message('debug', "{$info['http_code']} Internal Server Error");
|
||||||
|
break;
|
||||||
|
case 501:
|
||||||
|
log_message('debug', "{$info['http_code']} Not Implemented");
|
||||||
|
break;
|
||||||
|
case 502:
|
||||||
|
log_message('debug', "{$info['http_code']} Bad Gateway");
|
||||||
|
break;
|
||||||
|
case 503:
|
||||||
|
log_message('debug', "{$info['http_code']} Service Unavailable");
|
||||||
|
break;
|
||||||
|
case 504:
|
||||||
|
log_message('debug', "{$info['http_code']} Gateway Timeout");
|
||||||
|
break;
|
||||||
|
case 505:
|
||||||
|
log_message('debug', "{$info['http_code']} HTTP Version Not Supported");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
log_message('debug', "Return Code : {$info['http_code']}");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected function getChannel()
|
||||||
|
{
|
||||||
|
if (is_null($this->_channel)) {
|
||||||
|
$this->_channel = curl_init();
|
||||||
|
}
|
||||||
|
return $this->_channel;
|
||||||
|
}
|
||||||
|
public function setSSLVerifay()
|
||||||
|
{
|
||||||
|
//SSL 확인여부용
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_SSL_VERIFYPEER, API['SSL_VERIFY']);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_SSL_VERIFYHOST, API['SSL_VERIFY']);
|
||||||
|
}
|
||||||
|
public function setCookie()
|
||||||
|
{
|
||||||
|
//cookie값 전달용
|
||||||
|
foreach (curl_getinfo($this->getChannel(), CURLINFO_COOKIELIST) as $cookie_line) {
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_COOKIELIST, $cookie_line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function setAUthentication()
|
||||||
|
{
|
||||||
|
//접속인증 정보값 전달용
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_USERPWD, implode(":", $this->getAccountInfo()));
|
||||||
|
}
|
||||||
|
protected function execute_process(): object
|
||||||
|
{
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_URL, $this->getServerInfo() . $this->getURL());
|
||||||
|
switch ($this->getMethod()) {
|
||||||
|
case 'POST':
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_POST, TRUE);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_CUSTOMREQUEST, 'PATCH');
|
||||||
|
//cookie값 파일저장용
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_COOKIEJAR, API['COOKIE_FILE']);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_COOKIEFILE, API['COOKIE_FILE']);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_POST, false);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_POSTFIELDS, json_encode($this->getDatas(), true));
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_RETURNTRANSFER, true);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_CONNECTTIMEOUT, 3);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_TIMEOUT, 20);
|
||||||
|
curl_setopt($this->getChannel(), CURLOPT_HTTPHEADER, $this->getHeaders());
|
||||||
|
$response = curl_exec($this->getChannel());
|
||||||
|
$this->debugging($response);
|
||||||
|
curl_close($this->getChannel());
|
||||||
|
if (is_null($response)) {
|
||||||
|
throw new \Exception("해당서버[{$this->getServerInfo()}]의 ILO접속 오류가 발생하였습니다.");
|
||||||
|
}
|
||||||
|
return json_decode($response);
|
||||||
|
}
|
||||||
|
}
|
||||||
85
app/Libraries/Adapter/API/GuzzleAPI.php
Normal file
85
app/Libraries/Adapter/API/GuzzleAPI.php
Normal file
@ -0,0 +1,85 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\API;
|
||||||
|
|
||||||
|
use GuzzleHttp\Psr7;
|
||||||
|
use GuzzleHttp\Exception\ClientException;
|
||||||
|
// 참고:https://github.com/SyntaxPhoenix/iloclient
|
||||||
|
class GuzzleAPI extends API
|
||||||
|
{
|
||||||
|
private $_jar = null;
|
||||||
|
public function __construct($debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
}
|
||||||
|
private function getCookieJar(): \GuzzleHttp\Cookie\CookieJar
|
||||||
|
{
|
||||||
|
if (is_null($this->_jar)) {
|
||||||
|
$this->_jar = new \GuzzleHttp\Cookie\CookieJar();
|
||||||
|
}
|
||||||
|
return $this->_jar;
|
||||||
|
}
|
||||||
|
protected function setLocalCookie(): void
|
||||||
|
{
|
||||||
|
// dd($this->getCookieJar(), true);
|
||||||
|
foreach (['Key', 'Lang', 'Url'] as $key) {
|
||||||
|
log_message('debug', var_export($this->getCookieJar()->getCookieByName('session' . $key), true));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function getChannel() //Guzzle이용시
|
||||||
|
{
|
||||||
|
if (is_null($this->_channel)) {
|
||||||
|
// 참조:https://docs.guzzlephp.org/en/stable/request-options.html
|
||||||
|
// ex:)$options = [ 'base_uri' => 'http://www.foo.com/1.0/', 'timeout' => 0, 'allow_redirects' => false, 'proxy' => '192.168.16.1:10' ]
|
||||||
|
$options = [
|
||||||
|
'base_uri' => $this->getServerInfo(),
|
||||||
|
'auth' => $this->getAccountInfo(),
|
||||||
|
'verify' => API['SSL_VERIFY'],
|
||||||
|
'cookie' => API['COOKIE_FILE'],
|
||||||
|
// \GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => [
|
||||||
|
// 'max' => 10, // allow at most 10 redirects.
|
||||||
|
// 'strict' => true, // use "strict" RFC compliant redirects.
|
||||||
|
// 'referer' => true, // add a Referer header
|
||||||
|
// 'track_redirects' => true,
|
||||||
|
// ],
|
||||||
|
];
|
||||||
|
$this->_channel = new \GuzzleHttp\Client($options);
|
||||||
|
}
|
||||||
|
return $this->_channel;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute_process(): object
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
$options = array();
|
||||||
|
if ($this->_debug) {
|
||||||
|
$options['debug'] = fopen('php://stderr', 'w'); //or true
|
||||||
|
}
|
||||||
|
switch ($this->getMethod()) {
|
||||||
|
case 'POST':
|
||||||
|
$options['json'] = $this->getDatas();
|
||||||
|
break;
|
||||||
|
case 'HEAD':
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
$response = $this->getChannel()->request($this->getMethod(), $this->getURL(), $options);
|
||||||
|
if ($response->getStatusCode() != 200) {
|
||||||
|
throw new \Exception(sprintf(
|
||||||
|
"오류가 발생하였습니다.\n%s\n%s",
|
||||||
|
$response->getHeaderLine('content-type'),
|
||||||
|
$response->getBody()
|
||||||
|
));
|
||||||
|
}
|
||||||
|
$this->setLocalCookie($this->getURL());
|
||||||
|
// echo $response->getHeaderLine('content-type'); // 'application/json; charset=utf8'
|
||||||
|
// echo $response->getBody()=>'{"id": 1420053, "name": "guzzle", ...}
|
||||||
|
return json_decode($response->getBody()->getContents());
|
||||||
|
} catch (ClientException $e) {
|
||||||
|
throw new \Exception(
|
||||||
|
Psr7\Message::toString($e->getRequest()) . "\n" .
|
||||||
|
Psr7\Message::toString($e->getResponse())
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,16 +2,16 @@
|
|||||||
|
|
||||||
namespace App\Libraries\Adapter\API;
|
namespace App\Libraries\Adapter\API;
|
||||||
|
|
||||||
class LocalAdapter extends Adapter
|
class LocalAPI extends API
|
||||||
{
|
{
|
||||||
public function __construct($debug = false)
|
public function __construct($debug = false)
|
||||||
{
|
{
|
||||||
parent::__construct($debug);
|
parent::__construct($debug);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getClient() //Codeigniter4 Service의 curlrequest이용시
|
protected function getChannel() //Codeigniter4 Service의 curlrequest이용시
|
||||||
{
|
{
|
||||||
if (is_null($this->_client)) {
|
if (is_null($this->_channel)) {
|
||||||
// 참조:https://www.codeigniter.com/user_guide/libraries/curlrequest.html?highlight=curl#
|
// 참조:https://www.codeigniter.com/user_guide/libraries/curlrequest.html?highlight=curl#
|
||||||
// ex:)$options = [ 'baseURI' => 'http://www.foo.com/1.0/', 'timeout' => 0, 'allow_redirects' => false, 'proxy' => '192.168.16.1:10' ]
|
// ex:)$options = [ 'baseURI' => 'http://www.foo.com/1.0/', 'timeout' => 0, 'allow_redirects' => false, 'proxy' => '192.168.16.1:10' ]
|
||||||
$options = [
|
$options = [
|
||||||
@ -23,21 +23,21 @@ class LocalAdapter extends Adapter
|
|||||||
if ($this->_debug) {
|
if ($this->_debug) {
|
||||||
$options['debug'] = API['DEBUG_FILE'];
|
$options['debug'] = API['DEBUG_FILE'];
|
||||||
}
|
}
|
||||||
$this->_client = \Config\Services::curlrequest($options);
|
$this->_channel = \Config\Services::curlrequest($options);
|
||||||
}
|
}
|
||||||
return $this->_client;
|
return $this->_channel;
|
||||||
}
|
}
|
||||||
protected function requestURL(string $url, string $method, array $datas = []): object
|
protected function execute_process(): object
|
||||||
{
|
{
|
||||||
$options = array();
|
$options = array();
|
||||||
switch ($method) {
|
switch ($this->getMethod()) {
|
||||||
case 'POST':
|
case 'POST':
|
||||||
$response = $this->getClient()->setBody($datas)->request($method, $url, $options);
|
$response = $this->getChannel()->setBody($this->getDatas())->request($this->getMethod(), $this->getURL(), $options);
|
||||||
break;
|
break;
|
||||||
case 'HEAD':
|
case 'HEAD':
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$response = $this->getClient()->request($method, $url, $options);
|
$response = $this->getChannel()->request($this->getMethod(), $this->getURL(), $options);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
dd($response);
|
dd($response);
|
||||||
|
|||||||
15
app/Libraries/Adapter/Adapter.php
Normal file
15
app/Libraries/Adapter/Adapter.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter;
|
||||||
|
|
||||||
|
abstract class Adapter
|
||||||
|
{
|
||||||
|
protected $_debug = false;
|
||||||
|
protected $_session = null;
|
||||||
|
protected function __construct($debug = false)
|
||||||
|
{
|
||||||
|
$this->_debug = $debug;
|
||||||
|
$this->_session = \Config\Services::session();
|
||||||
|
}
|
||||||
|
abstract public function execute();
|
||||||
|
}
|
||||||
82
app/Libraries/Adapter/Auth/Auth.php
Normal file
82
app/Libraries/Adapter/Auth/Auth.php
Normal file
@ -0,0 +1,82 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\Auth;
|
||||||
|
|
||||||
|
use App\Entities\UserEntity;
|
||||||
|
use App\Models\UserModel;
|
||||||
|
use App\Models\UserSNSModel;
|
||||||
|
use App\Libraries\Adapter\Adapter;
|
||||||
|
|
||||||
|
// 참고:https://github.com/SyntaxPhoenix/iloclient
|
||||||
|
abstract class Auth extends Adapter
|
||||||
|
{
|
||||||
|
private $_site = null;
|
||||||
|
private $_userModel = null;
|
||||||
|
private $_userSNSModel = null;
|
||||||
|
private $_formDatas = array();
|
||||||
|
protected function __construct(string $site, $debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
$this->_site = $site;
|
||||||
|
}
|
||||||
|
final public function getSiteName(): string
|
||||||
|
{
|
||||||
|
if (is_null($this->_site)) {
|
||||||
|
throw new \Exception("Auth Adpater Site명이 정의 되지 않았습니다.");
|
||||||
|
}
|
||||||
|
return ucfirst($this->_site);
|
||||||
|
}
|
||||||
|
abstract public function getAuthButton();
|
||||||
|
abstract protected function execute_process(): UserEntity;
|
||||||
|
|
||||||
|
final protected function getUserModel(): UserModel
|
||||||
|
{
|
||||||
|
if (is_null($this->_userModel)) {
|
||||||
|
$this->_userModel = new UserModel();
|
||||||
|
}
|
||||||
|
return $this->_userModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
final protected function getUserSNSModel(): UserSNSModel
|
||||||
|
{
|
||||||
|
if (is_null($this->_userSNSModel)) {
|
||||||
|
$this->_userSNSModel = new UserSNSModel();
|
||||||
|
}
|
||||||
|
return $this->_userSNSModel;
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function setFormDatas(array $formDatas)
|
||||||
|
{
|
||||||
|
$this->_formDatas = $formDatas;
|
||||||
|
}
|
||||||
|
final public function getFormDatas(): array
|
||||||
|
{
|
||||||
|
return $this->_formDatas;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function setSession_process(UserEntity $entity): UserEntity
|
||||||
|
{
|
||||||
|
$this->_session->set(SESSION_NAMES['ISLOGIN'], true);
|
||||||
|
$auths = [];
|
||||||
|
foreach (array_values(AUTH_FIELDS) as $field) {
|
||||||
|
switch ($field) {
|
||||||
|
case 'id':
|
||||||
|
$auths[$field] = $entity->getPrimaryKey();
|
||||||
|
break;
|
||||||
|
case 'title':
|
||||||
|
$auths[$field] = $entity->getTitle();
|
||||||
|
break;
|
||||||
|
case 'role':
|
||||||
|
$auths[$field] = $entity->$field;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$this->_session->set(SESSION_NAMES['AUTH'], $auths);
|
||||||
|
return $entity;
|
||||||
|
}
|
||||||
|
|
||||||
|
final public function execute(): UserEntity
|
||||||
|
{
|
||||||
|
return $this->execute_process();
|
||||||
|
}
|
||||||
|
}
|
||||||
131
app/Libraries/Adapter/Auth/GoogleAuth.php
Normal file
131
app/Libraries/Adapter/Auth/GoogleAuth.php
Normal file
@ -0,0 +1,131 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\Auth;
|
||||||
|
|
||||||
|
use App\Entities\UserEntity;
|
||||||
|
use App\Entities\UserSNSEntity;
|
||||||
|
|
||||||
|
class GoogleAuth extends Auth
|
||||||
|
{
|
||||||
|
private $_client = null;
|
||||||
|
public function __construct(string $site, $debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($site, $debug);
|
||||||
|
}
|
||||||
|
private function getClient(): \Google_Client
|
||||||
|
{
|
||||||
|
if (is_null($this->_client)) {
|
||||||
|
$this->_client = new \Google_Client();
|
||||||
|
$this->_client->setClientId(AUTH_ADAPTERS[$this->getSiteName()]['CLIENT_ID']);
|
||||||
|
$this->_client->setClientSecret(AUTH_ADAPTERS[$this->getSiteName()]['CLIENT_KEY']);
|
||||||
|
$this->_client->setRedirectUri(base_url() . AUTH_ADAPTERS[$this->getSiteName()]['CALLBACK_URL']);
|
||||||
|
$this->_client->addScope('email');
|
||||||
|
$this->_client->addScope('profile');
|
||||||
|
}
|
||||||
|
return $this->_client;
|
||||||
|
}
|
||||||
|
|
||||||
|
private function setAccessToken()
|
||||||
|
{
|
||||||
|
$formDatas = $this->getFormDatas();
|
||||||
|
//1. Google 로그인후 인증코드 확인
|
||||||
|
if (!isset($formDatas['code']) || !$formDatas['code']) {
|
||||||
|
throw new \Exception($this->getSiteName() . " 인증 CallBack Code가 필요합니다.");
|
||||||
|
}
|
||||||
|
//2.토큰정보 가져오기
|
||||||
|
$tokenInfo = $this->getClient()->fetchAccessTokenWithAuthCode($formDatas['code']);
|
||||||
|
if (isset($tokenInfo['error'])) {
|
||||||
|
throw new \Exception($tokenInfo['error']);
|
||||||
|
}
|
||||||
|
$token = $tokenInfo[AUTH_ADAPTERS[$this->getSiteName()]['TOKEN_NAME']];
|
||||||
|
//3. Google Service에 접근하기위해 Access Token을 설정
|
||||||
|
$this->getClient()->setAccessToken($token);
|
||||||
|
|
||||||
|
//4. Google에 로그인이 했으므로 세션에 Token값 설정
|
||||||
|
$this->_session->set(AUTH_ADAPTERS[$this->getSiteName()]['TOKEN_NAME'], $token);
|
||||||
|
}
|
||||||
|
private function getAccessToken(): ?string
|
||||||
|
{
|
||||||
|
return $this->_session->get(AUTH_ADAPTERS[$this->getSiteName()]['TOKEN_NAME']);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAuthButton()
|
||||||
|
{
|
||||||
|
$button = "";
|
||||||
|
if (!$this->getAccessToken()) {
|
||||||
|
$button = anchor($this->getClient()->createAuthUrl(), AUTH_ADAPTERS[$this->getSiteName()]['ICON'], ["target" => "_self"]);
|
||||||
|
}
|
||||||
|
return $button;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute_process(): UserEntity
|
||||||
|
{
|
||||||
|
try {
|
||||||
|
//Google 접근 권한 설정.
|
||||||
|
$this->setAccessToken();
|
||||||
|
//Google 서비스 설정
|
||||||
|
$service = new \Google\Service\Oauth2($this->getClient());
|
||||||
|
$result = $service->userinfo->get();
|
||||||
|
if ($this->_debug) {
|
||||||
|
log_message("debug", var_export($result, true));
|
||||||
|
}
|
||||||
|
// throw new \Exception(__METHOD__ . "에서 데이터 처리 필요");
|
||||||
|
// DEBUG - 2023-07-13 12:54:51 --> \Google\Service\Oauth2\Userinfo::__set_state(array(
|
||||||
|
// 'internal_gapi_mappings' =>
|
||||||
|
// array (
|
||||||
|
// 'familyName' => 'family_name',
|
||||||
|
// 'givenName' => 'given_name',
|
||||||
|
// 'verifiedEmail' => 'verified_email',
|
||||||
|
// ),
|
||||||
|
// 'modelData' =>
|
||||||
|
// array (
|
||||||
|
// 'verified_email' => true,
|
||||||
|
// 'given_name' => '이름',
|
||||||
|
// 'family_name' => '성',
|
||||||
|
// ),
|
||||||
|
// 'processed' =>
|
||||||
|
// array (
|
||||||
|
// ),
|
||||||
|
// 'email' => 'twsdfsew342s@gmail.com',
|
||||||
|
// 'familyName' => '성',
|
||||||
|
// 'gender' => NULL,
|
||||||
|
// 'givenName' => '이름',
|
||||||
|
// 'hd' => NULL,
|
||||||
|
// 'id' => '103667492432234234236838324',
|
||||||
|
// 'link' => NULL,
|
||||||
|
// 'locale' => 'ko',
|
||||||
|
// 'name' => '성이름',
|
||||||
|
// 'picture' => 'https://lh3.googleusercontent.com/a/AAcHTteFSgefsdfsdRJBkJA2tBEmg4PQrvI1Ta_5IXu5=s96-c',
|
||||||
|
// 'verifiedEmail' => true,
|
||||||
|
// ))
|
||||||
|
//조건에 해당하는 이미 등록된 사용자가 있는지 검사
|
||||||
|
$snsEntity = $this->getUserSNSModel()->asObject(UserSNSEntity::class)->where(
|
||||||
|
array("site" => $this->getSiteName(), "id" => $result['id'])
|
||||||
|
)->first();
|
||||||
|
//snsEntity 없으면 신규등록
|
||||||
|
if (is_null($snsEntity)) {
|
||||||
|
$snsEntity = $this->getUserSNSModel()->create([
|
||||||
|
'site' => $this->getSiteName(),
|
||||||
|
'id' => $result['id'],
|
||||||
|
'name' => $result['name'],
|
||||||
|
'email' => $result['email'],
|
||||||
|
'detail' => json_encode($result),
|
||||||
|
'status' => 'standby'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
//상태가 use(승인완료)가 아니라면
|
||||||
|
if ($snsEntity->status !== DEFAULTS['STATUS']) {
|
||||||
|
throw new \Exception($this->getSiteName() . "의{$result['email']}:{$result['name']}님은 " . lang("Admin/UserSNS.label." . $snsEntity->status) . "입니다");
|
||||||
|
}
|
||||||
|
//user_id가 연결되어있지 않았다면
|
||||||
|
if (!$snsEntity->user_id) {
|
||||||
|
throw new \Exception($this->getSiteName() . "의{$result['email']}:{$result['name']}님은 아직 사용자 지정이 되지 않았습니다. ");
|
||||||
|
}
|
||||||
|
//인증된 사용자 정보를 가져온후 로그인처리
|
||||||
|
$entity = $this->getUserModel()->getEntity($snsEntity->user_id);
|
||||||
|
return $this->setSession_process($entity);;
|
||||||
|
} catch (\Exception $e) {
|
||||||
|
throw new \Exception("관리자에게 문의하시기 바랍니다.<BR>{$e->getMessage()}");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
32
app/Libraries/Adapter/Auth/LocalAuth.php
Normal file
32
app/Libraries/Adapter/Auth/LocalAuth.php
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\Auth;
|
||||||
|
|
||||||
|
use App\Entities\UserEntity;
|
||||||
|
|
||||||
|
class LocalAuth extends Auth
|
||||||
|
{
|
||||||
|
public function __construct(string $site, $debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($site, $debug);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getAuthButton()
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function execute_process(): UserEntity
|
||||||
|
{
|
||||||
|
$formDatas = $this->getFormDatas();
|
||||||
|
if (!isset($formDatas['id']) || !$formDatas['id'] || !isset($formDatas['passwd']) || !$formDatas['passwd']) {
|
||||||
|
throw new \Exception("ID 나 암호의 값이 없습니다.");
|
||||||
|
}
|
||||||
|
$entity = $this->getUserModel()->getEntity(['id' => $formDatas['id'], 'status' => DEFAULTS['STATUS']]);
|
||||||
|
if (!password_verify($formDatas['passwd'], $entity->passwd)) {
|
||||||
|
throw new \Exception("암호가 맞지않습니다.");
|
||||||
|
}
|
||||||
|
//Session에 인증정보 설정
|
||||||
|
return $this->setSession_process($entity);;
|
||||||
|
}
|
||||||
|
}
|
||||||
66
app/Libraries/Adapter/Payment/CookiePayment.php
Normal file
66
app/Libraries/Adapter/Payment/CookiePayment.php
Normal file
@ -0,0 +1,66 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\Payment;
|
||||||
|
|
||||||
|
use App\Libraries\Adapter\API\CurlAPI as APIAdapter;
|
||||||
|
|
||||||
|
// 참고:
|
||||||
|
// https://techhub.hpe.com/eginfolib/servers/docs/HPRestfultool/iLo4/data_model_reference.html
|
||||||
|
// https://github.com/SyntaxPhoenix/iloclient
|
||||||
|
class CookiePayment extends Payment
|
||||||
|
{
|
||||||
|
public function __construct($debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
}
|
||||||
|
|
||||||
|
private function getToken()
|
||||||
|
{
|
||||||
|
$adapter = new APIAdapter();
|
||||||
|
$adapter->setHeader("content-type", "application/json; charset=utf-8");
|
||||||
|
/* 토큰 발행 API */
|
||||||
|
$adapter->setURL(getenv("payment.card.pay2.token_url") ?: "{TOKEN 발행 URL}");
|
||||||
|
$adapter->setDatas(array(
|
||||||
|
'pay2_id' => getenv("payment.card.pay2.id") ?: 'cookiepayments에서 발급받은 ID',
|
||||||
|
'pay2_key' => getenv("payment.card.pay2.key") ?: 'cookiepayments에서 발급받은 연동키',
|
||||||
|
));
|
||||||
|
$token = $adapter->execute();
|
||||||
|
/* 여기 까지 */
|
||||||
|
if ($token['RTN_CD'] != '0000') {
|
||||||
|
throw new \Exception("Cookipay에서 Token을 받는데 실패했습니다.");
|
||||||
|
}
|
||||||
|
return $token;
|
||||||
|
}
|
||||||
|
protected function execute_process(): object
|
||||||
|
{
|
||||||
|
$adapter = new APIAdapter();
|
||||||
|
$adapter->setHeader("content-type", "application/json; charset=utf-8");
|
||||||
|
$adapter->setHeader("ApiKey", getenv("payment.card.pay2.apikey") ?: "COOKIEPAY에서 발급받은 연동키");
|
||||||
|
$adapter->setHeader("TOKEN", $this->getToken());
|
||||||
|
$adapter->setURL(getenv("payment.card.pay2.url") ?: "{요청도메인}/keyin/payment");
|
||||||
|
|
||||||
|
$datas = $this->getDatas();
|
||||||
|
// array(
|
||||||
|
// 'API_ID' => 'COOKIEPAY에서 발급받은 가맹점연동 ID',
|
||||||
|
// 'ORDERNO' => '주문번호',
|
||||||
|
// 'PRODUCTNAME' => '상품명',
|
||||||
|
// 'AMOUNT' => '결제금액',
|
||||||
|
// 'BUYERNAME' => '고객명',
|
||||||
|
// 'BUYEREMAIL' => '고객 E-MAIL',
|
||||||
|
// 'CARDNO' => '카드번호',
|
||||||
|
// 'EXPIREDT' => '카드유효기간',
|
||||||
|
// 'PRODUCTCODE' => '상품코드',
|
||||||
|
// 'BUYERID' => '고객 ID',
|
||||||
|
// 'BUYERADDRESS' => '고객 주소',
|
||||||
|
// 'BUYERPHONE' => '고객 휴대폰번호',
|
||||||
|
// 'QUOTA' => '할부개월',
|
||||||
|
// 'ETC1' => '추가필드 1',
|
||||||
|
// 'ETC2' => '추가필드 2',
|
||||||
|
// 'ETC3' => '추가필드 3',
|
||||||
|
// 'ETC4' => '추가필드 4',
|
||||||
|
// 'ETC5' => '추가필드 5',
|
||||||
|
// )
|
||||||
|
$adapter->setDatas($datas);
|
||||||
|
return $adapter->execute();
|
||||||
|
}
|
||||||
|
}
|
||||||
29
app/Libraries/Adapter/Payment/Payment.php
Normal file
29
app/Libraries/Adapter/Payment/Payment.php
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Libraries\Adapter\Payment;
|
||||||
|
|
||||||
|
use App\Libraries\Adapter\Adapter;
|
||||||
|
|
||||||
|
abstract class Payment extends Adapter
|
||||||
|
{
|
||||||
|
private $_datas = array();
|
||||||
|
protected function __construct($debug = false)
|
||||||
|
{
|
||||||
|
parent::__construct($debug);
|
||||||
|
}
|
||||||
|
abstract protected function execute_process(): object;
|
||||||
|
|
||||||
|
//결제용 데이터
|
||||||
|
final public function setDatas(array $datas)
|
||||||
|
{
|
||||||
|
$this->_datas = $datas;
|
||||||
|
}
|
||||||
|
final public function getDatas(): array
|
||||||
|
{
|
||||||
|
return $this->_datas;
|
||||||
|
}
|
||||||
|
final public function execute(): object
|
||||||
|
{
|
||||||
|
return $this->execute_process();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -10,12 +10,16 @@ abstract class BaseHierarchyModel extends BaseModel
|
|||||||
protected function __construct(string $className)
|
protected function __construct(string $className)
|
||||||
{
|
{
|
||||||
parent::__construct($className);
|
parent::__construct($className);
|
||||||
$this->allowedFields = [...$this->allowedFields, "grpno", "grporder", "grpdepth"];
|
$this->allowedFields = [...$this->allowedFields, "grpno", "grporder", "grpdepth", "parent_uid"];
|
||||||
$this->validationRules = [...$this->validationRules,];
|
$this->validationRules = [...$this->validationRules,];
|
||||||
}
|
}
|
||||||
abstract public function getContentField();
|
abstract public function getContentField();
|
||||||
abstract public function reply($parent_entity, array $formDatas): BaseEntity;
|
abstract public function reply($parent_entity, array $formDatas): BaseEntity;
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getSiblingEntitys($entity)
|
||||||
|
{
|
||||||
|
return $this->getEntitys(['grpno' => $entity->getHierarchy_No()]);
|
||||||
|
}
|
||||||
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "grpno":
|
case "grpno":
|
||||||
@ -23,6 +27,9 @@ abstract class BaseHierarchyModel extends BaseModel
|
|||||||
case "grpdepth":
|
case "grpdepth":
|
||||||
$rules[$field] = "if_exist|numeric"; //반드시숫자여야함
|
$rules[$field] = "if_exist|numeric"; //반드시숫자여야함
|
||||||
break;
|
break;
|
||||||
|
case "parent_uid":
|
||||||
|
$rules[$field] = "if_exist";
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$rules = parent::getFieldRule($field, $rules, $action);
|
$rules = parent::getFieldRule($field, $rules, $action);
|
||||||
break;
|
break;
|
||||||
@ -51,6 +58,7 @@ abstract class BaseHierarchyModel extends BaseModel
|
|||||||
]);
|
]);
|
||||||
$this->update();
|
$this->update();
|
||||||
//reply용 설정
|
//reply용 설정
|
||||||
|
$entity->parent_uid = $parent_entity->getPrimaryKey();
|
||||||
$entity->grpno = $parent_entity->grpno;
|
$entity->grpno = $parent_entity->grpno;
|
||||||
$entity->grporder = $parent_entity->grporder + 1;
|
$entity->grporder = $parent_entity->grporder + 1;
|
||||||
$entity->grpdepth = $parent_entity->grpdepth + 1;
|
$entity->grpdepth = $parent_entity->grpdepth + 1;
|
||||||
|
|||||||
@ -56,7 +56,7 @@ abstract class BaseModel extends Model
|
|||||||
$this->_session = \Config\Services::session();
|
$this->_session = \Config\Services::session();
|
||||||
$this->_validation = \Config\Services::validation();
|
$this->_validation = \Config\Services::validation();
|
||||||
}
|
}
|
||||||
final public function getClassName()
|
final protected function getClassName()
|
||||||
{
|
{
|
||||||
return $this->_className;
|
return $this->_className;
|
||||||
}
|
}
|
||||||
@ -73,10 +73,11 @@ abstract class BaseModel extends Model
|
|||||||
{
|
{
|
||||||
return $this->where($conditions)->findAll();
|
return $this->where($conditions)->findAll();
|
||||||
}
|
}
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case $this->primaryKey:
|
case $this->primaryKey:
|
||||||
|
//수동입력인경우
|
||||||
if (!$this->useAutoIncrement) {
|
if (!$this->useAutoIncrement) {
|
||||||
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
|
$rules[$field] = "required|regex_match[/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/]";
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
@ -154,17 +155,17 @@ abstract class BaseModel extends Model
|
|||||||
return $options;
|
return $options;
|
||||||
}
|
}
|
||||||
//Field별 Form Option용
|
//Field별 Form Option용
|
||||||
final public function getFieldFormOptions(array $fields): array
|
// final public function getFieldFormOptions(array $fields): array
|
||||||
{
|
// {
|
||||||
$fieldFormOptions = array();
|
// $fieldFormOptions = array();
|
||||||
foreach ($fields as $field) {
|
// foreach ($fields as $field) {
|
||||||
if (!is_string($field)) {
|
// if (!is_string($field)) {
|
||||||
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true));
|
// throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true));
|
||||||
}
|
// }
|
||||||
$fieldFormOptions[$field] = $this->getFieldFormOption($field);
|
// $fieldFormOptions[$field] = $this->getFieldFormOption($field);
|
||||||
}
|
// }
|
||||||
return $fieldFormOptions;
|
// return $fieldFormOptions;
|
||||||
}
|
// }
|
||||||
|
|
||||||
final public function getUUID()
|
final public function getUUID()
|
||||||
{
|
{
|
||||||
@ -184,8 +185,8 @@ abstract class BaseModel extends Model
|
|||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case $this->primaryKey:
|
case $this->primaryKey:
|
||||||
//primaryKey가 자동입력이 아니면
|
//primaryKey가 수동입력이고 추가(Reply도 결국엔 create_process를 상용)시에만
|
||||||
if (!$this->useAutoIncrement) {
|
if ($action == 'create' && !$this->useAutoIncrement) {
|
||||||
$pk = $this->primaryKey;
|
$pk = $this->primaryKey;
|
||||||
$entity->$pk = $this->getUUID();
|
$entity->$pk = $this->getUUID();
|
||||||
}
|
}
|
||||||
@ -229,11 +230,6 @@ abstract class BaseModel extends Model
|
|||||||
log_message("error", implode("\n", $this->errors()));
|
log_message("error", implode("\n", $this->errors()));
|
||||||
throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . $this->getLastQuery() . "\n" . var_export($this->errors(), true));
|
throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . $this->getLastQuery() . "\n" . var_export($this->errors(), true));
|
||||||
}
|
}
|
||||||
//primaryKey가 자동입력이면
|
|
||||||
if ($this->useAutoIncrement) {
|
|
||||||
$pk = $this->primaryKey;
|
|
||||||
$entity->$pk = $this->insertID();
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
throw new \Exception(__FUNCTION__ . " 오류 발생.\n 기존정보와 동일하여 수정되지 않았습니다.");
|
throw new \Exception(__FUNCTION__ . " 오류 발생.\n 기존정보와 동일하여 수정되지 않았습니다.");
|
||||||
}
|
}
|
||||||
@ -241,21 +237,21 @@ abstract class BaseModel extends Model
|
|||||||
}
|
}
|
||||||
protected function create_process($entity, array $formDatas)
|
protected function create_process($entity, array $formDatas)
|
||||||
{
|
{
|
||||||
// echo var_export($entity);
|
|
||||||
// exit;
|
|
||||||
foreach ($this->allowedFields as $field) {
|
foreach ($this->allowedFields as $field) {
|
||||||
$entity = $this->changeFormData('create', $field, $formDatas, $entity);
|
$entity = $this->changeFormData('create', $field, $formDatas, $entity);
|
||||||
}
|
}
|
||||||
// echo var_export($this->allowedFields);
|
$entity = $this->save_process($entity);
|
||||||
// exit
|
//primaryKey가 자동입력이면
|
||||||
return $this->save_process($entity);
|
if ($this->useAutoIncrement) {
|
||||||
|
$pk = $this->primaryKey;
|
||||||
|
$entity->$pk = $this->insertID();
|
||||||
|
}
|
||||||
|
return $entity;
|
||||||
}
|
}
|
||||||
final protected function modify_process($entity, array $formDatas)
|
final protected function modify_process($entity, array $formDatas)
|
||||||
{
|
{
|
||||||
foreach ($this->allowedFields as $field) {
|
foreach ($this->allowedFields as $field) {
|
||||||
if ($field != $this->primaryKey) {
|
$entity = $this->changeFormData('modify', $field, $formDatas, $entity);
|
||||||
$entity = $this->changeFormData('modify', $field, $formDatas, $entity);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
$entity->updated_at = time();
|
$entity->updated_at = time();
|
||||||
return $this->save_process($entity);
|
return $this->save_process($entity);
|
||||||
@ -272,13 +268,9 @@ abstract class BaseModel extends Model
|
|||||||
$this->where("created_at <=", $end);
|
$this->where("created_at <=", $end);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public function setIndexOrderBy(?string $field, ?string $order)
|
public function setIndexOrderBy(string $field, string $order)
|
||||||
{
|
{
|
||||||
if ($this->useAutoIncrement) {
|
$this->orderBy($field, $order);
|
||||||
$this->orderBy($field ?: $this->primaryKey, $order ?: "DESC");
|
|
||||||
} else {
|
|
||||||
$this->orderBy($field ?: "created_at", $order ?: "DESC");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
final public function setCondition(array $filterFields, $word, $start, $end, $order_field, $order_value)
|
final public function setCondition(array $filterFields, $word, $start, $end, $order_field, $order_value)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -28,7 +28,7 @@ class BoardModel extends BaseHierarchyModel
|
|||||||
{
|
{
|
||||||
return 'content';
|
return 'content';
|
||||||
}
|
}
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "category_uid":
|
case "category_uid":
|
||||||
|
|||||||
@ -13,7 +13,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
parent::__construct('Category');
|
parent::__construct('Category');
|
||||||
$this->allowedFields = [
|
$this->allowedFields = [
|
||||||
...$this->allowedFields,
|
...$this->allowedFields,
|
||||||
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
'name', "linkurl", "photo", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
|
||||||
"head", "tail", "status"
|
"head", "tail", "status"
|
||||||
];
|
];
|
||||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||||
@ -26,13 +26,16 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
{
|
{
|
||||||
return 'head';
|
return 'head';
|
||||||
}
|
}
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case $this->getTitleField():
|
case $this->getTitleField():
|
||||||
$rules[$field] = "required|trim|string";
|
$rules[$field] = "required|trim|string";
|
||||||
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
|
case 'photo':
|
||||||
|
$rules[$field] = !$action ? "if_exist|string" : "is_image[{$field}]|mime_in[{$field},image/jpg,image/jpeg,image/gif,image/png,image/webp]|max_size[{$field},300]|max_dims[{$field},2048,768]";
|
||||||
|
break;
|
||||||
case "isaccess":
|
case "isaccess":
|
||||||
case "isread":
|
case "isread":
|
||||||
case "iswrite":
|
case "iswrite":
|
||||||
@ -55,6 +58,7 @@ class CategoryModel extends BaseHierarchyModel
|
|||||||
{
|
{
|
||||||
//대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능)
|
//대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능)
|
||||||
$old_title = "";
|
$old_title = "";
|
||||||
|
$options = array();
|
||||||
foreach ($this->getEntitys($conditions) as $entity) {
|
foreach ($this->getEntitys($conditions) as $entity) {
|
||||||
if ($entity->getHierarchy_Depth() == 1) {
|
if ($entity->getHierarchy_Depth() == 1) {
|
||||||
$options[$entity->getTitle()] = [];
|
$options[$entity->getTitle()] = [];
|
||||||
|
|||||||
90
app/Models/SitepageModel.php
Normal file
90
app/Models/SitepageModel.php
Normal file
@ -0,0 +1,90 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models;
|
||||||
|
|
||||||
|
use App\Entities\SitepageEntity;
|
||||||
|
|
||||||
|
class SitepageModel extends BaseModel
|
||||||
|
{
|
||||||
|
private $_category_options = null;
|
||||||
|
protected $table = "tw_sitepage";
|
||||||
|
protected $returnType = SitepageEntity::class;
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct('Sitepage');
|
||||||
|
$this->allowedFields = [
|
||||||
|
...$this->allowedFields,
|
||||||
|
"category_uid",
|
||||||
|
"user_uid", 'title', "content",
|
||||||
|
"status"
|
||||||
|
];
|
||||||
|
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||||
|
}
|
||||||
|
public function getTitleField(): string
|
||||||
|
{
|
||||||
|
return 'title';
|
||||||
|
}
|
||||||
|
public function getContentField(): string
|
||||||
|
{
|
||||||
|
return 'content';
|
||||||
|
}
|
||||||
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
case "category_uid":
|
||||||
|
$rules[$field] = "required|numeric";
|
||||||
|
break;
|
||||||
|
case $this->getTitleField():
|
||||||
|
case "content":
|
||||||
|
$rules[$field] = "required|string";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$rules = parent::getFieldRule($field, $rules, $action);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $rules;
|
||||||
|
}
|
||||||
|
//Field별 Form Option용
|
||||||
|
public function getFieldFormOption(string $field): array
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
case 'category_uid':
|
||||||
|
if (is_null($this->_category_options)) {
|
||||||
|
$categoryModel = new CategoryModel();
|
||||||
|
$this->_category_options = $categoryModel->getOptions();
|
||||||
|
}
|
||||||
|
$options = $this->_category_options;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return parent::getFieldFormOption($field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (!is_array($options)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
|
||||||
|
}
|
||||||
|
return $options;
|
||||||
|
}
|
||||||
|
public function getEntity($conditions): SitepageEntity
|
||||||
|
{
|
||||||
|
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function create(array $formDatas): SitepageEntity
|
||||||
|
{
|
||||||
|
return $this->create_process(new SitepageEntity(), $formDatas);
|
||||||
|
}
|
||||||
|
public function modify(SitepageEntity $entity, array $formDatas): SitepageEntity
|
||||||
|
{
|
||||||
|
return $this->modify_process($entity, $formDatas);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Index관련
|
||||||
|
public function setIndexWordFilter(string $word)
|
||||||
|
{
|
||||||
|
if ($word !== DEFAULTS['EMPTY']) {
|
||||||
|
parent::setIndexWordFilter($word);
|
||||||
|
$this->orLike($this->getTitleField(), $word, "both");
|
||||||
|
$this->orLike("content", $word, "both"); //befor , after , both
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -15,7 +15,7 @@ class UserModel extends BaseModel
|
|||||||
parent::__construct('User');
|
parent::__construct('User');
|
||||||
$this->allowedFields = [
|
$this->allowedFields = [
|
||||||
...$this->allowedFields,
|
...$this->allowedFields,
|
||||||
"id", "passwd", 'name', "email", "role", "status"
|
"id", "passwd", 'name', "email", "phone", "mobile", "role", "status"
|
||||||
];
|
];
|
||||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||||
}
|
}
|
||||||
@ -23,7 +23,7 @@ class UserModel extends BaseModel
|
|||||||
{
|
{
|
||||||
return 'name';
|
return 'name';
|
||||||
}
|
}
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "id":
|
case "id":
|
||||||
@ -92,8 +92,10 @@ class UserModel extends BaseModel
|
|||||||
//Index관련
|
//Index관련
|
||||||
public function setIndexWordFilter(string $word)
|
public function setIndexWordFilter(string $word)
|
||||||
{
|
{
|
||||||
parent::setIndexWordFilter($word);
|
if ($word !== DEFAULTS['EMPTY']) {
|
||||||
$this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
|
parent::setIndexWordFilter($word);
|
||||||
$this->orLike("id", $word, "both");
|
$this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
|
||||||
|
$this->orLike("id", $word, "both");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ class UserSNSModel extends BaseModel
|
|||||||
return 'name';
|
return 'name';
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
public function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||||
{
|
{
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "id":
|
case "id":
|
||||||
|
|||||||
@ -1,33 +1,32 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="top">
|
<div id="content">
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div class="top container-fluid">
|
||||||
<ul class="nav">
|
<nav class="nav">
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||||
<?= $this->include('templates/admin/index_head') ?>
|
</nav>
|
||||||
</ul>
|
<?= $this->include('templates/admin/index_head') ?>
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>#</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>@</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
<td>
|
<td nowrap>
|
||||||
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td nowrap><?= getFieldIndex_Row_BoardHelper_Admin($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldIndex_Row_BoardHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_BoardHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_BoardHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_BoardHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '답변글추가', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_BoardHelper($field, old($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_BoardHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_BoardHelper($field, old($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,16 +1,19 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<div id="content">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<table class="form table table-bordered table-striped">
|
||||||
<tr>
|
<tbody>
|
||||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td class="column">
|
<tr>
|
||||||
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||||
<?= validation_show_error($field); ?>
|
<td class="column">
|
||||||
</td>
|
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
</tr>
|
<?= validation_show_error($field); ?>
|
||||||
<?php endforeach; ?>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,33 +1,32 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="top">
|
<div id="content">
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div class="top container-fluid">
|
||||||
<ul class="nav">
|
<nav class="nav">
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_CategoryHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_CategoryHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||||
<?= $this->include('templates/admin/index_head') ?>
|
</nav>
|
||||||
</ul>
|
<?= $this->include('templates/admin/index_head') ?>
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>#</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_CategoryHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_CategoryHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>@</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
<td>
|
<td nowrap>
|
||||||
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td nowrap><?= getFieldIndex_Row_CategoryHelper_Admin($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldIndex_Row_CategoryHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_CategoryHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_CategoryHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
14
app/Views/admin/category/leftmenu_template.php
Normal file
14
app/Views/admin/category/leftmenu_template.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title"><?= $viewDatas['parent_category']->getTitle() ?></div>
|
||||||
|
</div>
|
||||||
|
<?php foreach ($viewDatas['sibling_categorys'] as $category) : ?>
|
||||||
|
<div class="sibling <?php if ($viewDatas['category']->getPrimaryKey() == $category->getPrimaryKey()) : ?>active<?php endif ?>">
|
||||||
|
<?= anchor(
|
||||||
|
$category->linkurl . '?category=' . $category->getPrimaryKey(),
|
||||||
|
$category->getTitle(),
|
||||||
|
["target" => "_self"]
|
||||||
|
) ?>
|
||||||
|
<span class="play"><?= ICONS['PLAY'] ?></span>
|
||||||
|
</div>
|
||||||
|
<?php endforeach ?>
|
||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_CategoryHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '중분류추가', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_CategoryHelper($field, old($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_CategoryHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_CategoryHelper($field, old($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,16 +1,19 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<div id="content">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<table class="form table table-bordered table-striped">
|
||||||
<tr>
|
<tbody>
|
||||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td class="column">
|
<tr>
|
||||||
<?= getFieldView_CategoryHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||||
<?= validation_show_error($field); ?>
|
<td class="column">
|
||||||
</td>
|
<?= getFieldView_CategoryHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
</tr>
|
<?= validation_show_error($field); ?>
|
||||||
<?php endforeach; ?>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
48
app/Views/admin/sitepage/index.php
Normal file
48
app/Views/admin/sitepage/index.php
Normal file
@ -0,0 +1,48 @@
|
|||||||
|
<?= $this->extend('layouts/admin') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div class="top container-fluid">
|
||||||
|
<nav class="nav">
|
||||||
|
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_SitepageHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||||
|
</nav>
|
||||||
|
<?= $this->include('templates/admin/index_head') ?>
|
||||||
|
</div>
|
||||||
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<table class="table table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>#</th>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_SitepageHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
|
<th>@</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $cnt = 0 ?>
|
||||||
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
|
<td nowrap>
|
||||||
|
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
||||||
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
|
</td>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<td><?= getFieldIndex_Row_SitepageHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<div class="bottom">
|
||||||
|
<ul class="nav justify-content-center">
|
||||||
|
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||||
|
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_SitepageHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?><?php endforeach ?>
|
||||||
|
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")) ?></li>
|
||||||
|
<li class="nav-item"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?= $viewDatas['pagination'] ?>
|
||||||
|
</div>
|
||||||
|
<?= form_close() ?>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
24
app/Views/admin/sitepage/insert.php
Normal file
24
app/Views/admin/sitepage/insert.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?= $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"><?= getFieldLabel_SitepageHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_SitepageHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= 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>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
24
app/Views/admin/sitepage/update.php
Normal file
24
app/Views/admin/sitepage/update.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?= $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"><?= getFieldLabel_SitepageHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_SitepageHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= 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>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
19
app/Views/admin/sitepage/view.php
Normal file
19
app/Views/admin/sitepage/view.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
<?= $this->extend('layouts/admin') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<table class="form table table-bordered table-striped">
|
||||||
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_SitepageHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldView_SitepageHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -1,39 +1,38 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="top">
|
<div id="content">
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div class="top container-fluid">
|
||||||
<ul class="nav">
|
<nav class="nav">
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||||
<?= $this->include('templates/admin/index_head') ?>
|
</nav>
|
||||||
</ul>
|
<?= $this->include('templates/admin/index_head') ?>
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>#</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>@</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
<td>
|
<td nowarp>
|
||||||
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td nowrap><?= getFieldIndex_Row_UserHelper_Admin($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldIndex_Row_UserHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<ul class="nav justify-content-center">
|
<ul class="nav justify-content-center">
|
||||||
|
|||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_UserHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_UserHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,21 +1,24 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="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']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<tbody>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_UserHelper($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?= validation_show_error($field); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
<td class="column">
|
|
||||||
<?= getFieldForm_UserHelper($field, old($field, $viewDatas['entity']->$field ?: DEFAULTS['EMPTY']), $viewDatas) ?>
|
|
||||||
<?= validation_show_error($field); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
</tbody>
|
||||||
<tr>
|
<?= form_close(); ?>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,16 +1,19 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<div id="content">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<table class="form table table-bordered table-striped">
|
||||||
<tr>
|
<tbody>
|
||||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td class="column">
|
<tr>
|
||||||
<?= getFieldView_UserHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||||
<?= validation_show_error($field); ?>
|
<td class="column">
|
||||||
</td>
|
<?= getFieldView_UserHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
</tr>
|
<?= validation_show_error($field); ?>
|
||||||
<?php endforeach; ?>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,39 +1,38 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="top">
|
<div id="content">
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div class="top container-fluid">
|
||||||
<ul class="nav">
|
<nav class="nav">
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserSNSHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserSNSHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||||
<?= $this->include('templates/admin/index_head') ?>
|
</nav>
|
||||||
</ul>
|
<?= $this->include('templates/admin/index_head') ?>
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
</div>
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>#</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserSNSHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_UserSNSHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>@</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
<td>
|
<td nowrap>
|
||||||
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td nowrap><?= getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
<td><?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
</tbody>
|
</tbody>
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<ul class="nav justify-content-center">
|
<ul class="nav justify-content-center">
|
||||||
|
|||||||
@ -1,16 +1,19 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/admin/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<div id="content">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<table class="form table table-bordered table-striped">
|
||||||
<tr>
|
<tbody>
|
||||||
<td class="label"><?= getFieldLabel_UserSNSHelper($field, $viewDatas) ?></td>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td class="column">
|
<tr>
|
||||||
<?= getFieldView_UserSNSHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
<td class="label"><?= getFieldLabel_UserSNSHelper($field, $viewDatas) ?></td>
|
||||||
<?= validation_show_error($field); ?>
|
<td class="column">
|
||||||
</td>
|
<?= getFieldView_UserSNSHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
</tr>
|
<?= validation_show_error($field); ?>
|
||||||
<?php endforeach; ?>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,91 +1,5 @@
|
|||||||
<?= $this->extend('layouts/admin') ?>
|
<?= $this->extend('layouts/admin') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<?= $this->include('templates/admin/header'); ?>
|
<?= $this->include('templates/admin/header'); ?>
|
||||||
<!-- Body Content QuickInfo Start -->
|
|
||||||
<div class="row">
|
|
||||||
<!-- Body Content QuickInfo 쪽지 Start -->
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-primary" onClick="location.href='/admin/memorecevie';" style="cursor: pointer;">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3"><i class="fa fa-comments fa-5x"></i></div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge" style="padding-top:30px;">
|
|
||||||
<?= ICONS['NEW'] ?>
|
|
||||||
<?= AUDIOS['Alram_GetEmail'] ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">자세히보기</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Body Content QuickInfo 쪽지 End -->
|
|
||||||
<!-- Body Content QuickInfo 신규서버 Start -->
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-success" onClick="location.href='/serviceList.sev';" style="cursor: pointer;">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3"><i class="fa fa-plus-square-o fa-5x"></i></div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">day7_server</div>
|
|
||||||
<div>최근 7일간 신규서버 대수</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">자세히보기</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Body Content QuickInfo 신규서버 End -->
|
|
||||||
<!-- Body Content QuickInfo 요청업무 Start -->
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-warning">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3"><i class="fa fa-tasks fa-5x"></i></div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">0</div>
|
|
||||||
<div>요청업무 알림</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">자세히보기</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Body Content QuickInfo 요청업무 End -->
|
|
||||||
<!-- Body Content QuickInfo 금일지군 미납서버 Start -->
|
|
||||||
<div class="col-lg-3 col-md-6">
|
|
||||||
<div class="panel panel-danger" onClick="location.href='/IdcDepositNonPaymentListMK.dep';" style="cursor: pointer;">
|
|
||||||
<div class="panel-heading">
|
|
||||||
<div class="row">
|
|
||||||
<div class="col-xs-3"><i class="fa fa-support fa-5x"></i></div>
|
|
||||||
<div class="col-xs-9 text-right">
|
|
||||||
<div class="huge">deposit_server</div>
|
|
||||||
<div>금일 기준 미납 서버</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="panel-footer">
|
|
||||||
<span class="pull-left">자세히보기</span>
|
|
||||||
<span class="pull-right"><i class="fa fa-arrow-circle-right"></i></span>
|
|
||||||
<div class="clearfix"></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<!-- Body Content QuickInfo 금일지군 미납서버 End -->
|
|
||||||
</div>
|
|
||||||
<!-- Body Content QuickInfo End -->
|
|
||||||
<?= $this->include('templates/admin/footer'); ?>
|
<?= $this->include('templates/admin/footer'); ?>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,43 +1,37 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
|
<div id="content">
|
||||||
<div class="top">
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
|
||||||
<ul class="nav">
|
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
|
||||||
<?= $this->include('templates/front/index_head') ?>
|
|
||||||
</ul>
|
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>번호</th>
|
<th>#</th>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<th>작업</th>
|
<th>@</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
<?php $cnt = 0 ?>
|
<?php $cnt = 0 ?>
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
<td>
|
<td nowrap>
|
||||||
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
|
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
|
||||||
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
<?php else : ?>
|
<?php else : ?>
|
||||||
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
|
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
</td>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td nowrap><?= getFieldIndex_Row_BoardHelper($field, $entity, $viewDatas) ?></td>
|
<td><?= getFieldIndex_Row_BoardHelper($field, $entity, $viewDatas) ?></td>
|
||||||
<?php endforeach ?>
|
<?php endforeach ?>
|
||||||
<td>
|
<td>
|
||||||
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
|
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
|
||||||
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->user_uid == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
||||||
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey() . '?category=' . $viewDatas['category']->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -46,15 +40,13 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<ul class="nav justify-content-center">
|
<!-- 사용자가 쓰기권한이 있는지 확인-->
|
||||||
<!-- 사용자가 쓰기권한이 있는지 확인-->
|
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $viewDatas['category'], 'iswrite')) : ?>
|
||||||
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $viewDatas['category'], CATEGORY_ROLE_FIELDS['WRITE'])) : ?>
|
<?= anchor(current_url() . '/insert?category=' . $viewDatas['category']->getPrimaryKey(), '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?>
|
||||||
<li class="nav-item"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
|
||||||
</ul>
|
|
||||||
<?= $viewDatas['pagination'] ?>
|
<?= $viewDatas['pagination'] ?>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,7 +1,8 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
|
<div id="content">
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-hover table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
@ -18,6 +19,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
<?= form_close(); ?>
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,7 +1,8 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
|
<div id="content">
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-hover table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
@ -14,10 +15,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '답글', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
<?= form_close(); ?>
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,7 +1,8 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
|
<div id="content">>
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-hover table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
@ -14,10 +15,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
<?= form_close(); ?>
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,18 +1,21 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
|
<div id="content">
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<table class="form table table-bordered table-striped">
|
||||||
<tr>
|
<tbody>
|
||||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
<td class="column">
|
<tr>
|
||||||
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||||
<?= validation_show_error($field); ?>
|
<td class="column">
|
||||||
</td>
|
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||||
</tr>
|
<?= validation_show_error($field); ?>
|
||||||
<?php endforeach; ?>
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
14
app/Views/front/sitepage/index.php
Normal file
14
app/Views/front/sitepage/index.php
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<?= $this->extend('layouts/front') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="/css/front/sitepage.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
|
<?php $cnt = 0 ?>
|
||||||
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
|
<?= getFieldIndex_Row_SitepageHelper('content', $entity, $viewDatas) ?>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -1,51 +1,41 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="top">
|
<div id="content">
|
||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<ul class="nav">
|
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
|
||||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
|
||||||
<?= $this->include('templates/front/index_head') ?>
|
|
||||||
</ul>
|
|
||||||
<?= form_close() ?>
|
|
||||||
</div>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="table table-bordered table-hover table-striped">
|
<table class="table table-hover">
|
||||||
<tr>
|
<thead>
|
||||||
<th>번호</th>
|
<tr>
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
<th>#</th>
|
||||||
</tr>
|
<?php foreach ($viewDatas['fields'] as $field) : ?><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?><?php endforeach ?>
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
|
||||||
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
|
||||||
<td>
|
|
||||||
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
|
|
||||||
<?php if ($this->viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $this->viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
|
||||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
|
||||||
<td nowrap><?= getFieldIndex_Row_UserHelper($field, $entity, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
|
|
||||||
<?php if ($this->viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $this->viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
|
||||||
<?= anchor(current_url() . '/delete/' . $entity->getPrimaryKey(), ICONS['DELETE'], ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
|
||||||
<?php endif ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
<?php $cnt++ ?>
|
</thead>
|
||||||
<?php endforeach ?>
|
<tbody>
|
||||||
|
<?php $cnt = 0 ?>
|
||||||
|
<?php foreach ($viewDatas['entitys'] as $entity) : ?>
|
||||||
|
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this)">
|
||||||
|
<td nowrap>
|
||||||
|
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
|
||||||
|
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getPrimaryKey() == $viewDatas['auth'][AUTH_FIELDS['ID']]) : ?>
|
||||||
|
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||||
|
<?php else : ?>
|
||||||
|
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
|
||||||
|
<?php endif ?>
|
||||||
|
</td>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<td><?= getFieldIndex_Row_UserHelper($field, $entity, $viewDatas) ?></td>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<!-- 사용자가 쓰기권한이 있는지 확인-->
|
|
||||||
<?php if (isRole_CommonHelper($this->viewDatas['currentRoles'], $this->viewDatas['category'], CATEGORY_ROLE_FIELDS['WRITE'])) : ?>
|
|
||||||
<li class="nav-item"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
|
|
||||||
<?php endif ?>
|
|
||||||
</ul>
|
|
||||||
<?= $viewDatas['pagination'] ?>
|
<?= $viewDatas['pagination'] ?>
|
||||||
</div>
|
</div>
|
||||||
<?= form_close() ?>
|
<?= form_close() ?>
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
24
app/Views/front/user/insert.php
Normal file
24
app/Views/front/user/insert.php
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
<?= $this->extend('layouts/front') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<table class="form table table-bordered table-hover table-striped">
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
|
<tr>
|
||||||
|
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||||
|
<td class="column">
|
||||||
|
<?= getFieldForm_UserHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||||
|
<?= 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>
|
||||||
|
</table>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
41
app/Views/front/user/login.php
Normal file
41
app/Views/front/user/login.php
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
<?= $this->extend('layouts/front') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="/css/front/login.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div class="login container">
|
||||||
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<table>
|
||||||
|
<tr>
|
||||||
|
<td class="label" nowrap>계정</td>
|
||||||
|
<td class="column">
|
||||||
|
<?= form_input('id', old('id', DEFAULTS['EMPTY'])) ?>
|
||||||
|
</td>
|
||||||
|
<td rowspan="2" class="submit">
|
||||||
|
<?= form_input([
|
||||||
|
'type' => 'image', 'src' => "/images/common/btn_login.png",
|
||||||
|
'width' => '57', 'height' => '60',
|
||||||
|
]) ?>
|
||||||
|
</td>
|
||||||
|
<td rowspan="2">
|
||||||
|
<?php foreach ($viewDatas['login_buttons'] as $key => $login_button) : ?>
|
||||||
|
<?= $login_button ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td class="label" nowrap>암호</td>
|
||||||
|
<td class="column">
|
||||||
|
<?= form_password('passwd', old('passwd', DEFAULTS['EMPTY'])) ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td colspan="4" class="login_bottom">
|
||||||
|
<a href="/front/user/insert">회원가입</a>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
37
app/Views/front/user/login_v1.php
Normal file
37
app/Views/front/user/login_v1.php
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
<?= $this->extend('layouts/front') ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<link href="/css/front/login_v1.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div class="login container">
|
||||||
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="label_column col-3">
|
||||||
|
<label class="col-form-label">아이디</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
<?= form_input('id', old('id', DEFAULTS['EMPTY'])) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row mb-3">
|
||||||
|
<div class="label_column col-3">
|
||||||
|
<label class="col-form-label">비밀번호</label>
|
||||||
|
</div>
|
||||||
|
<div class="col-9">
|
||||||
|
<?= form_password('passwd', old('passwd', DEFAULTS['EMPTY'])) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-12 text-center d-grid">
|
||||||
|
<?= form_submit('', '로그인', array("class" => "btn btn-outline btn-primary")) ?>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="login_bottom row">
|
||||||
|
<div class="col"><a href="/front/user/insert">회원가입</a></div>
|
||||||
|
<!-- <div class="col"><a href="/front/user/findid">아이디찾기</a></div>
|
||||||
|
<div class="col"><a href="/front/user/findpw">비밀번호찾기</a></div> -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -1,6 +1,8 @@
|
|||||||
<?= $this->extend('layouts/front') ?>
|
<?= $this->extend('layouts/front') ?>
|
||||||
<?= $this->section('content') ?>
|
<?= $this->section('content') ?>
|
||||||
<div class="content">
|
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div id="content">
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
<table class="form table table-bordered table-hover table-striped">
|
<table class="form table table-bordered table-hover table-striped">
|
||||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||||
@ -13,9 +15,10 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
<td valign="bottom" colspan="2"><?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
<?= form_close(); ?>
|
<?= form_close(); ?>
|
||||||
|
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
|
||||||
</div>
|
</div>
|
||||||
<?= $this->endSection() ?>
|
<?= $this->endSection() ?>
|
||||||
@ -1,10 +1,10 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="ko">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<base href="/" target="_self" />
|
<meta charset="utf-8">
|
||||||
<meta charset="UTF-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" id="viewport" content="width=1280">
|
||||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||||
<?= $stylesheet ?>
|
<?= $stylesheet ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -24,19 +24,26 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator'); ?>
|
<div id="head">
|
||||||
<table id="layout">
|
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator'); ?>
|
||||||
<tr>
|
</div>
|
||||||
<td id="left" valign="top" width="180">
|
<div class="container-fluid">
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
<nav class="nav"></nav>
|
||||||
</td>
|
<nav class="nav justify-content-center">
|
||||||
<td id="body" valign="top" width="*">
|
<table id="layout">
|
||||||
<?= $this->include('templates/admin/header'); ?>
|
<tr>
|
||||||
<?= $this->renderSection('content') ?>
|
<td id="left" valign="top" width="160">
|
||||||
<?= $this->include('templates/admin/footer'); ?>
|
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
<td id="body" valign="top" width="*">
|
||||||
</table>
|
<?= $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>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -5,5 +5,6 @@
|
|||||||
<div class="accordion accordion-flush">
|
<div class="accordion accordion-flush">
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
|
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
|
||||||
|
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -4,10 +4,13 @@
|
|||||||
</h2>
|
</h2>
|
||||||
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
|
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>범주 관리</a></h2>
|
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>분류 관리</a></h2>
|
||||||
</div>
|
</div>
|
||||||
<div class="accordion-item">
|
<div class="accordion-item">
|
||||||
<h2><a href="/admin/board"><?= CLASS_ICONS['BOARD'] ?>게시글 관리</a></h2>
|
<h2><a href="/admin/board"><?= CLASS_ICONS['BOARD'] ?>게시글 관리</a></h2>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2><a href="/admin/sitepage"><?= CLASS_ICONS['SITEPAGE'] ?>SitePage 관리</a></h2>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
13
app/Views/layouts/admin/left_menu/shoppingmall.php
Normal file
13
app/Views/layouts/admin/left_menu/shoppingmall.php
Normal file
@ -0,0 +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-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/product"><?= CLASS_ICONS['PRODUCT'] ?>상품 관리</a></h2>
|
||||||
|
</div>
|
||||||
|
<div class="accordion-item">
|
||||||
|
<h2><a href="/admin/order"><?= CLASS_ICONS['ORDER'] ?></i>주문 관리</a></h2>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
@ -1,10 +1,16 @@
|
|||||||
<!doctype html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html lang="ko">
|
||||||
|
|
||||||
<head>
|
<head>
|
||||||
<base href="/" target="_self" />
|
<meta charset="utf-8">
|
||||||
<meta charset="UTF-8">
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
<meta name="viewport" id="viewport" content="width=1280">
|
||||||
|
<meta name="subject" content="IT Solution">
|
||||||
|
<meta name="description" content="일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버">
|
||||||
|
<meta name="keywords" content="일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버">
|
||||||
|
<meta property="og:type" content="website">
|
||||||
|
<meta property="og:title" content="IT Solution">
|
||||||
|
<meta property="og:description" content="일본IDC 일본서버 일본 서버 일본호스팅 서버호스팅 디도스 공격 해외 호스팅 DDOS 방어 ddos 의뢰 디도스 보안 일본 단독서버">
|
||||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||||
<?= $stylesheet ?>
|
<?= $stylesheet ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
@ -24,19 +30,31 @@
|
|||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator'); ?>
|
<div id="head">
|
||||||
<table id="layout">
|
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator'); ?>
|
||||||
<tr>
|
<?= $this->include($viewDatas['layout']['path'] . '/top_menu'); ?>
|
||||||
<td id="left" valign="top" width="180">
|
<?= CLASS_TOP_BANNER[strtoupper($viewDatas['className'])] ?>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
</div>
|
||||||
</td>
|
<div class="container-fluid">
|
||||||
<td id="body" valign="top" width="*">
|
<nav class="nav"></nav>
|
||||||
<?= $this->include('templates/front/header'); ?>
|
<nav class="nav justify-content-center">
|
||||||
<?= $this->renderSection('content') ?>
|
<table id="layout">
|
||||||
<?= $this->include('templates/front/footer'); ?>
|
<tr>
|
||||||
</td>
|
<td id="left" valign="top" width="200">
|
||||||
</tr>
|
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||||
</table>
|
</td>
|
||||||
|
<td id="body" valign="top" width="*">
|
||||||
|
<?= $this->include('templates/front/header'); ?>
|
||||||
|
<?= $this->renderSection('content') ?>
|
||||||
|
<?= $this->include('templates/front/footer'); ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<nav class="nav justify-content-end"></nav>
|
||||||
|
</div>
|
||||||
|
<nav id="tail" class="navbar navbar-expand-lg" style="background-color:white">
|
||||||
|
<?= $this->include($viewDatas['layout']['path'] . '/copyright'); ?>
|
||||||
|
</nav>
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
@ -1,11 +1,12 @@
|
|||||||
<!-- Copyright 시작-->
|
<!-- Copyright 시작-->
|
||||||
<div id="tail">
|
<link href="/css/front/copyright.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<div class="foot-logo"><img src="../images/common/foot_logo.png" alt="IT Solution"></div>
|
<div id="copyright" class="container-fluid">
|
||||||
<div class="foot-info">
|
<nav class="nav"><a class="navbar-brand" href="/">LOGO</a></nav>
|
||||||
<address>
|
<nav class="nav justify-content-center">
|
||||||
社名 : 株式会社 DUNAMIS <span class="bar"></span> 代表者 : 天 海 照 彩 <span class="bar"></span> 住所 : 東京都江東区亀戸5丁-1-2 <span class="bar"></span> 事業者登録番号 : 0400-01-082327 <span class="bar"></span> Tel : 1661-0577 <br>
|
<div class="address">
|
||||||
Copyright by 2018 (주)ITSolution. All Right Reserved.
|
社名 : 株式会社 DUNAMIS | 代表者 : 天 海 照 彩 | 住所 : 東京都江東区亀戸5丁-1-2 | 事業者登録番号 : 0400-01-082327 | Tel : 1661-0577 <br>
|
||||||
</address>
|
</div>
|
||||||
</div>
|
</nav>
|
||||||
|
<nav class="nav justify-content-end">Copyright by 2018 (주)ITSolution. All Right Reserved.</nav>
|
||||||
</div>
|
</div>
|
||||||
<!-- Copyright 끝-->
|
<!-- Copyright 끝-->
|
||||||
@ -1,9 +1,6 @@
|
|||||||
<!-- left menu start -->
|
<!-- left menu start -->
|
||||||
<link href="/css/front/left_menu.css" media="screen" rel="stylesheet" type="text/css" />
|
<link href="/css/front/left_menu.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
<script type="text/javascript" src="/js/side_menu.js"></script>
|
<div id="left_menu">
|
||||||
<div id="left_menu" class="shadow-lg rounded">
|
<?= $this->include($viewDatas['layout']['path'] . "/left_menu/leftmenu_{$viewDatas['category']->getPrimaryKey()}"); ?>
|
||||||
<div class="accordion accordion-flush">
|
</div>
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
<!-- left menu end -->
|
||||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
13
app/Views/layouts/front/left_menu/leftmenu_11.php
Normal file
13
app/Views/layouts/front/left_menu/leftmenu_11.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!-- DEBUG-VIEW START 7 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">개인정보</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/user?category=22" target="_self">사용자정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 7 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
16
app/Views/layouts/front/left_menu/leftmenu_12.php
Normal file
16
app/Views/layouts/front/left_menu/leftmenu_12.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<!-- DEBUG-VIEW START 8 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">개인정보</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/order?category=11" target="_self">주문정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/payment?category=12" target="_self">결제정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/user?category=22" target="_self">사용자정보</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 8 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
13
app/Views/layouts/front/left_menu/leftmenu_14.php
Normal file
13
app/Views/layouts/front/left_menu/leftmenu_14.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!-- DEBUG-VIEW START 5 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">AboutUS</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=14" target="_self">인사말</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=15" target="_self">회사소개</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 5 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
13
app/Views/layouts/front/left_menu/leftmenu_15.php
Normal file
13
app/Views/layouts/front/left_menu/leftmenu_15.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!-- DEBUG-VIEW START 6 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">AboutUS</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=14" target="_self">인사말</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=15" target="_self">회사소개</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 6 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
13
app/Views/layouts/front/left_menu/leftmenu_17.php
Normal file
13
app/Views/layouts/front/left_menu/leftmenu_17.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!-- DEBUG-VIEW START 3 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">Hosting</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=17" target="_self">제품안내</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=18" target="_self">신청절차</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 3 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
13
app/Views/layouts/front/left_menu/leftmenu_18.php
Normal file
13
app/Views/layouts/front/left_menu/leftmenu_18.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<!-- DEBUG-VIEW START 4 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
|
<div class="parent">
|
||||||
|
<div>-</div>
|
||||||
|
<div class="title">Hosting</div>
|
||||||
|
</div>
|
||||||
|
<div class="sibling ">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=17" target="_self">제품안내</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
<div class="sibling active">
|
||||||
|
<a href="http://localhost:8080/front/sitepage?category=18" target="_self">신청절차</a> <span class="play"><i class="bi bi-play-fill"></i></span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- DEBUG-VIEW ENDED 4 APPPATH\Views\admin\category\leftmenu_template.php -->
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user