shoppingmallv2 init...

This commit is contained in:
최준흠 2023-08-08 10:25:03 +09:00
parent 3e1bcb29c5
commit aa8225569d
10 changed files with 31 additions and 23 deletions

View File

@ -19,4 +19,12 @@ class CategoryEntity extends BaseHierarchyEntity
}
//추가기능
//CommonHelper에서 사용
public function getRole($field = 'isaccess')
{
return array_key_exists(
$field,
$this->attributes
) ? $this->attributes[$field] : DEFAULTS['ROLE'];
}
}

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div class="top"><?= $this->include('templates/front/index_head') ?></div>
<?= form_open(current_url() . '/batchjob', $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="table table-hover">
@ -49,6 +49,6 @@
<?= $viewDatas['pagination'] ?>
</div>
<?= form_close() ?>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">>
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<?= form_open_multipart(current_url(), $viewDatas['forms']['attributes'], $viewDatas['forms']['hiddens']) ?>
<table class="form table table-bordered table-hover table-striped">
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -19,6 +19,6 @@
</tr>
</table>
<?= form_close(); ?>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<table class="form table table-bordered table-striped">
<tbody>
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -16,6 +16,6 @@
<?php endforeach; ?>
</tbody>
</table>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -1,20 +1,20 @@
<?= form_open("ecommerce/addCart", ['method' => 'post']) ?>
<?= form_hidden("product_uid", $viewDatas['entity']->getPrimaryKey()) ?>
<input type="hidden" id="price" name="price" value="<?= ($viewDatas['entity']->getPrice()) * 1 ?>">
<input type="hidden" id="price" name="price" value="<?= ($viewDatas['entity']->price) * 1 ?>">
<?php
$quantityOptions = [DEFAULTS['EMPTY'] => "구매수량 선택"];
for ($i = 1; $i <= $viewDatas['entity']->getStock(); $i++) {
for ($i = 1; $i <= $viewDatas['entity']->stock; $i++) {
$quantityOptions[$i] = $i . "";
}
?>
구매 수량 : <?= form_dropdown('quantity', $quantityOptions, 1, ['onChange' => "cal_price(this.options[this.selectedIndex].value)"]); ?>
구매 금액 : <span id="order_price"><?= number_format($viewDatas['entity']->getPrice() * 1) ?></span>원
<?= form_submit('', '최소:1 ~ 최대:' . $viewDatas['entity']->getStock(), array("class" => "btn btn-outline btn-primary")); ?>
구매 금액 : <span id="order_price"><?= number_format($viewDatas['entity']->price * 1) ?></span>원
<?= form_submit('', '최소:1 ~ 최대:' . $viewDatas['entity']->stock, array("class" => "btn btn-outline btn-primary")); ?>
<?= form_close(); ?>
<script>
function cal_price(quantity) {
var price = 0;
price = <?= $viewDatas['entity']->getPrice() ?> * quantity;;
price = <?= $viewDatas['entity']->price ?> * quantity;;
document.getElementById('price').value = price;
document.getElementById('order_price').textContent = new Intl.NumberFormat().format(price);
}

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div class="top">
<?= $this->include('templates/front/index_head') ?>
<nav class="navbar navbar-expand-lg">
@ -47,6 +47,6 @@
<?php $cnt++ ?>
<?php endforeach ?>
<div class="bottom"><?= $viewDatas['pagination'] ?></div>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<div class="top">
<?= $this->include('templates/front/index_head') ?>
<nav class="navbar navbar-expand-lg">
@ -41,6 +41,6 @@
</tbody>
</table>
<div class="bottom"><?= $viewDatas['pagination'] ?></div>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>

View File

@ -2,7 +2,7 @@
<?= $this->section('content') ?>
<link href="/css/front/content.css" media="screen" rel="stylesheet" type="text/css" />
<div id="content">
<div><?= html_entity_decode($viewDatas['category']->getHead()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->head) ?></div>
<table class="form table table-bordered table-striped">
<tbody>
<?php foreach ($viewDatas['fields'] as $field) : ?>
@ -17,12 +17,12 @@
</tbody>
</table>
<div style="text-align:center">
<?php if ($viewDatas['entity']->getStatus() == DEFAULTS['STATUS']) : ?>
<?php if ($viewDatas['entity']->status == DEFAULTS['STATUS']) : ?>
<?= $this->include('front/product/addCart'); ?>
<?php else : ?>
이제품은 현재[<?= lang('Product.STATUS.' . $viewDatas['entity']->getStatus()) ?>]입니다.
이제품은 현재[<?= lang('Product.STATUS.' . $viewDatas['entity']->status) ?>]입니다.
<?php endif ?>
</div>
<div><?= html_entity_decode($viewDatas['category']->getTail()) ?></div>
<div><?= html_entity_decode($viewDatas['category']->tail) ?></div>
</div>
<?= $this->endSection() ?>