상품보기 유형 변경 코드를 파일에 분리해서 저장
This commit is contained in:
@ -97,20 +97,20 @@ if ($is_admin)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<?php
|
||||||
|
$qstr1 .= 'ca_id='.$ca_id;
|
||||||
|
if($skin)
|
||||||
|
$qstr1 .= '&skin='.$skin;
|
||||||
|
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
||||||
|
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
|
||||||
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 하단 HTML
|
// 하단 HTML
|
||||||
echo '<div id="sct_thtml">'.stripslashes($ca['ca_mobile_tail_html']).'</div>';
|
echo '<div id="sct_thtml">'.stripslashes($ca['ca_mobile_tail_html']).'</div>';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
|
||||||
$qstr1 .= 'ca_id='.$ca_id;
|
|
||||||
if($skin)
|
|
||||||
$qstr1 .= '&skin='.$skin;
|
|
||||||
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
|
||||||
echo get_paging($config['cf_mobile_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once(G4_MSHOP_PATH.'/_tail.php');
|
include_once(G4_MSHOP_PATH.'/_tail.php');
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,9 @@ if (file_exists($list_file))
|
|||||||
{
|
{
|
||||||
include G4_SHOP_PATH.'/list.sort.php';
|
include G4_SHOP_PATH.'/list.sort.php';
|
||||||
|
|
||||||
|
// 상품 보기 타입 변경 버튼
|
||||||
|
include G4_SHOP_PATH.'/list.sub.php';
|
||||||
|
|
||||||
// 총몇개 = 한줄에 몇개 * 몇줄
|
// 총몇개 = 한줄에 몇개 * 몇줄
|
||||||
$items = $ev['ev_list_mod'] * $ev['ev_list_row'];
|
$items = $ev['ev_list_mod'] * $ev['ev_list_row'];
|
||||||
// 페이지가 없으면 첫 페이지 (1 페이지)
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
||||||
@ -72,6 +75,9 @@ if ($i==0)
|
|||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
// 상품 보기 타입 변경 처리 스크립트
|
||||||
|
include G4_SHOP_PATH.'/list.sub2.php';
|
||||||
|
|
||||||
$qstr .= 'skin='.$skin.'&ev_id='.$ev_id.'&sort='.$sort.'&sortodr='.$sortodr;
|
$qstr .= 'skin='.$skin.'&ev_id='.$ev_id.'&sort='.$sort.'&sortodr='.$sortodr;
|
||||||
echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page=");
|
echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page=");
|
||||||
?>
|
?>
|
||||||
|
|||||||
@ -75,6 +75,9 @@ if ($is_admin)
|
|||||||
if (file_exists($list_file)) {
|
if (file_exists($list_file)) {
|
||||||
include G4_SHOP_PATH.'/list.sort.php';
|
include G4_SHOP_PATH.'/list.sort.php';
|
||||||
|
|
||||||
|
// 상품 보기 타입 변경 버튼
|
||||||
|
include G4_SHOP_PATH.'/list.sub.php';
|
||||||
|
|
||||||
// 총몇개 = 한줄에 몇개 * 몇줄
|
// 총몇개 = 한줄에 몇개 * 몇줄
|
||||||
$items = $ca['ca_list_mod'] * $ca['ca_list_row'];
|
$items = $ca['ca_list_mod'] * $ca['ca_list_row'];
|
||||||
// 페이지가 없으면 첫 페이지 (1 페이지)
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
||||||
@ -115,18 +118,16 @@ if ($is_admin)
|
|||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<script>
|
<?php
|
||||||
// 리스트 타입 쿠키가 있을 경우 바로 적용
|
// 상품 보기 타입 변경 처리 스크립트
|
||||||
if(itemlist_type = get_cookie("ck_itemlist_type")) {
|
include G4_SHOP_PATH.'/list.sub2.php';
|
||||||
if(itemlist_type == "gallery") {
|
|
||||||
$("ul.sct").removeClass("sct_13");
|
$qstr1 .= 'ca_id='.$ca_id;
|
||||||
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
if($skin)
|
||||||
} else {
|
$qstr1 .= '&skin='.$skin;
|
||||||
$("ul.sct").addClass("sct_13");
|
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
||||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
|
||||||
}
|
?>
|
||||||
}
|
|
||||||
</script>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 하단 HTML
|
// 하단 HTML
|
||||||
@ -138,14 +139,6 @@ if ($is_admin)
|
|||||||
echo '<div id="sct_timg" class="sct_img"><img src="'.G4_DATA_URL.'/category/'.$ca_id.'_t" alt="">';
|
echo '<div id="sct_timg" class="sct_img"><img src="'.G4_DATA_URL.'/category/'.$ca_id.'_t" alt="">';
|
||||||
?>
|
?>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<?php
|
|
||||||
$qstr1 .= 'ca_id='.$ca_id;
|
|
||||||
if($skin)
|
|
||||||
$qstr1 .= '&skin='.$skin;
|
|
||||||
$qstr1 .='&sort='.$sort.'&sortodr='.$sortodr;
|
|
||||||
echo get_paging($config['cf_write_pages'], $page, $total_page, $_SERVER['PHP_SELF'].'?'.$qstr1.'&page=');
|
|
||||||
?>
|
|
||||||
<!-- } 상품 목록 끝 -->
|
<!-- } 상품 목록 끝 -->
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -1,10 +1,14 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
$sct_sort_href = $_SERVER['PHP_SELF'].'?ca_id='.$ca_id;
|
$sct_sort_href = $_SERVER['PHP_SELF'].'?';
|
||||||
|
if($ca_id)
|
||||||
|
$sct_sort_href .= 'ca_id='.$ca_id;
|
||||||
|
else if($ev_id)
|
||||||
|
$sct_sort_href .= 'ev_id='.$ev_id;
|
||||||
if($skin)
|
if($skin)
|
||||||
$sct_sort_href .= '&skin='.$skin;
|
$sct_sort_href .= '&skin='.$skin;
|
||||||
$sct_sort_href .= '&ev_id='.$ev_id.'&sort=';
|
$sct_sort_href .= '&sort=';
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<!-- 상품 정렬 선택 시작 { -->
|
<!-- 상품 정렬 선택 시작 { -->
|
||||||
@ -21,21 +25,5 @@ $sct_sort_href .= '&ev_id='.$ev_id.'&sort=';
|
|||||||
<li><a href="<?php echo $sct_sort_href; ?>it_type4&sortodr=desc" class="btn01">인기상품</a></li>
|
<li><a href="<?php echo $sct_sort_href; ?>it_type4&sortodr=desc" class="btn01">인기상품</a></li>
|
||||||
<li><a href="<?php echo $sct_sort_href; ?>it_type5&sortodr=desc" class="btn01">할인상품</a></li>
|
<li><a href="<?php echo $sct_sort_href; ?>it_type5&sortodr=desc" class="btn01">할인상품</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<button type="button" class="sct_lst_view sct_lst_list">리스트뷰</button>
|
|
||||||
<button type="button" class="sct_lst_view sct_lst_gallery">갤러리뷰</button>
|
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<script>
|
|
||||||
$(function() {
|
|
||||||
$("button.sct_lst_view").on("click", function() {
|
|
||||||
if($(this).hasClass("sct_lst_gallery")) {
|
|
||||||
$("ul.sct").removeClass("sct_13");
|
|
||||||
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
|
||||||
} else {
|
|
||||||
$("ul.sct").addClass("sct_13");
|
|
||||||
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
</script>
|
|
||||||
<!-- } 상품 정렬 선택 끝 -->
|
<!-- } 상품 정렬 선택 끝 -->
|
||||||
@ -1,19 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||||
|
|
||||||
// 총몇개 = 한줄에 몇개 * 몇줄
|
|
||||||
$items = $list_mod * $list_row;
|
|
||||||
// <TD> 태그 폭
|
|
||||||
$td_width = (int)(100 / $list_mod);
|
|
||||||
|
|
||||||
$sql = "select COUNT(*) as cnt $sql_common ";
|
|
||||||
$row = sql_fetch($sql);
|
|
||||||
$total_count = $row['cnt'];
|
|
||||||
|
|
||||||
// 전체 페이지 계산
|
|
||||||
$total_page = ceil($total_count / $items);
|
|
||||||
// 페이지가 없으면 첫 페이지 (1 페이지)
|
|
||||||
if ($page == "") $page = 1;
|
|
||||||
// 시작 레코드 구함
|
|
||||||
$from_record = ($page - 1) * $items;
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<button type="button" class="sct_lst_view sct_lst_list">리스트뷰</button>
|
||||||
|
<button type="button" class="sct_lst_view sct_lst_gallery">갤러리뷰</button>
|
||||||
28
shop/list.sub2.php
Normal file
28
shop/list.sub2.php
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
if (!defined("_GNUBOARD_")) exit; // 개별 페이지 접근 불가
|
||||||
|
?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// 리스트 타입 쿠키가 있을 경우 바로 적용
|
||||||
|
if(itemlist_type = get_cookie("ck_itemlist_type")) {
|
||||||
|
if(itemlist_type == "gallery") {
|
||||||
|
$("ul.sct").removeClass("sct_13");
|
||||||
|
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
||||||
|
} else {
|
||||||
|
$("ul.sct").addClass("sct_13");
|
||||||
|
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$("button.sct_lst_view").on("click", function() {
|
||||||
|
if($(this).hasClass("sct_lst_gallery")) {
|
||||||
|
$("ul.sct").removeClass("sct_13");
|
||||||
|
set_cookie("ck_itemlist_type", "gallery", 1, g4_cookie_domain);
|
||||||
|
} else {
|
||||||
|
$("ul.sct").addClass("sct_13");
|
||||||
|
set_cookie("ck_itemlist_type", "list", 1, g4_cookie_domain);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
@ -55,6 +55,13 @@ if (file_exists($list_file)) {
|
|||||||
$list->set_is_page(true);
|
$list->set_is_page(true);
|
||||||
$list->set_order_by($order_by);
|
$list->set_order_by($order_by);
|
||||||
$list->set_from_record($from_record);
|
$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_cust_price', false);
|
||||||
|
$list->set_view('it_price', true);
|
||||||
|
$list->set_view('it_icon', true);
|
||||||
|
$list->set_view('sns', true);
|
||||||
echo $list->run();
|
echo $list->run();
|
||||||
|
|
||||||
// where 된 전체 상품수
|
// where 된 전체 상품수
|
||||||
|
|||||||
Reference in New Issue
Block a user