vhost init...2

This commit is contained in:
최준흠 2024-05-13 17:35:22 +09:00
parent 92929fa5d7
commit c0400c1433
14 changed files with 104 additions and 114 deletions

View File

@ -108,7 +108,8 @@ define('LAYOUTS', [
'front' => [
'title' => '사용자화면',
'path' => 'layouts' . DIRECTORY_SEPARATOR . 'front',
'topmenus' => ['aboutus', 'hosting', 'serverdevice', 'service', 'support'],
//'topmenus' => ['aboutus', 'hosting', 'serverdevice', 'service', 'support'],
'topmenus' => ['aboutus', 'hosting', 'service', 'support'],
'stylesheets' => [
'<link rel="icon" href="/favicon.ico">',
'<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">',
@ -230,6 +231,20 @@ foreach (PATHS as $key => $path) {
}
}
define('CLASS_ICONS', [
'USER' => '<i class="bi bi-person-vcard"></i>',
'USERSNS' => '<i class="bi bi-globe"></i>',
'BOARD' => '<i class="bi bi-pencil-square"></i>',
'SITEPAGE' => '<i class="bi bi-body-text"></i>',
'CATEGORY' => '<i class="bi bi-boxes"></i>',
'PRODUCT' => '<i class="bi bi-box2"></i>',
'ORDER' => '<i class="bi bi-clipboard-check"></i>',
'BILLING' => '<i class="bi bi-clipboard-check"></i>',
'CART' => '<i class="bi bi-cart4"></i>',
'CARD' => '<i class="bi bi-credit-card"></i>',
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
]);
//아이콘 및 Sound관련
define('ICONS', [
'LOGIN' => '<i class="bi bi-shield-check"></i>',
@ -254,19 +269,6 @@ define('ICONS', [
'RIGHT' => '<i class="bi bi-arrow-right"></i>',
'IMAGE_FILE' => '<i class="bi bi-file-earmark-image"></i>',
]);
define('CLASS_ICONS', [
'USER' => '<i class="bi bi-person-vcard"></i>',
'USERSNS' => '<i class="bi bi-globe"></i>',
'BOARD' => '<i class="bi bi-pencil-square"></i>',
'SITEPAGE' => '<i class="bi bi-body-text"></i>',
'CATEGORY' => '<i class="bi bi-boxes"></i>',
'PRODUCT' => '<i class="bi bi-box2"></i>',
'ORDER' => '<i class="bi bi-clipboard-check"></i>',
'BILLING' => '<i class="bi bi-clipboard-check"></i>',
'CART' => '<i class="bi bi-cart4"></i>',
'CARD' => '<i class="bi bi-credit-card"></i>',
'DEPOSIT' => '<i class="bi bi-cash-coin"></i>',
]);
define('TOP_BANNER', [
'default' => '<img src="/images/banner/sub_visual1.jpg"/>',

View File

@ -42,6 +42,7 @@ DROP TABLE IF EXISTS vhost.tw_category;
CREATE TABLE vhost.tw_category (
uid varchar(50) NOT NULL,
classname varchar(50) NOT NULL DEFAULT 'Sitepage',
grpno int(10) unsigned NOT NULL DEFAULT 1 COMMENT 'Group번호: 상위가없을시 기본 uid와 같음,항상 숫자여야함',
grporder int(5) unsigned NOT NULL DEFAULT 1 COMMENT 'Group순서: 상위가없을시 1부터시작',
grpdepth int(3) unsigned NOT NULL DEFAULT 1 COMMENT 'Group깊이: 상위가없을시 1부터시작 , 상위 grpdepth+1씩 추가필요',
@ -100,8 +101,7 @@ CREATE TABLE vhost.tw_sitepage (
user_uid varchar(36) DEFAULT NULL COMMENT '작성자 정보',
title varchar(255) NOT NULL COMMENT '제목',
content text NOT NULL COMMENT '내용',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,
unuse: ',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 사용않함 등등',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,
@ -121,13 +121,13 @@ CREATE TABLE vhost.tw_product (
type varchar(10) NOT NULL DEFAULT 'rental' COMMENT 'rental: 월임대, onetime:판매,일회성',
name varchar(255) NOT NULL COMMENT '상품명',
photo varchar(255) DEFAULT NULL COMMENT '상품이미지',
cost int(10) unsigned NOT NULL COMMENT '원가',
price int(10) unsigned NOT NULL COMMENT '판매가',
cost int(10) unsigned NOT NULL DEFAULT 0 COMMENT '원가',
price int(10) unsigned NOT NULL DEFAULT 0 COMMENT '판매가',
sale int(10) unsigned NOT NULL DEFAULT 0 COMMENT '할인가',
stock int(5) unsigned DEFAULT 1 COMMENT '재고수량',
view_cnt int(4) unsigned NOT NULL DEFAULT 0 COMMENT '조회수',
content text NOT NULL COMMENT '상품정보',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 판매, unuse: 판매않함, standby: 판매준비, hold: 판매중지 soldout: 상품부족 등등',
stock int(5) unsigned NOT NULL DEFAULT 1 COMMENT '재고수량',
view_cnt int(4) unsigned NOT NULL DEFAULT 1 COMMENT '조회수',
content text NOT NULL COMMENT '상품내용',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 판매, unuse: 판매않함, soldout:상품부족 등등',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,
@ -138,6 +138,39 @@ CREATE TABLE vhost.tw_product (
CONSTRAINT tw_product_ibfk_2 FOREIGN KEY (user_uid) REFERENCES tw_user (uid)
) ENGINE = InnoDB CHARSET = utf8 COLLATE = utf8_general_ci COMMENT = '상품 정보';
DROP TABLE IF EXISTS vhost.tw_device;
CREATE TABLE vhost.tw_device (
uid varchar(36) NOT NULL,
type varchar(20) NOT NULL COMMENT '형식:server(HP,KVM,Container),cpu,memory,disk(ssd,nvme),os(linux,windows),공인ip등등',
name varchar(255) NOT NULL,
cost int(10) unsigned NOT NULL DEFAULT 0 COMMENT '원가',
price int(10) unsigned NOT NULL DEFAULT 0 COMMENT '판매가',
sale int(10) unsigned NOT NULL DEFAULT 0 COMMENT '할인가',
stock int(5) unsigned NOT NULL DEFAULT 1 COMMENT '재고수량',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 판매중 unuse: 판매않함, soldout:상품부족 등등',
content text NOT NULL COMMENT '장비내용',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,
PRIMARY KEY (uid)
) ENGINE = InnoDB CHARSET = utf8 COLLATE = utf8_general_ci COMMENT '장비 정보';
DROP TABLE IF EXISTS vhost.tw_product_device;
CREATE TABLE vhost.tw_product_device (
uid int(10) unsigned NOT NULL AUTO_INCREMENT,
product_uid varchar(36) NOT NULL COMMENT '상품 정보',
device_uid varchar(36) NOT NULL COMMENT '장비 정보',
device_cnt int(3) unsigned NOT NULL DEFAULT 1 COMMENT '장비 갯수',
created_at timestamp NOT NULL DEFAULT current_timestamp(),
PRIMARY KEY (uid),
KEY product_uid (product_uid),
KEY device_uid (device_uid),
CONSTRAINT tw_product_device_ibfk_1 FOREIGN KEY (product_uid) REFERENCES tw_product (uid) ON DELETE CASCADE,
CONSTRAINT tw_product_device_ibfk_2 FOREIGN KEY (device_uid) REFERENCES tw_device (uid) ON DELETE RESTRICT
) ENGINE = InnoDB CHARSET = utf8 COLLATE = utf8_general_ci COMMENT '상품장비연결';
DROP TABLE IF EXISTS vhost.tw_order;
CREATE TABLE vhost.tw_order (
@ -149,11 +182,9 @@ CREATE TABLE vhost.tw_order (
sale int(10) unsigned NOT NULL DEFAULT 0 COMMENT '할인가',
price int(10) unsigned NOT NULL COMMENT '결제액',
quantity varchar(255) NOT NULL COMMENT '수량',
type varchar(10) NOT NULL DEFAULT 'rental' COMMENT 'rental: 월임대,
onetime:,',
type varchar(10) NOT NULL DEFAULT 'rental' COMMENT 'rental: 월임대,onetime:판매,일회성',
paymentday int(2) unsigned DEFAULT NULL COMMENT '결제일',
status varchar(10) NOT NULL DEFAULT 'unuse' COMMENT 'use: 주문요청/장바구니,
unuse: /',
status varchar(10) NOT NULL DEFAULT 'unuse' COMMENT 'use: 주문요청/장바구니,unuse: 주문완료/서비스',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,
@ -168,13 +199,12 @@ DROP TABLE IF EXISTS vhost.tw_service;
CREATE TABLE vhost.tw_service (
uid varchar(36) NOT NULL,
product_uid varchar(36) DEFAULT NULL COMMENT '상품 정보',
user_uid varchar(36) DEFAULT NULL COMMENT '구매자 정보',
type varchar(10) NOT NULL DEFAULT 'rental' COMMENT 'rental: 월임대,
onetime:,',
type varchar(10) NOT NULL DEFAULT 'rental' COMMENT 'rental: 월임대,onetime:판매,일회성',
price int(10) unsigned NOT NULL COMMENT '결제액',
paymentday int(2) unsigned DEFAULT NULL COMMENT '결제일',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,
unuse: ',
status varchar(10) NOT NULL DEFAULT 'use' COMMENT 'use: 사용,unuse: 해지',
updated_at timestamp NULL DEFAULT NULL,
created_at timestamp NOT NULL DEFAULT current_timestamp(),
deleted_at timestamp NULL DEFAULT NULL,

View File

@ -40,8 +40,12 @@ abstract class BaseModel extends Model
protected $beforeDelete = [];
protected $afterDelete = [];
private $_user_options = null;
//추가변수선언
private $_className = null;
private $_userModel = null;
private $_categoryModel = null;
protected $_user_options = null;
protected $_category_options = null;
protected $_session = null;
protected $_validation = null;
protected function __construct(string $className)
@ -60,11 +64,25 @@ abstract class BaseModel extends Model
{
return $this->_className;
}
final public function getPrimaryKey(): string
final protected function getUserModel(): UserModel
{
if (is_null($this->_userModel)) {
$this->_userModel = new UserModel();
}
return $this->_userModel;
}
final protected function getCategoryModel(): CategoryModel
{
if (is_null($this->_categoryModel)) {
$this->_categoryModel = new CategoryModel();
}
return $this->_categoryModel;
}
abstract public function getTitleField(): string;
final public function getPrimaryKey()
{
return $this->primaryKey;
}
abstract public function getTitleField(): string;
public function getEntity($conditions): BaseEntity
{
return $this->where($conditions)->first() ?: throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 해당 데이터가 없습니다.");
@ -156,11 +174,16 @@ abstract class BaseModel extends Model
switch ($field) {
case 'user_uid':
if (is_null($this->_user_options)) {
$userModel = new UserModel();
$this->_user_options = $userModel->getOptions();
$this->_user_options = $this->getUserModel()->getOptions();
}
$options = $this->_user_options;
break;
case 'category_uid':
if (is_null($this->_category_options)) {
$this->_category_options = $this->getCategoryModel()->getOptions(['classname' => $this->_className]);
}
$options = $this->_category_options;
break;
default:
$options = lang($this->getClassName() . '.' . strtoupper($field));
break;

View File

@ -6,7 +6,6 @@ use App\Entities\BoardEntity;
class BoardModel extends BaseHierarchyModel
{
private $_category_options = null;
protected $table = "tw_board";
protected $returnType = BoardEntity::class;
public function __construct()
@ -53,26 +52,6 @@ class BoardModel extends BaseHierarchyModel
}
return $rules;
}
//Field별 Form Option용
public function getFieldFormOption(string $field): array
{
switch ($field) {
case 'category_uid':
if (is_null($this->_category_options)) {
$categoryModel = new CategoryModel();
$this->_category_options = $categoryModel->getOptions();
}
$options = $this->_category_options;
break;
default:
return parent::getFieldFormOption($field);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
}
return $options;
}
public function getEntity($conditions): BoardEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));

View File

@ -58,11 +58,10 @@ class CategoryModel extends BaseHierarchyModel
return $rules;
}
//Form 선택용 Options Data용
public function getOptions(array $conditions = array(), $options = array()): array
public function getOptions(array $conditions = [], $options = []): array
{
//대분류 부분은 선택이 되지 않게 하기위해 따로 만듬 (form_dropdown의 optgroup 기능)
$old = "";
$options = array();
foreach ($this->getEntitys($conditions) as $entity) {
if ($entity->getHierarchy_Depth() == 1) {
$old = $entity->getTitle();
@ -74,7 +73,7 @@ class CategoryModel extends BaseHierarchyModel
return $options;
}
public function getMenus(array $conditions = array()): array
public function getMenus(array $conditions = []): array
{
$old = "";
$menus = array();

View File

@ -7,7 +7,6 @@ use App\Entities\ProductEntity;
class ProductModel extends BaseModel
{
const STATUS_OUTOFSTOCK = "outofstock";
private $_category_options = null;
protected $table = "tw_product";
protected $useAutoIncrement = false;
protected $returnType = ProductEntity::class;
@ -63,26 +62,6 @@ class ProductModel extends BaseModel
}
return $rules;
}
//Field별 Form Option용
public function getFieldFormOption(string $field): array
{
switch ($field) {
case 'category_uid':
if (is_null($this->_category_options)) {
$categoryModel = new CategoryModel();
$this->_category_options = $categoryModel->getOptions();
}
$options = $this->_category_options;
break;
default:
return parent::getFieldFormOption($field);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
}
return $options;
}
public function getEntity($conditions): ProductEntity
{

View File

@ -6,7 +6,6 @@ use App\Entities\SitepageEntity;
class SitepageModel extends BaseModel
{
private $_category_options = null;
protected $table = "tw_sitepage";
protected $returnType = SitepageEntity::class;
public function __construct()
@ -47,26 +46,7 @@ class SitepageModel extends BaseModel
}
return $rules;
}
//Field별 Form Option용
public function getFieldFormOption(string $field): array
{
switch ($field) {
case 'category_uid':
if (is_null($this->_category_options)) {
$categoryModel = new CategoryModel();
$this->_category_options = $categoryModel->getOptions();
}
$options = $this->_category_options;
break;
default:
return parent::getFieldFormOption($field);
break;
}
if (!is_array($options)) {
throw new \Exception(__FUNCTION__ . "에서 {$this->getClassName()}의 Field:{$field}의 FormOptionData가 array가 아닙니다.\n" . var_export($options, true));
}
return $options;
}
public function getEntity($conditions): SitepageEntity
{
return $this->where($conditions)->first() ?: throw new \Exception("해당 데이터가 없습니다.\n" . var_export($conditions, true));

View File

@ -4,7 +4,7 @@
<div id="left_menu" class="shadow-lg rounded">
<div class="accordion accordion-flush">
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/base'); ?>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/board'); ?>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/site'); ?>
<?= $this->include($viewDatas['layout']['path'] . '/left_menu/shoppingmall'); ?>
</div>
</div>

View File

@ -6,4 +6,7 @@
</div>
<div class="accordion-item">
<h2><a href="/admin/usersns"><?= CLASS_ICONS['USERSNS'] ?></i>SNS 계정 관리</a></h2>
</div>
<div class="accordion-item">
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>분류 관리</a></h2>
</div>

View File

@ -1,11 +1,8 @@
<div class="accordion-item">
<h2 class="accordion-header">
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-heading-Board" aria-expanded="false" aria-controls="flush-heading-Board"><b>게시판관리</b></button>
<button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#flush-heading-Board" aria-expanded="false" aria-controls="flush-heading-Board"><b>사이트관리</b></button>
</h2>
<div id="flush-heading-Board" class="accordion-collapse collapse show" aria-labelledby="flush-heading-Board">
<div class="accordion-item">
<h2><a href="/admin/category"><?= CLASS_ICONS['CATEGORY'] ?>분류 관리</a></h2>
</div>
<div class="accordion-item">
<h2><a href="/admin/board"><?= CLASS_ICONS['BOARD'] ?>게시글 관리</a></h2>
</div>

View File

@ -1,7 +1,7 @@
<!-- Copyright 시작-->
<link href="/css/common/copyright.css" media="screen" rel="stylesheet" type="text/css" />
<div id="copyright" class="container-fluid">
<nav class="nav"><a class="navbar-brand" href="/">LOGO</a></nav>
<nav class="nav">&nbsp;</nav>
<nav class="nav justify-content-center">
<div>
<div style="padding: 10px; margin: 10px;">
@ -36,9 +36,9 @@
</div>
</div>
<div class="address">
주소 : 전자우편주소 : itsolutionidc.jp@gmail.com 전화번호 : 1661-0577<BR>
주소 : 전자우편주소 : webmaster@daemonidc.com 전화번호 : 1661-0577<BR>
사업자등록번호 : 777-86-00287 [사업자정보확인]통신판매업신고번호 : 2023-사울동작-0001<BR>
Copyright(c) www.itsolution-mall.com All Right Reserved.
Copyright(c) www.daemonidc.com All Right Reserved.
</div>
</div>
</nav>

View File

@ -5,7 +5,7 @@
<nav class="nav justify-content-center">
<nav id="top_menu" class="navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="nav"><a class="navbar-brand" href="/">HOME</a></nav>
<nav class="nav"><a class="navbar-brand" href="/"><?= ICONS['HOME'] ?></a></nav>
<nav class="nav justify-content-center"></nav>
<ul class="nav justify-content-end">
<li class="nav-item" style="padding-top:10px;">|</li>

View File

@ -1,9 +1,7 @@
<link href="/css/common/top_navigator.css" media="screen" rel="stylesheet" type="text/css" />
<nav id="top_navigator" class="navbar navbar-expand-lg">
<div class="container-fluid">
<nav class="nav">
<a class="navbar-brand" href="#">Logo</a>
</nav>
<nav class="nav">&nbsp;</nav>
<ul class="nav justify-content-center">
<li class="nav-item">
<?= $this->include($viewDatas['layout']['path'] . '/top_navigator/top_center'); ?>

View File

@ -1,5 +1,5 @@
<div class="navigator_center">
<span><strong>고객센터</strong> 1661-0577 (365 24시간)</span>
<span>|</span>
<span><img src="/images/common/top_skype.png" alt="스카이프"> itsolution-idc@outlook.kr</span>
<span><img src="/images/common/top_skype.png" alt="스카이프"> webmaster@daemonidc.com</span>
</div>