servermgrv2 init...
This commit is contained in:
parent
2a901a2d98
commit
49d53fb635
@ -154,6 +154,15 @@ define('SESSION_NAMES', [
|
||||
'CART' => 'cart'
|
||||
]);
|
||||
define('AUTH_FIELDS', ['ID' => 'id', 'TITLE' => 'title', 'ROLE' => 'role']);
|
||||
//Category관련 Role Fields
|
||||
define('CATEGORY_ROLE_FIELDS', [
|
||||
'ACCESS' => 'isaccess',
|
||||
'READ' => 'isread',
|
||||
'WRITE' => 'iswrite',
|
||||
'REPLY' => 'isreply',
|
||||
'UPLOAD' => 'isupload',
|
||||
'DOWNLOAD' => 'isdownload',
|
||||
]);
|
||||
|
||||
//인증 관련
|
||||
define('AUTH_ADAPTERS', [
|
||||
@ -212,7 +221,7 @@ define('AUDIOS', [
|
||||
|
||||
//Default값 정의
|
||||
define('DEFAULTS', [
|
||||
'ROLE' => getenv('default.role') ?: "user",
|
||||
'ROLE' => getenv('default.role') ?: "guest",
|
||||
'STATUS' => getenv('default.status') ?: "use",
|
||||
'EMPTY' => getenv('default.empty') ?: "",
|
||||
'PERPAGE' => getenv('default.perpage') ?: 20,
|
||||
|
||||
@ -13,9 +13,7 @@ class BoardController extends AdminController
|
||||
{
|
||||
$this->_model = new BoardModel();
|
||||
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
|
||||
|
||||
@ -13,9 +13,7 @@ class CategoryController extends AdminController
|
||||
{
|
||||
$this->_model = new CategoryModel();
|
||||
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
|
||||
|
||||
@ -14,9 +14,9 @@ class HPILOController extends \App\Controllers\Admin\AdminController
|
||||
private $_adapter = null;
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->_backend = service('hpilo');
|
||||
$this->_model = new HPILOModel();
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewPath .= strtolower($this->_backend->getClassName());
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
}
|
||||
|
||||
private function getAdapter(HPILOEntity $entity)
|
||||
@ -30,6 +30,27 @@ class HPILOController extends \App\Controllers\Admin\AdminController
|
||||
return $this->_adapter;
|
||||
}
|
||||
|
||||
public function getFields(string $action = ""): array
|
||||
{
|
||||
$fields = ['customer', 'ip', 'port', 'id', 'passwd', 'status'];
|
||||
switch ($action) {
|
||||
case "index":
|
||||
case "excel":
|
||||
return ['customer', 'ip', 'port', 'model', 'processor', 'memory', 'health', 'power', 'status', 'created_at'];
|
||||
break;
|
||||
case "view":
|
||||
return ['customer', 'ip', 'port', 'id', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'updated_at', 'created_at'];
|
||||
break;
|
||||
default:
|
||||
return $fields;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function getFieldFilters(array $fields = array()): array
|
||||
{
|
||||
return ["power", "status", ...$fields];
|
||||
}
|
||||
|
||||
//Insert관련
|
||||
protected function insert_validate()
|
||||
{
|
||||
|
||||
@ -13,9 +13,7 @@ class UserController extends AdminController
|
||||
{
|
||||
$this->_model = new UserModel();
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
helper($this->_model->getClassName());
|
||||
}
|
||||
|
||||
//Field별 Form Datas 처리용
|
||||
|
||||
@ -13,9 +13,7 @@ class UserSNSController extends AdminController
|
||||
{
|
||||
$this->_model = new UserSNSModel();
|
||||
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
|
||||
{
|
||||
|
||||
@ -75,7 +75,7 @@ class AuthController extends Controller
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view('auth/login', $this->_viewDatas);
|
||||
return view('auth/login', ['viewDatas' => $this->_viewDatas]);
|
||||
}
|
||||
|
||||
public function signup(string $site)
|
||||
|
||||
@ -37,7 +37,7 @@ abstract class BaseController extends Controller
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $helpers = ['Common'];
|
||||
protected $helpers = ['Common', 'Base'];
|
||||
|
||||
/**
|
||||
* Be sure to declare properties for any property fetch you initialized.
|
||||
@ -62,8 +62,19 @@ abstract class BaseController extends Controller
|
||||
$this->_viewDatas['layout'] = LAYOUTS['empty'];
|
||||
$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 지정
|
||||
$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"]];
|
||||
}
|
||||
}
|
||||
|
||||
abstract public function getFields(string $action): array;
|
||||
@ -137,17 +148,21 @@ abstract class BaseController extends Controller
|
||||
}
|
||||
|
||||
//Insert관련
|
||||
final public function insert_form()
|
||||
protected function insert_form_process()
|
||||
{
|
||||
}
|
||||
public function insert_form()
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$this->insert_form_process();
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/insert', $this->_viewDatas);
|
||||
return view($this->_viewPath . '/insert', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
log_message("error", $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
protected function insert_validate()
|
||||
@ -180,7 +195,7 @@ abstract class BaseController extends Controller
|
||||
$this->insert_validate();
|
||||
$entity = $this->insert_process();
|
||||
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
|
||||
log_message("error", $e->getMessage());
|
||||
@ -192,18 +207,23 @@ abstract class BaseController extends Controller
|
||||
}
|
||||
|
||||
//Update관련
|
||||
final public function update_form($uid)
|
||||
protected function update_form_process($entity)
|
||||
{
|
||||
return $entity;
|
||||
}
|
||||
public function update_form($uid)
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->_viewDatas['entity'] = $this->update_form_process($entity);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
$this->_viewDatas['entity'] = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
return view($this->_viewPath . '/update', $this->_viewDatas);
|
||||
return view($this->_viewPath . '/update', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
log_message("error", $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
protected function update_validate($entity)
|
||||
@ -240,7 +260,7 @@ abstract class BaseController extends Controller
|
||||
$this->update_validate($entity);
|
||||
$entity = $this->update_process($entity);
|
||||
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
|
||||
log_message("error", $e->getMessage());
|
||||
@ -252,23 +272,27 @@ abstract class BaseController extends Controller
|
||||
}
|
||||
|
||||
//Reply관련
|
||||
final public function reply_form($uid)
|
||||
protected function reply_form_process($entity)
|
||||
{
|
||||
$titleField = $this->_model->getTitleField();
|
||||
$entity->$titleField = "RE: " . $entity->$titleField;
|
||||
$contentField = $this->_model->getContentField();
|
||||
$entity->$contentField .= "\n----------------------------------------------\n";
|
||||
return $entity;
|
||||
}
|
||||
public function reply_form($uid)
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
helper(['form']);
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$titleField = $this->_model->getTitleField();
|
||||
$entity->$titleField = "RE: " . $entity->$titleField;
|
||||
$contentField = $this->_model->getContentField();
|
||||
$entity->$contentField .= "\n----------------------------------------------\n";
|
||||
$this->_viewDatas['entity'] = $entity;
|
||||
return view($this->_viewPath . '/reply', $this->_viewDatas);
|
||||
$this->_viewDatas['entity'] = $this->reply_form_process($entity);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/reply', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
log_message("error", $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
protected function reply_validate($entity)
|
||||
@ -288,7 +312,7 @@ abstract class BaseController extends Controller
|
||||
$this->reply_validate($entity);
|
||||
$entity = $this->reply_process($entity);
|
||||
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $e->getMessage();
|
||||
log_message("error", $e->getMessage());
|
||||
@ -317,11 +341,11 @@ abstract class BaseController extends Controller
|
||||
$this->toggle_validate($entity);
|
||||
$entity = $this->toggle_process($entity);
|
||||
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $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']) ?: "/");
|
||||
} finally {
|
||||
$this->_session->setFlashdata("return_message", $msg);
|
||||
}
|
||||
@ -376,7 +400,7 @@ abstract class BaseController extends Controller
|
||||
count($entitys),
|
||||
__FUNCTION__
|
||||
);
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
//Transaction Rollback
|
||||
$this->_model->transRollback();
|
||||
@ -389,7 +413,7 @@ abstract class BaseController extends Controller
|
||||
__FUNCTION__,
|
||||
);
|
||||
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']) ?: "/");
|
||||
} finally {
|
||||
$this->_session->setFlashdata("return_message", $msg);
|
||||
}
|
||||
@ -412,11 +436,11 @@ abstract class BaseController extends Controller
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->delete_process($entity);
|
||||
$msg = "{$this->_viewDatas['title']}에서 {$entity->getTitle()}의 " . __FUNCTION__ . " 완료하였습니다.";
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']));
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/");
|
||||
} catch (\Exception $e) {
|
||||
$msg = "{$this->_viewDatas['title']}에서 " . __FUNCTION__ . " 실패하였습니다.\n" . $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']) ?: "/");
|
||||
} finally {
|
||||
$this->_session->setFlashdata("return_message", $msg);
|
||||
}
|
||||
@ -431,18 +455,21 @@ abstract class BaseController extends Controller
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$entity = $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
$this->_viewDatas['entity'] = $this->view_process($entity);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||
return view($this->_viewPath . '/view', $this->_viewDatas);
|
||||
return view($this->_viewPath . '/view', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
//Index 관련
|
||||
protected function index_process()
|
||||
{
|
||||
}
|
||||
protected function index_setCondition()
|
||||
{
|
||||
//조건절 처리
|
||||
@ -452,12 +479,19 @@ abstract class BaseController extends Controller
|
||||
$filterFields[$field] = $this->request->getVar($field);
|
||||
}
|
||||
}
|
||||
$word = $this->request->getVar('word');
|
||||
$start = $this->request->getVar('start');
|
||||
$end = $this->request->getVar('end');
|
||||
$order_field = $this->request->getVar('order_field');
|
||||
$order_value = $this->request->getVar('order_value');
|
||||
$this->_model->setCondition($filterFields, $word, $start, $end, $order_field, $order_value);
|
||||
$this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
|
||||
$this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
|
||||
$this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
|
||||
$this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'uid';
|
||||
$this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
|
||||
$this->_model->setCondition(
|
||||
$filterFields,
|
||||
$this->_viewDatas['word'],
|
||||
$this->_viewDatas['start'],
|
||||
$this->_viewDatas['end'],
|
||||
$this->_viewDatas['order_field'],
|
||||
$this->_viewDatas['order_value']
|
||||
);
|
||||
}
|
||||
private function index_getPagination($pager_group = 'default', int $segment = 0, $template = 'bootstrap_full'): string
|
||||
{
|
||||
@ -490,23 +524,20 @@ abstract class BaseController extends Controller
|
||||
{
|
||||
try {
|
||||
$this->_viewDatas = $this->init(__FUNCTION__);
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->index_process();
|
||||
foreach ($this->_viewDatas['fieldFilters'] as $field) {
|
||||
$this->_viewDatas[$field] = $this->request->getVar($field) ?: DEFAULTS['EMPTY'];
|
||||
}
|
||||
$this->_viewDatas['word'] = $this->request->getVar('word') ?: '';
|
||||
$this->_viewDatas['start'] = $this->request->getVar('start') ?: '';
|
||||
$this->_viewDatas['end'] = $this->request->getVar('end') ?: '';
|
||||
$this->_viewDatas['order_field'] = $this->request->getVar('order_field') ?: 'uid';
|
||||
$this->_viewDatas['order_value'] = $this->request->getVar('order_value') ?: 'DESC';
|
||||
$this->_viewDatas['page'] = (int)$this->request->getVar('page') ?: 1;
|
||||
$this->_viewDatas['per_page'] = (int)$this->request->getVar('per_page') ?: DEFAULTS['PERPAGE'];
|
||||
$this->_viewDatas['uri'] = $this->request->getUri();
|
||||
//Totalcount 처리
|
||||
$this->index_setCondition();
|
||||
$this->_viewDatas['total_count'] = $this->_model->countAllResults();
|
||||
// echo $this->_model->getLastQuery();
|
||||
// echo "<HR>";
|
||||
// log_message("debug", __METHOD__ . "에서 TotalCount 호출:" . $this->_model->getLastQuery());
|
||||
//Page, Per_page필요부분
|
||||
$this->_viewDatas['page'] = (int)$this->request->getVar('page') ?: 1;
|
||||
$this->_viewDatas['per_page'] = (int)$this->request->getVar('per_page') ?: DEFAULTS['PERPAGE'];
|
||||
$this->_viewDatas['uri'] = $this->request->getUri();
|
||||
//줄수 처리용
|
||||
$this->_viewDatas['pageOptions'] = array("" => "줄수선택");
|
||||
for ($i = 10; $i <= $this->_viewDatas['total_count'] + $this->_viewDatas['per_page']; $i += 10) {
|
||||
@ -519,10 +550,13 @@ abstract class BaseController extends Controller
|
||||
// echo $this->_model->getLastQuery();
|
||||
// log_message("debug", __METHOD__ . "에서 findAll 호출:" . $this->_model->getLastQuery());
|
||||
//setting return_url to session flashdata
|
||||
helper(['form']);
|
||||
$this->_viewDatas['forms'] = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||
$this->_session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . '?' . $this->request->getUri()->getQuery() ?: "");
|
||||
return view($this->_viewPath . '/index', $this->_viewDatas);
|
||||
return view($this->_viewPath . '/index', ['viewDatas' => $this->_viewDatas]);
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->back()->with('return_message', $e->getMessage());
|
||||
return alert_CommonHelper($e->getMessage(), "back");
|
||||
// return redirect()->back()->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@ -569,7 +603,7 @@ abstract class BaseController extends Controller
|
||||
// return readfile(PATHS['EXCEL'] . '/' . $fileName);
|
||||
return $writer->save('php://output');
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
//File Download관련
|
||||
@ -586,7 +620,7 @@ abstract class BaseController extends Controller
|
||||
}
|
||||
return $this->response->download(WRITEPATH . PATHS['UPLOAD'] . "/" . $filename, null)->setFileName(date("YmdHms") . '_' . $origin_filename);
|
||||
} catch (\Exception $e) {
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']))->with('return_message', $e->getMessage());
|
||||
return redirect()->to($this->_session->getFlashdata(SESSION_NAMES['RETURN_URL']) ?: "/")->with('return_message', $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,19 +3,25 @@
|
||||
namespace App\Controllers\Front;
|
||||
|
||||
use App\Models\BoardModel;
|
||||
use App\Models\CategoryModel;
|
||||
use CodeIgniter\HTTP\RequestInterface;
|
||||
use CodeIgniter\HTTP\ResponseInterface;
|
||||
use Psr\Log\LoggerInterface;
|
||||
|
||||
class BoardController extends FrontController
|
||||
{
|
||||
private $_category_uid = null;
|
||||
private $_categoryModel = null;
|
||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||
{
|
||||
$this->_model = new BoardModel($this->getFields());
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
helper($this->_model->getClassName());
|
||||
}
|
||||
|
||||
private function getCategoryModel(): CategoryModel
|
||||
{
|
||||
return $this->_categoryModel = $this->_categoryModel ?: new CategoryModel();
|
||||
}
|
||||
|
||||
public function getFields(string $action = ""): array
|
||||
@ -60,10 +66,137 @@ class BoardController extends FrontController
|
||||
return $this->_viewDatas['fieldDatas'];
|
||||
}
|
||||
|
||||
//Insert관련
|
||||
protected function insert_form_process()
|
||||
{
|
||||
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
|
||||
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['WRITE']
|
||||
)) {
|
||||
throw new \Exception("고객님은 쓰기권한이 없습니다.");
|
||||
}
|
||||
return parent::insert_form();
|
||||
}
|
||||
protected function insert_process()
|
||||
{
|
||||
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
|
||||
//사용자가 Category에서 해당 게시판의 WRITE권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['WRITE']
|
||||
)) {
|
||||
throw new \Exception("고객님은 쓰기권한이 없습니다.");
|
||||
}
|
||||
return parent::insert();
|
||||
}
|
||||
|
||||
//Update관련
|
||||
protected function update_form_process($entity)
|
||||
{
|
||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||
}
|
||||
return parent::update_form_process($entity);
|
||||
}
|
||||
protected function update_process($entity)
|
||||
{
|
||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 수정을 시도방지용
|
||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||
}
|
||||
return parent::update_process($entity);
|
||||
}
|
||||
//Reply관련
|
||||
protected function reply_form_process($entity)
|
||||
{
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
|
||||
[$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
|
||||
);
|
||||
// echo var_export(isRole_CommonHelper(
|
||||
// $this->_viewDatas['currentRoles'],
|
||||
// $this->_viewDatas['category'],
|
||||
// CATEGORY_ROLE_FIELDS['REPLY']
|
||||
// ), true);
|
||||
// exit;
|
||||
//사용자가 Category에서 해당 게시판의 REPLY권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['REPLY']
|
||||
)) {
|
||||
throw new \Exception("고객님은 답변권한이 없습니다.");
|
||||
}
|
||||
return parent::reply_form_process($entity);
|
||||
}
|
||||
protected function reply_process($entity)
|
||||
{
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
|
||||
[$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
|
||||
);
|
||||
//사용자가 Category에서 해당 게시판의 REPLY권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['REPLY']
|
||||
)) {
|
||||
throw new \Exception("고객님은 답변권한이 없습니다.");
|
||||
}
|
||||
return parent::reply_process($entity);
|
||||
}
|
||||
//Delete 관련
|
||||
protected function delete_process($entity)
|
||||
{
|
||||
//본인이 작성한글인지 최종확인용 정상접속이 아닌 위회해서 삭제 시도 방지용
|
||||
if (!$this->_viewDatas[SESSION_NAMES['ISLOGIN']] || $entity->getUser_Uid() == $this->_viewDatas['auth'][AUTH_FIELDS['ID']]) {
|
||||
throw new \Exception("작성자 본인글인지 여부가 확인되지 않습니다.");
|
||||
}
|
||||
return parent::delete_process($entity);
|
||||
}
|
||||
//View관련
|
||||
protected function view_process($entity)
|
||||
{
|
||||
$entity = parent::view_process($entity);
|
||||
return $this->_model->addViewCount($entity);
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity(
|
||||
[$this->getCategoryModel()->getPrimaryKey() => $entity->getCategory_Uid()]
|
||||
);
|
||||
//사용자가 Category에서 해당 게시판의 READ권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['READ']
|
||||
)) {
|
||||
throw new \Exception("고객님은 읽기권한이 없습니다.");
|
||||
}
|
||||
//조회수 올리기
|
||||
$this->_model->addViewCount($entity);
|
||||
return parent::view_process($entity);
|
||||
}
|
||||
//Index관련
|
||||
protected function index_process()
|
||||
{
|
||||
$this->_category_uid = $this->request->getVar('category_uid') ?: throw new \Exception("범주를 지정하지 않으셨습니다.");
|
||||
$this->_viewDatas['category'] = $this->getCategoryModel()->getEntity([$this->getCategoryModel()->getPrimaryKey() => $this->_category_uid]);
|
||||
//사용자가 Category에서 해당 게시판의 ACCESS권한이 있는지 확인
|
||||
if (!isRole_CommonHelper(
|
||||
$this->_viewDatas['currentRoles'],
|
||||
$this->_viewDatas['category'],
|
||||
CATEGORY_ROLE_FIELDS['ACCESS']
|
||||
)) {
|
||||
throw new \Exception("고객님은 접속권한이 없습니다.");
|
||||
}
|
||||
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();
|
||||
}
|
||||
}
|
||||
|
||||
@ -13,9 +13,7 @@ class UserController extends FrontController
|
||||
{
|
||||
$this->_model = new UserModel();
|
||||
parent::initController($request, $response, $logger);
|
||||
$this->_viewDatas['title'] = lang($this->_model->getClassName() . '.title');
|
||||
$this->_viewPath .= strtolower($this->_model->getClassName());
|
||||
helper($this->_model->getClassName());
|
||||
}
|
||||
|
||||
//Field별 Form Datas 처리용
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
|
||||
DROP TABLE IF EXISTS servermgr.tw_user;
|
||||
DROP TABLE IF EXISTS baseproject.tw_user;
|
||||
|
||||
CREATE TABLE servermgr.tw_user (
|
||||
CREATE TABLE baseproject.tw_user (
|
||||
uid varchar(36) NOT NULL COMMENT "사용자 UUID",
|
||||
id varchar(30) NOT NULL,
|
||||
passwd varchar(100) NOT NULL,
|
||||
@ -17,11 +17,11 @@ CREATE TABLE servermgr.tw_user (
|
||||
UNIQUE KEY (email)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='사용자 정보';
|
||||
-- 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;
|
||||
DROP TABLE IF EXISTS baseproject.tw_user_profile;
|
||||
|
||||
DROP TABLE IF EXISTS servermgr.tw_user_sns;
|
||||
DROP TABLE IF EXISTS baseproject.tw_user_sns;
|
||||
|
||||
CREATE TABLE servermgr.tw_user_sns (
|
||||
CREATE TABLE baseproject.tw_user_sns (
|
||||
uid int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
|
||||
user_uid varchar(36) NULL COMMENT '사용자 정보',
|
||||
site varchar(20) NOT NULL COMMENT 'Site: GOOGLE,FACEBOOK 등등',
|
||||
@ -38,14 +38,14 @@ CREATE TABLE servermgr.tw_user_sns (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='SNS 로그인 후 정보';
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS servermgr.tw_category;
|
||||
DROP TABLE IF EXISTS baseproject.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 (
|
||||
CREATE TABLE baseproject.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부터시작',
|
||||
@ -66,14 +66,14 @@ CREATE TABLE servermgr.tw_category (
|
||||
PRIMARY KEY (uid)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci COMMENT ='범주';
|
||||
|
||||
DROP TABLE IF EXISTS servermgr.tw_board;
|
||||
DROP TABLE IF EXISTS baseproject.tw_board;
|
||||
-- 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
|
||||
-- 3. 게시물 조회시 작업
|
||||
-- select * from tw_board order by grpno desc,grporder asc
|
||||
CREATE TABLE servermgr.tw_board (
|
||||
CREATE TABLE baseproject.tw_board (
|
||||
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부터시작',
|
||||
|
||||
@ -31,4 +31,11 @@ class CategoryEntity extends BaseHierarchyEntity
|
||||
{
|
||||
return $this->attributes['tail'];
|
||||
}
|
||||
public function getRole($field = 'isaccess')
|
||||
{
|
||||
return array_key_exists(
|
||||
$field,
|
||||
$this->attributes
|
||||
) ? $this->attributes[$field] : DEFAULTS['ROLE'];
|
||||
}
|
||||
}
|
||||
|
||||
@ -15,11 +15,11 @@ class HPILOEntity extends BaseEntity
|
||||
{
|
||||
return $this->attributes['uid'];
|
||||
}
|
||||
public function getTitle()
|
||||
public function getTitle(): string
|
||||
{
|
||||
return $this->attributes['title'];
|
||||
}
|
||||
public function getStatus()
|
||||
public function getStatus(): string
|
||||
{
|
||||
return $this->attributes['status'];
|
||||
}
|
||||
|
||||
@ -1,67 +1,71 @@
|
||||
<?php
|
||||
function getFieldLabel_BoardHelper($field, array $fieldRules, array $attributes = array()): string
|
||||
function getFieldLabel_BoardHelper($field, array $viewDatas): string
|
||||
{
|
||||
$attributes = [];
|
||||
switch ($field) {
|
||||
default:
|
||||
if (strpos($fieldRules[$field], 'required') !== false) {
|
||||
array_push($attributes, 'style="color:red";');
|
||||
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||
$attributes = ['style="color:red";'];
|
||||
}
|
||||
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("Board.label.{$field}"));
|
||||
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//header.php에서 getFieldForm_Helper사용
|
||||
function getFieldForm_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldForm_BoardHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case "category_uid":
|
||||
case "user_uid":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-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"]);
|
||||
break;
|
||||
case "status":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Board.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']);
|
||||
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'], [...$attributes]),
|
||||
lang("Board.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
|
||||
form_password($field, DEFAULTS['EMPTY']),
|
||||
lang("{$viewDatas['className']}.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY']),
|
||||
);
|
||||
break;
|
||||
case 'content':
|
||||
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
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 'title':
|
||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||
break;
|
||||
case 'view_cnt':
|
||||
return form_input($field, $value, [...$attributes, 'type' => 'number']);
|
||||
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, [...$attributes]);
|
||||
return form_input($field, $value);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldView_BoardHelper($field, $entity, array $viewDatas)
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'category_uid':
|
||||
$categorys = array();
|
||||
foreach (array_values($fieldFormOptions[$field]) as $category_2depth) {
|
||||
foreach (array_values($viewDatas['fieldFormOptions'][$field]) as $category_2depth) {
|
||||
foreach ($category_2depth as $key => $label) {
|
||||
$categorys[$key] = $label;
|
||||
}
|
||||
@ -69,27 +73,27 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
|
||||
return $categorys[$value];
|
||||
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;\">%s %s</div>",
|
||||
anchor(
|
||||
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
||||
ICONS['REPLY'],
|
||||
[
|
||||
...$attributes,
|
||||
"style" => sprintf("padding-left:%spx", $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH']),
|
||||
"target" => "_self"
|
||||
]
|
||||
),
|
||||
anchor(
|
||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||
$value,
|
||||
["target" => "_self"]
|
||||
)
|
||||
"<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], [...$attributes, "target" => "_self"]);
|
||||
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);
|
||||
@ -102,47 +106,48 @@ function getFieldView_BoardHelper($field, $entity, array $fieldFilters, array $f
|
||||
return $value ? str_split($value, 10)[0] : "";
|
||||
break;
|
||||
default:
|
||||
return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
|
||||
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldFilter_BoardHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldFilter_BoardHelper($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_BoardHelper($field, array $viewDatas)
|
||||
{
|
||||
$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;
|
||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_BoardHelper($field, $entity, array $viewDatas): string
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldForm_BoardHelper($field, $value, $fieldFormOptions, $attributes);
|
||||
return getFieldView_BoardHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Column_BoardHelper($field, $order_field, $order_value, array $attributes = array())
|
||||
{
|
||||
$label = lang("Board.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_BoardHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
|
||||
function getFieldIndex_Row_BoardHelper_Admin($field, $entity, array $viewDatas): string
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldView_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_BoardHelper_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_BoardHelper($field, $entity->$field, $fieldFormOptions, $attributes);
|
||||
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_BoardHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||
}
|
||||
return getFieldIndex_Row_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
return getFieldView_BoardHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
@ -1,18 +1,18 @@
|
||||
<?php
|
||||
function getFieldLabel_CategoryHelper($field, array $fieldRules, array $attributes = array()): string
|
||||
function getFieldLabel_CategoryHelper($field, array $viewDatas): string
|
||||
{
|
||||
$attributes = [];
|
||||
switch ($field) {
|
||||
default:
|
||||
if (strpos($fieldRules[$field], 'required') !== false) {
|
||||
array_push($attributes, 'style="color:red";');
|
||||
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||
$attributes = ['style="color:red";'];
|
||||
}
|
||||
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("Category.label.{$field}"));
|
||||
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//header.php에서 getFieldForm_Helper사용
|
||||
function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldForm_CategoryHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
@ -22,131 +22,127 @@ function getFieldForm_CategoryHelper($field, $value, array $fieldFormOptions, ar
|
||||
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(" ", $checkboxs);
|
||||
$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 "status":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("Category.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']);
|
||||
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'], [...$attributes]),
|
||||
lang("Category.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
|
||||
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), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
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 'name':
|
||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||
case 'view_cnt':
|
||||
return form_input($field, $value, ['type' => 'number']);
|
||||
break;
|
||||
default:
|
||||
return form_input($field, $value, [...$attributes]);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_CategoryHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'name':
|
||||
return sprintf(
|
||||
"<div style=\"text-align:left;\">%s %s</div>",
|
||||
anchor(
|
||||
current_url() . '/reply/' . $entity->getPrimaryKey(),
|
||||
ICONS['REPLY'],
|
||||
[
|
||||
...$attributes,
|
||||
"style" => sprintf("padding-left:%spx", $entity->getHierarchy_Depth() * DEFAULTS['HIERARCHY_GRPDEPTH']),
|
||||
"target" => "_self"
|
||||
]
|
||||
),
|
||||
anchor(
|
||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||
$value,
|
||||
["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"]);
|
||||
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 isset($value) ? str_split($value, 10)[0] : "";
|
||||
return form_input($field, $value, ['class' => 'calender']);
|
||||
break;
|
||||
case 'head':
|
||||
case 'tail':
|
||||
default:
|
||||
return form_input($field, $value);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_CategoryHelper($field, $entity, array $viewDatas)
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
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':
|
||||
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, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
|
||||
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldFilter_CategoryHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldFilter_CategoryHelper($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_CategoryHelper($field, array $viewDatas)
|
||||
{
|
||||
$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;
|
||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_CategoryHelper($field, $entity, array $viewDatas): string
|
||||
{
|
||||
$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);
|
||||
return getFieldView_CategoryHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Column_CategoryHelper($field, $order_field, $order_value, array $attributes = array())
|
||||
{
|
||||
$label = lang("Category.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_CategoryHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
|
||||
function getFieldIndex_Row_CategoryHelper_Admin($field, $entity, array $viewDatas): string
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldView_CategoryHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_CategoryHelper_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_CategoryHelper($field, $entity->$field, $fieldFormOptions, $attributes);
|
||||
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_CategoryHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||
}
|
||||
return getFieldIndex_Row_CategoryHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
return getFieldView_CategoryHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
@ -1,4 +1,10 @@
|
||||
<?php
|
||||
//로그인체크 한후 권한체크
|
||||
function isRole_CommonHelper(array $userRoles, $categoryEntity, $roleField = 'isaccess')
|
||||
{
|
||||
return in_array($categoryEntity->getRole($roleField), $userRoles);
|
||||
}
|
||||
|
||||
function getValueByKey_CommonHelper($key, array $attributes)
|
||||
{
|
||||
$options = array();
|
||||
|
||||
@ -1,110 +1,133 @@
|
||||
<?php
|
||||
function getFieldLabel_HPILOHelper($field, array $fieldRules, array $attributes = array()): string
|
||||
function getFieldLabel_HPILOHelper($field, array $viewDatas): string
|
||||
{
|
||||
$attributes = [];
|
||||
switch ($field) {
|
||||
default:
|
||||
if (strpos($fieldRules[$field], 'required') !== false) {
|
||||
array_push($attributes, 'style="color:red";');
|
||||
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||
$attributes = ['style="color:red";'];
|
||||
}
|
||||
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("HPILO.label.{$field}"));
|
||||
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//header.php에서 getFieldForm_Helper사용
|
||||
function getFieldForm_HPILOHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldForm_HPILOHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'power':
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("HPILO.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||
return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes, 'class' => "select-field"]);
|
||||
// foreach ($fieldFormOptions[$field] as $key => $label) {
|
||||
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, is_array($value) ? [...$value] : [$value]), $attributes) . $label;
|
||||
// }
|
||||
// return implode(" ", $checkboxs);
|
||||
// return form_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
|
||||
case "power":
|
||||
$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 'status':
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("HPILO.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||
return form_dropdown($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], $attributes);
|
||||
break;
|
||||
case 'updated_at':
|
||||
case 'created_at':
|
||||
return form_input($field, $value, [...$attributes, 'class' => 'calender']);
|
||||
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'], [...$attributes]),
|
||||
lang("HPILO.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
|
||||
form_password($field, DEFAULTS['EMPTY']),
|
||||
lang("{$viewDatas['className']}.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY']),
|
||||
);
|
||||
break;
|
||||
case 'content':
|
||||
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
case 'head':
|
||||
case 'tail':
|
||||
return form_textarea($field, html_entity_decode($value), ['class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
break;
|
||||
case 'upload_file':
|
||||
case 'HPILO_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, [...$attributes]);
|
||||
return form_input($field, $value);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_HPILOHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldView_HPILOHelper($field, $entity, array $viewDatas)
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'customer':
|
||||
return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
|
||||
case 'title':
|
||||
case 'name':
|
||||
return anchor(
|
||||
current_url() . '/view/' . $entity->getPrimaryKey(),
|
||||
$value,
|
||||
["target" => "_self"]
|
||||
);
|
||||
break;
|
||||
case 'memory':
|
||||
return $value . "GB";
|
||||
break;
|
||||
case 'detail':
|
||||
return nl2br($value);
|
||||
break;
|
||||
case 'HPILO_file':
|
||||
case 'upload_file':
|
||||
return $value == DEFAULTS['EMPTY'] ? DEFAULTS['EMPTY'] : anchor(current_url() . '/download/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode("||", $value)[0], [...$attributes, "target" => "_self"]);
|
||||
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':
|
||||
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, $fieldFilters) ? $fieldFormOptions[$field][$value] : $value;
|
||||
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldFilter_HPILOHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldFilter_HPILOHelper($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_HPILOHelper($field, array $viewDatas)
|
||||
{
|
||||
$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;
|
||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_HPILOHelper($field, $entity, array $viewDatas): string
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldForm_HPILOHelper($field, $value, $fieldFormOptions, $attributes);
|
||||
return getFieldView_HPILOHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Column_HPILOHelper($field, $order_field, $order_value, array $attributes = array())
|
||||
{
|
||||
$label = lang("HPILO.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_HPILOHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
|
||||
function getFieldIndex_Row_HPILOHelper_Admin($field, $entity, array $viewDatas): 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 getFieldFilter_HPILOHelper($field, $entity->$field, $fieldFormOptions, $attributes);
|
||||
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_HPILOHelper($field, $entity->$field, $viewDatas, $attributes);
|
||||
}
|
||||
return getFieldView_HPILOHelper($field, $entity, $fieldFormOptions, $attributes);
|
||||
return getFieldView_HPILOHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
@ -1,112 +1,141 @@
|
||||
<?php
|
||||
function getFieldLabel_UserSNSHelper($field, array $fieldRules, array $attributes = array()): string
|
||||
function getFieldLabel_UserSNSHelper($field, array $viewDatas): string
|
||||
{
|
||||
$attributes = [];
|
||||
switch ($field) {
|
||||
default:
|
||||
if (strpos($fieldRules[$field], 'required') !== false) {
|
||||
array_push($attributes, 'style="color:red";');
|
||||
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||
$attributes = ['style="color:red";'];
|
||||
}
|
||||
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("UserSNS.label.{$field}"));
|
||||
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//header.php에서 getFieldForm_Helper사용
|
||||
function getFieldForm_UserSNSHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldForm_UserSNSHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case "user_uid":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("UserSNS.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
|
||||
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 "status":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("UserSNS.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']);
|
||||
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'], [...$attributes]),
|
||||
lang("UserSNS.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
|
||||
form_password($field, DEFAULTS['EMPTY']),
|
||||
lang("{$viewDatas['className']}.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY']),
|
||||
);
|
||||
break;
|
||||
case 'content':
|
||||
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
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, [...$attributes]);
|
||||
return form_input($field, $value);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_UserSNSHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldView_UserSNSHelper($field, $entity, array $viewDatas)
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'id':
|
||||
return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
|
||||
case 'user_uid':
|
||||
$categorys = array();
|
||||
foreach (array_values($viewDatas['fieldFormOptions'][$field]) as $category_2depth) {
|
||||
foreach ($category_2depth as $key => $label) {
|
||||
$categorys[$key] = $label;
|
||||
}
|
||||
}
|
||||
return $categorys[$value];
|
||||
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/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
|
||||
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':
|
||||
return html_entity_decode($value);
|
||||
break;
|
||||
case 'updated_at':
|
||||
case 'created_at':
|
||||
return isset($value) ? str_split($value, 10)[0] : "";
|
||||
return $value ? str_split($value, 10)[0] : "";
|
||||
break;
|
||||
default:
|
||||
return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
|
||||
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldFilter_UserSNSHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldFilter_UserSNSHelper($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_UserSNSHelper($field, array $viewDatas)
|
||||
{
|
||||
$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;
|
||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_UserSNSHelper($field, $entity, array $viewDatas): string
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldForm_UserSNSHelper($field, $value, $fieldFormOptions, $attributes);
|
||||
return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Column_UserSNSHelper($field, $order_field, $order_value, array $attributes = array())
|
||||
{
|
||||
$label = lang("UserSNS.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_UserSNSHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
|
||||
function getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, array $viewDatas): string
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldView_UserSNSHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_UserSNSHelper_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_UserSNSHelper($field, $entity->$field, $fieldFormOptions, $attributes);
|
||||
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_UserSNSHelper($field, $entity->field, $viewDatas, $attributes);
|
||||
}
|
||||
return getFieldIndex_Row_UserSNSHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
return getFieldView_UserSNSHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
@ -1,127 +1,147 @@
|
||||
<?php
|
||||
function getFieldLabel_UserHelper($field, array $fieldRules, array $attributes = array()): string
|
||||
function getFieldLabel_UserHelper($field, array $viewDatas): string
|
||||
{
|
||||
$attributes = [];
|
||||
switch ($field) {
|
||||
default:
|
||||
if (strpos($fieldRules[$field], 'required') !== false) {
|
||||
array_push($attributes, 'style="color:red";');
|
||||
if (strpos($viewDatas['fieldRules'][$field], 'required') !== false) {
|
||||
$attributes = ['style="color:red";'];
|
||||
}
|
||||
return sprintf("<span %s>%s</span>", implode(" ", [...$attributes]), lang("User.label.{$field}"));
|
||||
return sprintf("<span %s>%s</span>", implode(" ", $attributes), lang("{$viewDatas['className']}.label.{$field}"));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
//header.php에서 getFieldForm_Helper사용
|
||||
function getFieldForm_UserHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldForm_UserHelper($field, $value, array $viewDatas, array $attributes = array())
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'role':
|
||||
// $fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.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;
|
||||
// $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_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
|
||||
foreach ($viewDatas['fieldFormOptions'][$field] as $key => $label) {
|
||||
$checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
||||
}
|
||||
return implode(" ", $checkboxs);
|
||||
break;
|
||||
case "status":
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.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']);
|
||||
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'], [...$attributes]),
|
||||
lang("User.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY'], [...$attributes]),
|
||||
form_password($field, DEFAULTS['EMPTY']),
|
||||
lang("{$viewDatas['className']}.label.confirmpassword"),
|
||||
form_password('confirmpassword', DEFAULTS['EMPTY']),
|
||||
);
|
||||
break;
|
||||
case 'content':
|
||||
return form_textarea($field, html_entity_decode($value), [...$attributes, 'class' => 'editor', 'rows' => '20', 'cols' => '100']);
|
||||
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 'name':
|
||||
return form_input($field, $value, [...$attributes, "placeholder" => "예)홍길동", "style" => "width:60%; ::placeholder{ color:silver; opacity: 1; }"]);
|
||||
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, [...$attributes]);
|
||||
return form_input($field, $value);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldView_UserHelper($field, $entity, array $fieldFilters, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldView_UserHelper($field, $entity, array $viewDatas)
|
||||
{
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'id':
|
||||
return anchor(current_url() . '/view/' . $entity->getPrimaryKey(), $value, [...$attributes, "target" => "_self"]);
|
||||
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/' . $entity->getPrimaryKey(), ICONS['IMAGE_FILE'] . explode(DEFAULTS['DELIMITER_FILE'], $value)[0], [...$attributes, "target" => "_self"]);
|
||||
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':
|
||||
return html_entity_decode($value);
|
||||
break;
|
||||
case 'updated_at':
|
||||
case 'created_at':
|
||||
return $value ? str_split($value, 10)[0] : "";
|
||||
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 'content':
|
||||
return html_entity_decode($value);
|
||||
break;
|
||||
default:
|
||||
return in_array($field, $fieldFilters) && $value ? $fieldFormOptions[$field][$value] : $value;
|
||||
return in_array($field, $viewDatas['fieldFilters']) && $value ? $viewDatas['fieldFormOptions'][$field][$value] : $value;
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldFilter_UserHelper($field, $value, array $fieldFormOptions, array $attributes = array())
|
||||
function getFieldFilter_UserHelper($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_UserHelper($field, array $viewDatas)
|
||||
{
|
||||
$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;
|
||||
$value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
||||
return anchor(current_url() . "?order_field={$field}&order_value={$value}", $label);
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_UserHelper($field, $entity, array $viewDatas): string
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldView_UserHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
function getFieldIndex_Row_UserHelper_Admin($field, $entity, array $viewDatas): string
|
||||
{
|
||||
$value = $value ?: DEFAULTS['EMPTY'];
|
||||
switch ($field) {
|
||||
case 'role':
|
||||
$fieldFormOptions[$field] = [DEFAULTS['EMPTY'] => lang("User.label.{$field}") . " 선택", ...$fieldFormOptions[$field]];
|
||||
return form_dropdown($field, $fieldFormOptions[$field], $value, [...$attributes, 'class' => "select-field"]);
|
||||
break;
|
||||
default:
|
||||
return getFieldForm_UserHelper($field, $value, $fieldFormOptions, $attributes);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Column_UserHelper($field, $order_field, $order_value, array $attributes = array())
|
||||
{
|
||||
$label = lang("User.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_UserHelper($field, $entity, array $fieldFilters, $fieldFormOptions, $attributes = array()): string
|
||||
{
|
||||
switch ($field) {
|
||||
default:
|
||||
return getFieldView_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
|
||||
function getFieldIndex_Row_UserHelper_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_UserHelper($field, $entity->$field, $fieldFormOptions, $attributes);
|
||||
$value = $entity->$field ?: DEFAULTS['EMPTY'];
|
||||
// $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_multiselect($field, $fieldFormOptions[$field], is_array($value) ? [...$value] : [$value], [...$attributes]);
|
||||
foreach ($viewDatas['fieldFormOptions'][$field] as $key => $label) {
|
||||
$checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
||||
}
|
||||
return getFieldIndex_Row_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions, $attributes);
|
||||
return implode(" ", $checkboxs);
|
||||
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_UserHelper($field, $entity->field, $viewDatas, $attributes);
|
||||
}
|
||||
return getFieldView_UserHelper($field, $entity, $viewDatas);
|
||||
break;
|
||||
}
|
||||
} //
|
||||
@ -20,5 +20,5 @@ return [
|
||||
'created_at' => "작성일"
|
||||
],
|
||||
"POWER" => ["On" => "On", "Off" => "Off", "Restart" => "Restart"],
|
||||
"STATUS" => FORM_OPTIONS['STATUS'],
|
||||
'STATUS' => ['use' => '사용', 'unuse' => '사용않함'],
|
||||
];
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
$roles = [
|
||||
'user' => '일반회원', 'vip' => 'VIP회원',
|
||||
'guest' => '비회원', 'user' => '일반회원', 'vip' => 'VIP회원',
|
||||
'bronze' => '일반판매자', 'silver' => '고급판매자', 'gold' => '파워리셀러',
|
||||
'manager' => '관리자', 'cloudflare' => "Cloudflare관리자", 'director' => '감독자', 'master' => "마스터",
|
||||
];
|
||||
|
||||
@ -272,8 +272,10 @@ abstract class BaseModel extends Model
|
||||
}
|
||||
public function setIndexDateFilter($start, $end)
|
||||
{
|
||||
$this->where("created_at >=", $start);
|
||||
$this->where("created_at <=", $end);
|
||||
if ($start !== DEFAULTS['EMPTY'] && $end !== DEFAULTS['EMPTY']) {
|
||||
$this->where("created_at >=", $start);
|
||||
$this->where("created_at <=", $end);
|
||||
}
|
||||
}
|
||||
public function setIndexOrderBy(?string $field, ?string $order)
|
||||
{
|
||||
|
||||
@ -91,9 +91,11 @@ class BoardModel extends BaseHierarchyModel
|
||||
//Index관련
|
||||
public function setIndexWordFilter(string $word)
|
||||
{
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike($this->getTitleField(), $word, "both");
|
||||
$this->orLike("content", $word, "both"); //befor , after , both
|
||||
if ($word !== DEFAULTS['EMPTY']) {
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike($this->getTitleField(), $word, "both");
|
||||
$this->orLike("content", $word, "both"); //befor , after , both
|
||||
}
|
||||
}
|
||||
|
||||
//조회수 올리기
|
||||
|
||||
@ -75,7 +75,6 @@ class CategoryModel extends BaseHierarchyModel
|
||||
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];
|
||||
}
|
||||
@ -114,15 +113,8 @@ class CategoryModel extends BaseHierarchyModel
|
||||
public function setIndexWordFilter(string $word)
|
||||
{
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
||||
$this->orLike($word, "both"); //befor , after , both
|
||||
$this->orLike($this->getTitleField(), $word, "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
|
||||
}
|
||||
}
|
||||
|
||||
@ -10,33 +10,24 @@ class HPILOModel extends BaseModel
|
||||
protected $returnType = HPILOEntity::class;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->allowedFields = [...$this->allowedFields, ...$this->getFields(), 'model', 'processor', 'memory', 'health', 'power', 'detail',];
|
||||
$this->validationRules = [...$this->validationRules, ...$this->getFieldRules($this->allowedFields),];
|
||||
parent::__construct('HPILO');
|
||||
$this->allowedFields = [
|
||||
...$this->allowedFields,
|
||||
'customer', 'ip', 'port', 'id', 'passwd', 'status',
|
||||
'model', 'processor', 'memory', 'health', 'power', 'detail',
|
||||
];
|
||||
$this->validationRules = [
|
||||
...$this->validationRules,
|
||||
...$this->getFieldRules($this->allowedFields),
|
||||
];
|
||||
}
|
||||
public function getTitle(): string
|
||||
public function getTitleField(): string
|
||||
{
|
||||
return 'customer';
|
||||
}
|
||||
public function getFields(string $action = ""): array
|
||||
public function getContentField(): string
|
||||
{
|
||||
$fields = [$this->getTitle(), 'ip', 'port', 'id', 'passwd', 'status'];
|
||||
switch ($action) {
|
||||
case "index":
|
||||
case "excel":
|
||||
return [$this->getTitle(), 'ip', 'port', 'model', 'processor', 'memory', 'health', 'power', 'status', 'created_at'];
|
||||
break;
|
||||
case "view":
|
||||
return [$this->getTitle(), 'ip', 'port', 'id', 'model', 'processor', 'memory', 'health', 'power', 'detail', 'status', 'updated_at', 'created_at'];
|
||||
break;
|
||||
default:
|
||||
return $fields;
|
||||
break;
|
||||
}
|
||||
}
|
||||
public function getFieldFilters(array $fields = array()): array
|
||||
{
|
||||
return ["power", "status", ...$fields];
|
||||
return 'model';
|
||||
}
|
||||
protected function getFieldRule(string $field, array $rules, string $action = ""): array
|
||||
{
|
||||
@ -102,7 +93,9 @@ class HPILOModel extends BaseModel
|
||||
//Index관련
|
||||
public function setIndexWordFilter(string $word)
|
||||
{
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike($this->getTitle(), $word, "both"); //befor , after , both
|
||||
if ($word !== DEFAULTS['EMPTY']) {
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -106,7 +106,7 @@ class UserModel extends BaseModel
|
||||
public function setIndexWordFilter(string $word)
|
||||
{
|
||||
parent::setIndexWordFilter($word);
|
||||
$this->orLike("id", $word, "both");
|
||||
$this->orLike($this->getTitleField(), $word, "both"); //befor , after , both
|
||||
$this->orLike("id", $word, "both");
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,42 +4,42 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_BoardHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/admin/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?></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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_BoardHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_BoardHelper_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 $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_BoardHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?></li>
|
||||
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,13 +1,13 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -4,42 +4,42 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_CategoryHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_CategoryHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/admin/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_CategoryHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_CategoryHelper($field, $viewDatas) ?></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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_CategoryHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_CategoryHelper_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 $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_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>
|
||||
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_CategoryHelper($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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,13 +1,13 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_CategoryHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_CategoryHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_CategoryHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_CategoryHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_CategoryHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_CategoryHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_CategoryHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_CategoryHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_CategoryHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -4,42 +4,42 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_HPILOHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_HPILOHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/admin/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_HPILOHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_HPILOHelper($field, $viewDatas) ?></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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_HPILOHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_HPILOHelper_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 $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_HPILOHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?></li>
|
||||
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_HPILOHelper($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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,13 +1,13 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_HPILOHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_HPILOHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_HPILOHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_HPILOHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_HPILOHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_HPILOHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_HPILOHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -4,42 +4,42 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_UserHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/admin/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?></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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_UserHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_UserHelper_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 $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_UserHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?></li>
|
||||
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_UserHelper($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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,13 +1,13 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_UserHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_UserHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_UserHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_UserHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_UserHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -4,42 +4,42 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_UserSNSHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserSNSHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/admin/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_UserSNSHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserSNSHelper($field, $viewDatas) ?></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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_UserSNSHelper_Admin($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_UserSNSHelper_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 $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_UserSNSHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?></li>
|
||||
<?php foreach ($viewDatas['batchjobFilters'] as $field) : ?><?= getFieldFilter_UserSNSHelper($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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserSNSHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserSNSHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_UserSNSHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_UserSNSHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
<?= $this->section('content') ?>
|
||||
<link href="/css/login.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<div class="login">
|
||||
<?= form_open(url_to('signup'), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(url_to('signup'), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table>
|
||||
<tr>
|
||||
<td class="label">계정</td>
|
||||
@ -11,7 +11,7 @@
|
||||
</td>
|
||||
<td rowspan="2" class="submit"><?= imageSubmit_CommonHelper('/images/common/btn_login.png', ['width' => '57', 'height' => '60']) ?></td>
|
||||
<td rowspan="2">
|
||||
<?php foreach ($login_buttons as $key => $login_button) : ?>
|
||||
<?php foreach ($viewDatas['login_buttons'] as $key => $login_button) : ?>
|
||||
<?= $login_button ?>
|
||||
<?php endforeach ?>
|
||||
</td>
|
||||
|
||||
@ -4,35 +4,50 @@
|
||||
<div class="top">
|
||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||
<ul class="nav">
|
||||
조건검색:<?php foreach ($fieldFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_BoardHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/front/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_BoardHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/front/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_BoardHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
||||
</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);">
|
||||
<?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>
|
||||
<?php if ($session->get(SESSION_NAMES['ISLOGIN']) && $entity->getUser_Uid() == $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']]) : ?>
|
||||
<?= anchor(current_url() . '/update/' . $entity->getPrimaryKey(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?>
|
||||
<!-- 사용자가 자신의 작성한것인지 확인되면 update 가능-->
|
||||
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $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 : ?>
|
||||
<?= $total_count - (($page - 1) * $per_page + $i) ?>
|
||||
<?php endif; ?>
|
||||
<?= $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt) ?>
|
||||
<?php endif ?>
|
||||
</td>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_BoardHelper_Admin($field, $entity, $viewDatas) ?></td>
|
||||
<?php endforeach ?>
|
||||
<td>
|
||||
<!-- 사용자가 자신의 작성한것인지 확인되면 delete 가능-->
|
||||
<?php if ($viewDatas[SESSION_NAMES['ISLOGIN']] && $entity->getUser_Uid() == $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>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?></td>
|
||||
<?php endforeach; ?>
|
||||
</tr>
|
||||
<?php $i++; ?>
|
||||
<?php endforeach; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?php endforeach ?>
|
||||
</table>
|
||||
<div class="bottom">
|
||||
<?= $pagination ?>
|
||||
<ul class="nav justify-content-center">
|
||||
<!-- 사용자가 쓰기권한이 있는지 확인-->
|
||||
<?php if (isRole_CommonHelper($viewDatas['currentRoles'], $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'] ?>
|
||||
</div>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,13 +1,13 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, DEFAULTS['EMPTY']), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($field, DEFAULTS['EMPTY']), $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_BoardHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_BoardHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -1,12 +1,12 @@
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $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) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_BoardHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_BoardHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_BoardHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -1,45 +1,51 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->extend('layouts/front') ?>
|
||||
<?= $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_UserHelper($field, $$field, $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<?= $this->include('templates/admin/index_head'); ?>
|
||||
조건검색:<?php foreach ($viewDatas['fieldFilters'] as $field) : ?><?= getFieldFilter_UserHelper($field, $viewDatas[$field], $viewDatas) ?><?php endforeach ?>
|
||||
<?= $this->include('templates/front/index_head') ?>
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
<?php foreach ($fields as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $order_field, $order_value) ?></th><?php endforeach; ?>
|
||||
<th>작업</th>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?><th><?= getFieldIndex_Column_UserHelper($field, $viewDatas) ?></th><?php endforeach ?>
|
||||
</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);">
|
||||
<?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>
|
||||
<?= 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"]) ?>
|
||||
<!-- 사용자가 자신의 작성한것인지 확인되면 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_Admin($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>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_UserHelper_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; ?>
|
||||
<?php $cnt++ ?>
|
||||
<?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_UserHelper($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>
|
||||
<!-- 사용자가 쓰기권한이 있는지 확인-->
|
||||
<?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>
|
||||
<?= $pagination ?>
|
||||
<?= $viewDatas['pagination'] ?>
|
||||
</div>
|
||||
<?= form_close(); ?>
|
||||
<?= form_close() ?>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
@ -1,19 +1,19 @@
|
||||
<?= $this->extend('layouts/admin') ?>
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<?= form_open_multipart(current_url(), $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldForm_UserHelper($field, old($field, $entity->$field), $fieldFormOptions) ?>
|
||||
<?= getFieldForm_UserHelper($field, old($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>
|
||||
<td valign="bottom" colspan="2"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
@ -2,11 +2,11 @@
|
||||
<?= $this->section('content') ?>
|
||||
<div class="content">
|
||||
<table class="form table table-bordered table-hover table-striped">
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<?php foreach ($viewDatas['fields'] as $field) : ?>
|
||||
<tr>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $fieldRules) ?></td>
|
||||
<td class="label"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></td>
|
||||
<td class="column">
|
||||
<?= getFieldView_UserHelper($field, $entity, $fieldFilters, $fieldFormOptions) ?>
|
||||
<?= getFieldView_UserHelper($field, $viewDatas['entity'], $viewDatas) ?>
|
||||
<?= validation_show_error($field); ?>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@ -5,32 +5,32 @@
|
||||
<base href="/" target="_self" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<?php foreach ($layout['stylesheets'] as $stylesheet) : ?>
|
||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||
<?= $stylesheet ?>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($layout['javascripts'] as $javascript) : ?>
|
||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript) : ?>
|
||||
<?= $javascript ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
<link href="/css/admin.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/admin.js"></script>
|
||||
<link href="/css/front.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<script type="text/javascript" src="/js/front.js"></script>
|
||||
<!-- HTML5 Shim and Respond.js IE8 support of HTML5 elements and media queries -->
|
||||
<!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<title><?= $title ?></title>
|
||||
<title><?= $viewDatas['title'] ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="head" class="row">
|
||||
<?= $this->include($layout['path'] . '/top_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu'); ?>
|
||||
</div>
|
||||
<table id="layout">
|
||||
<tr>
|
||||
<td id="left" valign="top" width="160">
|
||||
<?= $this->include($layout['path'] . '/left_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||
</td>
|
||||
<td id="body" valign="top" width="*">
|
||||
<?= $this->include('templates/admin/header'); ?>
|
||||
@ -38,7 +38,7 @@
|
||||
<?= $this->include('templates/admin/footer'); ?>
|
||||
</td>
|
||||
<td id="right" valign="top" width="50">
|
||||
<?= $this->include($layout['path'] . '/right_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/right_menu'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<script type="text/javascript" src="/js/side_menu.js"></script>
|
||||
<div id="left_menu" class="shadow-lg rounded">
|
||||
<div class="accordion accordion-flush">
|
||||
<?= $this->include($layout['path'] . '/left_menu/base'); ?>
|
||||
<?= $this->include($layout['path'] . '/left_menu/board'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,12 +1,12 @@
|
||||
<link href="/css/admin/member_link.css" media="screen" rel="stylesheet" type="text/css" />
|
||||
<ul class="member-link navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($session->get(SESSION_NAMES['ISLOGIN'])) : ?>
|
||||
<?php if ($isLogin) : ?>
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<i class="fa fa-id-card"></i> <?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
<i class="fa fa-id-card"></i> <?= $auth[AUTH_FIELDS['TITLE']] ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a href="/admin/user/update/<?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><i class="fa fa-cog"></i>내정보수정</a></li>
|
||||
<li><a href="/admin/user/update/<?= $$auth[AUTH_FIELDS['ID']] ?>"><i class="fa fa-cog"></i>내정보수정</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
|
||||
@ -2,13 +2,13 @@
|
||||
<div class="container-fluid">
|
||||
<a href="/admin" class="navbar-brand">BaseProject 관리 Site</a>
|
||||
<div class="input-group custom-search-form" style="width:270px;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/search'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/search'); ?>
|
||||
</div>
|
||||
<div class="input-group custom-search-form" style="width:270px;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/make_password'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/make_password'); ?>
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/member_link'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/member_link'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -1,11 +1,11 @@
|
||||
<ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($session->get(SESSION_NAMES['ISLOGIN'])) : ?>
|
||||
<?php if ($viewDatas['session']->get(SESSION_NAMES['ISLOGIN'])) : ?>
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<?= ICONS['LOGIN'] ?><?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
<?= ICONS['LOGIN'] ?><?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="/admin/user/update/<?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li><a class="dropdown-item" href="/admin/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
<base href="/" target="_self" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<?php foreach ($layout['stylesheets'] as $stylesheet) : ?>
|
||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||
<?= $stylesheet ?>
|
||||
<?php endforeach ?>
|
||||
<?php foreach ($layout['javascripts'] as $javascript) : ?>
|
||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript) : ?>
|
||||
<?= $javascript ?>
|
||||
<?php endforeach ?>
|
||||
|
||||
@ -20,7 +20,7 @@
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<title><?= $title ?></title>
|
||||
<title><?= $viewDatas['title'] ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
@ -5,10 +5,10 @@
|
||||
<base href="/" target="_self" />
|
||||
<meta charset="UTF-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<?php foreach ($layout['stylesheets'] as $stylesheet) : ?>
|
||||
<?php foreach ($viewDatas['layout']['stylesheets'] as $stylesheet) : ?>
|
||||
<?= $stylesheet ?>
|
||||
<?php endforeach; ?>
|
||||
<?php foreach ($layout['javascripts'] as $javascript) : ?>
|
||||
<?php foreach ($viewDatas['layout']['javascripts'] as $javascript) : ?>
|
||||
<?= $javascript ?>
|
||||
<?php endforeach; ?>
|
||||
|
||||
@ -20,26 +20,26 @@
|
||||
<script src="https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js"></script>
|
||||
<script src="https://oss.maxcdn.com/libs/respond.js/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
<title><?= $title ?></title>
|
||||
<title><?= $viewDatas['title'] ?></title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div id="head" class="row">
|
||||
<?= $this->include($layout['path'] . '/top_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu'); ?>
|
||||
</div>
|
||||
<table id="layout">
|
||||
<tr>
|
||||
<td id="left" valign="top" width="160">
|
||||
<?= $this->include($layout['path'] . '/left_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu'); ?>
|
||||
</td>
|
||||
<td id="body" valign="top" width="*">
|
||||
<?= $this->include('templates/front/header'); ?>
|
||||
<?= $this->renderSection('content') ?>
|
||||
<?= $this->include('templates/front/footer'); ?>
|
||||
<?= $this->include($layout['path'] . '/copyright'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/copyright'); ?>
|
||||
</td>
|
||||
<td id="right" valign="top" width="50">
|
||||
<?= $this->include($layout['path'] . '/right_menu'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/right_menu'); ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
<script type="text/javascript" src="/js/side_menu.js"></script>
|
||||
<div id="left_menu" class="shadow-lg rounded">
|
||||
<div class="accordion accordion-flush">
|
||||
<?= $this->include($layout['path'] . '/left_menu/base'); ?>
|
||||
<?= $this->include($layout['path'] . '/left_menu/board'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
|
||||
</div>
|
||||
</div>
|
||||
@ -1,6 +1,6 @@
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/front/board?category=notice"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2>
|
||||
<h2><a href="/front/board?category_uid=3"><?= CLASS_ICONS['BOARD'] ?>공지사항</a></h2>
|
||||
</div>
|
||||
<div class="accordion-item">
|
||||
<h2><a href="/front/board?category=faq"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2>
|
||||
<h2><a href="/front/board?category_uid=4"><?= CLASS_ICONS['BOARD'] ?>FAQ</a></h2>
|
||||
</div>
|
||||
@ -2,13 +2,13 @@
|
||||
<div class="container-fluid">
|
||||
<a href="/admin" class="navbar-brand">BaseProject 관리 Site</a>
|
||||
<div class="input-group custom-search-form" style="width:270px;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/search'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/search'); ?>
|
||||
</div>
|
||||
<div class="input-group custom-search-form" style="width:270px;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/make_password'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/make_password'); ?>
|
||||
</div>
|
||||
<div style="float: right;">
|
||||
<?= $this->include($layout['path'] . '/top_menu/member_link'); ?>
|
||||
<?= $this->include($viewDatas['layout']['path'] . '/top_menu/member_link'); ?>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
@ -1,11 +1,11 @@
|
||||
<ul class="navbar-nav me-auto my-2 my-lg-0 navbar-nav-scroll" style="--bs-scroll-height: 100px;">
|
||||
<li class="nav-item dropdown">
|
||||
<?php if ($session->get(SESSION_NAMES['ISLOGIN'])) : ?>
|
||||
<?php if ($viewDatas['session']->get(SESSION_NAMES['ISLOGIN'])) : ?>
|
||||
<a class="nav-link dropdown-toggle" href="#" role="button" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<?= ICONS['LOGIN'] ?><?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
<?= ICONS['LOGIN'] ?><?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['TITLE']] ?>
|
||||
</a>
|
||||
<ul class="dropdown-menu dropdown-menu-end">
|
||||
<li><a class="dropdown-item" href="/admin/user/update/<?= $session->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li><a class="dropdown-item" href="/admin/user/update/<?= $viewDatas['session']->get(SESSION_NAMES['AUTH'])[AUTH_FIELDS['ID']] ?>"><?= ICONS['SETUP'] ?>수정</a></li>
|
||||
<li>
|
||||
<hr class="dropdown-divider">
|
||||
</li>
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="footer"></div>
|
||||
<?= $session->getFlashdata('return_message') ? alert_CommonHelper($session->getFlashdata('return_message')) : "" ?>
|
||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
//class가 calender인 inputbox용,날짜field용
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<div class="header">
|
||||
<h4><?= $class_icon ?></i><?= $title ?></h4>
|
||||
<h4><?= $viewDatas['class_icon'] ?></i><?= $viewDatas['title'] ?></h4>
|
||||
</div>
|
||||
@ -1,6 +1,6 @@
|
||||
<li class="nav-item">검색어:<?= form_input('word', $word) ?></li>
|
||||
<li class="nav-item">검색일:
|
||||
<?= form_input('start', $start, ["class" => "calender"]) ?><?= form_input('end', $end, ["class" => "calender"]) ?>
|
||||
<?= form_submit('', '검색', array("class" => "btn btn-outline btn-primary")); ?><?= anchor(current_url() . '/excel?' . $uri->getQuery(), '<i class="bi bi-file-excel"></i>', ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
||||
</li>
|
||||
<li class="nav-item">page:<?= $page ?> / total:<?= $total_page ?> <?= form_dropdown('per_page', $pageOptions, $per_page, array('onChange' => 'this.form.submit()')) ?> / 총:<?= $total_count ?></li>
|
||||
<li class="nav-item">검색어:<?= form_input('word', $viewDatas['word']) ?></li>
|
||||
<li class="nav-item">검색일:
|
||||
<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
|
||||
<?= form_submit('', '검색', array("class" => "btn btn-outline btn-primary")); ?><?= anchor(current_url() . '/excel?' . $viewDatas['uri']->getQuery(), '<i class="bi bi-file-excel"></i>', ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
||||
</li>
|
||||
<li class="nav-item">page:<?= $viewDatas['page'] ?> / total:<?= $viewDatas['total_page'] ?> <?= form_dropdown('per_page', $viewDatas['pageOptions'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?> / 총:<?= $viewDatas['total_count'] ?></li>
|
||||
@ -1,2 +1,2 @@
|
||||
<div class="footer"></div>
|
||||
<?= $session->getFlashdata('return_message') ? alert_CommonHelper($session->getFlashdata('return_message')) : "" ?>
|
||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="footer"></div>
|
||||
<?= $session->getFlashdata('return_message') ? alert_CommonHelper($session->getFlashdata('return_message')) : "" ?>
|
||||
<?= $viewDatas['session']->getFlashdata('return_message') ? alert_CommonHelper($viewDatas['session']->getFlashdata('return_message')) : "" ?>
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
//class가 calender인 inputbox용,날짜field용
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
<div class="header">
|
||||
<h4><?= $class_icon ?></i><?= $title ?></h4>
|
||||
<h4><?= $viewDatas['class_icon'] ?></i><?= $viewDatas['title'] ?></h4>
|
||||
</div>
|
||||
@ -1,6 +1,6 @@
|
||||
<li class="nav-item">검색어:<?= form_input('word', $word) ?></li>
|
||||
<li class="nav-item">검색일:
|
||||
<?= form_input('start', $start, ["class" => "calender"]) ?><?= form_input('end', $end, ["class" => "calender"]) ?>
|
||||
<?= form_submit('', '검색', array("class" => "btn btn-outline btn-primary")); ?><?= anchor(current_url() . '/excel?' . $uri->getQuery(), '<i class="bi bi-file-excel"></i>', ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
||||
</li>
|
||||
<li class="nav-item">page:<?= $page ?> / total:<?= $total_page ?> <?= form_dropdown('per_page', $pageOptions, $per_page, array('onChange' => 'this.form.submit()')) ?> / 총:<?= $total_count ?></li>
|
||||
<li class="nav-item">검색어:<?= form_input('word', $viewDatas['word']) ?></li>
|
||||
<li class="nav-item">검색일:
|
||||
<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
|
||||
<?= form_submit('', '검색', array("class" => "btn btn-outline btn-primary")); ?><?= anchor(current_url() . '/excel?' . $viewDatas['uri']->getQuery(), '<i class="bi bi-file-excel"></i>', ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self"]) ?>
|
||||
</li>
|
||||
<li class="nav-item">page:<?= $viewDatas['page'] ?> / total:<?= $viewDatas['total_page'] ?> <?= form_dropdown('per_page', $viewDatas['pageOptions'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?> / 총:<?= $viewDatas['total_count'] ?></li>
|
||||
Loading…
Reference in New Issue
Block a user