dbms_init...1
This commit is contained in:
parent
b988774fdb
commit
3908b3240e
@ -37,7 +37,7 @@ class ServiceController extends CustomerController
|
|||||||
protected function index_process(): array
|
protected function index_process(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'fields' => ['clientinfo_uid', 'type', $this->getService()->getModel()->getTitleField(), 'payment_date', 'amount', 'startdate_at', 'enddate_at', 'status'],
|
'fields' => ['clientinfo_uid', 'type', $this->getService()->getModel()->getTitleField(), 'payment_date', 'amount', 'start_at', 'end_at', 'status'],
|
||||||
];
|
];
|
||||||
$this->init('index', $fields);
|
$this->init('index', $fields);
|
||||||
$this->modal_type = 'modal_iframe';
|
$this->modal_type = 'modal_iframe';
|
||||||
|
|||||||
@ -2,10 +2,12 @@
|
|||||||
|
|
||||||
namespace App\Controllers\Admin\Equipment;
|
namespace App\Controllers\Admin\Equipment;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
use App\Helpers\Equipment\ServerHelper;
|
use App\Helpers\Equipment\ServerHelper;
|
||||||
|
use App\Services\Equipment\ServerPartService;
|
||||||
|
|
||||||
use App\Services\Equipment\PartService;
|
use App\Services\Equipment\PartService;
|
||||||
use App\Services\Equipment\ServerService;
|
use App\Services\Equipment\ServerService;
|
||||||
|
|
||||||
use CodeIgniter\HTTP\RequestInterface;
|
use CodeIgniter\HTTP\RequestInterface;
|
||||||
use CodeIgniter\HTTP\ResponseInterface;
|
use CodeIgniter\HTTP\ResponseInterface;
|
||||||
use CodeIgniter\Validation\Validation;
|
use CodeIgniter\Validation\Validation;
|
||||||
@ -14,10 +16,14 @@ use Psr\Log\LoggerInterface;
|
|||||||
class ServerController extends EquipmentController
|
class ServerController extends EquipmentController
|
||||||
{
|
{
|
||||||
private ?PartService $_partService = null;
|
private ?PartService $_partService = null;
|
||||||
|
private ?ServerPartService $_serverPartService = null;
|
||||||
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->uri_path .= strtolower($this->getService()->getClassName()) . '/';
|
$this->uri_path .= strtolower($this->getService()->getClassName()) . '/';
|
||||||
|
$this->view_path .= strtolower($this->getService()->getClassName()) . DIRECTORY_SEPARATOR;
|
||||||
|
// echo $this->view_path;
|
||||||
|
// exit;
|
||||||
$this->class_path = $this->getService()->getClassPath();
|
$this->class_path = $this->getService()->getClassPath();
|
||||||
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
$this->title = lang("{$this->getService()->getClassPath()}.title");
|
||||||
$this->helper = $this->getHelper();
|
$this->helper = $this->getHelper();
|
||||||
@ -45,6 +51,13 @@ class ServerController extends EquipmentController
|
|||||||
}
|
}
|
||||||
return $this->_partService;
|
return $this->_partService;
|
||||||
}
|
}
|
||||||
|
final public function getServerPartService(): ServerPartService
|
||||||
|
{
|
||||||
|
if (!$this->_serverPartService) {
|
||||||
|
$this->_serverPartService = new ServerPartService();
|
||||||
|
}
|
||||||
|
return $this->_serverPartService;
|
||||||
|
}
|
||||||
|
|
||||||
//Index,FieldForm관련
|
//Index,FieldForm관련
|
||||||
protected function getFieldRule(string $action, string $field): string
|
protected function getFieldRule(string $action, string $field): string
|
||||||
@ -100,33 +113,43 @@ class ServerController extends EquipmentController
|
|||||||
$entity = parent::create_process();
|
$entity = parent::create_process();
|
||||||
//변경할 UIDS
|
//변경할 UIDS
|
||||||
$cpu_uids = $this->request->getVar('cpu_partinfo_uid[]');
|
$cpu_uids = $this->request->getVar('cpu_partinfo_uid[]');
|
||||||
if (!is_array($cpu_uids) || !count($cpu_uids)) {
|
if (!is_array($cpu_uids)) {
|
||||||
throw new \Exception("CPU가 정의되지 않았습니다.");
|
throw new \Exception("CPU가 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
|
foreach ($cpu_uids as $uid) {
|
||||||
|
$temps = ['serverinfo_uid' => $entity->getPK(), 'partinfo_uid' => $uid];
|
||||||
|
$this->getServerPartService()->create($temps, new ServerPartEntity());
|
||||||
|
}
|
||||||
$ram_uids = $this->request->getVar('ram_partinfo_uid[]');
|
$ram_uids = $this->request->getVar('ram_partinfo_uid[]');
|
||||||
if (!is_array($ram_uids) || !count($ram_uids)) {
|
if (!is_array($ram_uids)) {
|
||||||
throw new \Exception("RAM가 정의되지 않았습니다.");
|
throw new \Exception("RAM가 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
$disk_uids = $this->request->getVar('cpu_partinfo_uid[]');
|
foreach ($ram_uids as $uid) {
|
||||||
if (!is_array($disk_uids) || !count($disk_uids)) {
|
$temps = ['serverinfo_uid' => $entity->getPK(), 'partinfo_uid' => $uid];
|
||||||
|
$this->getServerPartService()->create($temps, new ServerPartEntity());
|
||||||
|
}
|
||||||
|
$disk_uids = $this->request->getVar('disk_partinfo_uid[]');
|
||||||
|
if (!is_array($disk_uids)) {
|
||||||
throw new \Exception("DISK가 정의되지 않았습니다.");
|
throw new \Exception("DISK가 정의되지 않았습니다.");
|
||||||
}
|
}
|
||||||
//데이터가 있는경우 Field만 처리하기위해
|
foreach ($disk_uids as $uid) {
|
||||||
$fields = [];
|
$temps = ['serverinfo_uid' => $entity->getPK(), 'partinfo_uid' => $uid];
|
||||||
foreach ($this->batchjob_fields as $field) {
|
$this->getServerPartService()->create($temps, new ServerPartEntity());
|
||||||
if ($this->request->getVar($field)) {
|
|
||||||
$fields[] = $field;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return $this->getService()->create($this->formDatas);
|
return $entity;
|
||||||
}
|
}
|
||||||
protected function index_process(): array
|
protected function index_process(): array
|
||||||
{
|
{
|
||||||
$fields = [
|
$fields = [
|
||||||
'fields' => ['code', 'clientinfo_uid', 'type', $this->getService()->getModel()->getTitleField(), 'price', 'status', 'description'],
|
'fields' => ['code', 'clientinfo_uid', 'type', $this->getService()->getModel()->getTitleField(), 'price', 'status'],
|
||||||
];
|
];
|
||||||
$this->init('index', $fields);
|
$this->init('index', $fields);
|
||||||
$this->modal_type = 'modal_iframe';
|
$this->modal_type = 'modal_iframe';
|
||||||
return parent::index_process();
|
$entities = parent::index_process();
|
||||||
|
foreach ($entities as $key => $entity) {
|
||||||
|
$entities[$key]['partinfo_uid'] = $this->getServerPartService()->getEntities(['serverinfo_uid' => $entity['id']);
|
||||||
|
$entities[$key]['ram_partinfo_uid'] = $this->getServerPartService()->getEntities(['serverinfo_uid' => $entity['id']);
|
||||||
|
$entities[$key]['disk_partinfo_uid'] = $this->getServerPartService()->getEntities(['serverinfo_uid' => $entity['id']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -470,7 +470,7 @@ abstract class CommonController extends BaseController
|
|||||||
$this->getService()->getModel()->where(sprintf("%s.created_at <= '%s 23:59:59'", $this->getService()->getModel()->getTable(), $this->end));
|
$this->getService()->getModel()->where(sprintf("%s.created_at <= '%s 23:59:59'", $this->getService()->getModel()->getTable(), $this->end));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
protected function setOrcerByForList()
|
protected function setOrderByForList()
|
||||||
{
|
{
|
||||||
//OrderBy 처리
|
//OrderBy 처리
|
||||||
$this->order_field = $this->request->getVar('order_field');
|
$this->order_field = $this->request->getVar('order_field');
|
||||||
@ -518,7 +518,7 @@ abstract class CommonController extends BaseController
|
|||||||
$this->pagination = $this->getPaginationForList();
|
$this->pagination = $this->getPaginationForList();
|
||||||
//조건절 , OrcerBy , Limit 처리
|
//조건절 , OrcerBy , Limit 처리
|
||||||
$this->setConditionForList($this->filter_fields);
|
$this->setConditionForList($this->filter_fields);
|
||||||
$this->setOrcerByForList();
|
$this->setOrderByForList();
|
||||||
$this->getService()->getModel()->limit($this->per_page);
|
$this->getService()->getModel()->limit($this->per_page);
|
||||||
$this->getService()->getModel()->offset(($this->page - 1) * $this->per_page);
|
$this->getService()->getModel()->offset(($this->page - 1) * $this->per_page);
|
||||||
return $this->getService()->getEntities();
|
return $this->getService()->getEntities();
|
||||||
|
|||||||
@ -1,260 +0,0 @@
|
|||||||
-- 1. 관리자정보
|
|
||||||
CREATE TABLE userinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
id VARCHAR(20) NOT NULL UNIQUE,
|
|
||||||
passwd VARCHAR(255) NOT NULL,
|
|
||||||
name VARCHAR(20) NOT NULL,
|
|
||||||
email VARCHAR(50) NOT NULL UNIQUE,
|
|
||||||
mobile VARCHAR(20),
|
|
||||||
role ENUM('admin', 'manager') DEFAULT 'manager',
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '관리자정보';
|
|
||||||
|
|
||||||
-- 2. 고객정보
|
|
||||||
CREATE TABLE clientinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
name VARCHAR(100) NOT NULL,
|
|
||||||
phone VARCHAR(50),
|
|
||||||
email VARCHAR(100),
|
|
||||||
account_balance INT DEFAULT 0 COMMENT '보증금',
|
|
||||||
role ENUM('user', 'partner') DEFAULT 'user',
|
|
||||||
note TEXT,
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '고객정보';
|
|
||||||
|
|
||||||
-- 3. 고객 입출금
|
|
||||||
CREATE TABLE accountinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
clientinfo_uid INT NOT NULL,
|
|
||||||
status ENUM('deposit', 'withdrawal') DEFAULT 'deposit',
|
|
||||||
title VARCHAR(255) NOT NULL,
|
|
||||||
alias VARCHAR(50) NOT NULL COMMENT '입출금자명',
|
|
||||||
amount INT NOT NULL DEFAULT 0,
|
|
||||||
note TEXT,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
CONSTRAINT FK_accountinfo_TO_clientinfo FOREIGN KEY (clientinfo_uid) REFERENCES clientinfo(uid)
|
|
||||||
) COMMENT '입출금계좌';
|
|
||||||
|
|
||||||
-- 4. 장비 정보
|
|
||||||
CREATE TABLE deviceinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
type ENUM('server', 'vpc', 'kcs', 'network') DEFAULT 'server',
|
|
||||||
brand VARCHAR(50) DEFAULT 'HP',
|
|
||||||
model VARCHAR(50) NOT NULL,
|
|
||||||
cost_price INT DEFAULT 0,
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
description TEXT,
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '장비정보';
|
|
||||||
|
|
||||||
-- 5. 장비 부속품 정보
|
|
||||||
CREATE TABLE devicepartinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
type ENUM('memory', 'hdd', 'ssd', 'nic') DEFAULT 'memory',
|
|
||||||
brand VARCHAR(50) DEFAULT 'samsung',
|
|
||||||
capacity INT NOT NULL COMMENT '용량 (GB)',
|
|
||||||
cost_price INT DEFAULT 0,
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
description TEXT,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '장비 부품 정보';
|
|
||||||
|
|
||||||
-- 6. 장비 부속품 연결
|
|
||||||
CREATE TABLE deviceinfos_accessories (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
deviceinfo_uid INT NOT NULL,
|
|
||||||
devicepartinfo_uid INT NOT NULL,
|
|
||||||
softwareinfo_uid INT,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (deviceinfo_uid) REFERENCES deviceinfo(uid),
|
|
||||||
FOREIGN KEY (devicepartinfo_uid) REFERENCES devicepartinfo(uid),
|
|
||||||
FOREIGN KEY (softwareinfo_uid) REFERENCES softwareinfo(uid)
|
|
||||||
) COMMENT '장비-부속품 연결정보';
|
|
||||||
|
|
||||||
-- 7. 소프트웨어 정보
|
|
||||||
CREATE TABLE softwareinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
type ENUM('os', 'application') DEFAULT 'os',
|
|
||||||
title VARCHAR(100) NOT NULL,
|
|
||||||
cost_price INT DEFAULT 0,
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
description TEXT,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '소프트웨어 정보';
|
|
||||||
|
|
||||||
-- 8. 회선 정보
|
|
||||||
CREATE TABLE lineinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
code VARCHAR(50) NOT NULL,
|
|
||||||
type ENUM('general', 'dedicated') DEFAULT 'general',
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '회선 정보';
|
|
||||||
|
|
||||||
-- 9. IP 정보
|
|
||||||
CREATE TABLE ipinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
lineinfo_uid INT NOT NULL,
|
|
||||||
deviceinfo_uid INT,
|
|
||||||
serviceinfo_uid INT,
|
|
||||||
ip_address VARCHAR(50) NOT NULL UNIQUE,
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (lineinfo_uid) REFERENCES lineinfo(uid),
|
|
||||||
FOREIGN KEY (deviceinfo_uid) REFERENCES deviceinfo(uid),
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid)
|
|
||||||
) COMMENT 'IP 정보';
|
|
||||||
|
|
||||||
-- 10. 상면 정보 (Rack Space)
|
|
||||||
CREATE TABLE rackspaceinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
type ENUM('1u', '2u', '4u', 'fullrack', 'lightweight') DEFAULT '1u',
|
|
||||||
price INT DEFAULT 0,
|
|
||||||
status ENUM('use', 'stop') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
|
|
||||||
) COMMENT '랙 상면 정보';
|
|
||||||
|
|
||||||
-- 11. 서비스 정보
|
|
||||||
CREATE TABLE serviceinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
clientinfo_uid INT NOT NULL,
|
|
||||||
type ENUM('hosting', 'colocation', 'defense') DEFAULT 'hosting',
|
|
||||||
title VARCHAR(100) NOT NULL,
|
|
||||||
payment_date DATE NOT NULL,
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
startdate_at TIMESTAMP NULL,
|
|
||||||
enddate_at TIMESTAMP NULL,
|
|
||||||
status ENUM('use', 'stop', 'terminate') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (clientinfo_uid) REFERENCES clientinfo(uid)
|
|
||||||
) COMMENT '서비스 정보';
|
|
||||||
|
|
||||||
-- 12. 청구서 정보
|
|
||||||
CREATE TABLE invoiceinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
type ENUM('monthly', 'onetime', 'daily') DEFAULT 'monthly',
|
|
||||||
billing_amount INT DEFAULT 0,
|
|
||||||
description TEXT,
|
|
||||||
status ENUM('unpaid', 'paid', 'refunded') DEFAULT 'unpaid',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid)
|
|
||||||
) COMMENT '청구서 정보';
|
|
||||||
|
|
||||||
-- 13. 서비스 - 장비 연결
|
|
||||||
CREATE TABLE serviceinfos_deviceinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
deviceinfo_uid INT NOT NULL,
|
|
||||||
payment_type ENUM('onetime', 'month', 'free') DEFAULT 'month',
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (deviceinfo_uid) REFERENCES deviceinfo(uid)
|
|
||||||
) COMMENT '서비스-장비 연결';
|
|
||||||
|
|
||||||
-- 14. 서비스 - 장비 부품 연결
|
|
||||||
CREATE TABLE serviceinfos_devicepartinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
devicepartinfo_uid INT NOT NULL,
|
|
||||||
payment_type ENUM('onetime', 'month', 'free') DEFAULT 'month',
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (devicepartinfo_uid) REFERENCES devicepartinfo(uid)
|
|
||||||
) COMMENT '서비스-장비 부품 연결';
|
|
||||||
|
|
||||||
-- 15. 서비스 - 소프트웨어 연결
|
|
||||||
CREATE TABLE serviceinfos_softwareinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
softwareinfo_uid INT NOT NULL,
|
|
||||||
payment_type ENUM('onetime', 'month', 'free') DEFAULT 'month',
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (softwareinfo_uid) REFERENCES softwareinfo(uid)
|
|
||||||
) COMMENT '서비스-소프트웨어 연결';
|
|
||||||
|
|
||||||
-- 16. 서비스 - IP 연결
|
|
||||||
CREATE TABLE serviceinfos_ipinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
ipinfo_uid INT NOT NULL,
|
|
||||||
payment_type ENUM('onetime', 'month', 'free') DEFAULT 'month',
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (ipinfo_uid) REFERENCES ipinfo(uid)
|
|
||||||
) COMMENT '서비스-IP 연결';
|
|
||||||
|
|
||||||
-- 17. 서비스 - 회선 연결
|
|
||||||
CREATE TABLE serviceinfos_lineinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
lineinfo_uid INT NOT NULL,
|
|
||||||
payment_type ENUM('onetime', 'month', 'free') DEFAULT 'month',
|
|
||||||
amount INT DEFAULT 0,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (lineinfo_uid) REFERENCES lineinfo(uid)
|
|
||||||
) COMMENT '서비스-회선 연결';
|
|
||||||
|
|
||||||
-- 18. 서비스 - 랙 상면 연결
|
|
||||||
CREATE TABLE serviceinfos_rackinfos (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
serviceinfo_uid INT NOT NULL,
|
|
||||||
rackspaceinfo_uid INT NOT NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (serviceinfo_uid) REFERENCES serviceinfo(uid),
|
|
||||||
FOREIGN KEY (rackspaceinfo_uid) REFERENCES rackspaceinfo(uid)
|
|
||||||
) COMMENT '서비스-랙 연결';
|
|
||||||
|
|
||||||
-- 19. 고객 이벤트 (포인트, 도메인 등)
|
|
||||||
CREATE TABLE eventinfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
clientinfo_uid INT NOT NULL,
|
|
||||||
type ENUM('domain', 'point') DEFAULT 'point',
|
|
||||||
title VARCHAR(100) NOT NULL,
|
|
||||||
value INT NOT NULL,
|
|
||||||
note TEXT,
|
|
||||||
status ENUM('use', 'expired') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (clientinfo_uid) REFERENCES clientinfo(uid)
|
|
||||||
) COMMENT '고객 이벤트 (포인트/도메인)';
|
|
||||||
|
|
||||||
-- 20. 작업 로그
|
|
||||||
CREATE TABLE loginfo (
|
|
||||||
uid INT AUTO_INCREMENT PRIMARY KEY,
|
|
||||||
userinfo_uid INT NOT NULL,
|
|
||||||
type ENUM('info', 'warn', 'error', 'debug') DEFAULT 'info',
|
|
||||||
class VARCHAR(255),
|
|
||||||
method VARCHAR(255),
|
|
||||||
title VARCHAR(255) NOT NULL,
|
|
||||||
description TEXT NOT NULL,
|
|
||||||
status ENUM('use', 'archived') DEFAULT 'use',
|
|
||||||
updated_at TIMESTAMP NULL,
|
|
||||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
|
||||||
FOREIGN KEY (userinfo_uid) REFERENCES userinfo(uid)
|
|
||||||
) COMMENT '작업 기록 로그';
|
|
||||||
File diff suppressed because it is too large
Load Diff
11
app/Entities/Equipment/ServerPartEntity.php
Normal file
11
app/Entities/Equipment/ServerPartEntity.php
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Entities\Equipment;
|
||||||
|
|
||||||
|
use App\Models\Equipment\ServerPartModel;
|
||||||
|
|
||||||
|
class ServerPartEntity extends EquipmentEntity
|
||||||
|
{
|
||||||
|
const PK = ServerPartModel::PK;
|
||||||
|
const TITLE = ServerPartModel::TITLE;
|
||||||
|
}
|
||||||
@ -20,8 +20,8 @@ class ServiceHelper extends CustomerHelper
|
|||||||
}
|
}
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'payment_date':
|
case 'payment_date':
|
||||||
case 'startdate_at':
|
case 'start_at':
|
||||||
case 'enddate_at':
|
case 'end_at':
|
||||||
$extra_class = isset($extras['class']) ? $extras['class'] . ' calender' : 'calender';
|
$extra_class = isset($extras['class']) ? $extras['class'] . ' calender' : 'calender';
|
||||||
$form = form_input($field, $value ?? "", ['class' => $extra_class, ...array_diff_key($extras, ['class' => ''])]);
|
$form = form_input($field, $value ?? "", ['class' => $extra_class, ...array_diff_key($extras, ['class' => ''])]);
|
||||||
break;
|
break;
|
||||||
@ -36,8 +36,8 @@ class ServiceHelper extends CustomerHelper
|
|||||||
$value = $viewDatas['entity']->$field ?? "";
|
$value = $viewDatas['entity']->$field ?? "";
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case 'payment_date':
|
case 'payment_date':
|
||||||
case 'startdate_at':
|
case 'start_at':
|
||||||
case 'enddate_at':
|
case 'end_at':
|
||||||
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
$value = $value ? date("Y-m-d", strtotime($value)) : "";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@ -7,8 +7,8 @@ return [
|
|||||||
'title' => "제목",
|
'title' => "제목",
|
||||||
'payment_date' => "결제일",
|
'payment_date' => "결제일",
|
||||||
'amount' => "결제금액",
|
'amount' => "결제금액",
|
||||||
'startdate_at' => "개통일",
|
'start_at' => "개통일",
|
||||||
'enddate_at' => "해지일",
|
'end_at' => "해지일",
|
||||||
'status' => "상태",
|
'status' => "상태",
|
||||||
'updated_at' => "수정일",
|
'updated_at' => "수정일",
|
||||||
'created_at' => "신청일",
|
'created_at' => "신청일",
|
||||||
|
|||||||
@ -109,7 +109,7 @@ abstract class CommonModel extends Model
|
|||||||
$rule = "is_image[{$field}]|mime_in[{$field},image/jpg,image/jpeg,image/gif,image/png,image/webp]|max_size[{$field},300]|max_dims[{$field},2048,768]";
|
$rule = "is_image[{$field}]|mime_in[{$field},image/jpg,image/jpeg,image/gif,image/png,image/webp]|max_size[{$field},300]|max_dims[{$field},2048,768]";
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
$rule = "if_exist|in_list[use,unuse]";
|
$rule = "if_exist|trim|string";
|
||||||
break;
|
break;
|
||||||
case "updated_at":
|
case "updated_at":
|
||||||
case "created_at":
|
case "created_at":
|
||||||
@ -117,7 +117,7 @@ abstract class CommonModel extends Model
|
|||||||
$rule = "if_exist|valid_date";
|
$rule = "if_exist|valid_date";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = "if_exist|string";
|
$rule = "if_exist|trim|string";
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return $rule;
|
return $rule;
|
||||||
|
|||||||
@ -34,23 +34,18 @@ class ClientModel extends CustomerModel
|
|||||||
}
|
}
|
||||||
switch ($field) {
|
switch ($field) {
|
||||||
case "name":
|
case "name":
|
||||||
|
case "role":
|
||||||
$rule = "required|trim|string";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "email":
|
case "email":
|
||||||
$rule = "if_exist|trim|valid_email";
|
$rule = "if_exist|trim|valid_email";
|
||||||
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
$rule .= in_array($action, ["create", "create_form"]) ? "|is_unique[{$this->table}.{$field}]" : "";
|
||||||
break;
|
break;
|
||||||
case "role":
|
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "account_balance":
|
case "account_balance":
|
||||||
case "coupon_balance":
|
case "coupon_balance":
|
||||||
case "point_balance":
|
case "point_balance":
|
||||||
$rule = "if_exist|trim|numeric";
|
$rule = "if_exist|trim|numeric";
|
||||||
break;
|
break;
|
||||||
case "status":
|
|
||||||
$rule = "if_exist|in_list[use,pause]";
|
|
||||||
break;
|
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFieldRule($action, $field);
|
$rule = parent::getFieldRule($action, $field);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -18,8 +18,8 @@ class ServiceModel extends CustomerModel
|
|||||||
"title",
|
"title",
|
||||||
"payment_date",
|
"payment_date",
|
||||||
"amount",
|
"amount",
|
||||||
"startdate_at",
|
"start_at",
|
||||||
"enddate_at",
|
"end_at",
|
||||||
"status",
|
"status",
|
||||||
"updated_at"
|
"updated_at"
|
||||||
];
|
];
|
||||||
@ -40,20 +40,14 @@ class ServiceModel extends CustomerModel
|
|||||||
$rule = "if_exist|numeric";
|
$rule = "if_exist|numeric";
|
||||||
break;
|
break;
|
||||||
case "title":
|
case "title":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[hosting,colocation]";
|
$rule = "required|trim|string";
|
||||||
break;
|
|
||||||
case "status":
|
|
||||||
$rule = "required|in_list[use,pause,terminated]";
|
|
||||||
break;
|
break;
|
||||||
case "payment_date":
|
case "payment_date":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
case "startdate_at":
|
case "start_at":
|
||||||
case "enddate_at":
|
case "end_at":
|
||||||
case "deleted_at":
|
|
||||||
$rule = "if_exist|valid_date";
|
$rule = "if_exist|valid_date";
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFieldRule($action, $field);
|
$rule = parent::getFieldRule($action, $field);
|
||||||
|
|||||||
@ -35,7 +35,7 @@ class IpModel extends EquipmentModel
|
|||||||
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
$rule = "required|trim|valid_ip[both]"; //ipv4 , ipv6 , both(ipv4,ipv6)
|
||||||
break;
|
break;
|
||||||
case "status":
|
case "status":
|
||||||
$rule = "required|in_list[use,pause,occupied,forbidden]";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFieldRule($action, $field);
|
$rule = parent::getFieldRule($action, $field);
|
||||||
|
|||||||
@ -39,13 +39,9 @@ class LineModel extends EquipmentModel
|
|||||||
break;
|
break;
|
||||||
case "title":
|
case "title":
|
||||||
case "bandwith":
|
case "bandwith":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[general,dedicated,defence]";
|
|
||||||
break;
|
|
||||||
case "status":
|
case "status":
|
||||||
$rule = "required|in_list[use,pause,termination]";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$rule = parent::getFieldRule($action, $field);
|
$rule = parent::getFieldRule($action, $field);
|
||||||
|
|||||||
@ -41,17 +41,13 @@ class NetworkModel extends EquipmentModel
|
|||||||
break;
|
break;
|
||||||
case "code":
|
case "code":
|
||||||
case "model":
|
case "model":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[L2,L3,L4,Router,colocation]";
|
case "status":
|
||||||
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "manufactur_at":
|
case "manufactur_at":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
case "status":
|
|
||||||
$rule = "required|in_list[use,pause,occupied]";
|
|
||||||
break;
|
|
||||||
case "description":
|
case "description":
|
||||||
$rule = "if_exist|trim|string";
|
$rule = "if_exist|trim|string";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -39,17 +39,13 @@ class PartModel extends EquipmentModel
|
|||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
case "model":
|
case "model":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[CPU,RAM,DISK,colocation]";
|
case "status":
|
||||||
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "manufactur_at":
|
case "manufactur_at":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|valid_date";
|
||||||
break;
|
break;
|
||||||
case "status":
|
|
||||||
$rule = "required|in_list[use,pause,occupied]";
|
|
||||||
break;
|
|
||||||
case "description":
|
case "description":
|
||||||
$rule = "if_exist|trim|string";
|
$rule = "if_exist|trim|string";
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -41,16 +41,9 @@ class ServerModel extends EquipmentModel
|
|||||||
break;
|
break;
|
||||||
case "code":
|
case "code":
|
||||||
case "model":
|
case "model":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[Rack,PC,MiniPC,clocation]";
|
|
||||||
break;
|
|
||||||
case "manufactur_at":
|
case "manufactur_at":
|
||||||
$rule = "required|valid_date";
|
$rule = "required|trim|string";
|
||||||
break;
|
|
||||||
case "status":
|
|
||||||
$rule = "required|in_list[use,pause,occupied]";
|
|
||||||
break;
|
break;
|
||||||
case "description":
|
case "description":
|
||||||
$rule = "if_exist|trim|string";
|
$rule = "if_exist|trim|string";
|
||||||
|
|||||||
43
app/Models/Equipment/ServerPartModel.php
Normal file
43
app/Models/Equipment/ServerPartModel.php
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Models\Equipment;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
|
|
||||||
|
class ServerPartModel extends EquipmentModel
|
||||||
|
{
|
||||||
|
const TABLE = "serverinfos_partinfos";
|
||||||
|
const PK = "uid";
|
||||||
|
const TITLE = "serverinfo_uid";
|
||||||
|
protected $table = self::TABLE;
|
||||||
|
protected $primaryKey = self::PK;
|
||||||
|
protected $returnType = ServerPartEntity::class;
|
||||||
|
protected $allowedFields = [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"partinfo_uid",
|
||||||
|
"type"
|
||||||
|
];
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
}
|
||||||
|
public function getFieldRule(string $action, string $field): string
|
||||||
|
{
|
||||||
|
if (is_array($field)) {
|
||||||
|
throw new \Exception(__FUNCTION__ . "=> field가 array 입니다.\n" . var_export($field, true));
|
||||||
|
}
|
||||||
|
switch ($field) {
|
||||||
|
case "serverinfo_uid":
|
||||||
|
case "partinfo_uid":
|
||||||
|
$rule = "required|numeric";
|
||||||
|
break;
|
||||||
|
case "type":
|
||||||
|
$rule = "required|trim|string";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$rule = parent::getFieldRule($action, $field);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return $rule;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -35,13 +35,9 @@ class SoftwareModel extends EquipmentModel
|
|||||||
$rule = "required|numeric";
|
$rule = "required|numeric";
|
||||||
break;
|
break;
|
||||||
case "model":
|
case "model":
|
||||||
$rule = "required|trim|string";
|
|
||||||
break;
|
|
||||||
case "type":
|
case "type":
|
||||||
$rule = "required|in_list[Windows,Linux,Security,Virus,App]";
|
|
||||||
break;
|
|
||||||
case "status":
|
case "status":
|
||||||
$rule = "required|in_list[use,pause]";
|
$rule = "required|trim|string";
|
||||||
break;
|
break;
|
||||||
case "description":
|
case "description":
|
||||||
$rule = "if_exist|trim|string";
|
$rule = "if_exist|trim|string";
|
||||||
|
|||||||
@ -33,8 +33,8 @@ class ServiceService extends CustomerService
|
|||||||
"title",
|
"title",
|
||||||
"payment_date",
|
"payment_date",
|
||||||
"amount",
|
"amount",
|
||||||
"startdate_at",
|
"start_at",
|
||||||
"enddate_at",
|
"end_at",
|
||||||
"status",
|
"status",
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
44
app/Services/Equipment/ServerPartService.php
Normal file
44
app/Services/Equipment/ServerPartService.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Services\Equipment;
|
||||||
|
|
||||||
|
use App\Entities\Equipment\ServerPartEntity;
|
||||||
|
use App\Models\Equipment\ServerPartModel;
|
||||||
|
use CodeIgniter\HTTP\IncomingRequest;
|
||||||
|
use App\Services\Equipment\EquipmentService; // Ensure this path is correct and the class exists or create the class if missing
|
||||||
|
|
||||||
|
class ServerPartService extends EquipmentService
|
||||||
|
{
|
||||||
|
protected ?IncomingRequest $request = null;
|
||||||
|
public function __construct(?IncomingRequest $request = null)
|
||||||
|
{
|
||||||
|
parent::__construct($request);
|
||||||
|
}
|
||||||
|
public function getClassName(): string
|
||||||
|
{
|
||||||
|
return parent::getClassName() . DIRECTORY_SEPARATOR . "Part";
|
||||||
|
}
|
||||||
|
public function getModelClass(): ServerPartModel
|
||||||
|
{
|
||||||
|
return new ServerPartModel();
|
||||||
|
}
|
||||||
|
public function getEntityClass(): ServerPartEntity
|
||||||
|
{
|
||||||
|
return new ServerPartEntity();
|
||||||
|
}
|
||||||
|
public function getFields(): array
|
||||||
|
{
|
||||||
|
return [
|
||||||
|
"serverinfo_uid",
|
||||||
|
"partinfo_uid",
|
||||||
|
];
|
||||||
|
}
|
||||||
|
public function getFilterFields(): array
|
||||||
|
{
|
||||||
|
return ["serverinfo_uid", "partinfo_uid"];
|
||||||
|
}
|
||||||
|
public function getBatchJobFields(): array
|
||||||
|
{
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
31
app/Views/admin/equipment/server/create_form.php
Normal file
31
app/Views/admin/equipment/server/create_form.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="/js/<?= $viewDatas['layout'] ?>/form.js" referrerpolicy="origin"></script>
|
||||||
|
<script src="/assets/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||||
|
<?php foreach ($viewDatas['individualStylesheets'] as $css): ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/<?= $css ?>" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?php foreach ($viewDatas['individualScripts'] as $js): ?>
|
||||||
|
<script src="/js/<?= $viewDatas['layout'] ?>/<?= $js ?>" referrerpolicy="origin"></script>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?= form_open(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<div class=" action_form">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start">
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, old($field), $viewDatas) ?>
|
||||||
|
<span><?= validation_show_error($field); ?></span>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<div class="text-center"><?= form_submit('', '입력', array("class" => "btn btn-outline btn-primary")); ?></div>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
</div>
|
||||||
|
<?php if ($error = session('error')): ?><?= $viewDatas['helper']->alert($error) ?><?php endif ?>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
63
app/Views/admin/equipment/server/index.php
Normal file
63
app/Views/admin/equipment/server/index.php
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
||||||
|
<!-- Layout Middle Start -->
|
||||||
|
<table class="layout_middle">
|
||||||
|
<tr>
|
||||||
|
<td class="layout_left">
|
||||||
|
<!-- Layout Left Start -->
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
||||||
|
<!-- Layout Left End -->
|
||||||
|
</td>
|
||||||
|
<td class="layout_right">
|
||||||
|
<!-- Layout Right Start -->
|
||||||
|
<?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?>
|
||||||
|
<div id="container" class="layout_content">
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/index.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div class="index_body">
|
||||||
|
<?= $this->include("templates/{$viewDatas['layout']}/index_content_top"); ?>
|
||||||
|
<?= form_open(current_url(), ['id' => 'batchjob_form', 'method' => "post"]) ?>
|
||||||
|
<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['entities'] as $entity): ?>
|
||||||
|
<tr <?= $viewDatas['helper']->getListRowColor($entity) ?>>
|
||||||
|
<?php $viewDatas['cnt'] = $viewDatas['total_count'] - (($viewDatas['page'] - 1) * $viewDatas['per_page'] + $cnt); ?>
|
||||||
|
<?php $viewDatas['entity'] = $entity; ?>
|
||||||
|
<th><?= $viewDatas['helper']->getListButton('modify', $viewDatas) ?></th>
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<td><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<th><?= $viewDatas['helper']->getListButton('delete', $viewDatas) ?></th>
|
||||||
|
</tr>
|
||||||
|
<?php $cnt++ ?>
|
||||||
|
<?php endforeach ?>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<?= $this->include("templates/{$viewDatas['layout']}/index_content_batchjob"); ?>
|
||||||
|
<?= form_close() ?>
|
||||||
|
<div class=" index_pagination"><?= $viewDatas['pagination'] ?></div>
|
||||||
|
</div>
|
||||||
|
<div class="index_bottom"><?= $this->include("templates/common/" . (isset($viewDatas['modal_type']) ? $viewDatas['modal_type'] : 'modal_fetch')); ?></div>
|
||||||
|
<script type="text/javascript" src="/js/<?= $viewDatas['layout'] ?>/index.js"></script>
|
||||||
|
</div>
|
||||||
|
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||||
|
<!-- Layout Right End -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<?php if ($error = session('error')): ?><?= $viewDatas['helper']->alert($error) ?><?php endif ?>
|
||||||
|
<!-- Layout Middle End -->
|
||||||
|
<div class="layout_bottom">
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
31
app/Views/admin/equipment/server/modify_form.php
Normal file
31
app/Views/admin/equipment/server/modify_form.php
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<script src="/js/<?= $viewDatas['layout'] ?>/form.js" referrerpolicy="origin"></script>
|
||||||
|
<script src="/assets/tinymce/tinymce.min.js" referrerpolicy="origin"></script>
|
||||||
|
<?php foreach ($viewDatas['individualStylesheets'] as $css): ?>
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/<?= $css ?>" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?php foreach ($viewDatas['individualScripts'] as $js): ?>
|
||||||
|
<script src="/js/<?= $viewDatas['layout'] ?>/<?= $js ?>" referrerpolicy="origin"></script>
|
||||||
|
<?php endforeach ?>
|
||||||
|
<?= form_open(current_url(), ['id' => 'action_form', ...$viewDatas['forms']['attributes']], $viewDatas['forms']['hiddens']) ?>
|
||||||
|
<div class="action_form">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start">
|
||||||
|
<?= $viewDatas['helper']->getFieldForm($field, old($field) ?? $viewDatas['entity']->$field, $viewDatas) ?>
|
||||||
|
<div><?= validation_show_error($field); ?></div>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
<div class="text-center"><?= form_submit("", '수정', ["class" => "btn btn-outline btn-primary"]) ?></div>
|
||||||
|
<?= form_close(); ?>
|
||||||
|
</div>
|
||||||
|
<?php if ($error = session('error')): ?><?= $viewDatas['helper']->alert($error) ?><?php endif ?>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
16
app/Views/admin/equipment/server/view.php
Normal file
16
app/Views/admin/equipment/server/view.php
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<div id="container" class="content">
|
||||||
|
<link href="/css/<?= $viewDatas['layout'] ?>/form.css" media="screen" rel="stylesheet" type="text/css" />
|
||||||
|
<div class="action_form">
|
||||||
|
<table class="table table-bordered">
|
||||||
|
<?php foreach ($viewDatas['fields'] as $field): ?>
|
||||||
|
<tr>
|
||||||
|
<th nowrap class="text-end"><?= $viewDatas['helper']->getFieldLabel($field, $viewDatas) ?></th>
|
||||||
|
<td nowrap class="text-start"><?= $viewDatas['helper']->getFieldView($field, $viewDatas) ?></td>
|
||||||
|
</tr>
|
||||||
|
<?php endforeach; ?>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
103
app/Views/admin/equipment/server/welcome_message.php
Normal file
103
app/Views/admin/equipment/server/welcome_message.php
Normal file
@ -0,0 +1,103 @@
|
|||||||
|
<?= $this->extend(LAYOUTS[$viewDatas['layout']]['path']) ?>
|
||||||
|
<?= $this->section('content') ?>
|
||||||
|
<div class="layout_top"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/top'); ?></div>
|
||||||
|
<!-- Layout Middle Start -->
|
||||||
|
<table class="layout_middle">
|
||||||
|
<tr>
|
||||||
|
<td class="layout_left">
|
||||||
|
<!-- Layout Left Start -->
|
||||||
|
<?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/left_menu'); ?>
|
||||||
|
<!-- Layout Left End -->
|
||||||
|
</td>
|
||||||
|
<td class="layout_right">
|
||||||
|
<!-- Layout Right Start -->
|
||||||
|
<?= $this->include("templates/{$viewDatas['layout']}/index_header"); ?>
|
||||||
|
<div id="container" class="layout_content">
|
||||||
|
<!-- RSS Feed Start -->
|
||||||
|
<style>
|
||||||
|
.news-container {
|
||||||
|
display: flex;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
justify-content: space-between;
|
||||||
|
}
|
||||||
|
|
||||||
|
.news-item {
|
||||||
|
width: 48%;
|
||||||
|
margin-bottom: 20px;
|
||||||
|
border: 1px solid #ddd;
|
||||||
|
padding: 10px;
|
||||||
|
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
|
||||||
|
}
|
||||||
|
|
||||||
|
.news-item h3 {
|
||||||
|
font-size: 18px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.news-item p {
|
||||||
|
font-size: 14px;
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
<div class="news-container" id="newsContainer"><!-- RSS 피드 항목들이 여기에 동적으로 추가됩니다 --></div>
|
||||||
|
<script>
|
||||||
|
// fetchRSS 함수 정의
|
||||||
|
function fetchRSS() {
|
||||||
|
fetch('/RSSFeed/getITWorld')
|
||||||
|
.then(response => response.json())
|
||||||
|
.then(data => {
|
||||||
|
const newsContainer = document.getElementById('newsContainer');
|
||||||
|
newsContainer.innerHTML = '';
|
||||||
|
data.forEach(item => {
|
||||||
|
const pubDate = new Date(item.pubDate);
|
||||||
|
const newsItem = document.createElement('div');
|
||||||
|
newsItem.className = 'news-item';
|
||||||
|
|
||||||
|
let imageUrl = item.imageUrl || extractImageFromContent(item.content);
|
||||||
|
imageUrl = convertToAbsoluteUrl(imageUrl, item.link);
|
||||||
|
|
||||||
|
newsItem.innerHTML = `
|
||||||
|
<h3><img src="${imageUrl || '/images/common/news.png'}" alt="${item.title}" style="width: 30px; height: 30px; object-fit: cover; margin-bottom: 10px;" onerror="this.onerror=null; this.src='/images/common/news.png';"><a href="${item.link}" target="_blank">${item.title}</a></h3>
|
||||||
|
<p>${item.description}</p>
|
||||||
|
<small>게시일: ${pubDate.toLocaleString()}</small>
|
||||||
|
`;
|
||||||
|
newsContainer.appendChild(newsItem);
|
||||||
|
});
|
||||||
|
})
|
||||||
|
.catch(error => console.error('RSS 피드를 가져오는 중 오류 발생:', error));
|
||||||
|
}
|
||||||
|
|
||||||
|
function extractImageFromContent(content) {
|
||||||
|
const parser = new DOMParser();
|
||||||
|
const doc = parser.parseFromString(content, 'text/html');
|
||||||
|
const img = doc.querySelector('img');
|
||||||
|
return img ? img.src : null;
|
||||||
|
}
|
||||||
|
|
||||||
|
function convertToAbsoluteUrl(url, baseUrl) {
|
||||||
|
if (!url) return null;
|
||||||
|
if (url.startsWith('http://') || url.startsWith('https://')) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
const base = new URL(baseUrl);
|
||||||
|
if (url.startsWith('/')) {
|
||||||
|
return `${base.protocol}//${base.hostname}${url}`;
|
||||||
|
}
|
||||||
|
return `${base.protocol}//${base.hostname}${base.pathname.substring(0, base.pathname.lastIndexOf('/') + 1)}${url}`;
|
||||||
|
}
|
||||||
|
|
||||||
|
document.addEventListener('DOMContentLoaded', function () {
|
||||||
|
fetchRSS();
|
||||||
|
setInterval(fetchRSS, 3600000);
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
<!-- RSS Feed End -->
|
||||||
|
</div>
|
||||||
|
<div class="layout_footer"><?= $this->include("templates/{$viewDatas['layout']}/index_footer"); ?></div>
|
||||||
|
<!-- Layout Right End -->
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<!-- Layout Middle End -->
|
||||||
|
<div class="layout_bottom"><?= $this->include(LAYOUTS[$viewDatas['layout']]['path'] . '/bottom'); ?></div>
|
||||||
|
<?= $this->endSection() ?>
|
||||||
@ -14,6 +14,7 @@ table.action_form {
|
|||||||
table.action_form th {
|
table.action_form th {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.action_form td {
|
table.action_form td {
|
||||||
@ -70,7 +71,7 @@ table.index_table {
|
|||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.index_table thead th {
|
table.index_table thead tr th {
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
padding-top: 15px;
|
padding-top: 15px;
|
||||||
padding-bottom: 15px;
|
padding-bottom: 15px;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user