cfmgrv4 init...2
This commit is contained in:
parent
c50940aada
commit
9e3ea123ff
@ -224,7 +224,7 @@ define('LAYOUTS', [
|
|||||||
'stylesheets' => [
|
'stylesheets' => [
|
||||||
'<link rel="icon" href="/favicon.ico">',
|
'<link rel="icon" href="/favicon.ico">',
|
||||||
'<link href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">',
|
'<link href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-9ndCyUaIbzAi2FUVXJi0CjmCapSmO7SnpJef0486qhLnuZ2cdeRhO02iuK6FUUVM" crossorigin="anonymous">',
|
||||||
'<link rel="stylesheet" href="/css/style.css" />',
|
'<link rel="stylesheet" href="/css/common/style.css" />',
|
||||||
],
|
],
|
||||||
'javascripts' => [
|
'javascripts' => [
|
||||||
'<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>',
|
'<script src="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js" integrity="sha384-geWF76RCwLtnZ8qwWowPQNguL3RmwHVBC9FhGdlKrxdiJJigb/j/68SIy3Te4Bkz" crossorigin="anonymous"></script>',
|
||||||
@ -253,7 +253,7 @@ define('LAYOUTS', [
|
|||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">',
|
||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
|
||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
|
||||||
'<link rel="stylesheet" href="/css/style.css" />',
|
'<link rel="stylesheet" href="/css/common/style.css" />',
|
||||||
],
|
],
|
||||||
'javascripts' => [
|
'javascripts' => [
|
||||||
'<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
|
'<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
|
||||||
@ -284,7 +284,7 @@ define('LAYOUTS', [
|
|||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">',
|
||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css">',
|
||||||
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
|
'<link rel="stylesheet" href="//cdn.jsdelivr.net/npm/select2-bootstrap-5-theme@1.3.0/dist/select2-bootstrap-5-theme.min.css" />',
|
||||||
'<link rel="stylesheet" href="/css/style.css" />',
|
'<link rel="stylesheet" href="/css/common/style.css" />',
|
||||||
],
|
],
|
||||||
'javascripts' => [
|
'javascripts' => [
|
||||||
'<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
|
'<script src="//cdn.jsdelivr.net/npm/jquery@3.7.0/dist/jquery.min.js"></script>',
|
||||||
|
|||||||
@ -13,7 +13,8 @@ abstract class AdminController extends MVController
|
|||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->layout = "admin";
|
$this->layout = "admin";
|
||||||
$this->view_root .= "admin/";
|
$this->uri_path = "admin/";
|
||||||
$this->action_form = FORMS['IFRAME'];
|
$this->view_path = "admin/";
|
||||||
|
$this->action_form = FORMS['MODAL'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use App\Helpers\Cloudflare\AccountHelper;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
|
||||||
use App\Libraries\Cloudflare\Account;
|
use App\Libraries\Cloudflare\Account;
|
||||||
|
use App\Models\Cloudflare\AccountModel;
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class AccountController extends CloudflareController
|
class AccountController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -20,9 +21,8 @@ class AccountController extends CloudflareController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name = "Account";
|
$this->class_name = "Account";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_path);
|
$this->helper = new AccountHelper();
|
||||||
}
|
}
|
||||||
final protected function getModel(): AccountModel
|
final protected function getModel(): AccountModel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,12 +2,13 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use App\Helpers\Cloudflare\AuthHelper;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
use App\Models\Cloudflare\AuthModel;
|
use App\Models\Cloudflare\AuthModel;
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class AuthController extends CloudflareController
|
class AuthController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -17,9 +18,8 @@ class AuthController extends CloudflareController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Auth";
|
$this->class_name .= "Auth";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_path);
|
$this->helper = new AuthHelper();
|
||||||
}
|
}
|
||||||
final protected function getModel(): AuthModel
|
final protected function getModel(): AuthModel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,15 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
|
||||||
use App\Models\Cloudflare\RecordModel;
|
|
||||||
use App\Models\Cloudflare\AuthModel;
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
|
||||||
use App\Controllers\Admin\AdminController;
|
use App\Controllers\Admin\AdminController;
|
||||||
|
use App\Models\Cloudflare\AccountModel;
|
||||||
|
use App\Models\Cloudflare\AuthModel;
|
||||||
|
use App\Models\Cloudflare\RecordModel;
|
||||||
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
abstract class CloudflareController extends AdminController
|
abstract class CloudflareController extends AdminController
|
||||||
{
|
{
|
||||||
@ -21,8 +21,8 @@ abstract class CloudflareController extends AdminController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_path .= "Cloudflare/";
|
$this->class_path = "Cloudflare/";
|
||||||
$this->view_root .= strtolower($this->class_path);
|
$this->uri_path .= strtolower($this->class_path);
|
||||||
}
|
}
|
||||||
final protected function getAuthModel(): AuthModel
|
final protected function getAuthModel(): AuthModel
|
||||||
{
|
{
|
||||||
@ -59,6 +59,7 @@ abstract class CloudflareController extends AdminController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->sync_process($uid);
|
$this->sync_process($uid);
|
||||||
|
$this->message = "{$this->class_name}: 동기화작업을 완료하였습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", $this->message);
|
log_message("notice", $this->message);
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
||||||
@ -79,6 +80,7 @@ abstract class CloudflareController extends AdminController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->reload_process($uid);
|
$this->reload_process($uid);
|
||||||
|
$this->message = "{$this->class_name}: Reload 작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", $this->message);
|
log_message("notice", $this->message);
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
||||||
|
|||||||
@ -2,13 +2,14 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use App\Helpers\Cloudflare\RecordHelper;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
use App\Models\Cloudflare\RecordModel;
|
|
||||||
use App\Libraries\Cloudflare\Record;
|
use App\Libraries\Cloudflare\Record;
|
||||||
|
use App\Models\Cloudflare\RecordModel;
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class RecordController extends CloudflareController
|
class RecordController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -19,9 +20,8 @@ class RecordController extends CloudflareController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Record";
|
$this->class_name .= "Record";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_path);
|
$this->helper = new RecordHelper();
|
||||||
}
|
}
|
||||||
final protected function getModel(): RecordModel
|
final protected function getModel(): RecordModel
|
||||||
{
|
{
|
||||||
@ -100,7 +100,7 @@ class RecordController extends CloudflareController
|
|||||||
$cnt = 1;
|
$cnt = 1;
|
||||||
foreach ($this->formDatas['hosts'] as $host) {
|
foreach ($this->formDatas['hosts'] as $host) {
|
||||||
//호스트명 형식확인
|
//호스트명 형식확인
|
||||||
if (!isHost_CommonHelper($host)) {
|
if (!$this->helper->isHost($host)) {
|
||||||
throw new \Exception("{$this->_zone_entity->getTitle()}의 {$cnt}번째 {$host} 호스트명 형식 오류");
|
throw new \Exception("{$this->_zone_entity->getTitle()}의 {$cnt}번째 {$host} 호스트명 형식 오류");
|
||||||
}
|
}
|
||||||
$cnt++;
|
$cnt++;
|
||||||
@ -110,7 +110,6 @@ class RecordController extends CloudflareController
|
|||||||
$entity = $this->getMyLibrary()->create($host, $this->formDatas['type'], $this->formDatas['content'], $this->formDatas['proxied']);
|
$entity = $this->getMyLibrary()->create($host, $this->formDatas['type'], $this->formDatas['content'], $this->formDatas['proxied']);
|
||||||
log_message("debug", "Record:{$entity->getTitle()} 생성 작업을 완료하였습니다.");
|
log_message("debug", "Record:{$entity->getTitle()} 생성 작업을 완료하였습니다.");
|
||||||
}
|
}
|
||||||
$this->message = "Record {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
public function create(mixed $zone_uid = false): RedirectResponse|string
|
public function create(mixed $zone_uid = false): RedirectResponse|string
|
||||||
{
|
{
|
||||||
@ -137,7 +136,6 @@ class RecordController extends CloudflareController
|
|||||||
//Socket처리
|
//Socket처리
|
||||||
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
||||||
}
|
}
|
||||||
$this->message = "Record:{$entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
//일괄처리작업
|
//일괄처리작업
|
||||||
public function batcjob(): RedirectResponse
|
public function batcjob(): RedirectResponse
|
||||||
@ -159,7 +157,6 @@ class RecordController extends CloudflareController
|
|||||||
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->entity->getParent());
|
||||||
//Socket처리
|
//Socket처리
|
||||||
$this->getMyLibrary()->sync($this->entity);
|
$this->getMyLibrary()->sync($this->entity);
|
||||||
$this->message = "Record:{$this->entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
public function sync(string $uid): RedirectResponse
|
public function sync(string $uid): RedirectResponse
|
||||||
{
|
{
|
||||||
@ -178,7 +175,6 @@ class RecordController extends CloudflareController
|
|||||||
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->formDatas[$this->getModel()::PARENT]);
|
$this->_zone_entity = $this->getZoneModel()->getEntityByPK($this->formDatas[$this->getModel()::PARENT]);
|
||||||
//Cloudflare 삭제
|
//Cloudflare 삭제
|
||||||
$this->getMyLibrary()->delete($this->entity);
|
$this->getMyLibrary()->delete($this->entity);
|
||||||
$this->message = "Record:{$this->entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
// 리스트
|
// 리스트
|
||||||
public function index(): string
|
public function index(): string
|
||||||
|
|||||||
@ -2,14 +2,15 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Cloudflare;
|
namespace App\Controllers\Admin\Cloudflare;
|
||||||
|
|
||||||
use Psr\Log\LoggerInterface;
|
use App\Helpers\Cloudflare\ZoneHelper;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
|
||||||
use App\Libraries\Cloudflare\Zone;
|
|
||||||
use App\Libraries\Cloudflare\Record;
|
use App\Libraries\Cloudflare\Record;
|
||||||
|
use App\Libraries\Cloudflare\Zone;
|
||||||
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
|
use Psr\Log\LoggerInterface;
|
||||||
|
|
||||||
class ZoneController extends CloudflareController
|
class ZoneController extends CloudflareController
|
||||||
{
|
{
|
||||||
@ -21,9 +22,8 @@ class ZoneController extends CloudflareController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Zone";
|
$this->class_name .= "Zone";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
$this->title = lang("{$this->class_path}.title");
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->helper = new ZoneHelper();
|
||||||
helper($this->class_path);
|
|
||||||
}
|
}
|
||||||
final protected function getModel(): ZoneModel
|
final protected function getModel(): ZoneModel
|
||||||
{
|
{
|
||||||
@ -35,7 +35,6 @@ class ZoneController extends CloudflareController
|
|||||||
final protected function getMyLibrary(): Zone
|
final protected function getMyLibrary(): Zone
|
||||||
{
|
{
|
||||||
if ($this->_myLibrary === null) {
|
if ($this->_myLibrary === null) {
|
||||||
|
|
||||||
$this->_myLibrary = new Zone($this->_account_entity);
|
$this->_myLibrary = new Zone($this->_account_entity);
|
||||||
}
|
}
|
||||||
return $this->_myLibrary;
|
return $this->_myLibrary;
|
||||||
@ -111,14 +110,14 @@ class ZoneController extends CloudflareController
|
|||||||
//데이터검증
|
//데이터검증
|
||||||
//Type이 A형식일경우 IP형태인지 확인
|
//Type이 A형식일경우 IP형태인지 확인
|
||||||
if ($this->formDatas['type'] === 'A') {
|
if ($this->formDatas['type'] === 'A') {
|
||||||
if (!isIPAddress_CommonHelper($this->formDatas['content'], $this->formDatas['type'])) {
|
if (!$this->helper->isIPAddress($this->formDatas['content'], $this->formDatas['type'])) {
|
||||||
throw new \Exception("{$this->_account_entity->getTitle()}의 {$this->formDatas['type']}, {$this->formDatas['content']} 형식 오류[사설IP 않됨]");
|
throw new \Exception("{$this->_account_entity->getTitle()}의 {$this->formDatas['type']}, {$this->formDatas['content']} 형식 오류[사설IP 않됨]");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$cnt = 1;
|
$cnt = 1;
|
||||||
foreach ($this->formDatas['domains'] as $domain) {
|
foreach ($this->formDatas['domains'] as $domain) {
|
||||||
//도메인명 형식확인
|
//도메인명 형식확인
|
||||||
if (!isDomain_CommonHelper($domain)) {
|
if (!$this->helper->isDomain($domain)) {
|
||||||
throw new \Exception("{$this->_account_entity->getTitle()}의 {$cnt}번째 {$domain} 형식 오류");
|
throw new \Exception("{$this->_account_entity->getTitle()}의 {$cnt}번째 {$domain} 형식 오류");
|
||||||
}
|
}
|
||||||
//도메인명이 해당계정의 유일한 도메인인지 확인
|
//도메인명이 해당계정의 유일한 도메인인지 확인
|
||||||
@ -130,7 +129,7 @@ class ZoneController extends CloudflareController
|
|||||||
$cnt = 1;
|
$cnt = 1;
|
||||||
foreach ($this->formDatas['hosts'] as $host) {
|
foreach ($this->formDatas['hosts'] as $host) {
|
||||||
//호스트명 형식확인
|
//호스트명 형식확인
|
||||||
if (!isHost_CommonHelper($host)) {
|
if (!$this->helper->isHost($host)) {
|
||||||
throw new \Exception("{$this->_account_entity->getTitle()}의 {$cnt}번째 {$host} 호스트명 형식 오류");
|
throw new \Exception("{$this->_account_entity->getTitle()}의 {$cnt}번째 {$host} 호스트명 형식 오류");
|
||||||
}
|
}
|
||||||
$cnt++;
|
$cnt++;
|
||||||
@ -153,7 +152,6 @@ class ZoneController extends CloudflareController
|
|||||||
log_message("debug", "Record:{$entity->getTitle()} 작업을 완료하였습니다.");
|
log_message("debug", "Record:{$entity->getTitle()} 작업을 완료하였습니다.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$this->message = "Zone {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
public function create(): RedirectResponse|string
|
public function create(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
@ -175,7 +173,6 @@ class ZoneController extends CloudflareController
|
|||||||
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
|
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
|
||||||
//Socket처리
|
//Socket처리
|
||||||
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
$entity = $this->getMyLibrary()->modify($this->entity, $this->formDatas);
|
||||||
$this->message = "Zone:{$entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
//일괄처리작업
|
//일괄처리작업
|
||||||
public function batcjob(): RedirectResponse
|
public function batcjob(): RedirectResponse
|
||||||
@ -197,7 +194,6 @@ class ZoneController extends CloudflareController
|
|||||||
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
|
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->entity->getParent());
|
||||||
//Socket처리
|
//Socket처리
|
||||||
$this->getMyLibrary()->sync($this->entity);
|
$this->getMyLibrary()->sync($this->entity);
|
||||||
$this->message = "Zone:{$this->entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
public function sync(string $uid): RedirectResponse
|
public function sync(string $uid): RedirectResponse
|
||||||
{
|
{
|
||||||
@ -216,7 +212,6 @@ class ZoneController extends CloudflareController
|
|||||||
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->formDatas[$this->getModel()::PARENT]);
|
$this->_account_entity = $this->getAccountModel()->getEntityByPK($this->formDatas[$this->getModel()::PARENT]);
|
||||||
//Cloudflare 삭제
|
//Cloudflare 삭제
|
||||||
$this->getMyLibrary()->delete($this->entity);
|
$this->getMyLibrary()->delete($this->entity);
|
||||||
$this->message = "Zone:{$this->entity->getTitle()} {$this->action} 작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
// 리스트
|
// 리스트
|
||||||
public function index(): string
|
public function index(): string
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Helpers\MapurlHelper;
|
||||||
use App\Models\MapurlModel;
|
use App\Models\MapurlModel;
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
|
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -18,9 +19,8 @@ class MapurlController extends AdminController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name .= "Mapurl";
|
$this->class_name .= "Mapurl";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_path);
|
$this->helper = new MapurlHelper();
|
||||||
}
|
}
|
||||||
protected function getModel(): MapurlModel
|
protected function getModel(): MapurlModel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -2,9 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin;
|
namespace App\Controllers\Admin;
|
||||||
|
|
||||||
|
use App\Helpers\UserHelper;
|
||||||
use App\Models\UserModel;
|
use App\Models\UserModel;
|
||||||
use CodeIgniter\HTTP\DownloadResponse;
|
|
||||||
|
|
||||||
|
use CodeIgniter\HTTP\DownloadResponse;
|
||||||
use CodeIgniter\HTTP\RedirectResponse;
|
use CodeIgniter\HTTP\RedirectResponse;
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
@ -19,9 +20,8 @@ class UserController extends AdminController
|
|||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->class_name = "User";
|
$this->class_name = "User";
|
||||||
$this->class_path .= $this->class_name;
|
$this->class_path .= $this->class_name;
|
||||||
$this->view_path = strtolower($this->view_root . $this->class_name);
|
|
||||||
$this->title = lang("{$this->class_path}.title");
|
$this->title = lang("{$this->class_path}.title");
|
||||||
helper($this->class_path);
|
$this->helper = new UserHelper();
|
||||||
}
|
}
|
||||||
protected function getModel(): UserModel
|
protected function getModel(): UserModel
|
||||||
{
|
{
|
||||||
|
|||||||
@ -14,7 +14,6 @@ abstract class CommonController extends BaseController
|
|||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->session = service('session');
|
$this->session = service('session');
|
||||||
helper("common");
|
|
||||||
}
|
}
|
||||||
final public function __get($name)
|
final public function __get($name)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -13,7 +13,8 @@ abstract class FrontController extends MVController
|
|||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
$this->layout = "front";
|
$this->layout = "front";
|
||||||
$this->view_root .= "front/";
|
$this->uri_path = "front/";
|
||||||
|
$this->view_path = "front/";
|
||||||
$this->action_form = FORMS['MODAL'];
|
$this->action_form = FORMS['MODAL'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,6 @@ abstract class MVController extends CommonController
|
|||||||
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
public function initController(RequestInterface $request, ResponseInterface $response, LoggerInterface $logger)
|
||||||
{
|
{
|
||||||
parent::initController($request, $response, $logger);
|
parent::initController($request, $response, $logger);
|
||||||
helper('common');
|
|
||||||
$this->session = service('session');
|
$this->session = service('session');
|
||||||
}
|
}
|
||||||
abstract protected function getModel(): mixed;
|
abstract protected function getModel(): mixed;
|
||||||
@ -89,9 +88,7 @@ abstract class MVController extends CommonController
|
|||||||
));
|
));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected function create_form_process(): void
|
protected function create_form_process(): void {}
|
||||||
{
|
|
||||||
}
|
|
||||||
final protected function create_form_procedure(): RedirectResponse|string
|
final protected function create_form_procedure(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@ -100,7 +97,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return view(
|
return view(
|
||||||
$this->view_path . "/create",
|
$this->view_path . "create",
|
||||||
data: ['viewDatas' => $this->getViewDatas()]
|
data: ['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -113,7 +110,6 @@ abstract class MVController extends CommonController
|
|||||||
$this->create_validate($this->action, $this->fields);
|
$this->create_validate($this->action, $this->fields);
|
||||||
$this->formDatas = $this->getFormDatas();
|
$this->formDatas = $this->getFormDatas();
|
||||||
$this->entity = $this->getModel()->create(formDatas: $this->formDatas);
|
$this->entity = $this->getModel()->create(formDatas: $this->formDatas);
|
||||||
$this->message = "{$this->action} 작업이 완료되었습니다.";
|
|
||||||
}
|
}
|
||||||
final protected function create_procedure(): RedirectResponse|string
|
final protected function create_procedure(): RedirectResponse|string
|
||||||
{
|
{
|
||||||
@ -121,6 +117,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->create_process();
|
$this->create_process();
|
||||||
|
$this->message = "{$this->class_name} : 생성작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . $this->message);
|
log_message("notice", __FUNCTION__ . $this->message);
|
||||||
switch ($this->action_form) {
|
switch ($this->action_form) {
|
||||||
@ -172,7 +169,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
$this->session->keepFlashdata(SESSION_NAMES['RETURN_URL']);
|
||||||
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
$this->forms = ['attributes' => ['method' => "post",], 'hiddens' => []];
|
||||||
return view(
|
return view(
|
||||||
$this->view_path . "/modify",
|
$this->view_path . "modify",
|
||||||
data: ['viewDatas' => $this->getViewDatas()]
|
data: ['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
@ -190,7 +187,6 @@ abstract class MVController extends CommonController
|
|||||||
throw new \Exception(__FUNCTION__, " => {$uid} 정보를 찾을수 없습니다.");
|
throw new \Exception(__FUNCTION__, " => {$uid} 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
$this->entity = $this->getModel()->modify($this->entity, $this->formDatas);
|
$this->entity = $this->getModel()->modify($this->entity, $this->formDatas);
|
||||||
$this->message = "{$this->action} 작업이 완료되었습니다.";
|
|
||||||
}
|
}
|
||||||
final protected function modify_procedure(string $uid): RedirectResponse|string
|
final protected function modify_procedure(string $uid): RedirectResponse|string
|
||||||
{
|
{
|
||||||
@ -198,6 +194,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->modify_process($uid);
|
$this->modify_process($uid);
|
||||||
|
$this->message = "{$this->class_name} : 수정작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", __FUNCTION__ . $this->message);
|
log_message("notice", __FUNCTION__ . $this->message);
|
||||||
switch ($this->action_form) {
|
switch ($this->action_form) {
|
||||||
@ -236,6 +233,7 @@ abstract class MVController extends CommonController
|
|||||||
foreach ($uids as $uid) {
|
foreach ($uids as $uid) {
|
||||||
$this->modify_process($uid);
|
$this->modify_process($uid);
|
||||||
}
|
}
|
||||||
|
$this->message = "{$this->class_name} : 일괄처리작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", $this->message);
|
log_message("notice", $this->message);
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
||||||
@ -258,6 +256,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->modify_process($uid);
|
$this->modify_process($uid);
|
||||||
|
$this->message = "{$this->class_name} : Toggle 수정작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", $this->message);
|
log_message("notice", $this->message);
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
||||||
@ -279,7 +278,6 @@ abstract class MVController extends CommonController
|
|||||||
throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
|
throw new \Exception("{$uid} 정보를 찾을수 없습니다.");
|
||||||
}
|
}
|
||||||
$this->entity = $this->getModel()->delete($this->entity->getPK());
|
$this->entity = $this->getModel()->delete($this->entity->getPK());
|
||||||
$this->message = "삭제작업을 완료하였습니다.";
|
|
||||||
}
|
}
|
||||||
final public function delete(string $uid): RedirectResponse
|
final public function delete(string $uid): RedirectResponse
|
||||||
{
|
{
|
||||||
@ -287,6 +285,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->getModel()->transStart();
|
$this->getModel()->transStart();
|
||||||
try {
|
try {
|
||||||
$this->delete_process($uid);
|
$this->delete_process($uid);
|
||||||
|
$this->message = "{$this->class_name} : 삭제작업이 완료되었습니다.";
|
||||||
$this->getModel()->transCommit();
|
$this->getModel()->transCommit();
|
||||||
log_message("notice", $this->message);
|
log_message("notice", $this->message);
|
||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_MSG'], $this->message);
|
||||||
@ -365,7 +364,7 @@ abstract class MVController extends CommonController
|
|||||||
$this->order_value = $this->request->getVar('order_value') ?: DEFAULTS['EMPTY'];
|
$this->order_value = $this->request->getVar('order_value') ?: DEFAULTS['EMPTY'];
|
||||||
$this->getModel()->setList_OrderBy(
|
$this->getModel()->setList_OrderBy(
|
||||||
$this->order_field !== DEFAULTS['EMPTY'] &&
|
$this->order_field !== DEFAULTS['EMPTY'] &&
|
||||||
$this->order_value !== DEFAULTS['EMPTY'] ? "{$this->order_field} {$this->order_value}" : ""
|
$this->order_value !== DEFAULTS['EMPTY'] ? "{$this->order_field} {$this->order_value}" : ""
|
||||||
);
|
);
|
||||||
if ($this->page) {
|
if ($this->page) {
|
||||||
$this->getModel()->limit(
|
$this->getModel()->limit(
|
||||||
@ -395,12 +394,12 @@ abstract class MVController extends CommonController
|
|||||||
$this->session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . ($this->uri->getQuery() ? "?" . $this->uri->getQuery() : ""));
|
$this->session->setFlashdata(SESSION_NAMES['RETURN_URL'], current_url() . ($this->uri->getQuery() ? "?" . $this->uri->getQuery() : ""));
|
||||||
|
|
||||||
return view(
|
return view(
|
||||||
$this->view_path . "/index",
|
$this->view_path . "index",
|
||||||
['viewDatas' => $this->getViewDatas()]
|
['viewDatas' => $this->getViewDatas()]
|
||||||
);
|
);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
return alert_CommonHelper($e->getMessage(), "back");
|
return $this->helper->alert($e->getMessage(), "back");
|
||||||
// return redirect()->back()->with(SESSION_NAMES['RETURN_MSG'], $e->getMessage());
|
// return redirect()->back()->with(SESSION_NAMES['RETURN_MSG'], $e->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -473,7 +472,7 @@ abstract class MVController extends CommonController
|
|||||||
return $this->response->download($full_path, null)->setFileName($file_name);
|
return $this->response->download($full_path, null)->setFileName($file_name);
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
log_message("error", $e->getMessage());
|
log_message("error", $e->getMessage());
|
||||||
return alert_CommonHelper($e->getMessage(), "back");
|
return $this->helper->alert($e->getMessage(), "back");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
112
app/Helpers/Cloudflare/AccountHelper.php
Normal file
112
app/Helpers/Cloudflare/AccountHelper.php
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Cloudflare;
|
||||||
|
|
||||||
|
use App\Helpers\CommonHelper;
|
||||||
|
use App\Models\Cloudflare\AccountModel;
|
||||||
|
|
||||||
|
class AccountHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public $old_parent = "";
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case AccountModel::PARENT:
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field],
|
||||||
|
], isset($viewDatas[AccountModel::PARENT]) ? $viewDatas[AccountModel::PARENT] : $value, [...$extras, 'class' => "select-field"]);
|
||||||
|
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
||||||
|
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
||||||
|
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
||||||
|
// }
|
||||||
|
// return implode(" ", $checkboxs);
|
||||||
|
break;
|
||||||
|
case AccountModel::TITLE:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)test@exmaple.com",
|
||||||
|
"style" =>
|
||||||
|
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'type':
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field],
|
||||||
|
], $value, $extras);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case AccountModel::PARENT:
|
||||||
|
if ($this->old_parent === $viewDatas['entity']->getParent()) {
|
||||||
|
$value = "";
|
||||||
|
} else {
|
||||||
|
// dd($viewDatas['field_options']);
|
||||||
|
$value = anchor(
|
||||||
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self",
|
||||||
|
]
|
||||||
|
) . " <span class=\"label_auth\">" .
|
||||||
|
preg_replace("/(\w+)@(.+)/", "$1", $viewDatas['field_options'][$field][$value])
|
||||||
|
. "</span>";
|
||||||
|
}
|
||||||
|
$this->old_parent = $viewDatas['entity']->getParent();
|
||||||
|
break;
|
||||||
|
case AccountModel::TITLE:
|
||||||
|
$value = anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . 'zone/reload/' . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self",
|
||||||
|
]
|
||||||
|
) . " " .
|
||||||
|
anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . "zone?account_uid=" . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["FLAG"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self",
|
||||||
|
]
|
||||||
|
) . " <span class=\"label_Accounts\">{$value}</span>";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
public function getListButton(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$action = "";
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$action = $viewDatas['cnt'];
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$action = "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,163 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\Cloudflare\AccountModel;
|
|
||||||
|
|
||||||
function getFieldLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
case AccountModel::PARENT:
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_AccountHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case AccountModel::PARENT:
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], isset($viewDatas[AccountModel::PARENT]) ? $viewDatas[AccountModel::PARENT] : $value, [...$extras, 'class' => "select-field"]);
|
|
||||||
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
|
||||||
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
|
||||||
// }
|
|
||||||
// return implode(" ", $checkboxs);
|
|
||||||
break;
|
|
||||||
case AccountModel::TITLE:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)test@exmaple.com",
|
|
||||||
"style" =>
|
|
||||||
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'type':
|
|
||||||
case 'status':
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calener form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" => "width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_AccountHelper(string $field, array $viewDatas, array $extras = [])
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case AccountModel::PARENT:
|
|
||||||
if ($viewDatas['old_auth'] === $viewDatas['entity']->getParent()) {
|
|
||||||
$value = "";
|
|
||||||
} else {
|
|
||||||
// dd($viewDatas['field_options']);
|
|
||||||
$value = anchor(
|
|
||||||
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " <span class=\"label_auth\">" .
|
|
||||||
preg_replace("/(\w+)@(.+)/", "$1", $viewDatas['field_options'][$field][$value])
|
|
||||||
. "</span>";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case AccountModel::TITLE:
|
|
||||||
$value = anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . 'zone/reload/' . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " " .
|
|
||||||
anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . "zone?account_uid=" . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["FLAG"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " <span class=\"label_Accounts\">{$value}</span>";
|
|
||||||
break;
|
|
||||||
case 'category_uid':
|
|
||||||
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
|
|
||||||
foreach ($category_2depths as $key => $depth) {
|
|
||||||
if ($key == $depth) {
|
|
||||||
$value = $depth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
// $value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
// $extras["onChange"] = sprintf(
|
|
||||||
// 'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
// current_url(),
|
|
||||||
// $viewDatas['entity']->getPK(),
|
|
||||||
// $field,
|
|
||||||
// $field
|
|
||||||
// );
|
|
||||||
// $value = getFieldForm_AccountHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
// }
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
function getListLabel_AccountHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_AccountHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string)$viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_AccountHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(['only' => AccountModel::PARENT]);
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'sync':
|
|
||||||
$action = $viewDatas['cnt'];
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$action = "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
60
app/Helpers/Cloudflare/AuthHelper.php
Normal file
60
app/Helpers/Cloudflare/AuthHelper.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Cloudflare;
|
||||||
|
|
||||||
|
use App\Helpers\CommonHelper;
|
||||||
|
use App\Models\Cloudflare\AuthModel;
|
||||||
|
|
||||||
|
class AuthHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case AuthModel::TITLE:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)test@example.com",
|
||||||
|
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case AuthModel::TITLE:
|
||||||
|
$value = anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . 'account/reload/' . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self"
|
||||||
|
]
|
||||||
|
) . " " .
|
||||||
|
anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . "account?auth_uid=" . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["FLAG"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self"
|
||||||
|
]
|
||||||
|
) . " <span class=\"label_Auths\">{$value}</span>";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
}
|
||||||
@ -1,141 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\Cloudflare\AuthModel;
|
|
||||||
|
|
||||||
function getFieldLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_AuthHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case AuthModel::TITLE:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)test@example.com",
|
|
||||||
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'status':
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calender form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" => "width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_AuthHelper(string $field, array $viewDatas, array $extras = [])
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case AuthModel::TITLE:
|
|
||||||
$value = anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . 'account/reload/' . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " " .
|
|
||||||
anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . "account?auth_uid=" . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["FLAG"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " <span class=\"label_Auths\">{$value}</span>";
|
|
||||||
break;
|
|
||||||
case 'category_uid':
|
|
||||||
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
|
|
||||||
foreach ($category_2depths as $key => $depth) {
|
|
||||||
if ($key == $depth) {
|
|
||||||
$value = $depth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
$extras["onChange"] = sprintf(
|
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
current_url(),
|
|
||||||
$viewDatas['entity']->getPK(),
|
|
||||||
$field,
|
|
||||||
$field
|
|
||||||
);
|
|
||||||
$value = getFieldForm_AuthHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
function getListLabel_AuthHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_AuthHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string) $viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_AuthHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action;
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
$pk = $viewDatas['entity']->getPK();
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$pk}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $pk,
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
"checked" => in_array($pk, old("batchjob_uids", []))
|
|
||||||
]);
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$action = $checkbox . getListButtonLabel_CommonHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
13
app/Helpers/Cloudflare/CloudflareHelper.php
Normal file
13
app/Helpers/Cloudflare/CloudflareHelper.php
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Cloudflare;
|
||||||
|
|
||||||
|
use App\Helpers\CommonHelper;
|
||||||
|
|
||||||
|
class CloudflareHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
}
|
||||||
124
app/Helpers/Cloudflare/RecordHelper.php
Normal file
124
app/Helpers/Cloudflare/RecordHelper.php
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Cloudflare;
|
||||||
|
|
||||||
|
use App\Helpers\CommonHelper;
|
||||||
|
use App\Models\Cloudflare\RecordModel;
|
||||||
|
|
||||||
|
class RecordHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public $old_parent = "";
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case RecordModel::PARENT:
|
||||||
|
$form = form_dropdown(
|
||||||
|
$field,
|
||||||
|
[
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field],
|
||||||
|
],
|
||||||
|
isset($viewDatas[RecordModel::PARENT]) ? $viewDatas[RecordModel::PARENT] : $value,
|
||||||
|
[...$extras, 'class' => "select-field"]
|
||||||
|
);
|
||||||
|
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
||||||
|
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
||||||
|
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
||||||
|
// }
|
||||||
|
// return implode(" ", $checkboxs);
|
||||||
|
break;
|
||||||
|
case RecordModel::TITLE: //host
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)www.example.com",
|
||||||
|
"style" =>
|
||||||
|
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'hosts':
|
||||||
|
$form = form_textarea($field, html_entity_decode($value), [
|
||||||
|
'rows' => '5',
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'content':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)123.123.123.123",
|
||||||
|
"style" =>
|
||||||
|
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case "type":
|
||||||
|
case "fixed":
|
||||||
|
case "locked":
|
||||||
|
case "proxied":
|
||||||
|
case "proxiable":
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field],
|
||||||
|
], $value, $extras);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case RecordModel::PARENT:
|
||||||
|
if ($this->old_parent === $viewDatas['entity']->getParent()) {
|
||||||
|
$value = "";
|
||||||
|
} else {
|
||||||
|
$value = anchor(
|
||||||
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self",
|
||||||
|
]
|
||||||
|
) . " " . "<span class=\"label_zones\">{$viewDatas['field_options'][$field][$value]}</span>";
|
||||||
|
}
|
||||||
|
$this->old_parent = $viewDatas['entity']->getParent();
|
||||||
|
break;
|
||||||
|
case RecordModel::TITLE:
|
||||||
|
$url = sprintf("%s/toggle/%s/fixed?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on");
|
||||||
|
$value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? "<span class=\"text-danger\">" . ICONS['LOCK'] . "</span>" : "", $value);
|
||||||
|
$value = anchor($url, $value, ["target" => "_self"]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
|
||||||
|
public function getListRowColor($entity): string
|
||||||
|
{
|
||||||
|
return $entity->locked != 'on' ? 'class="table-danger"' : "";
|
||||||
|
}
|
||||||
|
public function getListLabel(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$label = parent::getListLabel($field, $viewDatas, $extras);
|
||||||
|
switch ($field) {
|
||||||
|
case RecordModel::PARENT:
|
||||||
|
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_zones'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Domains</buttion>";
|
||||||
|
break;
|
||||||
|
case RecordModel::TITLE:
|
||||||
|
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_hosts'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Hosts</buttion>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,186 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\Cloudflare\RecordModel;
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
|
||||||
|
|
||||||
function getFieldLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
case RecordModel::PARENT:
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_RecordHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case RecordModel::PARENT:
|
|
||||||
$form = form_dropdown(
|
|
||||||
$field,
|
|
||||||
[
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
],
|
|
||||||
isset($viewDatas[RecordModel::PARENT]) ? $viewDatas[RecordModel::PARENT] : $value,
|
|
||||||
[...$extras, 'class' => "select-field"]
|
|
||||||
);
|
|
||||||
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
|
||||||
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
|
||||||
// }
|
|
||||||
// return implode(" ", $checkboxs);
|
|
||||||
break;
|
|
||||||
case RecordModel::TITLE: //host
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)www.example.com",
|
|
||||||
"style" =>
|
|
||||||
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'hosts':
|
|
||||||
$form = form_textarea($field, html_entity_decode($value), [
|
|
||||||
'rows' => '5',
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'content':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)123.123.123.123",
|
|
||||||
"style" =>
|
|
||||||
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case "type":
|
|
||||||
case "fixed":
|
|
||||||
case "locked":
|
|
||||||
case "proxied":
|
|
||||||
case "proxiable":
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calender form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" => "width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_RecordHelper(string $field, array $viewDatas, array $extras = [])
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case RecordModel::PARENT:
|
|
||||||
if ($viewDatas['old_zone'] === $viewDatas['entity']->getParent()) {
|
|
||||||
$value = "";
|
|
||||||
} else {
|
|
||||||
$value = anchor(
|
|
||||||
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " " . "<span class=\"label_zones\">{$viewDatas['field_options'][$field][$value]}</span>";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case RecordModel::TITLE:
|
|
||||||
$url = sprintf("%s/toggle/%s/fixed?fixed=%s", current_url(), $viewDatas['entity']->getPK(), $viewDatas['entity']->fixed == 'on' ? "off" : "on");
|
|
||||||
$value = sprintf("%s%s", $viewDatas['entity']->fixed == 'on' ? "<span class=\"text-danger\">" . ICONS['LOCK'] . "</span>" : "", $value);
|
|
||||||
$value = anchor($url, $value, ["target" => "_self"]);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
$extras["onChange"] = sprintf(
|
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
current_url(),
|
|
||||||
$viewDatas['entity']->getPK(),
|
|
||||||
$field,
|
|
||||||
$field
|
|
||||||
);
|
|
||||||
$value = getFieldForm_RecordHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
|
|
||||||
function getListLabel_RecordHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_RecordHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string) $viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
switch ($field) {
|
|
||||||
case RecordModel::PARENT:
|
|
||||||
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_zones'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Domains</buttion>";
|
|
||||||
break;
|
|
||||||
case RecordModel::TITLE:
|
|
||||||
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_hosts'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Hosts</buttion>";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_RecordHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(['only' => RecordModel::PARENT]);
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'sync':
|
|
||||||
$checkbox = "";
|
|
||||||
if ($viewDatas['entity']->type == "A" && $viewDatas['entity']->fixed != 'on') {
|
|
||||||
$pk = $viewDatas['entity']->getPK();
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$pk}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $pk,
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
"checked" => in_array($pk, old("batchjob_uids", []))
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
147
app/Helpers/Cloudflare/ZoneHelper.php
Normal file
147
app/Helpers/Cloudflare/ZoneHelper.php
Normal file
@ -0,0 +1,147 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers\Cloudflare;
|
||||||
|
|
||||||
|
use App\Helpers\CommonHelper;
|
||||||
|
use App\Models\Cloudflare\ZoneModel;
|
||||||
|
|
||||||
|
class ZoneHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public $old_parent = "";
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case ZoneModel::PARENT:
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field]
|
||||||
|
], isset($viewDatas[ZoneModel::PARENT]) ? $viewDatas[ZoneModel::PARENT] : $value, [...$extras, 'class' => "select-field"]);
|
||||||
|
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
||||||
|
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
||||||
|
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
||||||
|
// }
|
||||||
|
// return implode(" ", $checkboxs);
|
||||||
|
break;
|
||||||
|
case ZoneModel::TITLE:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)exmaple.com",
|
||||||
|
"style" =>
|
||||||
|
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'domains':
|
||||||
|
$form = form_textarea($field, $value, [
|
||||||
|
'rows' => '5',
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'hosts':
|
||||||
|
$form = form_textarea($field, $value == DEFAULTS['EMPTY'] ? "@\n*\nm\nwww" : $value, [
|
||||||
|
'rows' => '5',
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'content':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)123.123.123.123",
|
||||||
|
"style" =>
|
||||||
|
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case "development_mode":
|
||||||
|
case "ipv6":
|
||||||
|
case "security_level":
|
||||||
|
case 'status':
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field]
|
||||||
|
], $value, $extras);
|
||||||
|
break;
|
||||||
|
case 'type': //A,AAA...
|
||||||
|
case 'proxied': //CDN사용여부
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang('Cloudflare/Record.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field]
|
||||||
|
], $value, $extras);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case ZoneModel::PARENT:
|
||||||
|
if ($this->old_parent === $viewDatas['entity']->getParent()) {
|
||||||
|
$value = "";
|
||||||
|
} else {
|
||||||
|
$value = anchor(
|
||||||
|
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self"
|
||||||
|
]
|
||||||
|
) . " <span class=\"label_accounts\">" .
|
||||||
|
preg_replace("/(\w+)@(.+)/", "$1", $viewDatas['field_options'][$field][$value])
|
||||||
|
. "</span>";
|
||||||
|
}
|
||||||
|
$this->old_parent = $viewDatas['entity']->getParent();
|
||||||
|
break;
|
||||||
|
case ZoneModel::TITLE:
|
||||||
|
$value = anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . 'record/reload/' . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["RELOAD"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self"
|
||||||
|
]
|
||||||
|
) . " " .
|
||||||
|
anchor(
|
||||||
|
base_url() . $viewDatas['uri_path'] . "record?zone_uid=" . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS["FLAG"],
|
||||||
|
[
|
||||||
|
"class" => "btn btn-sm btn-primary btn-circle",
|
||||||
|
"target" => "_self"
|
||||||
|
]
|
||||||
|
) . " <span class=\"label_zones\">{$value}</span>";
|
||||||
|
break;
|
||||||
|
case 'name_servers':
|
||||||
|
case 'original_name_servers':
|
||||||
|
$value = str_replace(",", "<BR>", $value);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
public function getListRowColor($entity): string
|
||||||
|
{
|
||||||
|
return $entity->status != 'active' ? 'class="table-danger"' : "";
|
||||||
|
}
|
||||||
|
public function getListLabel(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$label = parent::getListLabel($field, $viewDatas, $extras);
|
||||||
|
switch ($field) {
|
||||||
|
case ZoneModel::TITLE:
|
||||||
|
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_zones'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Domains</buttion>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,222 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\Cloudflare\ZoneModel;
|
|
||||||
|
|
||||||
function getFieldLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
case ZoneModel::PARENT:
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_ZoneHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case ZoneModel::PARENT:
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], isset($viewDatas[ZoneModel::PARENT]) ? $viewDatas[ZoneModel::PARENT] : $value, [...$extras, 'class' => "select-field"]);
|
|
||||||
// // return form_multiselect($field, $field_options[$field], is_array($value) ? [...$value] : [$value], [$extras]);
|
|
||||||
// foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
// $checkboxs[] = form_checkbox("{$field}[]", $key, in_array($key, explode(DEFAULTS["DELIMITER_ROLE"], $value))) . $label;
|
|
||||||
// }
|
|
||||||
// return implode(" ", $checkboxs);
|
|
||||||
break;
|
|
||||||
case ZoneModel::TITLE:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)exmaple.com",
|
|
||||||
"style" =>
|
|
||||||
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'domains':
|
|
||||||
$form = form_textarea($field, $value, [
|
|
||||||
'rows' => '5',
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'hosts':
|
|
||||||
$form = form_textarea($field, $value == DEFAULTS['EMPTY'] ? "@\n*\nm\nwww" : $value, [
|
|
||||||
'rows' => '5',
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'content':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)123.123.123.123",
|
|
||||||
"style" =>
|
|
||||||
"width:200px; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case "development_mode":
|
|
||||||
case "ipv6":
|
|
||||||
case "security_level":
|
|
||||||
case 'status':
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'type': //A,AAA...
|
|
||||||
case 'proxied': //CDN사용여부
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang('Cloudflare/Record.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calender form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" =>
|
|
||||||
"width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_ZoneHelper(string $field, array $viewDatas, array $extras = [])
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case ZoneModel::PARENT:
|
|
||||||
if ($viewDatas['old_account'] === $viewDatas['entity']->getParent()) {
|
|
||||||
$value = "";
|
|
||||||
} else {
|
|
||||||
$value = anchor(
|
|
||||||
current_url() . "/reload/" . $viewDatas['entity']->getParent(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " <span class=\"label_accounts\">" .
|
|
||||||
preg_replace("/(\w+)@(.+)/", "$1", $viewDatas['field_options'][$field][$value])
|
|
||||||
. "</span>";
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case ZoneModel::TITLE:
|
|
||||||
$value = anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . 'record/reload/' . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["RELOAD"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " " .
|
|
||||||
anchor(
|
|
||||||
base_url() . $viewDatas['view_root'] . "record?zone_uid=" . $viewDatas['entity']->getPK(),
|
|
||||||
ICONS["FLAG"],
|
|
||||||
[
|
|
||||||
"class" => "btn btn-sm btn-primary btn-circle",
|
|
||||||
"target" => "_self"
|
|
||||||
]
|
|
||||||
) . " <span class=\"label_zones\">{$value}</span>";
|
|
||||||
break;
|
|
||||||
case 'name_servers':
|
|
||||||
case 'original_name_servers':
|
|
||||||
$value = str_replace(",", "<BR>", $value);
|
|
||||||
break;
|
|
||||||
case 'category_uid':
|
|
||||||
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
|
|
||||||
foreach ($category_2depths as $key => $depth) {
|
|
||||||
if ($key == $depth) {
|
|
||||||
$value = $depth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'cost':
|
|
||||||
case 'price':
|
|
||||||
case 'sale':
|
|
||||||
$value = number_format(!$value ? 0 : $value) . "원";
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
$extras["onChange"] = sprintf(
|
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
current_url(),
|
|
||||||
$viewDatas['entity']->getPK(),
|
|
||||||
$field,
|
|
||||||
$field
|
|
||||||
);
|
|
||||||
$value = getFieldForm_ZoneHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
function getListLabel_ZoneHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_ZoneHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string) $viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
switch ($field) {
|
|
||||||
case ZoneModel::PARENT:
|
|
||||||
break;
|
|
||||||
case ZoneModel::TITLE:
|
|
||||||
$label .= "<button onClick=\"getElementsByClassNameCopyToClipboard('label_zones'); return false;\" class=\"btn btn-sm btn-danger btn-circle\">Copy Domains</buttion>";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_ZoneHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '?' . $viewDatas['uri']->getQuery(['only' => ZoneModel::PARENT]);
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'sync':
|
|
||||||
$pk = $viewDatas['entity']->getPK();
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$pk}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $pk,
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
"checked" => in_array($pk, old("batchjob_uids", []))
|
|
||||||
]);
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$action = $checkbox . anchor($viewDatas['list_action_url'], $viewDatas['cnt'], $extras);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
289
app/Helpers/CommonHelper.php
Normal file
289
app/Helpers/CommonHelper.php
Normal file
@ -0,0 +1,289 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
abstract class CommonHelper
|
||||||
|
{
|
||||||
|
protected function __construct() {}
|
||||||
|
final public function getRandomString($length = 10, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
||||||
|
{
|
||||||
|
return substr(str_shuffle($characters), 0, $length);
|
||||||
|
}
|
||||||
|
final public function getPasswordString($length = 8)
|
||||||
|
{
|
||||||
|
return $this->getRandomString($length, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?");
|
||||||
|
} //
|
||||||
|
//byte값을 알아보기 쉽게 변환
|
||||||
|
final public function getSizeForHuman($bytes)
|
||||||
|
{
|
||||||
|
$ext = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
||||||
|
$unitCount = 0;
|
||||||
|
for (; $bytes > 1024; $unitCount++) {
|
||||||
|
$bytes /= 1024;
|
||||||
|
}
|
||||||
|
return floor($bytes) . $ext[$unitCount];
|
||||||
|
} //
|
||||||
|
//Proxy등을 통하여 Client_IP가 알수없는경우 실제사용자의 IP를 가져오기 위한것
|
||||||
|
final public function getClientIP($clientIP = false)
|
||||||
|
{
|
||||||
|
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
||||||
|
$clientIP = $_SERVER['HTTP_CLIENT_IP'];
|
||||||
|
} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
||||||
|
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
||||||
|
} else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
|
||||||
|
$clientIP = $_SERVER['HTTP_X_FORWARDED'];
|
||||||
|
} else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
||||||
|
$clientIP = $_SERVER['HTTP_FORWARDED_FOR'];
|
||||||
|
} else if (isset($_SERVER['HTTP_FORWARDED'])) {
|
||||||
|
$clientIP = $_SERVER['HTTP_FORWARDED'];
|
||||||
|
} else if (isset($_SERVER['REMOTE_ADDR'])) {
|
||||||
|
$clientIP = $_SERVER['REMOTE_ADDR'];
|
||||||
|
}
|
||||||
|
return $clientIP;
|
||||||
|
} //
|
||||||
|
final public function isDomain(string $domain): bool
|
||||||
|
{
|
||||||
|
$parttern_validation = '/((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])*/';
|
||||||
|
return preg_match("$parttern_validation", $domain);
|
||||||
|
}
|
||||||
|
final public function isIPAddress(string $ip, $type = false): bool
|
||||||
|
{
|
||||||
|
switch ($type) {
|
||||||
|
case 'ipv4':
|
||||||
|
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
|
||||||
|
break;
|
||||||
|
case 'ipv6':
|
||||||
|
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
|
||||||
|
break;
|
||||||
|
case 'all':
|
||||||
|
$result = filter_var($ip, FILTER_VALIDATE_IP);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $result;
|
||||||
|
}
|
||||||
|
final public function isHost(string $host): bool
|
||||||
|
{
|
||||||
|
$parttern_validation = '/[a-zA-Z0-9\.\/\?\:@\*\-_=#]/';
|
||||||
|
return preg_match($parttern_validation, $host);
|
||||||
|
}
|
||||||
|
//(EX:192.168.1.0 -> 192.168.001.000)
|
||||||
|
final public function convertIPV4toCIDR($cidr)
|
||||||
|
{
|
||||||
|
$temps = explode(".", $cidr);
|
||||||
|
return sprintf("%03d.%03d.%03d.%03d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
||||||
|
} //
|
||||||
|
//(EX:192.168.001.0000 -> 192.168.1.0)
|
||||||
|
final public function convertCIDRtoIPV4($ipv4)
|
||||||
|
{
|
||||||
|
$temps = explode(".", $ipv4);
|
||||||
|
return sprintf("%d.%d.%d.%d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
||||||
|
} //
|
||||||
|
final public function isMobile()
|
||||||
|
{
|
||||||
|
// Check the server headers to see if they're mobile friendly
|
||||||
|
if (isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// If the http_accept header supports wap then it's a mobile too
|
||||||
|
if (preg_match("/wap\.|\.wap/i", $_SERVER["HTTP_ACCEPT"])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
// Still no luck? Let's have a look at the user agent on the browser. If it contains
|
||||||
|
// any of the following, it's probably a mobile device. Kappow!
|
||||||
|
if (isset($_SERVER["HTTP_USER_AGENT"])) {
|
||||||
|
$user_agents = array("midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
|
||||||
|
foreach ($user_agents as $user_string) {
|
||||||
|
if (preg_match("/" . $user_string . "/i", $_SERVER["HTTP_USER_AGENT"])) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
|
||||||
|
if (preg_match("/iphone/i", $_SERVER["HTTP_USER_AGENT"])) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
// None of the above? Then it's probably not a mobile device.
|
||||||
|
return false;
|
||||||
|
} //
|
||||||
|
final public function alert(string $msg, $url = null)
|
||||||
|
{
|
||||||
|
$msg = preg_replace("/\r/", "\\r", $msg);
|
||||||
|
$msg = preg_replace("/\n/", "\\n", $msg);
|
||||||
|
$msg = preg_replace("/\'/", "\'", $msg);
|
||||||
|
$msg = preg_replace("/\"/", "\'", $msg);
|
||||||
|
$msg = "alert(\"{$msg}\");";
|
||||||
|
switch ($url) {
|
||||||
|
case 'close':
|
||||||
|
$msg .= "window.close();";
|
||||||
|
break;
|
||||||
|
case 'back':
|
||||||
|
$msg .= "history.back();";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$msg .= $url ? "location.href=\"{$url}\";" : "";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return "<script type=\"text/javascript\">{$msg}</script>";
|
||||||
|
} //
|
||||||
|
|
||||||
|
public function getFieldLabel(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
||||||
|
$extras = ["class" => 'text-danger', ...$extras];
|
||||||
|
}
|
||||||
|
$label = form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
//header.php에서 getFieldForm_Helper사용
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case 'status':
|
||||||
|
$form = form_dropdown($field, [
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field]
|
||||||
|
], $value, $extras);
|
||||||
|
break;
|
||||||
|
case 'updated_at':
|
||||||
|
case 'created_at':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"class" => "calender form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"style" => "width:100%;",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case 'category_uid':
|
||||||
|
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
|
||||||
|
foreach ($category_2depths as $key => $depth) {
|
||||||
|
if ($key == $depth) {
|
||||||
|
$value = $depth;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'updated_at':
|
||||||
|
case 'created_at':
|
||||||
|
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
||||||
|
$extras["onChange"] = sprintf(
|
||||||
|
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
||||||
|
current_url(),
|
||||||
|
$viewDatas['entity']->getPK(),
|
||||||
|
$field,
|
||||||
|
$field
|
||||||
|
);
|
||||||
|
$value = $this->getFieldForm($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
public function getListRowColor($entity): string
|
||||||
|
{
|
||||||
|
return $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger"' : "";
|
||||||
|
}
|
||||||
|
public function getListLabel(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($field) {
|
||||||
|
default:
|
||||||
|
$label = $this->getFieldLabel($field, $viewDatas, $extras);
|
||||||
|
if (isset($viewDatas['order_field']) && $viewDatas['order_field'] == $field) {
|
||||||
|
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
||||||
|
}
|
||||||
|
$viewDatas['uri']->addQuery('order_field', $field);
|
||||||
|
$viewDatas['uri']->addQuery('order_value', $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC");
|
||||||
|
$label = anchor((string) $viewDatas['uri'], $label);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
final public function getListButtonLink(string $url, string $label, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($viewDatas['action_form']) {
|
||||||
|
case FORMS['MODAL']:
|
||||||
|
$label = form_label(
|
||||||
|
$label,
|
||||||
|
"",
|
||||||
|
[
|
||||||
|
"data-src" => $url,
|
||||||
|
"data-bs-toggle" => "modal",
|
||||||
|
"data-bs-target" => "#index_action_form",
|
||||||
|
...$extras
|
||||||
|
]
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case FORMS['IFRAME']:
|
||||||
|
$label = form_label($label, "", [
|
||||||
|
"onClick" => "changeIframe_src('{$url}')",
|
||||||
|
...$extras,
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$label = anchor($url, $label, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $label;
|
||||||
|
}
|
||||||
|
public function getListButton(string $action, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
switch ($action) {
|
||||||
|
case 'create':
|
||||||
|
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = $this->getListButtonLink(
|
||||||
|
current_url() . '/' . $action,
|
||||||
|
'입력',
|
||||||
|
$viewDatas,
|
||||||
|
$extras
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'modify':
|
||||||
|
$pk = $viewDatas['entity']->getPK();
|
||||||
|
$checkbox = form_checkbox([
|
||||||
|
"id" => "checkbox_uid_{$pk}",
|
||||||
|
"name" => "batchjob_uids[]",
|
||||||
|
"value" => $pk,
|
||||||
|
"class" => "batchjobuids_checkboxs",
|
||||||
|
"checked" => in_array($pk, old("batchjob_uids", []))
|
||||||
|
]);
|
||||||
|
$action = $checkbox . $this->getListButtonLink(
|
||||||
|
current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(),
|
||||||
|
$viewDatas['cnt'],
|
||||||
|
$viewDatas,
|
||||||
|
$extras
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
case 'delete':
|
||||||
|
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
||||||
|
$action = anchor(
|
||||||
|
current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK(),
|
||||||
|
ICONS['DELETE'],
|
||||||
|
$extras
|
||||||
|
);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $action;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,158 +0,0 @@
|
|||||||
<?php
|
|
||||||
function getRandomString_CommonHelper($length = 10, $characters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789")
|
|
||||||
{
|
|
||||||
return substr(str_shuffle($characters), 0, $length);
|
|
||||||
}
|
|
||||||
function getPasswordString_CommonHelper($length = 8)
|
|
||||||
{
|
|
||||||
return getRandomString_CommonHelper($length, "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!@#$%^&*()_-=+;:,.?");
|
|
||||||
} //
|
|
||||||
|
|
||||||
//byte값을 알아보기 쉽게 변환
|
|
||||||
function getSizeForHuman_CommonHelper($bytes)
|
|
||||||
{
|
|
||||||
$ext = array('B', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB');
|
|
||||||
$unitCount = 0;
|
|
||||||
for (; $bytes > 1024; $unitCount++) {
|
|
||||||
$bytes /= 1024;
|
|
||||||
}
|
|
||||||
return floor($bytes) . $ext[$unitCount];
|
|
||||||
} //
|
|
||||||
|
|
||||||
//Proxy등을 통하여 Client_IP가 알수없는경우 실제사용자의 IP를 가져오기 위한것
|
|
||||||
function getClientIP_CommonHelper($clientIP = false)
|
|
||||||
{
|
|
||||||
if (isset($_SERVER['HTTP_CLIENT_IP'])) {
|
|
||||||
$clientIP = $_SERVER['HTTP_CLIENT_IP'];
|
|
||||||
} else if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
|
|
||||||
$clientIP = $_SERVER['HTTP_X_FORWARDED_FOR'];
|
|
||||||
} else if (isset($_SERVER['HTTP_X_FORWARDED'])) {
|
|
||||||
$clientIP = $_SERVER['HTTP_X_FORWARDED'];
|
|
||||||
} else if (isset($_SERVER['HTTP_FORWARDED_FOR'])) {
|
|
||||||
$clientIP = $_SERVER['HTTP_FORWARDED_FOR'];
|
|
||||||
} else if (isset($_SERVER['HTTP_FORWARDED'])) {
|
|
||||||
$clientIP = $_SERVER['HTTP_FORWARDED'];
|
|
||||||
} else if (isset($_SERVER['REMOTE_ADDR'])) {
|
|
||||||
$clientIP = $_SERVER['REMOTE_ADDR'];
|
|
||||||
}
|
|
||||||
return $clientIP;
|
|
||||||
} //
|
|
||||||
|
|
||||||
function isDomain_CommonHelper(string $domain): bool
|
|
||||||
{
|
|
||||||
$parttern_validation = '/((http|https)\:\/\/)?[a-zA-Z0-9\.\/\?\:@\-_=#]+\.([a-zA-Z0-9\&\.\/\?\:@\-_=#])*/';
|
|
||||||
return preg_match("$parttern_validation", $domain);
|
|
||||||
}
|
|
||||||
|
|
||||||
function isIPAddress_CommonHelper(string $ip, $type = false): bool
|
|
||||||
{
|
|
||||||
switch ($type) {
|
|
||||||
case 'ipv4':
|
|
||||||
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4);
|
|
||||||
break;
|
|
||||||
case 'ipv6':
|
|
||||||
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_IPV6);
|
|
||||||
break;
|
|
||||||
case 'all':
|
|
||||||
$result = filter_var($ip, FILTER_VALIDATE_IP);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$result = filter_var($ip, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $result;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isHost_CommonHelper(string $host): bool
|
|
||||||
{
|
|
||||||
$parttern_validation = '/[a-zA-Z0-9\.\/\?\:@\*\-_=#]/';
|
|
||||||
return preg_match($parttern_validation, $host);
|
|
||||||
}
|
|
||||||
//(EX:192.168.1.0 -> 192.168.001.000)
|
|
||||||
function convertIPV4toCIDR_CommonHelper($cidr)
|
|
||||||
{
|
|
||||||
$temps = explode(".", $cidr);
|
|
||||||
return sprintf("%03d.%03d.%03d.%03d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
|
||||||
} //
|
|
||||||
//(EX:192.168.001.0000 -> 192.168.1.0)
|
|
||||||
function convertCIDRtoIPV4_CommonHelper($ipv4)
|
|
||||||
{
|
|
||||||
$temps = explode(".", $ipv4);
|
|
||||||
return sprintf("%d.%d.%d.%d", $temps[0], $temps[1], $temps[2], $temps[3]);
|
|
||||||
} //
|
|
||||||
function isMobile_CommonHelper()
|
|
||||||
{
|
|
||||||
// Check the server headers to see if they're mobile friendly
|
|
||||||
if (isset($_SERVER["HTTP_X_WAP_PROFILE"])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// If the http_accept header supports wap then it's a mobile too
|
|
||||||
if (preg_match("/wap\.|\.wap/i", $_SERVER["HTTP_ACCEPT"])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
// Still no luck? Let's have a look at the user agent on the browser. If it contains
|
|
||||||
// any of the following, it's probably a mobile device. Kappow!
|
|
||||||
if (isset($_SERVER["HTTP_USER_AGENT"])) {
|
|
||||||
$user_agents = array("midp", "j2me", "avantg", "docomo", "novarra", "palmos", "palmsource", "240x320", "opwv", "chtml", "pda", "windows\ ce", "mmp\/", "blackberry", "mib\/", "symbian", "wireless", "nokia", "hand", "mobi", "phone", "cdm", "up\.b", "audio", "SIE\-", "SEC\-", "samsung", "HTC", "mot\-", "mitsu", "sagem", "sony", "alcatel", "lg", "erics", "vx", "NEC", "philips", "mmm", "xx", "panasonic", "sharp", "wap", "sch", "rover", "pocket", "benq", "java", "pt", "pg", "vox", "amoi", "bird", "compal", "kg", "voda", "sany", "kdd", "dbt", "sendo", "sgh", "gradi", "jb", "\d\d\di", "moto");
|
|
||||||
foreach ($user_agents as $user_string) {
|
|
||||||
if (preg_match("/" . $user_string . "/i", $_SERVER["HTTP_USER_AGENT"])) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Let's NOT return "mobile" if it's an iPhone, because the iPhone can render normal pages quite well.
|
|
||||||
if (preg_match("/iphone/i", $_SERVER["HTTP_USER_AGENT"])) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
// None of the above? Then it's probably not a mobile device.
|
|
||||||
return false;
|
|
||||||
} //
|
|
||||||
|
|
||||||
function alert_CommonHelper(string $msg, $url = null)
|
|
||||||
{
|
|
||||||
$msg = preg_replace("/\r/", "\\r", $msg);
|
|
||||||
$msg = preg_replace("/\n/", "\\n", $msg);
|
|
||||||
$msg = preg_replace("/\'/", "\'", $msg);
|
|
||||||
$msg = preg_replace("/\"/", "\'", $msg);
|
|
||||||
$msg = "alert(\"{$msg}\");";
|
|
||||||
switch ($url) {
|
|
||||||
case 'close':
|
|
||||||
$msg .= "window.close();";
|
|
||||||
break;
|
|
||||||
case 'back':
|
|
||||||
$msg .= "history.back();";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$msg .= $url ? "location.href=\"{$url}\";" : "";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return "<script type=\"text/javascript\">{$msg}</script>";
|
|
||||||
} //
|
|
||||||
|
|
||||||
function getListButtonLabel_CommonHelper(string $action, string $label, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($viewDatas['action_form']) {
|
|
||||||
case FORMS['MODAL']:
|
|
||||||
$label = form_label(
|
|
||||||
$label,
|
|
||||||
"",
|
|
||||||
[
|
|
||||||
"data-src" => $viewDatas['list_action_url'],
|
|
||||||
"data-bs-toggle" => "modal",
|
|
||||||
"data-bs-target" => "#index_action_form",
|
|
||||||
...$extras
|
|
||||||
]
|
|
||||||
);
|
|
||||||
break;
|
|
||||||
case FORMS['IFRAME']:
|
|
||||||
$label = form_label($label, "", [
|
|
||||||
"onClick" => "changeIframe_src('{$viewDatas['list_action_url']}')",
|
|
||||||
...$extras,
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$label = anchor($viewDatas['list_action_url'], $label, $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $label;
|
|
||||||
}
|
|
||||||
67
app/Helpers/MapurlHelper.php
Normal file
67
app/Helpers/MapurlHelper.php
Normal file
@ -0,0 +1,67 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
use App\Models\MapurlModel;
|
||||||
|
|
||||||
|
class MapurlHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case MapurlModel::TITLE:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)http://old.example.com",
|
||||||
|
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'newurl':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)https://new.example.com",
|
||||||
|
"style" =>
|
||||||
|
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getRemapPage(array $viewDatas): string
|
||||||
|
{
|
||||||
|
$urls = [];
|
||||||
|
foreach ($viewDatas['entitys'] as $viewDatas['entity']) {
|
||||||
|
//한글을 포함하고 있는지 체크 HTTP 나 HTTPS 와 도메인 분리해서 한글도메인을 Punycode로 변환
|
||||||
|
if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $viewDatas['entity']->oldurl)) {
|
||||||
|
preg_match("/^(https?:\/\/)(.*)/", $viewDatas['entity']->oldurl, $matches);
|
||||||
|
$oldurl = $matches[1] . idn_to_ascii($matches[2]);
|
||||||
|
} else {
|
||||||
|
$oldurl = trim($viewDatas['entity']->oldurl);
|
||||||
|
}
|
||||||
|
$urls[] = sprintf(
|
||||||
|
"case '%s': window.location.href='%s'; break;",
|
||||||
|
$oldurl,
|
||||||
|
trim($viewDatas['entity']->newurl)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return sprintf("
|
||||||
|
switch (window.location.origin) {
|
||||||
|
%s
|
||||||
|
default:
|
||||||
|
alert(window.location.origin + ' 지정되지 않은 URL입니다');
|
||||||
|
history.go(-1);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
", implode("\n", $urls));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,173 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\MapurlModel;
|
|
||||||
|
|
||||||
function getFieldLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_MapurlHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case MapurlModel::TITLE:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)http://old.example.com",
|
|
||||||
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'newurl':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)https://new.example.com",
|
|
||||||
"style" =>
|
|
||||||
"width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'status':
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calender form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" =>
|
|
||||||
"width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_MapurlHelper(string $field, array $viewDatas, array $extras = [])
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case MapurlModel::TITLE:
|
|
||||||
// $value = anchor(
|
|
||||||
// current_url() . '/view/' . $viewDatas['entity']->getPK(),
|
|
||||||
// $value,
|
|
||||||
// [
|
|
||||||
// "target" => "_self",
|
|
||||||
// ]
|
|
||||||
// );
|
|
||||||
break;
|
|
||||||
case 'category_uid':
|
|
||||||
foreach (array_values($viewDatas['field_options'][$field]) as $category_2depths) {
|
|
||||||
foreach ($category_2depths as $key => $depth) {
|
|
||||||
if ($key == $depth) {
|
|
||||||
$value = $depth;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
$extras["onChange"] = sprintf(
|
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
current_url(),
|
|
||||||
$viewDatas['entity']->getPK(),
|
|
||||||
$field,
|
|
||||||
$field
|
|
||||||
);
|
|
||||||
$value = getFieldForm_MapurlHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
function getListLabel_MapurlHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_MapurlHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string) $viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
switch ($field) {
|
|
||||||
case MapurlModel::TITLE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_MapurlHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action;
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
$pk = $viewDatas['entity']->getPK();
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$pk}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $pk,
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
"checked" => in_array($pk, old("batchjob_uids", []))
|
|
||||||
]);
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$action = $checkbox . getListButtonLabel_CommonHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
function getRemapPage_MapurlHelper(array $viewDatas): string
|
|
||||||
{
|
|
||||||
$urls = [];
|
|
||||||
foreach ($viewDatas['entitys'] as $viewDatas['entity']) {
|
|
||||||
//한글을 포함하고 있는지 체크 HTTP 나 HTTPS 와 도메인 분리해서 한글도메인을 Punycode로 변환
|
|
||||||
if (preg_match("/[\xE0-\xFF][\x80-\xFF][\x80-\xFF]/", $viewDatas['entity']->oldurl)) {
|
|
||||||
preg_match("/^(https?:\/\/)(.*)/", $viewDatas['entity']->oldurl, $matches);
|
|
||||||
$oldurl = $matches[1] . idn_to_ascii($matches[2]);
|
|
||||||
} else {
|
|
||||||
$oldurl = trim($viewDatas['entity']->oldurl);
|
|
||||||
}
|
|
||||||
$urls[] = sprintf(
|
|
||||||
"case '%s': window.location.href='%s'; break;",
|
|
||||||
$oldurl,
|
|
||||||
trim($viewDatas['entity']->newurl)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return sprintf("
|
|
||||||
switch (window.location.origin) {
|
|
||||||
%s
|
|
||||||
default:
|
|
||||||
alert(window.location.origin + ' 지정되지 않은 URL입니다');
|
|
||||||
history.go(-1);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
", implode("\n", $urls));
|
|
||||||
}
|
|
||||||
91
app/Helpers/UserHelper.php
Normal file
91
app/Helpers/UserHelper.php
Normal file
@ -0,0 +1,91 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Helpers;
|
||||||
|
|
||||||
|
use App\Models\UserModel;
|
||||||
|
|
||||||
|
class UserHelper extends CommonHelper
|
||||||
|
{
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldForm(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $value ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case UserModel::TITLE:
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)",
|
||||||
|
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'role':
|
||||||
|
if (in_array($viewDatas['action'], ['create', 'modify'])) {
|
||||||
|
$forms = [];
|
||||||
|
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
||||||
|
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
||||||
|
$forms[] = form_checkbox($field . "[]", $key, in_array($key, $values)) . $label;
|
||||||
|
}
|
||||||
|
$form = implode(" ", $forms);
|
||||||
|
} else {
|
||||||
|
$form = form_dropdown(
|
||||||
|
$field,
|
||||||
|
[
|
||||||
|
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
||||||
|
...$viewDatas['field_options'][$field]
|
||||||
|
],
|
||||||
|
$value,
|
||||||
|
$extras
|
||||||
|
);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case 'passwd':
|
||||||
|
$form = form_password($field, "", [
|
||||||
|
"style" => "width:100%;",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'email':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)test@example.com",
|
||||||
|
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
case 'mobile':
|
||||||
|
$form = form_input($field, $value, [
|
||||||
|
"placeholder" => "예)010-0010-0010",
|
||||||
|
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
||||||
|
"class" => "form-control",
|
||||||
|
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
||||||
|
]);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$form = parent::getFieldForm($field, $value, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $form;
|
||||||
|
} //
|
||||||
|
public function getFieldView(string $field, array $viewDatas, array $extras = []): string
|
||||||
|
{
|
||||||
|
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
||||||
|
switch ($field) {
|
||||||
|
case 'role':
|
||||||
|
$roles = [];
|
||||||
|
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
|
||||||
|
$roles[] = $viewDatas['field_options'][$field][$key];
|
||||||
|
}
|
||||||
|
$value = implode(" , ", $roles);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$value = parent::getFieldView($field, $viewDatas, $extras);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $value;
|
||||||
|
} //
|
||||||
|
}
|
||||||
@ -1,172 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Models\UserModel;
|
|
||||||
|
|
||||||
function getFieldLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($field) {
|
|
||||||
default:
|
|
||||||
if (strpos($viewDatas['field_rules'][$field], 'required') !== false) {
|
|
||||||
$extras = [...$extras, "class" => 'text-danger'];
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return form_label(lang("{$viewDatas['class_path']}.label.{$field}"), $field, $extras);
|
|
||||||
}
|
|
||||||
//header.php에서 getFieldForm_Helper사용
|
|
||||||
function getFieldForm_UserHelper(string $field, mixed $value, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $value ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case UserModel::TITLE:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)",
|
|
||||||
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'role':
|
|
||||||
if (in_array($viewDatas['action'], ['create', 'modify'])) {
|
|
||||||
$forms = [];
|
|
||||||
foreach ($viewDatas['field_options'][$field] as $key => $label) {
|
|
||||||
$values = is_array($value) ? $value : explode(DEFAULTS["DELIMITER_ROLE"], $value);
|
|
||||||
$forms[] = form_checkbox($field . "[]", $key, in_array($key, $values)) . $label;
|
|
||||||
}
|
|
||||||
$form = implode(" ", $forms);
|
|
||||||
} else {
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
case 'status':
|
|
||||||
$form = form_dropdown($field, [
|
|
||||||
"" => lang($viewDatas['class_path'] . '.label.' . $field) . ' 선택',
|
|
||||||
...$viewDatas['field_options'][$field]
|
|
||||||
], $value, $extras);
|
|
||||||
break;
|
|
||||||
case 'passwd':
|
|
||||||
$form = form_password($field, "", [
|
|
||||||
"style" => "width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'email':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)test@example.com",
|
|
||||||
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'mobile':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"placeholder" => "예)010-0010-0010",
|
|
||||||
"style" => "width:100%; ::placeholder{color:silver; opacity: 1;}",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"class" => "calender form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
$form = form_input($field, $value, [
|
|
||||||
"style" => "width:100%;",
|
|
||||||
"class" => "form-control",
|
|
||||||
(strpos($viewDatas['field_rules'][$field], 'required') !== false) ? "required" : ""
|
|
||||||
]);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $form;
|
|
||||||
} //
|
|
||||||
function getFieldView_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$value = $viewDatas['entity']->$field ?: DEFAULTS['EMPTY'];
|
|
||||||
switch ($field) {
|
|
||||||
case UserModel::TITLE:
|
|
||||||
// $value = anchor(
|
|
||||||
// current_url() . '/view/' . $viewDatas['entity']->getPK(),
|
|
||||||
// $value,
|
|
||||||
// [
|
|
||||||
// "target" => "_self",
|
|
||||||
// ]
|
|
||||||
// );
|
|
||||||
break;
|
|
||||||
case 'role':
|
|
||||||
$roles = [];
|
|
||||||
foreach (explode(DEFAULTS["DELIMITER_ROLE"], $value) as $key) {
|
|
||||||
$roles[] = $viewDatas['field_options'][$field][$key];
|
|
||||||
}
|
|
||||||
$value = implode(" , ", $roles);
|
|
||||||
break;
|
|
||||||
case 'updated_at':
|
|
||||||
case 'created_at':
|
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
if (in_array($field, $viewDatas['filter_fields']) && $value) {
|
|
||||||
$extras["onChange"] = sprintf(
|
|
||||||
'location.href="%s/toggle/%s/%s?%s="+this.options[this.selectedIndex].value',
|
|
||||||
current_url(),
|
|
||||||
$viewDatas['entity']->getPK(),
|
|
||||||
$field,
|
|
||||||
$field
|
|
||||||
);
|
|
||||||
$value = getFieldForm_UserHelper($field, $viewDatas['entity']->$field, $viewDatas, $extras);
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $value;
|
|
||||||
} //
|
|
||||||
function getListLabel_UserHelper(string $field, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
$label = getFieldLabel_UserHelper($field, $viewDatas, $extras);
|
|
||||||
if (isset($viewDatas['order_field']) && $field == $viewDatas['order_field']) {
|
|
||||||
$label .= $viewDatas['order_value'] == 'ASC' ? ICONS["UP"] : ICONS["DOWN"];
|
|
||||||
$order_value = $viewDatas['order_value'] == 'DESC' ? "ASC" : "DESC";
|
|
||||||
$viewDatas['uri']->addQuery('order_field', $field);
|
|
||||||
$viewDatas['uri']->addQuery('order_value', $order_value);
|
|
||||||
$label = anchor((string) $viewDatas['uri'], $label);
|
|
||||||
}
|
|
||||||
switch ($field) {
|
|
||||||
case UserModel::TITLE:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return sprintf("<th %s>%s</th>", implode(" ", $extras), $label);
|
|
||||||
}
|
|
||||||
function getListButton_UserHelper(string $action, array $viewDatas, array $extras = []): string
|
|
||||||
{
|
|
||||||
switch ($action) {
|
|
||||||
case 'create':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action;
|
|
||||||
$extras = ["class" => "btn btn-outline btn-primary btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = getListButtonLabel_CommonHelper($action, '입력', $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'modify':
|
|
||||||
$pk = $viewDatas['entity']->getPK();
|
|
||||||
$checkbox = form_checkbox([
|
|
||||||
"id" => "checkbox_uid_{$pk}",
|
|
||||||
"name" => "batchjob_uids[]",
|
|
||||||
"value" => $pk,
|
|
||||||
"class" => "batchjobuids_checkboxs",
|
|
||||||
"checked" => in_array($pk, old("batchjob_uids", []))
|
|
||||||
]);
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$action = $checkbox . getListButtonLabel_CommonHelper($action, $viewDatas['cnt'], $viewDatas, $extras);
|
|
||||||
break;
|
|
||||||
case 'delete':
|
|
||||||
$viewDatas['list_action_url'] = current_url() . '/' . $action . '/' . $viewDatas['entity']->getPK();
|
|
||||||
$extras = ["class" => "btn btn-sm btn-danger btn-circle", "target" => "_self", ...$extras];
|
|
||||||
$action = anchor($viewDatas['list_action_url'], ICONS['DELETE'], $extras);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
return $action;
|
|
||||||
}
|
|
||||||
@ -1,70 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.account">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_AccountHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php $old_auth = "" ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity; ?>
|
|
||||||
<?php $viewDatas['old_auth'] = $old_auth ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_AccountHelper('sync', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_AccountHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_AccountHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $old_auth = $entity->getParent() ?>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_AccountHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.auth">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_AuthHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity; ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_AuthHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_AuthHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_AuthHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_AuthHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
<li class="nav-item"><?= getListButton_AuthHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_AuthHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_AuthHelper($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_RecordHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_RecordHelper($field, old($field), $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.record">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_RecordHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php $old_zone = "" ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->locked != 'on' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity; ?>
|
|
||||||
<?php $viewDatas['old_zone'] = $old_zone ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_RecordHelper('sync', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_RecordHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_RecordHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $old_zone = $entity->getParent() ?>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_RecordHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
<li class="nav-item"><?= getListButton_RecordHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_ZoneHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_ZoneHelper($field, old($field), $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,74 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.zone">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_ZoneHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php $old_account = "" ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->status != 'active' ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity ?>
|
|
||||||
<?php $viewDatas['old_account'] = $old_account ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_ZoneHelper('sync', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_ZoneHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_ZoneHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $old_account = $entity->getParent() ?>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_ZoneHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
<li class="nav-item"><?= getListButton_ZoneHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -6,9 +6,9 @@
|
|||||||
<?php $cnt = 1 ?>
|
<?php $cnt = 1 ?>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_AuthHelper($field, $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= getFieldForm_AuthHelper($field, old($field), $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm($field, old($field), $viewDatas) ?>
|
||||||
<div><?= validation_show_error($field); ?></div>
|
<div><?= validation_show_error($field); ?></div>
|
||||||
</td>
|
</td>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
80
app/Views/admin/index.php
Normal file
80
app/Views/admin/index.php
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
|
||||||
|
<?= form_open(current_url(), array("method" => "get")) ?>
|
||||||
|
<nav class="index_top navbar navbar-expand-lg">
|
||||||
|
<div class="container-fluid">
|
||||||
|
<nav class="condition nav">
|
||||||
|
조건검색:
|
||||||
|
<?php foreach ($viewDatas['filter_fields'] as $field): ?>
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, $viewDatas[$field] ?: old($field), $viewDatas) ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</nav>
|
||||||
|
<nav class="search nav justify-content-center">
|
||||||
|
검색어:<?= form_input('word', $viewDatas['word']) ?>
|
||||||
|
검색일:<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
|
||||||
|
<?= form_submit('', '검색하기') ?>
|
||||||
|
<?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?>
|
||||||
|
</nav>
|
||||||
|
<nav class="pageinfo nav justify-content-end">
|
||||||
|
페이지 : <?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
|
||||||
|
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?>
|
||||||
|
/ 총:<?= $viewDatas['total_count'] ?>
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
<?= form_close() ?>
|
||||||
|
<div class="index_body">
|
||||||
|
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="reisze_table">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th class="index_head_short_column">번호</th>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<th data-rtc-resizable="<?= $field ?>"><?= $viewDatas['helper']->getListLabel($field, $viewDatas) ?></th>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<th class="index_head_short_column">작업</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<?php $cnt = 0 ?>
|
||||||
|
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
||||||
|
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
|
<td>
|
||||||
|
<?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?>
|
||||||
|
</td>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<td>
|
||||||
|
<?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
<div class="index_batchjob">
|
||||||
|
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<ul class="nav justify-content-center">
|
||||||
|
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
||||||
|
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
||||||
|
<li class="nav-item"><?= $viewDatas['helper']->getListButton('create', $viewDatas) ?></li>
|
||||||
|
</ul>
|
||||||
|
<?= form_close() ?>
|
||||||
|
</div>
|
||||||
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
|
<div class="index_bottom">
|
||||||
|
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
||||||
|
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
||||||
|
<?php endif ?>
|
||||||
|
</div>
|
||||||
|
<link href="/css/common/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script type="text/javascript" src="/js/common/resizeTable.js"></script>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_MapurlHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_MapurlHelper($field, old($field), $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.mapurl">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_MapurlHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity; ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_MapurlHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_MapurlHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_MapurlHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_MapurlHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
<li class="nav-item"><?= getListButton_MapurlHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -6,9 +6,9 @@
|
|||||||
<?php $cnt = 1 ?>
|
<?php $cnt = 1 ?>
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_MapurlHelper($field, $viewDatas) ?></th>
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||||
<td nowrap class="text-start">
|
<td nowrap class="text-start">
|
||||||
<?= getFieldForm_MapurlHelper($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas) ?>
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas) ?>
|
||||||
<div><?= validation_show_error($field); ?></div>
|
<div><?= validation_show_error($field); ?></div>
|
||||||
</td>
|
</td>
|
||||||
<?php $cnt++ ?>
|
<?php $cnt++ ?>
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_UserHelper($field, old($field), $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,71 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/content.js"></script>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/index_top'); ?>
|
|
||||||
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="index_table data table table-bordered table-hover table-striped" data-rtc-resizable-table="table.user">
|
|
||||||
<thead>
|
|
||||||
<tr>
|
|
||||||
<th class="index_head_short_column">번호</th>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<?= getListLabel_UserHelper($field, $viewDatas, ["data-rtc-resizable=\"{$field}\""]) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<th class="index_head_short_column">작업</th>
|
|
||||||
</tr>
|
|
||||||
</thead>
|
|
||||||
<tbody>
|
|
||||||
<?php $cnt = 0 ?>
|
|
||||||
<?php foreach ($viewDatas['entitys'] as $entity): ?>
|
|
||||||
<tr <?= $entity->status != DEFAULTS['STATUS'] ? 'class="table-danger" rowcolor="red"' : 'rowcolor="red"' ?>>
|
|
||||||
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
|
||||||
<?php $viewDatas['entity'] = $entity; ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_UserHelper('modify', $viewDatas, ["style" => "cursor:pointer"]) ?>
|
|
||||||
</td>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<td><?= getFieldView_UserHelper($field, $viewDatas) ?></td>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<td>
|
|
||||||
<?= getListButton_UserHelper('delete', $viewDatas) ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
<div class="index_bottom">
|
|
||||||
<ul class="nav justify-content-center">
|
|
||||||
<li class="nav-item"><?= form_checkbox(array("id" => "batchjobuids_checkbox")) ?>ALL</li>
|
|
||||||
<?php foreach ($viewDatas['batchjob_fields'] as $field): ?>
|
|
||||||
<?= getFieldForm_UserHelper($field, DEFAULTS['EMPTY'], $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
<li class="nav-item"><?= form_submit("", '일괄처리', ["class" => "btn btn-outline btn-warning"]) ?></li>
|
|
||||||
<li class="nav-item"><?= getListButton_UserHelper('create', $viewDatas, ["style" => "cursor:pointer"]) ?></li>
|
|
||||||
</ul>
|
|
||||||
</div>
|
|
||||||
<?= form_close() ?>
|
|
||||||
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
|
||||||
<?php if (in_array($viewDatas['action_form'], [FORMS['MODAL'], FORMS['IFRAME']])): ?>
|
|
||||||
<?= $this->include('templates/' . $viewDatas['layout'] . '/' . $viewDatas['action_form']); ?>
|
|
||||||
<?php endif ?>
|
|
||||||
<link href="/css/resizeTable.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/resizeTable.js"></script>
|
|
||||||
<script>
|
|
||||||
(function (window, ResizableTableColumns, undefined) {
|
|
||||||
var store = window.store && window.store.enabled ? window.store : null;
|
|
||||||
var els = document.querySelectorAll('table.data');
|
|
||||||
for (var index = 0; index < els.length; index++) {
|
|
||||||
var table = els[index];
|
|
||||||
if (table['rtc_data_object']) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
var options = { store: store };
|
|
||||||
if (table.querySelectorAll('thead > tr').length > 1) {
|
|
||||||
options.resizeFromBody = false;
|
|
||||||
}
|
|
||||||
new ResizableTableColumns(els[index], options);
|
|
||||||
}
|
|
||||||
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
|
||||||
</script>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= $this->extend("layouts/{$viewDatas['layout']}/{$viewDatas['action_form']}") ?>
|
|
||||||
<?= $this->section('content') ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>/content.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
|
||||||
<table class="action_form table table-bordered">
|
|
||||||
<?php $cnt = 1 ?>
|
|
||||||
<?php foreach ($viewDatas['fields'] as $field): ?>
|
|
||||||
<tr>
|
|
||||||
<th nowrap class="text-end"><?= getFieldLabel_UserHelper($field, $viewDatas) ?></th>
|
|
||||||
<td nowrap class="text-start">
|
|
||||||
<?= getFieldForm_UserHelper($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas) ?>
|
|
||||||
<div><?= validation_show_error($field); ?></div>
|
|
||||||
</td>
|
|
||||||
<?php $cnt++ ?>
|
|
||||||
</tr>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<tr>
|
|
||||||
<td valign=" bottom" colspan="<?= $cnt * 2 ?>">
|
|
||||||
<?= form_submit('', '수정', array("class" => "btn btn-outline btn-primary")); ?>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
</table>
|
|
||||||
<?= form_close(); ?>
|
|
||||||
<?= $this->endSection() ?>
|
|
||||||
@ -6,7 +6,7 @@
|
|||||||
<?= ICONS['LOCK'] ?>
|
<?= ICONS['LOCK'] ?>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<input type="text" class="form-control" value="<?= getPasswordString_CommonHelper() ?>" id="makePassword">
|
<input type="text" class="form-control" value="<?= $viewDatas['helper']->getPasswordString() ?>" id="makePassword">
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
|
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
|
||||||
@ -28,7 +28,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu dropdown-menu-end">
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
<?php $viewDatas['list_action_url'] = "/admin/user/modify/" . $viewDatas['session']->get(SESSION_NAMES['AUTH'])['uid'] ?>
|
<?php $viewDatas['list_action_url'] = "/admin/user/modify/" . $viewDatas['session']->get(SESSION_NAMES['AUTH'])['uid'] ?>
|
||||||
<li><?= getListButtonLabel_CommonHelper("modify", ICONS['SETUP'] . "정보수정", $viewDatas, ["class" => "dropdown-item"]) ?></li>
|
<li><?= $viewDatas['helper']->getListButtonLink("modify", ICONS['SETUP'] . "정보수정", $viewDatas, ["class" => "dropdown-item"]) ?></li>
|
||||||
<li>
|
<li>
|
||||||
<hr class="dropdown-divider">
|
<hr class="dropdown-divider">
|
||||||
</li>
|
</li>
|
||||||
|
|||||||
@ -27,9 +27,12 @@
|
|||||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="middle">
|
<div class="middle">
|
||||||
<div class="header"><?= $this->include("templates/{$viewDatas['layout']}/header"); ?></div>
|
<div class="left"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?></div>
|
||||||
<div id="container" class="content"><?= $this->renderSection('content') ?></div>
|
<div class="right">
|
||||||
<div class="footer"><?= $this->include("templates/{$viewDatas['layout']}/footer"); ?></div>
|
<div class="header"><?= $this->include("templates/{$viewDatas['layout']}/header"); ?></div>
|
||||||
|
<div id="container" class="content"><?= $this->renderSection('content') ?></div>
|
||||||
|
<div class="footer"><?= $this->include("templates/{$viewDatas['layout']}/footer"); ?></div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="bottom">
|
<div class="bottom">
|
||||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
<?= ICONS['LOCK'] ?>
|
<?= ICONS['LOCK'] ?>
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<input type="text" class="form-control" value="<?= getPasswordString_CommonHelper() ?>" id="makePassword">
|
<input type="text" class="form-control" value="<?= $viewDatas['helper']->getPasswordString() ?>" id="makePassword">
|
||||||
</li>
|
</li>
|
||||||
<li class="nav-item">
|
<li class="nav-item">
|
||||||
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
|
<button class="btn btn-default border border-dark" type="button" id="totSearchBtn"
|
||||||
@ -28,15 +28,14 @@
|
|||||||
</button>
|
</button>
|
||||||
<ul class="dropdown-menu dropdown-menu-end">
|
<ul class="dropdown-menu dropdown-menu-end">
|
||||||
<?php $viewDatas['list_action_url'] = "/admin/user/modify/" . $viewDatas['session']->get(SESSION_NAMES['AUTH'])['uid'] ?>
|
<?php $viewDatas['list_action_url'] = "/admin/user/modify/" . $viewDatas['session']->get(SESSION_NAMES['AUTH'])['uid'] ?>
|
||||||
<li><?= getListButtonLabel_CommonHelper("modify", ICONS['SETUP'] . "정보수정", $viewDatas, ["class" => "dropdown-item"]) ?></li>
|
<li><?= $viewDatas['helper']->getListButtonLink("modify", ICONS['SETUP'] . "정보수정", $viewDatas, ["class" => "dropdown-item"]) ?></li>
|
||||||
<li>
|
<li>
|
||||||
<hr class="dropdown-divider">
|
<hr class="dropdown-divider">
|
||||||
</li>
|
</li>
|
||||||
<li><a class="dropdown-item" href="<?= URLS['LOGOUT'] ?>"><?= ICONS['LOGOUT'] ?>Logout</a></li>
|
<li><a class="dropdown-item" href="<?= URLS['LOGOUT'] ?>"><?= ICONS['LOGOUT'] ?>Logout</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
<?php else: ?><a class="nav-link dropdown-toggle" href="<?= URLS['LOGIN'] ?>"
|
<?php else: ?><a class="nav-link dropdown-toggle" href="<?= URLS['LOGIN'] ?>" role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
|
||||||
role="button"><?= ICONS['LOGIN'] ?>Login</a><?php endif ?>
|
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
@ -1,42 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="ko">
|
|
||||||
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
|
||||||
<title><?= LAYOUTS[$viewDatas['layout']]['title'] ?></title>
|
|
||||||
<?php foreach (LAYOUTS[$viewDatas['layout']]['stylesheets'] as $stylesheet): ?>
|
|
||||||
<?= $stylesheet ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<?php foreach (LAYOUTS[$viewDatas['layout']]['javascripts'] as $javascript): ?>
|
|
||||||
<?= $javascript ?>
|
|
||||||
<?php endforeach; ?>
|
|
||||||
<link href="/css/<?= $viewDatas['layout'] ?>.css" media="screen" rel="stylesheet" type="text/css" />
|
|
||||||
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>.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]-->
|
|
||||||
</head>
|
|
||||||
|
|
||||||
<body>
|
|
||||||
<div class="top">
|
|
||||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?>
|
|
||||||
</div>
|
|
||||||
<div class="middle">
|
|
||||||
<div class="left"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?></div>
|
|
||||||
<div class="center">
|
|
||||||
<div class="header"><?= $this->include("templates/{$viewDatas['layout']}/header"); ?></div>
|
|
||||||
<div id="container" class="content"><?= $this->renderSection('content') ?></div>
|
|
||||||
<div class="footer"><?= $this->include("templates/{$viewDatas['layout']}/footer"); ?></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="bottom">
|
|
||||||
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
|
|
||||||
</html>
|
|
||||||
@ -1,64 +1 @@
|
|||||||
<?= $viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG']) ? alert_CommonHelper($viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG'])) : "" ?>
|
<?= $viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG']) ? $viewDatas['helper']->alert($viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG'])) : "" ?>
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
//class가 calender인 inputbox용,날짜field용
|
|
||||||
$(".calender").datepicker({
|
|
||||||
changeYear: true,
|
|
||||||
changeMonth: true,
|
|
||||||
yearRange: "-10:+0",
|
|
||||||
dateFormat: "yy-mm-dd"
|
|
||||||
});
|
|
||||||
//id가 batchjobuids_checkbox인 버튼을 클릭시 class가 batchjobuids_checkboxs인 checkbox용
|
|
||||||
$('#batchjobuids_checkbox').click(function(event) {
|
|
||||||
if (this.checked) {
|
|
||||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
|
||||||
$(this).prop('checked', true); //check
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
|
||||||
$(this).prop('checked', false); //uncheck
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//class가 select-field인 SelectBox용
|
|
||||||
$(".select-field").select2({
|
|
||||||
theme: "classic",
|
|
||||||
width: 'style',
|
|
||||||
dropdownAutoWidth: true
|
|
||||||
});
|
|
||||||
// text editor 초기화
|
|
||||||
//참고: https://phppot.com/menu/php/learn-php/
|
|
||||||
// class가 editor인 textarea용
|
|
||||||
tinymce.init({
|
|
||||||
selector: 'textarea.tinymce',
|
|
||||||
plugins: ['code', 'image', 'preview', 'table', 'emoticons', 'autoresize'],
|
|
||||||
height: 600,
|
|
||||||
// content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
|
|
||||||
automatic_uploads: false,
|
|
||||||
images_upload_url: '/tinymce_upload.php',
|
|
||||||
// images_upload_base_path: '/upload_images',
|
|
||||||
images_upload_handler: function(blobInfo, success, failure) {
|
|
||||||
var xhr, formData;
|
|
||||||
xhr = new XMLHttpRequest();
|
|
||||||
xhr.withCredentials = false;
|
|
||||||
xhr.open('POST', '/tinymce_upload.php');
|
|
||||||
xhr.onload = function() {
|
|
||||||
var json;
|
|
||||||
if (xhr.status != 200) {
|
|
||||||
failure('HTTP Error: ' + xhr.status);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
json = JSON.parse(xhr.responseText);
|
|
||||||
if (!json || typeof json.file_path != 'string') {
|
|
||||||
failure('Invalid JSON: ' + xhr.responseText);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
success(json.file_path);
|
|
||||||
};
|
|
||||||
formData = new FormData();
|
|
||||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
|
||||||
xhr.send(formData);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@ -1,24 +0,0 @@
|
|||||||
<?= form_open(current_url(), array("method" => "get")) ?>
|
|
||||||
<nav class="index_top navbar navbar-expand-lg">
|
|
||||||
<div class="container-fluid">
|
|
||||||
<nav class="condition nav">
|
|
||||||
조건검색:
|
|
||||||
<?php $fieldform_function = "getFieldForm_{$viewDatas['class_name']}Helper" ?>
|
|
||||||
<?php foreach ($viewDatas['filter_fields'] as $field): ?>
|
|
||||||
<?= $fieldform_function($field, $viewDatas[$field] ?: old($field), $viewDatas) ?>
|
|
||||||
<?php endforeach ?>
|
|
||||||
</nav>
|
|
||||||
<nav class="search nav justify-content-center">
|
|
||||||
검색어:<?= form_input('word', $viewDatas['word']) ?>
|
|
||||||
검색일:<?= form_input('start', $viewDatas['start'], ["class" => "calender"]) ?><?= form_input('end', $viewDatas['end'], ["class" => "calender"]) ?>
|
|
||||||
<?= form_submit('', '검색하기') ?>
|
|
||||||
<?= anchor(current_url() . '/download/excel', ICONS['EXCEL'], ["target" => "_self", "class" => "excel"]) ?>
|
|
||||||
</nav>
|
|
||||||
<nav class="pageinfo nav justify-content-end">
|
|
||||||
페이지 : <?= $viewDatas['page'] ?>/<?= $viewDatas['total_page'] ?>
|
|
||||||
<?= form_dropdown('per_page', $viewDatas['page_options'], $viewDatas['per_page'], array('onChange' => 'this.form.submit()')) ?>
|
|
||||||
/ 총:<?= $viewDatas['total_count'] ?>
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
||||||
<?= form_close() ?>
|
|
||||||
@ -1,64 +1 @@
|
|||||||
<?= $viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG']) ? alert_CommonHelper($viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG'])) : "" ?>
|
<?= $viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG']) ? $viewDatas['helper']->alert($viewDatas['session']->getFlashdata(SESSION_NAMES['RETURN_MSG'])) : "" ?>
|
||||||
<script type="text/javascript">
|
|
||||||
$(document).ready(function() {
|
|
||||||
//class가 calender인 inputbox용,날짜field용
|
|
||||||
$(".calender").datepicker({
|
|
||||||
changeYear: true,
|
|
||||||
changeMonth: true,
|
|
||||||
yearRange: "-10:+0",
|
|
||||||
dateFormat: "yy-mm-dd"
|
|
||||||
});
|
|
||||||
//id가 batchjobuids_checkbox인 버튼을 클릭시 class가 batchjobuids_checkboxs인 checkbox용
|
|
||||||
$('#batchjobuids_checkbox').click(function(event) {
|
|
||||||
if (this.checked) {
|
|
||||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
|
||||||
$(this).prop('checked', true); //check
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
$('.batchjobuids_checkboxs').each(function() { //loop checkbox
|
|
||||||
$(this).prop('checked', false); //uncheck
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
//class가 select-field인 SelectBox용
|
|
||||||
$(".select-field").select2({
|
|
||||||
theme: "classic",
|
|
||||||
width: 'style',
|
|
||||||
dropdownAutoWidth: true
|
|
||||||
});
|
|
||||||
// text editor 초기화
|
|
||||||
//참고: https://phppot.com/menu/php/learn-php/
|
|
||||||
// class가 editor인 textarea용
|
|
||||||
tinymce.init({
|
|
||||||
selector: 'textarea.tinymce',
|
|
||||||
plugins: ['code', 'image', 'preview', 'table', 'emoticons', 'autoresize'],
|
|
||||||
height: 600,
|
|
||||||
// content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
|
|
||||||
automatic_uploads: false,
|
|
||||||
images_upload_url: '/tinymce_upload.php',
|
|
||||||
// images_upload_base_path: '/upload_images',
|
|
||||||
images_upload_handler: function(blobInfo, success, failure) {
|
|
||||||
var xhr, formData;
|
|
||||||
xhr = new XMLHttpRequest();
|
|
||||||
xhr.withCredentials = false;
|
|
||||||
xhr.open('POST', '/tinymce_upload.php');
|
|
||||||
xhr.onload = function() {
|
|
||||||
var json;
|
|
||||||
if (xhr.status != 200) {
|
|
||||||
failure('HTTP Error: ' + xhr.status);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
json = JSON.parse(xhr.responseText);
|
|
||||||
if (!json || typeof json.file_path != 'string') {
|
|
||||||
failure('Invalid JSON: ' + xhr.responseText);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
success(json.file_path);
|
|
||||||
};
|
|
||||||
formData = new FormData();
|
|
||||||
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
|
||||||
xhr.send(formData);
|
|
||||||
},
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
@ -1,3 +1,31 @@
|
|||||||
|
/* create,modify,view 페이지용 */
|
||||||
|
table.action_form {
|
||||||
|
/* 블록 요소로 변경 */
|
||||||
|
margin-left: auto;
|
||||||
|
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
||||||
|
margin-right: auto;
|
||||||
|
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
||||||
|
/* border: 1px solid blue; */
|
||||||
|
/* table-layout: fixed; 고정 레이아웃 */
|
||||||
|
border-collapse: collapse;
|
||||||
|
/* 테두리 결합 */
|
||||||
|
}
|
||||||
|
|
||||||
|
table.action_form th {
|
||||||
|
text-align: center;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.action_form td {
|
||||||
|
text-align: center;
|
||||||
|
word-wrap: break-word;
|
||||||
|
/* 긴 단어 강제 줄바꿈 */
|
||||||
|
white-space: normal;
|
||||||
|
/* 자동 줄바꿈 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create,modify,view 페이지용 */
|
||||||
|
|
||||||
/*조건검색*/
|
/*조건검색*/
|
||||||
nav.index_top nav.condition {
|
nav.index_top nav.condition {
|
||||||
border-color: 1px solid red;
|
border-color: 1px solid red;
|
||||||
@ -65,22 +93,18 @@ table.index_table thead th:active {
|
|||||||
cursor: grabbing;
|
cursor: grabbing;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_bottom {
|
div.index_batchjob {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-wrap: break-word;
|
|
||||||
/* 긴 단어 강제 줄바꿈 */
|
|
||||||
white-space: normal;
|
|
||||||
/* 자동 줄바꿈 */
|
|
||||||
/* border: 1px solid red; */
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav {
|
div.index_pagination {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
/* border: 1px solid red; */
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination {
|
div.index_pagination ul.pagination {
|
||||||
/* border: 1px solid green; */
|
/* border: 1px solid green; */
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
/* UL의 너비를 내용에 맞춤 */
|
/* UL의 너비를 내용에 맞춤 */
|
||||||
@ -91,61 +115,43 @@ div.index_pagination nav ul.pagination {
|
|||||||
/* 기본 점 스타일 제거 (옵션) */
|
/* 기본 점 스타일 제거 (옵션) */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li {
|
div.index_pagination ul.pagination li {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li a {
|
div.index_pagination ul.pagination li a {
|
||||||
padding: 5px 10px 5px 10px;
|
padding: 5px 10px 5px 10px;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #808080;
|
background-color: #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li.active a {
|
div.index_pagination ul.pagination li a:hover {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index_pagination ul.pagination li.active a {
|
||||||
color: black;
|
color: black;
|
||||||
border: 1px solid #808080;
|
border: 1px solid #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li a:hover {
|
div.index_bottom {
|
||||||
border: 1px solid black;
|
padding-top: 15px;
|
||||||
}
|
|
||||||
|
|
||||||
div.index_action_form {
|
|
||||||
margin-top: 20px;
|
|
||||||
/* border: 1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
div.index_action_form iframe {
|
|
||||||
width: 100%;
|
|
||||||
border: none;
|
|
||||||
/* border: 1px solid blue; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create,modify,view 페이지용 */
|
|
||||||
table.action_form {
|
|
||||||
/* 블록 요소로 변경 */
|
|
||||||
margin-left: auto;
|
|
||||||
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
|
||||||
margin-right: auto;
|
|
||||||
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
|
||||||
/* border: 1px solid blue; */
|
|
||||||
/* table-layout: fixed; 고정 레이아웃 */
|
|
||||||
border-collapse: collapse;
|
|
||||||
/* 테두리 결합 */
|
|
||||||
}
|
|
||||||
|
|
||||||
table.action_form th {
|
|
||||||
text-align: center;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.action_form td {
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
/* 긴 단어 강제 줄바꿈 */
|
/* 긴 단어 강제 줄바꿈 */
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
/* 자동 줄바꿈 */
|
/* 자동 줄바꿈 */
|
||||||
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create,modify,view 페이지용 */
|
div.index_bottom div.index_action_form {
|
||||||
|
margin-top: 20px;
|
||||||
|
/* border: 1px solid red; */
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index_bottom div.index_action_form iframe {
|
||||||
|
width: 100%;
|
||||||
|
border: none;
|
||||||
|
/* border: 1px solid blue; */
|
||||||
|
}
|
||||||
@ -1,18 +1,7 @@
|
|||||||
.rtc-hidden {
|
|
||||||
display: none !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rtc-wrapper {
|
|
||||||
position: relative;
|
|
||||||
overflow-x: auto;
|
|
||||||
}
|
|
||||||
|
|
||||||
.rtc-wrapper table.rtc-table {
|
.rtc-wrapper table.rtc-table {
|
||||||
table-layout: fixed;
|
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
width: auto;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.rtc-wrapper table.rtc-table thead,
|
.rtc-wrapper table.rtc-table thead,
|
||||||
@ -44,8 +33,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.rtc-wrapper table.rtc-table.rtc-table-resizing thead,
|
.rtc-wrapper table.rtc-table.rtc-table-resizing thead,
|
||||||
.rtc-wrapper table.rtc-table.rtc-table-resizing thead>th,
|
.rtc-wrapper table.rtc-table.rtc-table-resizing thead > th,
|
||||||
.rtc-wrapper table.rtc-table.rtc-table-resizing thead>th>a {
|
.rtc-wrapper table.rtc-table.rtc-table-resizing thead > th > a {
|
||||||
cursor: col-resize;
|
cursor: col-resize;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1,3 +1,31 @@
|
|||||||
|
/* create,modify,view 페이지용 */
|
||||||
|
table.action_form {
|
||||||
|
/* 블록 요소로 변경 */
|
||||||
|
margin-left: auto;
|
||||||
|
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
||||||
|
margin-right: auto;
|
||||||
|
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
||||||
|
/* border: 1px solid blue; */
|
||||||
|
/* table-layout: fixed; 고정 레이아웃 */
|
||||||
|
border-collapse: collapse;
|
||||||
|
/* 테두리 결합 */
|
||||||
|
}
|
||||||
|
|
||||||
|
table.action_form th {
|
||||||
|
text-align: center;
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.action_form td {
|
||||||
|
text-align: center;
|
||||||
|
word-wrap: break-word;
|
||||||
|
/* 긴 단어 강제 줄바꿈 */
|
||||||
|
white-space: normal;
|
||||||
|
/* 자동 줄바꿈 */
|
||||||
|
}
|
||||||
|
|
||||||
|
/* create,modify,view 페이지용 */
|
||||||
|
|
||||||
/*조건검색*/
|
/*조건검색*/
|
||||||
nav.index_top nav.condition {
|
nav.index_top nav.condition {
|
||||||
border-color: 1px solid red;
|
border-color: 1px solid red;
|
||||||
@ -41,9 +69,8 @@ nav.index_top nav.pageinfo {
|
|||||||
/* Table 부분 */
|
/* Table 부분 */
|
||||||
table.index_table {
|
table.index_table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
/* table-layout: fixed; 고정 레이아웃 */
|
/* table-layout: fixed; */
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
/* 테두리 결합 */
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.index_table thead th {
|
table.index_table thead th {
|
||||||
@ -58,22 +85,26 @@ table.index_table thead th {
|
|||||||
/* border:1px solid silver; */
|
/* border:1px solid silver; */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_bottom {
|
table.index_table thead th.index_head_short_column {
|
||||||
|
width: 80px;
|
||||||
|
}
|
||||||
|
|
||||||
|
table.index_table thead th:active {
|
||||||
|
cursor: grabbing;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index_batchjob {
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-wrap: break-word;
|
|
||||||
/* 긴 단어 강제 줄바꿈 */
|
|
||||||
white-space: normal;
|
|
||||||
/* 자동 줄바꿈 */
|
|
||||||
/* border: 1px solid red; */
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav {
|
div.index_pagination {
|
||||||
margin-top: 20px;
|
margin-top: 20px;
|
||||||
/* border: 1px solid red; */
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination {
|
div.index_pagination ul.pagination {
|
||||||
/* border: 1px solid green; */
|
/* border: 1px solid green; */
|
||||||
width: fit-content;
|
width: fit-content;
|
||||||
/* UL의 너비를 내용에 맞춤 */
|
/* UL의 너비를 내용에 맞춤 */
|
||||||
@ -84,73 +115,43 @@ div.index_pagination nav ul.pagination {
|
|||||||
/* 기본 점 스타일 제거 (옵션) */
|
/* 기본 점 스타일 제거 (옵션) */
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li {
|
div.index_pagination ul.pagination li {
|
||||||
margin-left: 5px;
|
margin-left: 5px;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li a {
|
div.index_pagination ul.pagination li a {
|
||||||
padding: 5px 10px 5px 10px;
|
padding: 5px 10px 5px 10px;
|
||||||
font-size: 1.5rem;
|
font-size: 1.5rem;
|
||||||
color: white;
|
color: white;
|
||||||
background-color: #808080;
|
background-color: #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li.active a {
|
div.index_pagination ul.pagination li a:hover {
|
||||||
|
border: 1px solid black;
|
||||||
|
}
|
||||||
|
|
||||||
|
div.index_pagination ul.pagination li.active a {
|
||||||
color: black;
|
color: black;
|
||||||
border: 1px solid #808080;
|
border: 1px solid #808080;
|
||||||
}
|
}
|
||||||
|
|
||||||
div.index_pagination nav ul.pagination li a:hover {
|
div.index_bottom {
|
||||||
border: 1px solid black;
|
padding-top: 15px;
|
||||||
}
|
|
||||||
|
|
||||||
div.index_action_form {
|
|
||||||
margin-top: 20px;
|
|
||||||
/* border: 1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
div.index_action_form iframe {
|
|
||||||
width: 100%;
|
|
||||||
border: none;
|
|
||||||
/* border: 1px solid blue; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* create,modify,view 페이지용 */
|
|
||||||
table.action_form {
|
|
||||||
/* 블록 요소로 변경 */
|
|
||||||
margin-left: auto;
|
|
||||||
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
|
||||||
margin-right: auto;
|
|
||||||
/* 자동 여백을 이용한 가로 가운데 정렬 */
|
|
||||||
/* border: 1px solid blue; */
|
|
||||||
/* table-layout: fixed; 고정 레이아웃 */
|
|
||||||
border-collapse: collapse;
|
|
||||||
/* 테두리 결합 */
|
|
||||||
}
|
|
||||||
|
|
||||||
table.action_form th {
|
|
||||||
text-align: center;
|
|
||||||
background-color: #f5f5f5;
|
|
||||||
}
|
|
||||||
|
|
||||||
table.action_form td {
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
/* 긴 단어 강제 줄바꿈 */
|
/* 긴 단어 강제 줄바꿈 */
|
||||||
white-space: normal;
|
white-space: normal;
|
||||||
/* 자동 줄바꿈 */
|
/* 자동 줄바꿈 */
|
||||||
|
/* border: 1px solid red; */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* create,modify,view 페이지용 */
|
div.index_bottom div.index_action_form {
|
||||||
div.login-container {
|
margin-top: 20px;
|
||||||
position: absolute;
|
/* border: 1px solid red; */
|
||||||
top: 50%;
|
}
|
||||||
left: 50%;
|
|
||||||
transform: translate(-50%, -50%);
|
div.index_bottom div.index_action_form iframe {
|
||||||
width: 400px;
|
width: 100%;
|
||||||
height: 380px;
|
border: none;
|
||||||
margin: auto;
|
/* border: 1px solid blue; */
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
justify-content: center;
|
|
||||||
}
|
}
|
||||||
@ -1,207 +0,0 @@
|
|||||||
/* ------------------------------------------------------------
|
|
||||||
* Name : admin.css
|
|
||||||
* Desc : Admin StyleSheet
|
|
||||||
* Created : 2016/9/11 Tri-aBility by Junheum,Choi
|
|
||||||
* Updated :
|
|
||||||
------------------------------------------------------------ */
|
|
||||||
* {
|
|
||||||
margin: 0px;
|
|
||||||
padding: 0px;
|
|
||||||
font-size: 14px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* #head{
|
|
||||||
border:1px solid blue;
|
|
||||||
} */
|
|
||||||
#tail{
|
|
||||||
text-align:center;
|
|
||||||
/* border:1px solid green; */
|
|
||||||
}
|
|
||||||
#layout {
|
|
||||||
width:1280px;
|
|
||||||
/* border:1px solid blue; */
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout #body{
|
|
||||||
padding-left:10px;
|
|
||||||
/* border:1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
#layout #body nav.header{
|
|
||||||
/*content 상단라인*/
|
|
||||||
padding-top:40px;
|
|
||||||
margin-left:30px;
|
|
||||||
border-bottom:1px solid silver;
|
|
||||||
}
|
|
||||||
#layout #body nav.header nav h4.title{
|
|
||||||
font-size:26px;
|
|
||||||
font-weight:bold;
|
|
||||||
}
|
|
||||||
#layout #body nav.header nav span.flow{
|
|
||||||
color: gray;
|
|
||||||
}
|
|
||||||
#layout #body div.footer
|
|
||||||
/*content 하단라인*/{
|
|
||||||
height:20px;
|
|
||||||
/* border-top:0px;
|
|
||||||
border-left:1px solid silver;
|
|
||||||
border-bottom:1px solid silver;
|
|
||||||
border-right:1px solid silver;
|
|
||||||
border-radius: 0px 0px 10px 10px;
|
|
||||||
background-color:white; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* reset */
|
|
||||||
html {overflow-y:scroll;}
|
|
||||||
body,p,h1,h2,h3,h4,h5,h6,ul,ol,li,dl,dt,dd,table,th,td,form,fieldset,legend,input,textarea,button,select,figure,figcaption{margin:0;padding:0}
|
|
||||||
body,input,textarea,select,button,table{font-family:'Noto Sans KR', helvetica,sans-serif;font-size:16px;letter-spacing:-0.2px;line-height:1.7em;color:#505050;word-break:keep-all; -webkit-text-size-adjust:none;}
|
|
||||||
img{border:0}
|
|
||||||
ul,ol{list-style:none}
|
|
||||||
fieldset{border:none}
|
|
||||||
fieldset legend {position:absolute;visibility:hidden;overflow:hidden;width:0;height:0;margin:0;padding:0;font:0/0 Arial;}
|
|
||||||
button{cursor:pointer}
|
|
||||||
header,hgroup,article,nav,footer,figure,figcaption,canvas,section,time{display:block}
|
|
||||||
hr {clear:both;display:none;}
|
|
||||||
li img, dd img {vertical-align:top;}
|
|
||||||
*html body img {margin:none; padding:none;} /*for IE 6*/
|
|
||||||
* {max-height: 1000000px;}
|
|
||||||
|
|
||||||
a{
|
|
||||||
color:#5d5d5d;
|
|
||||||
text-decoration:none;
|
|
||||||
-webkit-transition: all 0.2s ease-in-out;
|
|
||||||
-moz-transition: all 0.2s ease-in-out;
|
|
||||||
-ms-transition: all 0.2s ease-in-out;
|
|
||||||
-o-transition: all 0.2s ease-in-out;
|
|
||||||
transition: all 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
a:hover,
|
|
||||||
a:active{
|
|
||||||
color:#000;
|
|
||||||
text-decoration:none;
|
|
||||||
-webkit-transition: all 0.2s ease-in-out;
|
|
||||||
-moz-transition: all 0.2s ease-in-out;
|
|
||||||
-ms-transition: all 0.2s ease-in-out;
|
|
||||||
-o-transition: all 0.2s ease-in-out;
|
|
||||||
transition: all 0.2s ease-in-out;
|
|
||||||
}
|
|
||||||
|
|
||||||
::-webkit-input-placeholder {color:#999;}
|
|
||||||
:-moz-placeholder {color:#999;}
|
|
||||||
::-moz-placeholder {color:#999;}
|
|
||||||
:-ms-input-placeholder {color:#999;}
|
|
||||||
:placeholder-shown {color:#999;}
|
|
||||||
|
|
||||||
table caption {visibility:hidden; overflow:hidden; width:0; height:0; margin:0; padding:0; font:0/0 Arial;}
|
|
||||||
input[type="radio"], input[type="checkbox"] {vertical-align:middle !important; margin:-2px 3px 0 0 !important; background:transparent;}
|
|
||||||
input,select {vertical-align:middle; background:#fff;}
|
|
||||||
|
|
||||||
|
|
||||||
/* user class */
|
|
||||||
h1,h2,h3,h4,h5,h6,strong,th,.bold{font-weight:500;}
|
|
||||||
.clear{clear:both;}
|
|
||||||
.clearfix:after {content:" "; display:block; clear:both;}
|
|
||||||
.hide {position:absolute;visibility:hidden;overflow:hidden;width:0;height:0;margin:0;padding:0;font:0/0 Arial;}
|
|
||||||
.pointer {cursor:pointer;}
|
|
||||||
.input {height:35px; padding:0 0 0 10px; font-size:15px; line-height:33px; border:1px solid #ddd; box-sizing:border-box;}
|
|
||||||
.textarea {padding:10px; font-size:15px; line-height:33px; border:1px solid #ddd; resize:none; overflow:auto; box-sizing:border-box;}
|
|
||||||
.select {height:35px; padding:0 0 0 10px; font-size:15px; border:1px solid #ddd; box-sizing:border-box;}
|
|
||||||
|
|
||||||
.mgb2 {margin-bottom:2px !important;}
|
|
||||||
.mgb3 {margin-bottom:3px !important;}
|
|
||||||
.mgb4 {margin-bottom:4px !important;}
|
|
||||||
.mgb5 {margin-bottom:5px !important;}
|
|
||||||
.mgb6 {margin-bottom:6px !important;}
|
|
||||||
.mgb7 {margin-bottom:7px !important;}
|
|
||||||
.mgb8 {margin-bottom:8px !important;}
|
|
||||||
.mgb9 {margin-bottom:9px !important;}
|
|
||||||
.mgb10 {margin-bottom:10px !important;}
|
|
||||||
.mgb15 {margin-bottom:15px !important;}
|
|
||||||
.mgb20 {margin-bottom:20px !important;}
|
|
||||||
.mgb25 {margin-bottom:25px !important;}
|
|
||||||
.mgb30 {margin-bottom:30px !important;}
|
|
||||||
.mgb35 {margin-bottom:35px !important;}
|
|
||||||
.mgb40 {margin-bottom:40px !important;}
|
|
||||||
.mgb45 {margin-bottom:45px !important;}
|
|
||||||
.mgb50 {margin-bottom:50px !important;}
|
|
||||||
.mgb60 {margin-bottom:60px !important;}
|
|
||||||
.mgb70 {margin-bottom:70px !important;}
|
|
||||||
.mgb75 {margin-bottom:75px !important;}
|
|
||||||
.mgb90 {margin-bottom:90px !important;}
|
|
||||||
|
|
||||||
.fl {float:left;}
|
|
||||||
.fr {float:right;}
|
|
||||||
|
|
||||||
.space-center {text-align:center !important;}
|
|
||||||
.space-right {text-align:right !important;}
|
|
||||||
.space-left {text-align:left !important;}
|
|
||||||
|
|
||||||
.text-blue {color:#284685}
|
|
||||||
.text-red {color:#b4260b}
|
|
||||||
.text-gray {color:#999}
|
|
||||||
.text-black {color:#000}
|
|
||||||
|
|
||||||
|
|
||||||
.line-through {text-decoration:line-through;}
|
|
||||||
|
|
||||||
.main-bnr {width:1200px; position:relative; margin:-120px auto 60px; z-index:12}
|
|
||||||
.main-bnr ul:after {content:" "; display:block; clear:both;}
|
|
||||||
.main-bnr ul li {float:left; width:33.333%; height:180px; background-repeat:no-repeat; background-position:40px 50%;}
|
|
||||||
.main-bnr ul li.bg1 {background-color:#41adde; background-image:url('/images/main/icon1.png');}
|
|
||||||
.main-bnr ul li.bg2 {background-color:#0280c9; background-image:url('/images/main/icon2.png');}
|
|
||||||
.main-bnr ul li.bg3 {background-color:#30539f; background-image:url('/images/main/icon3.png');}
|
|
||||||
.main-bnr ul li .info {padding-left:180px; display:table; height:180px; color:#fff}
|
|
||||||
.main-bnr ul li .info dl {width:100%; display:table-cell; vertical-align:middle;}
|
|
||||||
.main-bnr ul li .info dl dt {font-size:18px; line-height:1.7em; font-weight:500; margin-bottom:10px;}
|
|
||||||
.main-bnr ul li .info dl dd {font-size:15px; line-height:1.7em;}
|
|
||||||
|
|
||||||
.main-bnr2 {width:1200px; position:relative; margin:20px auto 60px; z-index:12;}
|
|
||||||
.main-bnr2 ul:after {content:" "; display:block; clear:both;}
|
|
||||||
.main-bnr2 ul li {float:left; width:33.333%; height:180px; background-repeat:no-repeat; background-position:40px 50%;}
|
|
||||||
.main-bnr2 ul li.bg1 {background-color:#41adde; background-image:url('/images/main/icon1.png');}
|
|
||||||
.main-bnr2 ul li.bg2 {background-color:#0280c9; background-image:url('/images/main/icon2.png');}
|
|
||||||
.main-bnr2 ul li.bg3 {background-color:#30539f; background-image:url('/images/main/icon3.png');}
|
|
||||||
.main-bnr2 ul li .info {padding-left:180px; display:table; width:100%; height:180px; color:#fff;}
|
|
||||||
.main-bnr2 ul li .info dl {width:100%; display:table-cell; vertical-align:middle;}
|
|
||||||
.main-bnr2 ul li .info dl dt {font-size:24px; line-height:1.7em; font-weight:500; margin-bottom:10px;}
|
|
||||||
.main-bnr2 ul li .info dl dd {font-size:15px; line-height:1.7em;}
|
|
||||||
.main-bnr2 ul li .info dl dd a{color:white;}
|
|
||||||
.main-bnr2 ul li .info dl dd span{float:right; padding-right:20px;}
|
|
||||||
|
|
||||||
.main-title {text-align:center; margin-bottom:40px;}
|
|
||||||
.main-title h2 {font-size:28px; line-height:1.6em; font-weight:700; color:#333;}
|
|
||||||
.main-title p {color:#656565; font-size:17px;line-height:1.6em;}
|
|
||||||
|
|
||||||
.main-price {margin:0 -10px 80px; overflow:hidden;}
|
|
||||||
.main-price:after{content:"";display:block;clear:both;}
|
|
||||||
.main-price .col {float:left; width:50%; padding:0 10px; box-sizing:border-box; margin-bottom:20px;}
|
|
||||||
.main-price .col:nth-child(2n+1) {clear:left;}
|
|
||||||
.main-table.type2 table thead th {background:#0280c9}
|
|
||||||
.main-table table {width:100%; border-collapse:collapse; border-spacing:0px;}
|
|
||||||
.main-table table thead th {padding:9px 10px; height:35px; font-size:22px; font-weight:500; line-height:22px; color:#fff; background:#30539f}
|
|
||||||
.main-table table tbody th {padding:9px 10px; height:35px; font-size:16px; font-weight:500; line-height:22px; color:#333; border-bottom:1px solid #d6d6d6; background:#eaeef4;}
|
|
||||||
.main-table table tbody td {padding:9px 20px; color:#2c2c2c; font-size:16px; line-height:22px; border-bottom:1px solid #d6d6d6; background:#f8f8f8}
|
|
||||||
.main-table table tbody th.none,.main-table table tbody td.none {border-bottom:0}
|
|
||||||
.main-table .f-back {background-color:#e62b2b; color:#fff; }
|
|
||||||
.main-table strong {font-weight:500}
|
|
||||||
|
|
||||||
.main-service {background:url('/images/main/bg_bnr.jpg') 50% 0 no-repeat; width:100%; height:330px;}
|
|
||||||
.main-service .col {float:left; width:50%; height:330px; display:table; text-align:center;}
|
|
||||||
.main-service .col .link {width:600px; height:330px; display:table-cell; vertical-align:middle; color:#fff;}
|
|
||||||
.main-service .col .link dl dt {font-size:30px; line-height:1.4em; font-weight:500; margin-bottom:5px;}
|
|
||||||
.main-service .col .link dl dd {font-size:17px; line-height:1.4em; margin-bottom:20px;}
|
|
||||||
.main-service .col .link .more {font-size:15px; line-height:1.4em; opacity:.8}
|
|
||||||
.main-service .col .link .more .arrow {margin:0 3px;position:relative;border: solid #ddd;border-width: 0 2px 2px 0;transform: rotate(-45deg);display: inline-block;padding: 3px;}
|
|
||||||
.main-service .col a {display:block;}
|
|
||||||
|
|
||||||
.main-notice {background:#f5f5f5; padding:60px 0;}
|
|
||||||
.main-notice .title {float:left; width:511px; height:276px; color:#fff; background:url('/images/main/bg_notice.gif') 0 0 no-repeat;}
|
|
||||||
.main-notice .title dl {padding:50px}
|
|
||||||
.main-notice .title dl dt {font-size:32px; line-height:1.4em; font-weight:500; margin-bottom:5px;}
|
|
||||||
.main-notice .title dl dd {font-size:16px; line-height:1.4em; color:#cbcfd9;}
|
|
||||||
.main-notice .list {float:left; width:688px; height:276px; background:#fff; border:1px solid #ddd; border-left:0; box-sizing:border-box;}
|
|
||||||
.main-notice .list ul {padding:15px 40px 0;}
|
|
||||||
.main-notice .list ul li {line-height:49px; height:49px; border-bottom:1px solid silver; position:relative;}
|
|
||||||
.main-notice .list ul li:last-child {border-bottom:0}
|
|
||||||
.main-notice .list ul li a {display:inline-block; font-size:16px; font-weight:bold; width:500px; height:49px; white-space:nowrap;overflow:hidden;text-overflow:ellipsis; }
|
|
||||||
.main-notice .list span {position:absolute; top:0; right:0; font-size:14px; color:#959595;}
|
|
||||||
@ -1,110 +0,0 @@
|
|||||||
div#content {
|
|
||||||
color: black;
|
|
||||||
padding-top: 20px;
|
|
||||||
padding-left: 30px;
|
|
||||||
margin-bottom: 40px;
|
|
||||||
/* border-left:1px solid silver;
|
|
||||||
border-right:1px solid silver; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* div#content div.top{
|
|
||||||
border:1px solid red;
|
|
||||||
} */
|
|
||||||
|
|
||||||
/*페이지정보*/
|
|
||||||
div#content div.top nav span.pageinfo {
|
|
||||||
font-weight: bold;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*검색*/
|
|
||||||
div#content div.top nav input[type=text] {
|
|
||||||
width: 200px;
|
|
||||||
height: 40px;
|
|
||||||
border-radius: 0px !important;
|
|
||||||
/* border:1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*검색submit*/
|
|
||||||
div#content div.top nav input[type=submit] {
|
|
||||||
font-size: 1.5rem;
|
|
||||||
font-weight: bold;
|
|
||||||
width: 80px;
|
|
||||||
height: 40px;
|
|
||||||
color: white;
|
|
||||||
border-radius: 0px !important;
|
|
||||||
background-color: #555555;
|
|
||||||
/* border:1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/*Excel Icon*/
|
|
||||||
div#content div.top nav a {
|
|
||||||
border-radius: 0px !important;
|
|
||||||
/* border:1px solid red; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Table 부분 */
|
|
||||||
div#content table {
|
|
||||||
width: 100%;
|
|
||||||
/* overflow-x: auto;
|
|
||||||
padding-top:5px;
|
|
||||||
padding-bottom:5px; */
|
|
||||||
}
|
|
||||||
|
|
||||||
/* insert,update,reply,view Form Page 관련 전용*/
|
|
||||||
div#content table.form tbody tr td.label {
|
|
||||||
width: 10%;
|
|
||||||
text-align: right;
|
|
||||||
padding-right: 20px;
|
|
||||||
background-color: #e8ebe9;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content table.form tbody tr td.column {
|
|
||||||
height: 27px;
|
|
||||||
text-align: left;
|
|
||||||
padding-left: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* insert,update,reply,view Form Page 관련 전용*/
|
|
||||||
|
|
||||||
/* 상품 리스트 전용 */
|
|
||||||
div#content table.product tr:first-child {
|
|
||||||
border-top: 2px solid black;
|
|
||||||
border-bottom: 1px solid silver;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* 상품 리스트 전용 */
|
|
||||||
|
|
||||||
div#content table thead th {
|
|
||||||
white-space: nowrap;
|
|
||||||
padding-top: 15px;
|
|
||||||
padding-bottom: 15px;
|
|
||||||
font-size: 1.5rem;
|
|
||||||
font-weight: bold;
|
|
||||||
border-top: 2px solid black;
|
|
||||||
border-bottom: 1px solid silver;
|
|
||||||
background-color: #F5F5F5;
|
|
||||||
/* border:1px solid silver; */
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content table thead th.index_head_short_column {
|
|
||||||
width: 80px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content div.bottom {
|
|
||||||
padding-top: 15px;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content div.bottom ul.pagination {
|
|
||||||
margin-top: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content div.bottom ul.pagination li.page-item a {
|
|
||||||
border: 0px;
|
|
||||||
border-radius: 0px !important;
|
|
||||||
background-color: #e8ebe9;
|
|
||||||
}
|
|
||||||
|
|
||||||
div#content div.bottom ul.pagination li.active a {
|
|
||||||
background-color: gray;
|
|
||||||
}
|
|
||||||
61
public/js/admin/index.js
Normal file
61
public/js/admin/index.js
Normal file
@ -0,0 +1,61 @@
|
|||||||
|
$(document).ready(function () {
|
||||||
|
//class가 calender인 inputbox용,날짜field용
|
||||||
|
$(".calender").datepicker({
|
||||||
|
changeYear: true,
|
||||||
|
changeMonth: true,
|
||||||
|
yearRange: "-10:+0",
|
||||||
|
dateFormat: "yy-mm-dd"
|
||||||
|
});
|
||||||
|
//id가 batchjobuids_checkbox인 버튼을 클릭시 class가 batchjobuids_checkboxs인 checkbox용
|
||||||
|
$('#batchjobuids_checkbox').click(function (event) {
|
||||||
|
if (this.checked) {
|
||||||
|
$('.batchjobuids_checkboxs').each(function () { //loop checkbox
|
||||||
|
$(this).prop('checked', true); //check
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
$('.batchjobuids_checkboxs').each(function () { //loop checkbox
|
||||||
|
$(this).prop('checked', false); //uncheck
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
//class가 select-field인 SelectBox용
|
||||||
|
$(".select-field").select2({
|
||||||
|
theme: "classic",
|
||||||
|
width: 'style',
|
||||||
|
dropdownAutoWidth: true
|
||||||
|
});
|
||||||
|
// text editor 초기화
|
||||||
|
//참고: https://phppot.com/menu/php/learn-php/
|
||||||
|
// class가 editor인 textarea용
|
||||||
|
tinymce.init({
|
||||||
|
selector: 'textarea.tinymce',
|
||||||
|
plugins: ['code', 'image', 'preview', 'table', 'emoticons', 'autoresize'],
|
||||||
|
height: 600,
|
||||||
|
// content_style: 'body { font-family:Helvetica,Arial,sans-serif; font-size:16px }'
|
||||||
|
automatic_uploads: false,
|
||||||
|
images_upload_url: '/tinymce_upload.php',
|
||||||
|
// images_upload_base_path: '/upload_images',
|
||||||
|
images_upload_handler: function (blobInfo, success, failure) {
|
||||||
|
var xhr, formData;
|
||||||
|
xhr = new XMLHttpRequest();
|
||||||
|
xhr.withCredentials = false;
|
||||||
|
xhr.open('POST', '/tinymce_upload.php');
|
||||||
|
xhr.onload = function () {
|
||||||
|
var json;
|
||||||
|
if (xhr.status != 200) {
|
||||||
|
failure('HTTP Error: ' + xhr.status);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
json = JSON.parse(xhr.responseText);
|
||||||
|
if (!json || typeof json.file_path != 'string') {
|
||||||
|
failure('Invalid JSON: ' + xhr.responseText);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
success(json.file_path);
|
||||||
|
};
|
||||||
|
formData = new FormData();
|
||||||
|
formData.append('file', blobInfo.blob(), blobInfo.filename());
|
||||||
|
xhr.send(formData);
|
||||||
|
},
|
||||||
|
});
|
||||||
|
});
|
||||||
@ -1,8 +1,9 @@
|
|||||||
(function (global, factory) {
|
(function (global, factory) {
|
||||||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
|
||||||
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
typeof define === 'function' && define.amd ? define(['exports'], factory) :
|
||||||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.validide_resizableTableColumns = {}));
|
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.validide_resizableTableColumns = {}));
|
||||||
})(this, (function (exports) { 'use strict';
|
})(this, (function (exports) {
|
||||||
|
'use strict';
|
||||||
|
|
||||||
var ResizableConstants = /** @class */ (function () {
|
var ResizableConstants = /** @class */ (function () {
|
||||||
function ResizableConstants() {
|
function ResizableConstants() {
|
||||||
@ -290,11 +291,11 @@
|
|||||||
var _this = this;
|
var _this = this;
|
||||||
this.tableHeaders
|
this.tableHeaders
|
||||||
.forEach(function (el) {
|
.forEach(function (el) {
|
||||||
_this.originalWidths.push({
|
_this.originalWidths.push({
|
||||||
el: el,
|
el: el,
|
||||||
detail: el.style.width
|
detail: el.style.width
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
this.originalWidths.push({
|
this.originalWidths.push({
|
||||||
el: this.table,
|
el: this.table,
|
||||||
detail: this.table.style.width
|
detail: this.table.style.width
|
||||||
@ -303,20 +304,20 @@
|
|||||||
ResizableTableColumns.prototype.restoreOriginalWidths = function () {
|
ResizableTableColumns.prototype.restoreOriginalWidths = function () {
|
||||||
this.originalWidths
|
this.originalWidths
|
||||||
.forEach(function (itm) {
|
.forEach(function (itm) {
|
||||||
itm.el.style.width = itm.detail;
|
itm.el.style.width = itm.detail;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.setHeaderWidths = function () {
|
ResizableTableColumns.prototype.setHeaderWidths = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
this.tableHeaders
|
this.tableHeaders
|
||||||
.forEach(function (el) {
|
.forEach(function (el) {
|
||||||
var width = el.offsetWidth;
|
var width = el.offsetWidth;
|
||||||
var constrainedWidth = _this.constrainWidth(el, width);
|
var constrainedWidth = _this.constrainWidth(el, width);
|
||||||
if (typeof _this.options.maxInitialWidthHint === 'number') {
|
if (typeof _this.options.maxInitialWidthHint === 'number') {
|
||||||
constrainedWidth = Math.min(constrainedWidth, _this.options.maxInitialWidthHint);
|
constrainedWidth = Math.min(constrainedWidth, _this.options.maxInitialWidthHint);
|
||||||
}
|
}
|
||||||
_this.updateWidth(el, constrainedWidth, true, false);
|
_this.updateWidth(el, constrainedWidth, true, false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.constrainWidth = function (el, width) {
|
ResizableTableColumns.prototype.constrainWidth = function (el, width) {
|
||||||
var result = width;
|
var result = width;
|
||||||
@ -334,16 +335,16 @@
|
|||||||
this.dragHandlesContainer.classList.add(ResizableConstants.classes.handleContainer);
|
this.dragHandlesContainer.classList.add(ResizableConstants.classes.handleContainer);
|
||||||
this.getResizableHeaders()
|
this.getResizableHeaders()
|
||||||
.forEach(function () {
|
.forEach(function () {
|
||||||
var _a;
|
var _a;
|
||||||
var handler = _this.ownerDocument.createElement('div');
|
var handler = _this.ownerDocument.createElement('div');
|
||||||
handler.classList.add(ResizableConstants.classes.handle);
|
handler.classList.add(ResizableConstants.classes.handle);
|
||||||
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.appendChild(handler);
|
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.appendChild(handler);
|
||||||
});
|
});
|
||||||
ResizableConstants.events.pointerDown
|
ResizableConstants.events.pointerDown
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
var _a;
|
var _a;
|
||||||
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.addEventListener(evt, _this.onPointerDownRef, false);
|
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.addEventListener(evt, _this.onPointerDownRef, false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.destroyDragHandles = function () {
|
ResizableTableColumns.prototype.destroyDragHandles = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
@ -351,9 +352,9 @@
|
|||||||
if (this.dragHandlesContainer !== null) {
|
if (this.dragHandlesContainer !== null) {
|
||||||
ResizableConstants.events.pointerDown
|
ResizableConstants.events.pointerDown
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
var _a;
|
var _a;
|
||||||
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.removeEventListener(evt, _this.onPointerDownRef, false);
|
(_a = _this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.removeEventListener(evt, _this.onPointerDownRef, false);
|
||||||
});
|
});
|
||||||
(_b = (_a = this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.removeChild(this.dragHandlesContainer);
|
(_b = (_a = this.dragHandlesContainer) === null || _a === void 0 ? void 0 : _a.parentElement) === null || _b === void 0 ? void 0 : _b.removeChild(this.dragHandlesContainer);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -376,11 +377,11 @@
|
|||||||
return;
|
return;
|
||||||
this.getResizableHeaders()
|
this.getResizableHeaders()
|
||||||
.forEach(function (el) {
|
.forEach(function (el) {
|
||||||
var width = data.columns[ResizableTableColumns.generateColumnId(el)];
|
var width = data.columns[ResizableTableColumns.generateColumnId(el)];
|
||||||
if (typeof width !== 'undefined') {
|
if (typeof width !== 'undefined') {
|
||||||
ResizableTableColumns.setWidth(el, width);
|
ResizableTableColumns.setWidth(el, width);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
if (typeof data.table !== 'undefined') {
|
if (typeof data.table !== 'undefined') {
|
||||||
ResizableTableColumns.setWidth(this.table, data.table);
|
ResizableTableColumns.setWidth(this.table, data.table);
|
||||||
}
|
}
|
||||||
@ -397,15 +398,15 @@
|
|||||||
var headersDetails = [];
|
var headersDetails = [];
|
||||||
this.tableHeaders
|
this.tableHeaders
|
||||||
.forEach(function (el, idx) {
|
.forEach(function (el, idx) {
|
||||||
if (el.hasAttribute(ResizableConstants.attributes.dataResizable)) {
|
if (el.hasAttribute(ResizableConstants.attributes.dataResizable)) {
|
||||||
var detail = {
|
var detail = {
|
||||||
el: el,
|
el: el,
|
||||||
detail: el.offsetWidth
|
detail: el.offsetWidth
|
||||||
};
|
};
|
||||||
headersDetails.push(detail);
|
headersDetails.push(detail);
|
||||||
resizableWidth += detail.detail;
|
resizableWidth += detail.detail;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var leftToAdd = 0;
|
var leftToAdd = 0;
|
||||||
var lastResizableCell = null;
|
var lastResizableCell = null;
|
||||||
var currentDetail;
|
var currentDetail;
|
||||||
@ -435,22 +436,22 @@
|
|||||||
var headers = this.getResizableHeaders();
|
var headers = this.getResizableHeaders();
|
||||||
this.getDragHandlers()
|
this.getDragHandlers()
|
||||||
.forEach(function (el, idx) {
|
.forEach(function (el, idx) {
|
||||||
var height = (_this.options.resizeFromBody ? _this.table : _this.table.tHead).clientHeight;
|
var height = (_this.options.resizeFromBody ? _this.table : _this.table.tHead).clientHeight;
|
||||||
if (idx < headers.length) {
|
if (idx < headers.length) {
|
||||||
var th = headers[idx];
|
var th = headers[idx];
|
||||||
var left = th.offsetWidth;
|
var left = th.offsetWidth;
|
||||||
left += ResizableTableColumns.getOffset(th).left;
|
left += ResizableTableColumns.getOffset(th).left;
|
||||||
left -= ResizableTableColumns.getOffset(_this.dragHandlesContainer).left;
|
left -= ResizableTableColumns.getOffset(_this.dragHandlesContainer).left;
|
||||||
el.style.left = "".concat(left, "px");
|
el.style.left = "".concat(left, "px");
|
||||||
el.style.height = "".concat(height, "px");
|
el.style.height = "".concat(height, "px");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.getResizableHeaders = function () {
|
ResizableTableColumns.prototype.getResizableHeaders = function () {
|
||||||
return this.tableHeaders
|
return this.tableHeaders
|
||||||
.filter(function (el, idx) {
|
.filter(function (el, idx) {
|
||||||
return el.hasAttribute(ResizableConstants.attributes.dataResizable);
|
return el.hasAttribute(ResizableConstants.attributes.dataResizable);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.handlePointerDown = function (event) {
|
ResizableTableColumns.prototype.handlePointerDown = function (event) {
|
||||||
this.handlePointerUp();
|
this.handlePointerUp();
|
||||||
@ -561,10 +562,10 @@
|
|||||||
var indicesToSkip = [];
|
var indicesToSkip = [];
|
||||||
this.tableHeaders
|
this.tableHeaders
|
||||||
.forEach(function (el, idx) {
|
.forEach(function (el, idx) {
|
||||||
if (!el.hasAttribute(ResizableConstants.attributes.dataResizable)) {
|
if (!el.hasAttribute(ResizableConstants.attributes.dataResizable)) {
|
||||||
indicesToSkip.push(idx);
|
indicesToSkip.push(idx);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
var span = this.ownerDocument.createElement('span');
|
var span = this.ownerDocument.createElement('span');
|
||||||
span.style.position = 'absolute';
|
span.style.position = 'absolute';
|
||||||
span.style.left = '-99999px';
|
span.style.left = '-99999px';
|
||||||
@ -628,23 +629,23 @@
|
|||||||
var _this = this;
|
var _this = this;
|
||||||
ResizableConstants.events.pointerMove
|
ResizableConstants.events.pointerMove
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
_this.ownerDocument.addEventListener(evt, _this.onPointerMoveRef, false);
|
_this.ownerDocument.addEventListener(evt, _this.onPointerMoveRef, false);
|
||||||
});
|
});
|
||||||
ResizableConstants.events.pointerUp
|
ResizableConstants.events.pointerUp
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
_this.ownerDocument.addEventListener(evt, _this.onPointerUpRef, false);
|
_this.ownerDocument.addEventListener(evt, _this.onPointerUpRef, false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.detachHandlers = function () {
|
ResizableTableColumns.prototype.detachHandlers = function () {
|
||||||
var _this = this;
|
var _this = this;
|
||||||
ResizableConstants.events.pointerMove
|
ResizableConstants.events.pointerMove
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
_this.ownerDocument.removeEventListener(evt, _this.onPointerMoveRef, false);
|
_this.ownerDocument.removeEventListener(evt, _this.onPointerMoveRef, false);
|
||||||
});
|
});
|
||||||
ResizableConstants.events.pointerUp
|
ResizableConstants.events.pointerUp
|
||||||
.forEach(function (evt, evtIdx) {
|
.forEach(function (evt, evtIdx) {
|
||||||
_this.ownerDocument.removeEventListener(evt, _this.onPointerUpRef, false);
|
_this.ownerDocument.removeEventListener(evt, _this.onPointerUpRef, false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.refreshWrapperStyle = function () {
|
ResizableTableColumns.prototype.refreshWrapperStyle = function () {
|
||||||
if (this.wrapper == null)
|
if (this.wrapper == null)
|
||||||
@ -665,8 +666,8 @@
|
|||||||
};
|
};
|
||||||
this.getResizableHeaders()
|
this.getResizableHeaders()
|
||||||
.forEach(function (el) {
|
.forEach(function (el) {
|
||||||
data.columns[ResizableTableColumns.generateColumnId(el)] = el.offsetWidth;
|
data.columns[ResizableTableColumns.generateColumnId(el)] = el.offsetWidth;
|
||||||
});
|
});
|
||||||
this.options.store.set(tableId, data);
|
this.options.store.set(tableId, data);
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.createHandlerReferences = function () {
|
ResizableTableColumns.prototype.createHandlerReferences = function () {
|
||||||
@ -694,8 +695,8 @@
|
|||||||
ResizableTableColumns.windowResizeHandlerRef = ResizableTableColumns.debounce(ResizableTableColumns.onWindowResize, 50, false);
|
ResizableTableColumns.windowResizeHandlerRef = ResizableTableColumns.debounce(ResizableTableColumns.onWindowResize, 50, false);
|
||||||
ResizableConstants.events.windowResize
|
ResizableConstants.events.windowResize
|
||||||
.forEach(function (evt, idx) {
|
.forEach(function (evt, idx) {
|
||||||
win === null || win === void 0 ? void 0 : win.addEventListener(evt, ResizableTableColumns.windowResizeHandlerRef, false);
|
win === null || win === void 0 ? void 0 : win.addEventListener(evt, ResizableTableColumns.windowResizeHandlerRef, false);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
ResizableTableColumns.prototype.handleWindowResize = function () {
|
ResizableTableColumns.prototype.handleWindowResize = function () {
|
||||||
this.checkTableWidth();
|
this.checkTableWidth();
|
||||||
@ -769,8 +770,8 @@
|
|||||||
var styles = (_b = contentElement.ownerDocument.defaultView) === null || _b === void 0 ? void 0 : _b.getComputedStyle(contentElement);
|
var styles = (_b = contentElement.ownerDocument.defaultView) === null || _b === void 0 ? void 0 : _b.getComputedStyle(contentElement);
|
||||||
['fontFamily', 'fontSize', 'fontWeight', 'padding', 'border', 'boxSizing']
|
['fontFamily', 'fontSize', 'fontWeight', 'padding', 'border', 'boxSizing']
|
||||||
.forEach(function (prop) {
|
.forEach(function (prop) {
|
||||||
measurementElement.style[prop] = styles[prop];
|
measurementElement.style[prop] = styles[prop];
|
||||||
});
|
});
|
||||||
measurementElement.innerHTML = text;
|
measurementElement.innerHTML = text;
|
||||||
return measurementElement.offsetWidth;
|
return measurementElement.offsetWidth;
|
||||||
};
|
};
|
||||||
@ -822,4 +823,21 @@
|
|||||||
exports.WidthsData = WidthsData;
|
exports.WidthsData = WidthsData;
|
||||||
|
|
||||||
}));
|
}));
|
||||||
|
(function (window, ResizableTableColumns, undefined) {
|
||||||
|
var store = window.store && window.store.enabled ? window.store : null;
|
||||||
|
var els = document.querySelectorAll('table.data');
|
||||||
|
for (var index = 0; index < els.length; index++) {
|
||||||
|
var table = els[index];
|
||||||
|
if (table['rtc_data_object']) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
var options = {
|
||||||
|
store: store
|
||||||
|
};
|
||||||
|
if (table.querySelectorAll('thead > tr').length > 1) {
|
||||||
|
options.resizeFromBody = false;
|
||||||
|
}
|
||||||
|
new ResizableTableColumns(els[index], options);
|
||||||
|
}
|
||||||
|
})(window, window.validide_resizableTableColumns.ResizableTableColumns, void (0));
|
||||||
//# sourceMappingURL=index.js.map
|
//# sourceMappingURL=index.js.map
|
||||||
@ -4,3 +4,9 @@
|
|||||||
<IfModule !authz_core_module>
|
<IfModule !authz_core_module>
|
||||||
Deny from all
|
Deny from all
|
||||||
</IfModule>
|
</IfModule>
|
||||||
|
<IfModule mod_rewrite.c>
|
||||||
|
RewriteEngine On
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-f
|
||||||
|
RewriteCond %{REQUEST_FILENAME} !-d
|
||||||
|
RewriteRule ^(.*)$ index.php/$1 [L]
|
||||||
|
</IfModule>
|
||||||
Loading…
Reference in New Issue
Block a user