servermgrv2 init...
This commit is contained in:
parent
70a6df1d65
commit
b76079e181
@ -1,151 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Entities\BaseEntity;
|
||||
use App\Models\UserModel;
|
||||
|
||||
abstract class BaseBackend
|
||||
{
|
||||
private $_userModel = null;
|
||||
private $_className = null;
|
||||
private $_user_uids = array();
|
||||
protected $_model = null;
|
||||
protected $_session = null;
|
||||
protected function __construct(string $className)
|
||||
{
|
||||
$this->_className = $className;
|
||||
$this->_session = \Config\Services::session();
|
||||
}
|
||||
|
||||
final public function getClassName()
|
||||
{
|
||||
return $this->_className;
|
||||
}
|
||||
|
||||
//User모델
|
||||
final public function getUserModel(): UserModel
|
||||
{
|
||||
return is_null($this->_userModel) ? new UserModel() : $this->_userModel;
|
||||
}
|
||||
//Entity값 가져오기
|
||||
final public function getEntity($uid)
|
||||
{
|
||||
return $this->_model->getEntity([$this->_model->getPrimaryKey() => $uid]);
|
||||
}
|
||||
|
||||
//transaction관련
|
||||
final public function transStart($isTest = false)
|
||||
{
|
||||
$this->_model->transStart($isTest);
|
||||
}
|
||||
final public function transComplete()
|
||||
{
|
||||
$this->_model->transComplete();
|
||||
}
|
||||
final public function transRollback()
|
||||
{
|
||||
$this->_model->transRollback();
|
||||
}
|
||||
|
||||
//초기화
|
||||
final public function getFields(string $action)
|
||||
{
|
||||
return $this->_model->getFields($action);
|
||||
}
|
||||
//TitleField
|
||||
final public function getTitleField()
|
||||
{
|
||||
return $this->_model->getTitleField();
|
||||
}
|
||||
//Field별 Form Rule용
|
||||
final public function getFieldRules(array $fields, string $action)
|
||||
{
|
||||
return $this->_model->getFieldRules($fields, $action);
|
||||
}
|
||||
//Field별 Form Filter용
|
||||
final public function getFieldFilters()
|
||||
{
|
||||
return $this->_model->getFieldFilters();
|
||||
}
|
||||
//Field별 Form BatchFilter용
|
||||
final public function getFieldBatchFilters()
|
||||
{
|
||||
return $this->_model->getFieldBatchFilters();
|
||||
}
|
||||
//Field별 Form Option용
|
||||
public function getFieldFormOption(string $field): array
|
||||
{
|
||||
switch ($field) {
|
||||
case 'user_uid':
|
||||
$options = $this->_user_uids = $this->_user_uids ?: $this->getUserModel()->getFieldFormOptions(['status' => 'use']);
|
||||
break;
|
||||
default:
|
||||
$options = lang($this->_className . '.' . strtoupper($field));
|
||||
break;
|
||||
}
|
||||
if (!is_array($options)) {
|
||||
throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
//Field별 Form Option용
|
||||
final public function getFieldFormOptions(array $fields): array
|
||||
{
|
||||
$fieldFormOptions = array();
|
||||
foreach ($fields as $field) {
|
||||
if (!is_string($field)) {
|
||||
throw new \Exception(__FUNCTION__ . "에서 {$this->_className}의 Field:{$field}가 string 아닙니다.\n" . var_export($fields, true));
|
||||
}
|
||||
$fieldFormOptions[$field] = $this->getFieldFormOption($field);
|
||||
}
|
||||
return $fieldFormOptions;
|
||||
}
|
||||
|
||||
//Insert관련
|
||||
public function insert(array $fieldDatas): BaseEntity
|
||||
{
|
||||
return $this->_model->create($fieldDatas);
|
||||
}
|
||||
//Update관련
|
||||
public function update($entity, array $fieldDatas)
|
||||
{
|
||||
return $this->_model->modify($entity, $fieldDatas);
|
||||
}
|
||||
//Delete 관련
|
||||
public function delete($entity)
|
||||
{
|
||||
if (!$this->_model->delete($entity->getPrimaryKey())) {
|
||||
log_message("error", __FUNCTION__ . "에서 호출:" . $this->_model->getLastQuery());
|
||||
log_message("error", implode("\n", $this->_model->errors()));
|
||||
throw new \Exception(__FUNCTION__ . " 오류 발생.\n" . var_export($this->_model->errors(), true));
|
||||
}
|
||||
}
|
||||
//View 관련
|
||||
public function view($entity)
|
||||
{
|
||||
return $entity;
|
||||
}
|
||||
|
||||
public function setCondition(array $filterFields, $word, $start, $end, $order_field, $order_value)
|
||||
{
|
||||
foreach ($filterFields as $field => $value) {
|
||||
$this->_model->where($field, $value);
|
||||
}
|
||||
if (!is_null($word)) {
|
||||
$this->_model->setIndexWordFilter($word);
|
||||
}
|
||||
if (!is_null($start) && !is_null($end)) {
|
||||
$this->_model->setIndexDateFilter($start, $end);
|
||||
}
|
||||
$this->_model->setIndexOrderBy($order_field, $order_value);
|
||||
}
|
||||
final public function getTotalCount()
|
||||
{
|
||||
return $this->_model->countAllResults();
|
||||
}
|
||||
final public function getFindEntitys(int $page = 0, int $per_page = 0)
|
||||
{
|
||||
return $per_page ? $this->_model->findAll($per_page, $page * $per_page - $per_page) : $this->_model->findAll();
|
||||
}
|
||||
}
|
||||
@ -1,21 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
abstract class BaseHierarchyBackend extends BaseBackend
|
||||
{
|
||||
public function __construct(string $className)
|
||||
{
|
||||
parent::__construct($className);
|
||||
}
|
||||
//ContentField
|
||||
final public function getContentField()
|
||||
{
|
||||
return $this->_model->getContentField();
|
||||
}
|
||||
//Reply관련
|
||||
public function reply($entity, array $fieldDatas)
|
||||
{
|
||||
return $this->_model->reply($entity, $fieldDatas);
|
||||
}
|
||||
}
|
||||
@ -1,47 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Models\BoardConfigModel;
|
||||
use App\Models\BoardModel;
|
||||
|
||||
class BoardBackend extends BaseHierarchyBackend
|
||||
{
|
||||
private $_board_config_uids = null;
|
||||
private $_boardConfigModel = null;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('Board');
|
||||
$this->_model = new BoardModel();
|
||||
}
|
||||
//BoardConfig모델
|
||||
final public function getBoardConfigModel(): BoardConfigModel
|
||||
{
|
||||
return is_null($this->_boardConfigModel) ? new BoardConfigModel() : $this->_boardConfigModel;
|
||||
}
|
||||
|
||||
//Field별 Form Option용
|
||||
public function getFieldFormOption(string $field): array
|
||||
{
|
||||
switch ($field) {
|
||||
case 'board_config_uid':
|
||||
$options = $this->_board_config_uids = $this->_board_config_uids ?: $this->getBoardConfigModel()->getFieldFormOptions(['status' => 'use']);
|
||||
break;
|
||||
default:
|
||||
return parent::getFieldFormOption($field);
|
||||
break;
|
||||
}
|
||||
if (!is_array($options)) {
|
||||
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
|
||||
}
|
||||
return $options;
|
||||
}
|
||||
|
||||
//View관련
|
||||
public function view($entity)
|
||||
{
|
||||
//view_cnt에 추가하기위함
|
||||
$this->_model->increaseViewCount($entity->getPrimaryKey());
|
||||
return parent::view($entity);
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Models\BoardConfigModel;
|
||||
|
||||
class BoardConfigBackend extends BaseBackend
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('BoardConfig');
|
||||
$this->_model = new BoardConfigModel();
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Models\HPILOModel;
|
||||
use App\Entities\HPILOEntity;
|
||||
|
||||
class HPILOBackend extends BaseBackend
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('HPILO');
|
||||
$this->_model = new HPILOModel();
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Models\UserModel;
|
||||
|
||||
class UserBackend extends BaseBackend
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('User');
|
||||
$this->_model = new UserModel();
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Backend;
|
||||
|
||||
use App\Models\UserSNSModel;
|
||||
|
||||
class UserSNSBackend extends BaseBackend
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct('UserSNS');
|
||||
$this->_model = new UserSNSModel();
|
||||
}
|
||||
}
|
||||
@ -9,7 +9,7 @@
|
||||
</ul>
|
||||
<?= form_close(); ?>
|
||||
</div>
|
||||
<?= form_open(current_url() . '/batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<?= form_open(current_url() . 'batchjob', $forms['attributes'], $forms['hiddens']) ?>
|
||||
<table class="table table-bordered table-hover table-striped">
|
||||
<tr>
|
||||
<th>번호</th>
|
||||
@ -21,12 +21,12 @@
|
||||
<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(), $total_count - (($page - 1) * $per_page + $i), ["target" => "_self"]) ?>
|
||||
</td>
|
||||
<?php foreach ($fields as $field) : ?>
|
||||
<td nowrap><?= getFieldIndex_Row_HPILOHelper($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>
|
||||
<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; ?>
|
||||
@ -36,7 +36,7 @@
|
||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||
<?php foreach ($batchjobFilters as $field) : ?><li class="nav-item"><?= getFieldFilter_HPILOHelper($field, DEFAULTS['EMPTY'], $fieldFormOptions) ?></li><?php endforeach; ?>
|
||||
<li class="nav-item"><?= form_submit('', '일괄처리', array("class" => "btn btn-outline btn-warning")); ?></li>
|
||||
<li class="nav-item"><?= anchor(current_url() . '/insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
|
||||
<li class="nav-item"><?= anchor(current_url() . 'insert', '입력', ["class" => "btn btn-sm btn-primary btn-circle", "target" => "_self"]) ?></li>
|
||||
</ul>
|
||||
<?= $pagination ?>
|
||||
</div>
|
||||
|
||||
@ -1,5 +0,0 @@
|
||||
<div style="text-align:right; margin-top:10px; margin-bottom:5px;">
|
||||
<i class="fa fa-plus text-danger" style="padding-left:5px; padding-right:5px;"></i><a href="/">HOME</a>
|
||||
<i class="fa fa-angle-right" style="padding-left:5px; padding-right:5px;"></i><a href="<?php echo $parentCategory->url ?>"><?php echo $language == LANGUAGE_JAPAN ? $parentCategory->title_japanese:$parentCategory->title ?></a>
|
||||
<i class="fa fa-angle-right" style="padding-left:5px; padding-right:5px;"></i><span style="font-weight:bold;"><?php echo $language == LANGUAGE_JAPAN ? $currentCategory->title_japanese:$currentCategory->title ?></span>
|
||||
</div>
|
||||
@ -1,8 +0,0 @@
|
||||
<!-- SITEBOARD LEFT BANNER 시작 -->
|
||||
<script src="/js/ScrollToFixed-master/jquery-scrolltofixed-min.js" type="text/javascript"></script>
|
||||
<script src="/js/front/subpage_fixed_left_banner.js" type="text/javascript"></script>
|
||||
<div id="subpage_fixed_left_banner">
|
||||
<div style="margin-top:30px;"><a href="/sitecontent/?sitecategory=44"><img src="left_banner_1.png"></a></div>
|
||||
<div style="margin-top:20px;"><a href="javascript://" onclick="window.open('<?php echo CHATTING_URL?>','chat','width=500, height=500')" onfocus="this.blur()"><img src="left_banner_2.png"></a></div>
|
||||
</div>
|
||||
<!-- SITEBOARD LEFT BANNER 끝 -->
|
||||
@ -1,8 +0,0 @@
|
||||
<!-- SITECMS LEFT BANNER 시작 -->
|
||||
<script src="/js/ScrollToFixed-master/jquery-scrolltofixed-min.js" type="text/javascript"></script>
|
||||
<script src="/js/front/subpage_fixed_left_banner.js" type="text/javascript"></script>
|
||||
<div id="subpage_fixed_left_banner">
|
||||
<div style="margin-top:30px;"><a href="/sitecontent/?sitecategory=44"><img src="left_banner_1.png"></a></div>
|
||||
<div style="margin-top:20px;"><a href="javascript://" onclick="window.open('<?php echo CHATTING_URL?>','chat','width=500, height=500')" onfocus="this.blur()"><img src="left_banner_2.png"></a></div>
|
||||
</div>
|
||||
<!-- SITECMS LEFT BANNER 끝 -->
|
||||
@ -1,13 +0,0 @@
|
||||
<!-- layout_content Top Logo 시작 -->
|
||||
<div style="position:relative;">
|
||||
<a href="/"><img src="logo.png"/></a>
|
||||
<img src="logo_side.png"/>
|
||||
<div style="position:absolute; with:700px; top:50px; left:620px;">
|
||||
<a href="/"><img src="main_link_home.png"/></a>
|
||||
<a href="mailto:idc@idcjp.jp"><img src="main_link_contact.png"/></a>
|
||||
<a href="javascript:bookmarksite('IDC-JP', 'http://www.idcjp.jp')"><img src="main_link_bookmark.png"/></a>
|
||||
<a href="/common/language/locale/korean"><img src="main_link_korea.png"/></a>
|
||||
<a href="/common/language/locale/japanese"><img src="main_link_japan.png"/></a>
|
||||
</div>
|
||||
</div>
|
||||
<!-- layout_content Top Logo 끝-->
|
||||
@ -1,5 +0,0 @@
|
||||
<div id='welcome_left_banner' style="position:absolute; top:150px; left:-215px; text-align:right;">
|
||||
<img src="side_left_title.png">
|
||||
<div style="padding-top:15px;"><a href="/sitecontent/?sitecategory=44"><img src="main_banner_1.png"></a></div>
|
||||
<div style="padding-top:15px;"><a href="javascript://" onclick="window.open('<?php echo CHATTING_URL?>','chat','width=<?php echo SITECHAT_WINDOW_WIDTH ?>, height=<?php echo SITECHAT_WINDOW_HEIGHT?>')" onfocus="this.blur()"><img src="main_banner_2.png"></a></div>
|
||||
</div>
|
||||
@ -1,16 +0,0 @@
|
||||
<div id='partner' style="margin-bottom:5px; padding-top:5px; padding-bottom:5px; border-top:1px solid silver; border-bottom:1px solid silver;">
|
||||
<img src='main_icon_partner.png'>
|
||||
<img src='main_icon_softbank.png'>
|
||||
<img src='main_icon_cisco.png'>
|
||||
<img src='main_icon_lg.png'>
|
||||
<img src='main_icon_hp.png'>
|
||||
<img src='main_icon_dell.png'>
|
||||
<img src='main_icon_ibm.png'>
|
||||
<img src='main_icon_slim.png'>
|
||||
<img src='main_icon_ntt.png'>
|
||||
<img src='main_icon_jstream.png'>
|
||||
<img src='main_icon_corel.png'>
|
||||
<img src='main_icon_kddi.png'>
|
||||
<img src='main_icon_red.png'>
|
||||
<img src='main_icon_yahoobb.png'>
|
||||
</div>
|
||||
@ -1,14 +0,0 @@
|
||||
<div id='welcome_right_banner' style="position:absolute; top:150px; left:10px;">
|
||||
<img src="side_right_title.gif">
|
||||
<div style='padding-top:15px; text-align:center;'>
|
||||
<div style='width: 190px;'>
|
||||
<div style='float: left; width: 90px; height: 73px;'><a href='/sitecontent/?sitecategory=50'><img src='main_icon_1.png' border=0></a></div>
|
||||
<div style='float: left; width: 100; height: 73px;'><a href='#'><img src='main_icon_2.png' border=0></a></div>
|
||||
<div style='clear: left;'></div>
|
||||
<div style='float: left; width: 90px; height: 83px;'><a href='/sitecontent/?sitecategory=52'><img src='main_icon_3.png' border=0></a></div>
|
||||
<div style='float: left; width: 10px; height:0 83px;'><a href='/sitecontent/?sitecategory=54'><img src='main_icon_4.png' border=0></a></div>
|
||||
<div style='clear: left;'></div>
|
||||
<div style='paddint-top:15px;'><img src='main_icon_ns.png' border=0></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Loading…
Reference in New Issue
Block a user