first commit 2
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
<?php
|
||||
include_once('./_common.php');
|
||||
|
||||
// 1. 카테고리 ID 확인
|
||||
$ca_id = isset($_GET['ca_id']) ? preg_replace('/[^0-9a-z]/i', '', $_GET['ca_id']) : '';
|
||||
|
||||
if (!$ca_id) {
|
||||
alert('카테고리 ID가 없습니다.');
|
||||
}
|
||||
|
||||
// 2. 카테고리 정보 가져오기
|
||||
$ca = sql_fetch(" select * from {$g5['g5_shop_category_table']} where ca_id = '{$ca_id}' ");
|
||||
if (!$ca['ca_id']) {
|
||||
alert('등록된 분류가 없습니다.');
|
||||
}
|
||||
|
||||
$g5['title'] = $ca['ca_name'];
|
||||
include_once(G5_THEME_SHOP_PATH.'/shop.head.php');
|
||||
|
||||
// 3. 상품 목록 가져오기
|
||||
$sql = " select * from {$g5['g5_shop_item_table']} where ca_id like '{$ca_id}%' and it_use = 1 order by it_order, it_id desc ";
|
||||
$result = sql_query($sql);
|
||||
?>
|
||||
|
||||
<div id="sct">
|
||||
<h2><?php echo $ca['ca_name']; ?></h2>
|
||||
|
||||
<ul class="sct_list">
|
||||
<?php
|
||||
for ($i=0; $row=sql_fetch_array($result); $i++) {
|
||||
$item_link = './view.php?it_id='.$row['it_id'].'&ca_id='.$ca_id;
|
||||
$img = get_it_image($row['it_id'], 230, 230, '', '', stripslashes($row['it_name']));
|
||||
?>
|
||||
<li class="sct_li">
|
||||
<div class="sct_img">
|
||||
<a href="<?php echo $item_link; ?>">
|
||||
<?php echo $img; ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="sct_txt">
|
||||
<a href="<?php echo $item_link; ?>" class="sct_a">
|
||||
<?php echo stripslashes($row['it_name']); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="sct_cost">
|
||||
<?php echo display_price(get_price($row), $row['it_tel_inq']); ?>
|
||||
</div>
|
||||
</li>
|
||||
<?php } ?>
|
||||
|
||||
<?php if ($i == 0) { ?>
|
||||
<li class="sct_no_item">등록된 상품이 없습니다.</li>
|
||||
<?php } ?>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
include_once(G5_THEME_SHOP_PATH.'/shop.tail.php');
|
||||
?>
|
||||
Reference in New Issue
Block a user