153 lines
4.7 KiB
PHP
153 lines
4.7 KiB
PHP
<?php
|
|
include_once('./_common.php');
|
|
|
|
$sql = " select *
|
|
from {$g5['g5_shop_category_table']}
|
|
where ca_id = '$ca_id'
|
|
and ca_use = '1' ";
|
|
$ca = sql_fetch($sql);
|
|
if (!$ca['ca_id'])
|
|
alert('등록된 분류가 없습니다.', G5_SHOP_URL);
|
|
|
|
// 본인인증, 성인인증체크
|
|
if(!$is_admin) {
|
|
$msg = shop_member_cert_check($ca_id, 'list');
|
|
if($msg)
|
|
alert($msg, G5_SHOP_URL);
|
|
}
|
|
|
|
$g5['title'] = $ca['ca_name'];
|
|
|
|
include_once(G5_MSHOP_PATH.'/_head.php');
|
|
|
|
// 스킨경로
|
|
$skin_dir = G5_MSHOP_SKIN_PATH;
|
|
|
|
if($ca['ca_mobile_skin_dir']) {
|
|
$skin_dir = G5_MOBILE_PATH.'/'.G5_SKIN_DIR.'/shop/'.$ca['ca_mobile_skin_dir'];
|
|
|
|
if(is_dir($skin_dir)) {
|
|
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
|
|
|
|
if(!is_file($skin_file))
|
|
$skin_dir = G5_MSHOP_SKIN_PATH;
|
|
} else {
|
|
$skin_dir = G5_MSHOP_SKIN_PATH;
|
|
}
|
|
}
|
|
|
|
define('G5_SHOP_CSS_URL', str_replace(G5_PATH, G5_URL, $skin_dir));
|
|
?>
|
|
|
|
<script>
|
|
var g5_shop_url = "<?php echo G5_SHOP_URL; ?>";
|
|
</script>
|
|
<script src="<?php echo G5_JS_URL; ?>/shop.mobile.list.js"></script>
|
|
|
|
<div id="sct">
|
|
|
|
<?php
|
|
// 상단 HTML
|
|
echo '<div id="sct_hhtml">'.conv_content($ca['ca_mobile_head_html'], 1).'</div>';
|
|
|
|
$cate_skin = $skin_dir.'/listcategory.skin.php';
|
|
if(!is_file($cate_skin))
|
|
$cate_skin = G5_MSHOP_SKIN_PATH.'/listcategory.skin.php';
|
|
include $cate_skin;
|
|
|
|
// 분류 Best Item
|
|
$list_mod = 3;
|
|
$list_row = 3;
|
|
$limit = $list_mod * $list_row;
|
|
$best_skin = G5_MSHOP_SKIN_PATH.'/list.best.10.skin.php';
|
|
|
|
$sql = " select *
|
|
from {$g5['g5_shop_item_table']}
|
|
where ( ca_id like '$ca_id%' or ca_id2 like '$ca_id%' or ca_id3 like '$ca_id%' )
|
|
and it_use = '1'
|
|
and it_type4 = '1'
|
|
order by it_order, it_id desc
|
|
limit 0, $limit ";
|
|
|
|
$list = new item_list($best_skin, $list_mod, $list_row, $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
|
|
$list->set_query($sql);
|
|
$list->set_mobile(true);
|
|
$list->set_view('it_img', true);
|
|
$list->set_view('it_id', false);
|
|
$list->set_view('it_name', true);
|
|
$list->set_view('it_price', true);
|
|
echo $list->run();
|
|
|
|
// 상품 출력순서가 있다면
|
|
if ($sort != "")
|
|
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
|
|
else
|
|
$order_by = 'it_order, it_id desc';
|
|
|
|
$error = '<p class="sct_noitem">등록된 상품이 없습니다.</p>';
|
|
|
|
// 리스트 스킨
|
|
$skin_file = $skin_dir.'/'.$ca['ca_mobile_skin'];
|
|
|
|
if (file_exists($skin_file)) {
|
|
$sort_skin = $skin_dir.'/list.sort.skin.php';
|
|
if(!is_file($sort_skin))
|
|
$sort_skin = G5_MSHOP_SKIN_PATH.'/list.sort.skin.php';
|
|
include $sort_skin;
|
|
|
|
// 총몇개
|
|
$items = $ca['ca_mobile_list_mod'] * $ca['ca_mobile_list_row'];
|
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
|
if ($page < 1) $page = 1;
|
|
// 시작 레코드 구함
|
|
$from_record = ($page - 1) * $items;
|
|
|
|
$list = new item_list($skin_file, $ca['ca_mobile_list_mod'], $ca['ca_mobile_list_row'], $ca['ca_mobile_img_width'], $ca['ca_mobile_img_height']);
|
|
$list->set_category($ca['ca_id'], 1);
|
|
$list->set_category($ca['ca_id'], 2);
|
|
$list->set_category($ca['ca_id'], 3);
|
|
$list->set_is_page(true);
|
|
$list->set_mobile(true);
|
|
$list->set_order_by($order_by);
|
|
$list->set_from_record($from_record);
|
|
$list->set_view('it_img', true);
|
|
$list->set_view('it_id', false);
|
|
$list->set_view('it_name', true);
|
|
$list->set_view('it_price', true);
|
|
echo $list->run();
|
|
|
|
// where 된 전체 상품수
|
|
$total_count = $list->total_count;
|
|
}
|
|
else
|
|
{
|
|
echo '<div class="sct_nofile">'.str_replace(G5_PATH.'/', '', $skin_file).' 파일을 찾을 수 없습니다.<br>관리자에게 알려주시면 감사하겠습니다.</div>';
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
if($i > 0 && $total_count > $items) {
|
|
$qstr1 .= 'ca_id='.$ca_id;
|
|
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
|
$ajax_url = G5_SHOP_URL.'/ajax.list.php?'.$qstr1;
|
|
?>
|
|
<div class="li_more">
|
|
<p id="item_load_msg"><img src="<?php echo G5_SHOP_CSS_URL; ?>/img/loading.gif" alt="로딩이미지" ><br>잠시만 기다려주세요.</p>
|
|
<div class="li_more_btn">
|
|
<button type="button" id="btn_more_item" data-url="<?php echo $ajax_url; ?>" data-page="<?php echo $page; ?>">MORE ITEM +</button>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<?php
|
|
// 하단 HTML
|
|
echo '<div id="sct_thtml">'.conv_content($ca['ca_mobile_tail_html'], 1).'</div>';
|
|
?>
|
|
</div>
|
|
|
|
<?php
|
|
include_once(G5_MSHOP_PATH.'/_tail.php');
|
|
|
|
echo "\n<!-- {$ca['ca_mobile_skin']} -->\n";
|
|
?>
|