shoppingmallv2 init...

This commit is contained in:
최준흠git config git config --helpgit config --global user.name 최준흠 2023-08-03 22:37:05 +09:00
parent d5ab961b43
commit abc1870436
28 changed files with 206 additions and 669 deletions

View File

@ -133,6 +133,8 @@ define('LAYOUTS', [
'<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' => [

View File

@ -39,10 +39,6 @@ $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('ecommerce', ['namespace' => 'App\Controllers'], static function ($routes) {
$routes->post('addCart', 'EcommerceController::addCart');
$routes->get('cancelCart/(:uuid)', 'EcommerceController::cancelCart/$1');
});;
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
});
// authGuard는 App\Config\Filters.php의 $aliases에 선언한 이름이어야 함
@ -68,17 +64,19 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('toggle/(:num)/(:hash)', 'UserSNSController::toggle/$1/$2');
$routes->post('batchjob', 'UserSNSController::batchjob');
});
$routes->group('boardconfig', static function ($routes) {
$routes->get('', 'BoardConfigController::index');
$routes->get('excel', 'BoardConfigController::excel/$1');
$routes->get('insert', 'BoardConfigController::insert_form');
$routes->post('insert', 'BoardConfigController::insert');
$routes->get('update/(:uuid)', 'BoardConfigController::update_form/$1');
$routes->post('update/(:uuid)', 'BoardConfigController::update/$1');
$routes->get('view/(:uuid)', 'BoardConfigController::view/$1');
$routes->get('delete/(:uuid)', 'BoardConfigController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:uuid)/(:hash)', 'BoardConfigController::toggle/$1/$2');
$routes->post('batchjob', 'BoardConfigController::batchjob');
$routes->group('category', static function ($routes) {
$routes->get('', 'CategoryController::index');
$routes->get('excel', 'CategoryController::excel/$1');
$routes->get('insert', 'CategoryController::insert_form');
$routes->post('insert', 'CategoryController::insert');
$routes->get('update/(:num)', 'CategoryController::update_form/$1');
$routes->post('update/(:num)', 'CategoryController::update/$1');
$routes->get('reply/(:num)', 'CategoryController::reply_form/$1');
$routes->post('reply/(:num)', 'CategoryController::reply/$1');
$routes->get('view/(:num)', 'CategoryController::view/$1');
$routes->get('delete/(:num)', 'CategoryController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
$routes->post('batchjob', 'CategoryController::batchjob');
});
$routes->group('board', static function ($routes) {
$routes->get('', 'BoardController::index');
@ -95,20 +93,6 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'BoardController::batchjob');
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
});
$routes->group('category', static function ($routes) {
$routes->get('', 'CategoryController::index');
$routes->get('excel', 'CategoryController::excel/$1');
$routes->get('insert', 'CategoryController::insert_form');
$routes->post('insert', 'CategoryController::insert');
$routes->get('update/(:num)', 'CategoryController::update_form/$1');
$routes->post('update/(:num)', 'CategoryController::update/$1');
$routes->get('view/(:num)', 'CategoryController::view/$1');
$routes->get('reply/(:num)', 'CategoryController::reply_form/$1');
$routes->post('reply/(:num)', 'CategoryController::reply/$1');
$routes->get('delete/(:num)', 'CategoryController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
$routes->post('batchjob', 'CategoryController::batchjob');
});
$routes->group('product', static function ($routes) {
$routes->get('', 'ProductController::index');
$routes->get('excel', 'ProductController::excel/$1');
@ -149,15 +133,6 @@ $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($rou
$routes->get('delete/(:num)', 'BoardController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
});
$routes->group('product', static function ($routes) {
$routes->get('', 'ProductController::index');
$routes->get('excel', 'ProductController::excel/$1');
$routes->get('view/(:uuid)', 'ProductController::view/$1');
});
$routes->group('order', static function ($routes) {
$routes->get('', 'OrderController::index');
$routes->get('view/(:uuid)', 'OrderController::view/$1');
});
});
/*
* --------------------------------------------------------------------

View File

@ -39,10 +39,6 @@ $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('ecommerce', ['namespace' => 'App\Controllers'], static function ($routes) {
$routes->post('addCart', 'EcommerceController::addCart');
$routes->get('cancelCart/(:uuid)', 'EcommerceController::cancelCart/$1');
});;
$routes->group('cli', ['namespace' => 'App\Controllers\CLI'], function ($routes) {
});
// authGuard는 App\Config\Filters.php의 $aliases에 선언한 이름이어야 함
@ -68,17 +64,19 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->get('toggle/(:num)/(:hash)', 'UserSNSController::toggle/$1/$2');
$routes->post('batchjob', 'UserSNSController::batchjob');
});
$routes->group('boardconfig', static function ($routes) {
$routes->get('', 'BoardConfigController::index');
$routes->get('excel', 'BoardConfigController::excel/$1');
$routes->get('insert', 'BoardConfigController::insert_form');
$routes->post('insert', 'BoardConfigController::insert');
$routes->get('update/(:uuid)', 'BoardConfigController::update_form/$1');
$routes->post('update/(:uuid)', 'BoardConfigController::update/$1');
$routes->get('view/(:uuid)', 'BoardConfigController::view/$1');
$routes->get('delete/(:uuid)', 'BoardConfigController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:uuid)/(:hash)', 'BoardConfigController::toggle/$1/$2');
$routes->post('batchjob', 'BoardConfigController::batchjob');
$routes->group('category', static function ($routes) {
$routes->get('', 'CategoryController::index');
$routes->get('excel', 'CategoryController::excel/$1');
$routes->get('insert', 'CategoryController::insert_form');
$routes->post('insert', 'CategoryController::insert');
$routes->get('update/(:num)', 'CategoryController::update_form/$1');
$routes->post('update/(:num)', 'CategoryController::update/$1');
$routes->get('reply/(:num)', 'CategoryController::reply_form/$1');
$routes->post('reply/(:num)', 'CategoryController::reply/$1');
$routes->get('view/(:num)', 'CategoryController::view/$1');
$routes->get('delete/(:num)', 'CategoryController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
$routes->post('batchjob', 'CategoryController::batchjob');
});
$routes->group('board', static function ($routes) {
$routes->get('', 'BoardController::index');
@ -95,20 +93,6 @@ $routes->group('admin', ['namespace' => 'App\Controllers\Admin', 'filter' => 'au
$routes->post('batchjob', 'BoardController::batchjob');
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
});
$routes->group('category', static function ($routes) {
$routes->get('', 'CategoryController::index');
$routes->get('excel', 'CategoryController::excel/$1');
$routes->get('insert', 'CategoryController::insert_form');
$routes->post('insert', 'CategoryController::insert');
$routes->get('update/(:num)', 'CategoryController::update_form/$1');
$routes->post('update/(:num)', 'CategoryController::update/$1');
$routes->get('view/(:num)', 'CategoryController::view/$1');
$routes->get('reply/(:num)', 'CategoryController::reply_form/$1');
$routes->post('reply/(:num)', 'CategoryController::reply/$1');
$routes->get('delete/(:num)', 'CategoryController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('toggle/(:num)/(:hash)', 'CategoryController::toggle/$1/$2');
$routes->post('batchjob', 'CategoryController::batchjob');
});
$routes->group('product', static function ($routes) {
$routes->get('', 'ProductController::index');
$routes->get('excel', 'ProductController::excel/$1');
@ -149,15 +133,6 @@ $routes->group('front', ['namespace' => 'App\Controllers\Front'], function ($rou
$routes->get('delete/(:num)', 'BoardController::delete/$1', ['filter' => 'authFilter:master']);
$routes->get('download/(:any)/(:num)', 'BoardController::download/$1/$2');
});
$routes->group('product', static function ($routes) {
$routes->get('', 'ProductController::index');
$routes->get('excel', 'ProductController::excel/$1');
$routes->get('view/(:uuid)', 'ProductController::view/$1');
});
$routes->group('order', static function ($routes) {
$routes->get('', 'OrderController::index');
$routes->get('view/(:uuid)', 'OrderController::view/$1');
});
});
/*
* --------------------------------------------------------------------

View File

@ -1,51 +0,0 @@
<?php
namespace App\Controllers\Admin;
use App\Models\BoardConfigModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
class BoardConfigController extends AdminController
{
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
{
$this->_model = new BoardConfigModel();
parent::initController($request, $response, $logger);
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
$this->_viewPath .= strtolower($this->_model->getClassName());
helper($this->_model->getClassName());
}
public function getFields(string $action = ""): array
{
$fields = [
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"status", "head", "tail",
];
switch ($action) {
case "index":
case "excel":
return [
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"status", "created_at"
];
break;
case "view":
return [...$fields, "updated_at", "created_at"];
break;
default:
return $fields;
break;
}
}
public function getFieldFilters(): array
{
return ["isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status"];
}
public function getFieldBatchFilters(): array
{
return parent::getFieldBatchFilters();
}
}

View File

@ -21,14 +21,14 @@ class BoardController extends AdminController
public function getFields(string $action = ""): array
{
$fields = ["board_config_uid", 'title', "board_file", "passwd", "status", "content"];
$fields = ["category_uid", 'title', "board_file", "passwd", "status", "content"];
switch ($action) {
case "index":
case "excel":
return ["board_config_uid", "user_uid", 'title', "board_file", "view_cnt", "status", "created_at"];
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "status", "created_at"];
break;
case "view":
return ["board_config_uid", "user_uid", 'title', "board_file", "view_cnt", "status", "created_at", "content"];
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "status", "created_at", "content"];
break;
default:
return $fields;
@ -37,7 +37,7 @@ class BoardController extends AdminController
}
public function getFieldFilters(): array
{
return ["board_config_uid", "user_uid", "status"];
return ["category_uid", "user_uid", "status"];
}
public function getFieldBatchFilters(): array
{

View File

@ -17,16 +17,23 @@ class CategoryController extends AdminController
$this->_viewPath .= strtolower($this->_model->getClassName());
helper($this->_model->getClassName());
}
public function getFields(string $action = ""): array
{
$fields = ['name', "status", "head", "tail",];
$fields = [
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"status", "head", "tail",
];
switch ($action) {
case "index":
case "excel":
return ['name', "status", "created_at"];
return [
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"status", "created_at"
];
break;
case "view":
return ['name', "status", "created_at", "head", "tail",];
return [...$fields, "updated_at", "created_at"];
break;
default:
return $fields;
@ -35,7 +42,7 @@ class CategoryController extends AdminController
}
public function getFieldFilters(): array
{
return ["status"];
return ["isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload", "status"];
}
public function getFieldBatchFilters(): array
{

View File

@ -6,7 +6,6 @@ use App\Models\BoardModel;
use CodeIgniter\HTTP\RequestInterface;
use CodeIgniter\HTTP\ResponseInterface;
use Psr\Log\LoggerInterface;
use App\Models\BoardConfigModel;
class BoardController extends FrontController
{
@ -21,14 +20,14 @@ class BoardController extends FrontController
public function getFields(string $action = ""): array
{
$fields = ["board_config_uid", 'title', "board_file", "passwd", "content"];
$fields = ["category_uid", 'title', "board_file", "passwd", "content"];
switch ($action) {
case "index":
case "excel":
return ["board_config_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at"];
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at"];
break;
case "view":
return ["board_config_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at", "content"];
return ["category_uid", "user_uid", 'title', "board_file", "view_cnt", "created_at", "content"];
break;
default:
return $fields;
@ -37,7 +36,7 @@ class BoardController extends FrontController
}
public function getFieldFilters(): array
{
return ["board_config_uid", "user_uid"];
return ["category_uid", "user_uid"];
}
public function getFieldBatchFilters(): array
{

View File

@ -19,19 +19,6 @@ CREATE TABLE servermgr.tw_user (
-- insert into tw_user (uid,id,passwd,name,email,role,status) select uuid(),id,passwd,name,email,role,status from cfmgr.user;
DROP TABLE IF EXISTS servermgr.tw_user_profile;
CREATE TABLE servermgr.tw_user_profile (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
user_uid varchar(36) NULL COMMENT '사용자 정보',
type varchar(10) NOT NULL COMMENT 'ICON|ADDRESS|PHONE|MOBILE|EMAIL 등등',
content varchar(255) NULL,
priority int(3) NOT NULL DEFAULT 1 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(),
PRIMARY KEY (uid),
CONSTRAINT FOREIGN KEY (user_uid) REFERENCES tw_user (uid) ON DELETE CASCADE
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 추가정보';
DROP TABLE IF EXISTS servermgr.tw_user_sns;
CREATE TABLE servermgr.tw_user_sns (
@ -51,26 +38,37 @@ CREATE TABLE servermgr.tw_user_sns (
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='SNS 로그인 후 정보';
DROP TABLE IF EXISTS servermgr.tw_board_config;
CREATE TABLE servermgr.tw_board_config (
uid varchar(36) NOT NULL,
name varchar(255) NOT NULL COMMENT '게시판명',
isaccess varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT '접근권한',
isread varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT '읽기권한',
iswrite varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT '쓰기권한',
isreply varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT '답글권한',
isupload varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT 'Upload권한',
isdownload varchar(255) NOT NULL DEFAULT 'manager|cloudflare|director|master' COMMENT 'Download권한',
head text NOT NULL DEFAULT '&nbsp;' COMMENT '게시판 위 내용',
tail text NOT NULL DEFAULT '&nbsp;' COMMENT '게시판 아래 내용',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용, unuse: 사용않함 등등',
DROP TABLE IF EXISTS servermgr.tw_category;
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
-- update tw_category set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno
-- 2. 게시물 추가시 작업
-- insert tw_category grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1
-- 3. 게시물 조회시 작업
-- select * from tw_category order by grpno desc,grporder asc
CREATE TABLE servermgr.tw_category (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
name varchar(255) NOT NULL COMMENT '범주명',
linkurl varchar(255) NULL COMMENT '연결URL',
isaccess varchar(30) NOT NULL DEFAULT 'guest' COMMENT '접근권한',
isread varchar(30) NOT NULL DEFAULT 'guest' COMMENT '읽기권한',
iswrite varchar(30) NOT NULL DEFAULT 'guest' COMMENT '쓰기권한',
isreply varchar(30) NOT NULL DEFAULT 'guest' COMMENT '답글권한',
isupload varchar(30) NOT NULL DEFAULT 'guest' COMMENT 'Upload권한',
isdownload varchar(30) NOT NULL DEFAULT 'guest' COMMENT 'Download권한',
head text NULL COMMENT '위 내용',
tail text 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)
) 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;
-- 1. 게시물 추가전 grpno에 해당하는 기존게시물의 grpord를 +1씩증가 작업
-- 1. 게시물 추가전 grpno에 해당하는 max(grporder)+1씩증가 작업
-- update tw_board set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno
-- 2. 게시물 추가시 작업
-- insert tw_board grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1
@ -81,7 +79,7 @@ CREATE TABLE servermgr.tw_board (
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
board_config_uid varchar(36) NOT NULL COMMENT '게시판구분',
cartory_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 '내용',
@ -91,21 +89,8 @@ CREATE TABLE servermgr.tw_board (
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 (board_config_uid) REFERENCES tw_board_config (uid),
CONSTRAINT FOREIGN KEY (cartory_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_board_file;
CREATE TABLE servermgr.tw_board_file (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
board_uid int(10) UNSIGNED NOT NULL COMMENT '게시물 정보',
mime_type varchar(50) NOT NULL COMMENT 'Mime_Type',
name varchar(255) NOT NULL COMMENT '파일명',
real_name varchar(255) 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(),
PRIMARY KEY (uid),
CONSTRAINT FOREIGN KEY (board_uid) REFERENCES tw_board (uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시판 File정보';
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='게시물 정보';

View File

@ -1,24 +1,3 @@
DROP TABLE IF EXISTS shoppingmall.tw_category;
-- 1. 게시물 추가전 grpno에 해당하는 기존게시물의 grporder를 +1씩증가 작업
-- update tw_category set grporder=grporder+1 where grpno=그룹번호 and grporder > 선택한 grpno
-- 2. 게시물 추가시 작업
-- insert tw_category grpno=그룹번호,grporder=grporder+1,grpdepth=grpdepth+1
-- 3. 게시물 조회시 작업
-- select * from tw_category order by grpno desc,grporder asc
CREATE TABLE shoppingmall.tw_category (
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT COMMENT 'Group번호와 type이 같아야하므로 항상 숫자여야함',
grpno int(10) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) UNSIGNED NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
name varchar(36) NOT NULL COMMENT '카테고리명',
head text NOT NULL DEFAULT '&nbsp;' COMMENT '위 내용',
tail text NOT NULL DEFAULT '&nbsp;' 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(),
PRIMARY KEY (uid)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='상품 카테고리';
DROP TABLE IF EXISTS shoppingmall.tw_product;
CREATE TABLE shoppingmall.tw_product (
uid varchar(36) NOT NULL,

View File

@ -1,34 +0,0 @@
<?php
namespace App\Entities;
class BoardConfigEntity extends BaseEntity
{
protected $datamap = [];
protected $dates = ['created_at', 'updated_at', 'deleted_at'];
protected $casts = [];
//기본기능
public function getPrimaryKey()
{
return $this->attributes['uid'];
}
public function getTitle(): string
{
return $this->attributes['name'];
}
public function getStatus(): string
{
return $this->attributes['status'];
}
//추가기능
public function getHead()
{
return $this->attributes['head'];
}
public function getTail()
{
return $this->attributes['tail'];
}
}

View File

@ -23,6 +23,10 @@ class CategoryEntity extends BaseHierarchyEntity
}
//추가기능
public function getLinkURL()
{
return $this->attributes['linkurl'];
}
public function getHead()
{
return $this->attributes['head'];

View File

@ -1,136 +0,0 @@
<?php
function getFieldLabel_BoardConfigHelper($field, array $fieldRules, array $attributes = array()): string
{
switch ($field) {
default:
if (strpos($fieldRules[$field], 'required') !== false) {
array_push($attributes, 'style="color:red";');
}
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("BoardConfig.label.{$field}"));
break;
}
}
//header.php에서 getFieldForm_Helper사용
function getFieldForm_BoardConfigHelper($field, $value, array $fieldFormOptions, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'isaccess':
case 'isread':
case 'iswrite':
case 'isreply':
case 'isupload':
case 'isdownload':
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("BoardConfig.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
// return form_multiselect($field, $fieldFormOptions[$field], $value, [...$attributes]);
// foreach ($fieldFormOptions[$field] as $key => $label) {
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : explode(DEFAULTS['DELIMITER_ROLE'], $value)), $attributes) . $label;
// }
// return implode("&nbsp;", $checkboxs);
break;
case "status":
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("BoardConfig.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, $attributes);
break;
case 'updated_at':
case 'created_at':
return form_input($field, $value, [...$attributes, 'class' => 'calender']);
break;
case 'passwd':
return sprintf(
"%s %s %s",
form_password($field, DEFAULTS['EMPTY'], [...$attributes]),
lang("BoardConfig.label.confirmpassword"),
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
);
break;
case 'head':
case 'tail':
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
return form_upload($field);
break;
case 'name':
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
default:
return form_input($field, $value, [...$attributes]);
break;
}
} //
function getFieldView_BoardConfigHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
{
$value = $entity->$field ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'name':
return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
break;
case 'upload_file':
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
break;
case 'updated_at':
case 'created_at':
return isset($value) ? str_split($value, 10)[0] : "";
break;
case 'head':
case 'tail':
return html_entity_decode($value);
break;
default:
return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
break;
}
} //
function getFieldFilter_BoardConfigHelper($field, $value, array $fieldFormOptions, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'isaccess':
case 'isread':
case 'iswrite':
case 'isreply':
case 'isupload':
case 'isdownload':
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("BoardConfig.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
break;
default:
return getFieldForm_BoardConfigHelper($field, $value, $fieldFormOptions, $attributes);
break;
}
} //
function getFieldIndex_Column_BoardConfigHelper($field, $order_field, $order_value, array $attributes = array())
{
$label = lang("BoardConfig.label.{$field}");
$label = $field == $order_field ? sprintf('%s <i class="fa fa-arrow-%s"></i>', $label, $order_value == 'ASC' ? "up" : "down") : $label;
$order_value = $order_value == 'DESC' ? "ASC" : "DESC";
return anchor(current_url() . "?order_field={$field}&order_value={$order_value}", $label, [...$attributes]);
} //
function getFieldIndex_Row_BoardConfigHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
{
switch ($field) {
default:
return getFieldView_BoardConfigHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
break;
}
} //
function getFieldIndex_Row_BoardConfigHelper_Admin($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
{
switch ($field) {
default:
if (in_array($field, $fieldFilters)) {
$attributes["onChange"] = sprintf('location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value', current_url(), $entity->getPrimaryKey(), $field, $field);
return getFieldForm_BoardConfigHelper($field, $entity->$field, $fieldFormOptions, $attributes);
}
return getFieldIndex_Row_BoardConfigHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
break;
}
} //

View File

@ -14,10 +14,21 @@ function getFieldLabel_CategoryHelper($field, array $fieldRules, array $attribut
//header.php에서 getFieldForm_Helper사용
function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, array $attributes = array())
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case "user_uid":
case 'isaccess':
case 'isread':
case 'iswrite':
case 'isreply':
case 'isupload':
case 'isdownload':
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
// return form_multiselect($field, $fieldFormOptions[$field], $value, [...$attributes]);
// foreach ($fieldFormOptions[$field] as $key => $label) {
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : explode(DEFAULTS['DELIMITER_ROLE'], $value)), $attributes) . $label;
// }
// return implode("&nbsp;", $checkboxs);
break;
case "status":
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
@ -37,12 +48,17 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar
break;
case 'head':
case 'tail':
case 'content':
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
break;
case 'upload_file':
return form_upload($field);
break;
case 'name':
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
case 'linkurl':
return form_input($field, $value, [...$attributes, "placeholder" => "예)/front/board", "style" => "width:100%; ::placeholder{ color:silver; opacity: 1; }"]);
break;
default:
return form_input($field, $value, [...$attributes]);
break;
@ -72,18 +88,17 @@ function getFieldView_CategoryHelper($field, $entity, array $fieldFilters, array
)
);
break;
case 'head':
case 'tail':
case 'content':
return html_entity_decode($value);
break;
case 'upload_file':
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELLIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
break;
case 'updated_at':
case 'created_at':
return isset($value) ? str_split($value, 10)[0] : "";
break;
case 'head':
case 'tail':
return html_entity_decode($value);
break;
default:
return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
break;
@ -94,6 +109,15 @@ function getFieldFilter_CategoryHelper($field, $value, array $fieldFormOptions,
{
$value = $value ?: DEFAULTS['EMPTY'];
switch ($field) {
case 'isaccess':
case 'isread':
case 'iswrite':
case 'isreply':
case 'isupload':
case 'isdownload':
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
break;
default:
return getFieldForm_CategoryHelper($field, $value, $fieldFormOptions, $attributes);
break;

View File

@ -6,7 +6,7 @@ return [
'grpno' => "그룹번호",
'grpord' => "부모번호",
'grpdpt' => "그룸Depth",
'board_config_uid' => "설정",
'category_uid' => "범주",
'user_uid' => "작성자",
'title' => "제목",
'content' => "내용",

View File

@ -1,32 +0,0 @@
<?php
$roles = [
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
];
return [
'title' => "게시판설정 정보",
'label' => [
'uid' => "번호",
'name' => "게시판제목",
'isaccess' => "접속권한",
'isread' => "읽기권한",
'iswrite' => "쓰기권한",
'isreply' => "답변권한",
'isupload' => "Upload권한",
'isdownload' => "Download권한",
'head' => "머리글",
'tail' => "꼬리글",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일"
],
"ISACCESS" => $roles,
"ISREAD" => $roles,
"ISWRITE" => $roles,
"ISREPLY" => $roles,
"ISUPLOAD" => $roles,
"ISDOWNLOAD" => $roles,
"STATUS" => $roles,
'STATUS' => ['use' => '사용', 'unuse' => '사용않함'],
];

View File

@ -1,17 +1,33 @@
<?php
$roles = [
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
];
return [
'title' => "Category 정보",
'title' => "범주 정보",
'label' => [
'uid' => "번호",
'grpno' => "그룹번호",
'grpord' => "부모번호",
'grpdpt' => "그룸Depth",
'name' => "제목",
'name' => "범주제목",
'linkurl' => "연결URL",
'isaccess' => "접속권한",
'isread' => "읽기권한",
'iswrite' => "쓰기권한",
'isreply' => "답변권한",
'isupload' => "Upload권한",
'isdownload' => "Download권한",
'head' => "머리글",
'tail' => "꼬리글",
'status' => "상태",
'updated_at' => "수정일",
'created_at' => "작성일"
],
"ISACCESS" => $roles,
"ISREAD" => $roles,
"ISWRITE" => $roles,
"ISREPLY" => $roles,
"ISUPLOAD" => $roles,
"ISDOWNLOAD" => $roles,
"STATUS" => $roles,
'STATUS' => ['use' => '사용', 'unuse' => '사용않함'],
];

View File

@ -1,121 +0,0 @@
<?php
namespace App\Models;
use App\Entities\BoardConfigEntity;
class BoardConfigModel extends BaseModel
{
protected $table = "tw_board_config";
protected $useAutoIncrement = false;
protected $returnType = BoardConfigEntity::class;
public function __construct()
{
parent::__construct('BoardConfig');
$this->allowedFields = [
...$this->allowedFields,
'name', "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"head", "tail", "status"
];
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
}
public function getTitleField(): string
{
return 'name';
}
protected function getFieldRule(string $field, array $rules, string $action = ""): array
{
switch ($field) {
case "uid":
$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}]" : "";
break;
case $this->getTitleField():
$rules[$field] = "required|trim|string";
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "isaccess":
case "isread":
case "iswrite":
case "isreply":
case "isupload":
case "isdownload":
//아래 Rule은 입력시에는 되는데 수정시에는 않됨 이유를 ?
// $rules[$field] = "required|in_list[master,director,cloudflare,manager,gold,silver,brone,vip,user,guest]";
//아래 Rule은 checkbox를 사용시에는 required만 우선 써야 수정시 validate문제없음
$rules[$field] = "required";
break;
default:
$rules = parent::getFieldRule($field, $rules, $action);
break;
}
return $rules;
}
//Form 선택용 Options Data용
public function getOptions_TEST(array $conditions = array(), $options = array()): array
{
foreach ($this->getEntitys($conditions) as $entity) {
// STATUS가 use가 아닐때 option을 disabled되게 하기위함
if ($entity->getStatus() != DEFAULTS['STATUS']) {
$options[$entity->getPrimaryKey() . "\" disabled=\"disabled"] = $entity->getTitle();
} else {
$options[$entity->getPrimaryKey()] = $entity->getTitle();
}
}
return $options;
}
//Field별 Form Option용
protected function changeFormData(string $action, string $field, array $formDatas, $entity)
{
switch ($field) {
case "isaccess":
case "isread":
case "iswrite":
case "isreply":
case "isupload":
case "isdownload":
case "isaccess":
if (array_key_exists($field, $formDatas) && !is_null($formDatas[$field])) {
$entity->$field = is_array($formDatas[$field]) ? implode(DEFAULTS['DELIMITER_ROLE'], $formDatas[$field]) : $formDatas[$field];
}
break;
case "head":
case "tail":
if (array_key_exists($field, $formDatas) && !is_null($formDatas[$field])) {
$entity->$field = htmlentities($formDatas[$field]);
}
break;
default:
$entity = parent::changeFormData($action, $field, $formDatas, $entity);
break;
}
return $entity;
}
public function getEntity($conditions): BoardConfigEntity
{
return parent::getEntity($conditions);
}
public function create(array $formDatas): BoardConfigEntity
{
return $this->create_process(new BoardConfigEntity(), $formDatas);
}
public function modify(BoardConfigEntity $entity, array $formDatas): BoardConfigEntity
{
return $this->modify_process($entity, $formDatas);
}
//Index관련
public function setIndexWordFilter(string $word)
{
parent::setIndexWordFilter($word);
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
$this->orLike("isaccess", $word, "both"); //befor , after , both
$this->orLike("isread", $word, "both"); //befor , after , both
$this->orLike("iswrite", $word, "both"); //befor , after , both
$this->orLike("isreply", $word, "both"); //befor , after , both
$this->orLike("isupload", $word, "both"); //befor , after , both
$this->orLike("isdownload", $word, "both"); //befor , after , both
}
}

View File

@ -6,7 +6,7 @@ use App\Entities\BoardEntity;
class BoardModel extends BaseHierarchyModel
{
private $_boardconfig_options = null;
private $_category_options = null;
protected $table = "tw_board";
protected $returnType = BoardEntity::class;
public function __construct()
@ -14,7 +14,7 @@ class BoardModel extends BaseHierarchyModel
parent::__construct('Board');
$this->allowedFields = [
...$this->allowedFields,
"board_config_uid",
"category_uid",
"user_uid", 'title', "content",
"passwd", "board_file", "view_cnt", "status"
];
@ -31,8 +31,8 @@ class BoardModel extends BaseHierarchyModel
protected function getFieldRule(string $field, array $rules, string $action = ""): array
{
switch ($field) {
case "board_config_uid":
$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}/]";
case "category_uid":
$rules[$field] = "required|numeric";
break;
case $this->getTitleField():
case "content":
@ -55,11 +55,11 @@ class BoardModel extends BaseHierarchyModel
{
switch ($field) {
case 'board_config_uid':
if (is_null($this->_boardconfig_options)) {
$boardConfigModel = new BoardConfigModel();
$this->_boardconfig_options = $boardConfigModel->getOptions();
if (is_null($this->_category_options)) {
$categoryModel = new CategoryModel();
$this->_category_options = $categoryModel->getOptions();
}
$options = $this->_boardconfig_options;
$options = $this->_category_options;
break;
default:
return parent::getFieldFormOption($field);

View File

@ -6,13 +6,16 @@ use App\Entities\CategoryEntity;
class CategoryModel extends BaseHierarchyModel
{
//BaseHierarchyModel를 확장하면 grpno가 숫자이고, primarykey를 대분류 생성시 copy하여 grpno에 넣고 sorting하므로
protected $table = "tw_category";
protected $returnType = CategoryEntity::class;
public function __construct()
{
parent::__construct('Category');
$this->allowedFields = [...$this->allowedFields, 'name', "head", "tail", "status"];
$this->allowedFields = [
...$this->allowedFields,
'name', "linkurl", "isaccess", "isread", "iswrite", "isreply", "isupload", "isdownload",
"head", "tail", "status"
];
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
}
public function getTitleField(): string
@ -27,11 +30,23 @@ class CategoryModel extends BaseHierarchyModel
{
switch ($field) {
case $this->getTitleField():
$rules[$field] = "required|trim|string";
$rules[$field] = "required|trim|string";
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "head":
case "tail":
$rules[$field] = "if_exist|string";
case "linkurl":
$rules[$field] = "if_exist|trim|string";
$rules[$field] .= $action == "insert" ? "|is_unique[{$this->table}.{$field}]" : "";
break;
case "isaccess":
case "isread":
case "iswrite":
case "isreply":
case "isupload":
case "isdownload":
//아래 Rule은 입력시에는 되는데 수정시에는 않됨 이유를 ?
// $rules[$field] = "required|in_list[master,director,cloudflare,manager,gold,silver,brone,vip,user,guest]";
//아래 Rule은 checkbox를 사용시에는 required만 우선 써야 수정시 validate문제없음
$rules[$field] = "required";
break;
default:
$rules = parent::getFieldRule($field, $rules, $action);
@ -39,13 +54,13 @@ class CategoryModel extends BaseHierarchyModel
}
return $rules;
}
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
{
//대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능)
$old_title = "";
foreach ($this->where($conditions)->orderby("grpno DESC, grporder ASC")->findAll() as $entity) {
if ($entity->getPrimaryKey() == $entity->getHierarchy_No()) {
if ($entity->getHierarchy_Depth() == 1) {
$options[$entity->getTitle()] = [];
$old_title = $entity->getTitle();
} else {
@ -54,12 +69,38 @@ class CategoryModel extends BaseHierarchyModel
}
return $options;
}
//Field별 Form Option용
protected function changeFormData(string $action, string $field, array $formDatas, $entity)
{
switch ($field) {
case "isaccess":
case "isread":
case "iswrite":
case "isreply":
case "isupload":
case "isdownload":
case "isaccess":
if (array_key_exists($field, $formDatas) && !is_null($formDatas[$field])) {
$entity->$field = is_array($formDatas[$field]) ? implode(DEFAULTS['DELIMITER_ROLE'], $formDatas[$field]) : $formDatas[$field];
}
break;
case "head":
case "tail":
if (array_key_exists($field, $formDatas) && !is_null($formDatas[$field])) {
$entity->$field = htmlentities($formDatas[$field]);
}
break;
default:
$entity = parent::changeFormData($action, $field, $formDatas, $entity);
break;
}
return $entity;
}
public function getEntity($conditions): CategoryEntity
{
return parent::getEntity($conditions);
}
public function create(array $formDatas): CategoryEntity
{
return $this->create_process(new CategoryEntity(), $formDatas);
@ -77,8 +118,15 @@ class CategoryModel extends BaseHierarchyModel
public function setIndexWordFilter(string $word)
{
parent::setIndexWordFilter($word);
$this->orLike($this->getTitleField(), $word, "both");
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
$this->orLike("linkurl", $word, "both"); //befor , after , both
$this->orLike("head", $word, "both"); //befor , after , both
$this->orLike("tail", $word, "both"); //befor , after , both
$this->orLike("isaccess", $word, "both"); //befor , after , both
$this->orLike("isread", $word, "both"); //befor , after , both
$this->orLike("iswrite", $word, "both"); //befor , after , both
$this->orLike("isreply", $word, "both"); //befor , after , both
$this->orLike("isupload", $word, "both"); //befor , after , both
$this->orLike("isdownload", $word, "both"); //befor , after , both
}
}

View File

@ -1,45 +0,0 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<div class="content">
<div class="top">
<?= form_open(current_url(), array("method" => "get")) ?>
<ul class="nav">
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_BoardConfigHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
<?= $this->include('templates/admin/index_head'); ?>
</ul>
<?= form_close(); ?>
</div>
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
<table class="table table-bordered table-hover table-striped">
<tr>
<th>번호</th>
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_BoardConfigHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
<th>작업</th>
</tr>
<?php $i = 0; ?>
<?php foreach ($entitys as $entity) : ?>
<tr id="<?= $entity->getPrimaryKey() ?>" <?= $entity->getStatus() != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?> onClick="indexRowCheckBoxToggle(this);">
<td>
<?= form_checkbox(["id" => "checkbox_uid_{$entity->getPrimaryKey()}", "name" => "batchjob_uids[]", "value" => $entity->getPrimaryKey(), "class" => "batchjobuids_checkboxs"]); ?>
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?>
</td>
<?php foreach ($fields as $field) : ?>
<td nowrap><?= getFieldIndex_Row_BoardConfigHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></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 $i++; ?>
<?php endforeach; ?>
</table>
<div class="bottom">
<ul class="nav justify-content-center">
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($batchjobFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_BoardConfigHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?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>
<?= $pagination ?>
</div>
<?= form_close(); ?>
</div>
<?= $this->endSection() ?>

View File

@ -1,21 +0,0 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<div class="content">
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($fields as $field) : ?>
<tr>
<td class="label"><?= getFieldLabel_BoardConfigHelper($field, $fieldRules) ?></td>
<td class="column">
<?= getFieldForm_BoardConfigHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
<?= 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>
</div>
<?= form_close(); ?>
<?= $this->endSection() ?>

View File

@ -1,21 +0,0 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<div class="content">
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($fields as $field) : ?>
<tr>
<td class="label"><?= getFieldLabel_BoardConfigHelper($field, $fieldRules) ?></td>
<td class="column">
<?= getFieldForm_BoardConfigHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
<?= 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>
</div>
<?= form_close(); ?>
<?= $this->endSection() ?>

View File

@ -1,16 +0,0 @@
<?= $this->extend('layouts/admin') ?>
<?= $this->section('content') ?>
<div class="content">
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($fields as $field) : ?>
<tr>
<td class="label"><?= getFieldLabel_BoardConfigHelper($field, $fieldRules) ?></td>
<td class="column">
<?= getFieldView_BoardConfigHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
<?= validation_show_error($field); ?>
</td>
</tr>
<?php endforeach; ?>
</table>
</div>
<?= $this->endSection() ?>

View File

@ -36,7 +36,7 @@
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
<?php foreach ($batchjobFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_CategoryHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?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>
<li class="nav-item"><?= anchor(current_url() . '/insert', '대범주추가', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
</ul>
<?= $pagination ?>
</div>

View File

@ -13,7 +13,7 @@
</tr>
<?php endforeach; ?>
<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>
</table>
</div>

View File

@ -13,7 +13,7 @@
</tr>
<?php endforeach; ?>
<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>
</table>
</div>

View File

@ -13,7 +13,7 @@
</tr>
<?php endforeach; ?>
<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>
</table>
</div>

View File

@ -4,7 +4,7 @@
</h2>
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
<div class="accordion-item">
<h2><a href="/admin/boardconfig"><?= CLASS_ICONS['BOARDCONFIG'] ?>설정 관리</a></h2>
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>범주 관리</a></h2>
</div>
<div class="accordion-item">
<h2><a href="/admin/board"><?= CLASS_ICONS['BOARD'] ?>게시글 관리</a></h2>