상품유형 리스트에 class 적용
This commit is contained in:
@ -281,7 +281,7 @@ class item_list
|
|||||||
if ($this->ca_id3) {
|
if ($this->ca_id3) {
|
||||||
$where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' ";
|
$where_ca_id[] = " ca_id3 like '{$this->ca_id3}%' ";
|
||||||
}
|
}
|
||||||
$where[] = implode(" or ", $where_ca_id);
|
$where[] = "( ".implode(" or ", $where_ca_id)." )";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($this->order_by) {
|
if ($this->order_by) {
|
||||||
|
|||||||
@ -2,11 +2,11 @@
|
|||||||
include_once('./_common.php');
|
include_once('./_common.php');
|
||||||
|
|
||||||
$type = $_REQUEST['type'];
|
$type = $_REQUEST['type'];
|
||||||
if ($type == 1) $g4['title'] = "히트상품";
|
if ($type == 1) $g4['title'] = '히트상품';
|
||||||
else if ($type == 2) $g4['title'] = "추천상품";
|
else if ($type == 2) $g4['title'] = '추천상품';
|
||||||
else if ($type == 3) $g4['title'] = "최신상품";
|
else if ($type == 3) $g4['title'] = '최신상품';
|
||||||
else if ($type == 4) $g4['title'] = "인기상품";
|
else if ($type == 4) $g4['title'] = '인기상품';
|
||||||
else if ($type == 5) $g4['title'] = "할인상품";
|
else if ($type == 5) $g4['title'] = '할인상품';
|
||||||
else
|
else
|
||||||
alert('상품유형이 아닙니다.');
|
alert('상품유형이 아닙니다.');
|
||||||
|
|
||||||
@ -16,45 +16,46 @@ include_once(G4_MSHOP_PATH.'/_head.php');
|
|||||||
$list_mod = 3; // 한줄에 이미지 몇개씩 출력?
|
$list_mod = 3; // 한줄에 이미지 몇개씩 출력?
|
||||||
$list_row = 5; // 한 페이지에 몇라인씩 출력?
|
$list_row = 5; // 한 페이지에 몇라인씩 출력?
|
||||||
|
|
||||||
$img_width = 230; // 출력이미지 폭
|
$img_width = $default['de_type'.$type.'_img_width']; // 출력이미지 폭
|
||||||
$img_height = 230; // 출력이미지 높이
|
$img_height = $default['de_type'.$type.'_img_height']; // 출력이미지 높이
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 상품 출력순서가 있다면
|
// 상품 출력순서가 있다면
|
||||||
if ($sort != "")
|
$order_by = ' it_order, it_id desc ';
|
||||||
$order_by = $sort . " , ";
|
if ($sort != '')
|
||||||
|
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
|
||||||
|
|
||||||
// 상품 (하위 분류의 상품을 모두 포함한다.)
|
$error = '<img src="'.G4_SHOP_URL.'/img/no_item.gif">';
|
||||||
$sql_list1 = " select * ";
|
|
||||||
$sql_list2 = " order by $order_by it_order, it_id desc ";
|
|
||||||
|
|
||||||
$sql_common = " from {$g4['shop_item_table']}
|
|
||||||
where it_type{$type} = '1'
|
|
||||||
and it_use = '1' ";
|
|
||||||
if ($ca_id) {
|
|
||||||
$sql_common .= " and ca_id = '$ca_id' ";
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = "<img src='".G4_MSHOP_URL."/img/no_item.gif' border=0>";
|
|
||||||
|
|
||||||
if (!$skin)
|
if (!$skin)
|
||||||
$skin = "list.skin.10.php";
|
$skin = "list.10.skin.php";
|
||||||
|
|
||||||
$td_width = (int)($mod / 100);
|
|
||||||
|
|
||||||
// 리스트 유형별로 출력
|
// 리스트 유형별로 출력
|
||||||
$list_file = G4_MSHOP_PATH.'/'.$skin;
|
$list_file = G4_SHOP_SKIN_PATH.'/'.$skin;
|
||||||
if (file_exists($list_file)) {
|
if (file_exists($list_file)) {
|
||||||
|
// 총몇개 = 한줄에 몇개 * 몇줄
|
||||||
|
$items = $list_mod * $list_row;
|
||||||
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
||||||
|
if ($page == "") $page = 1;
|
||||||
|
// 시작 레코드 구함
|
||||||
|
$from_record = ($page - 1) * $items;
|
||||||
|
|
||||||
include G4_MSHOP_PATH."/list.sub.php";
|
$list = new item_list();
|
||||||
//include "$cart_dir/list.sort.php";
|
$list->set_type($type);
|
||||||
|
$list->set_list_mod($list_mod);
|
||||||
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
|
$list->set_list_row($list_row);
|
||||||
$result = sql_query($sql);
|
$list->set_img_size($img_width, $img_height);
|
||||||
|
$list->set_is_page(true);
|
||||||
include $list_file;
|
$list->set_mobile(true);
|
||||||
|
$list->set_order_by($order_by);
|
||||||
|
$list->set_from_record($from_record);
|
||||||
|
echo $list->run();
|
||||||
|
|
||||||
|
// where 된 전체 상품수
|
||||||
|
$total_count = $list->total_count;
|
||||||
|
// 전체 페이지 계산
|
||||||
|
$total_page = ceil($total_count / $items);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -71,26 +72,7 @@ if ($i==0)
|
|||||||
|
|
||||||
<?php
|
<?php
|
||||||
$qstr .= '&type='.$type.'&sort='.$sort;
|
$qstr .= '&type='.$type.'&sort='.$sort;
|
||||||
echo get_paging($config['cf_write_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page=");
|
echo get_paging($config['cf_mobile_pages'], $page, $total_page, "{$_SERVER['PHP_SELF']}?$qstr&page=");
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
|
||||||
// 테스트
|
|
||||||
// 분류를 링크하는 코드
|
|
||||||
/*
|
|
||||||
$bar = "";
|
|
||||||
$sql = " select ca_id from $g4[shop_item_table]
|
|
||||||
where it_type{$type} = '1'
|
|
||||||
and it_use = '1'
|
|
||||||
group by ca_id
|
|
||||||
order by ca_id ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
for($i=0;$row=sql_fetch_array($result);$i++) {
|
|
||||||
$row2 = sql_fetch(" select ca_name from $g4[shop_category_table] where ca_id = '$row[ca_id]' ");
|
|
||||||
echo $bar . "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>$row2[ca_name]</a>";
|
|
||||||
$bar = " | ";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
|
|||||||
@ -7,11 +7,11 @@ if (G4_IS_MOBILE) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$type = $_REQUEST['type'];
|
$type = $_REQUEST['type'];
|
||||||
if ($type == 1) $g4['title'] = "히트상품";
|
if ($type == 1) $g4['title'] = '히트상품';
|
||||||
else if ($type == 2) $g4['title'] = "추천상품";
|
else if ($type == 2) $g4['title'] = '추천상품';
|
||||||
else if ($type == 3) $g4['title'] = "최신상품";
|
else if ($type == 3) $g4['title'] = '최신상품';
|
||||||
else if ($type == 4) $g4['title'] = "인기상품";
|
else if ($type == 4) $g4['title'] = '인기상품';
|
||||||
else if ($type == 5) $g4['title'] = "할인상품";
|
else if ($type == 5) $g4['title'] = '할인상품';
|
||||||
else
|
else
|
||||||
alert('상품유형이 아닙니다.');
|
alert('상품유형이 아닙니다.');
|
||||||
|
|
||||||
@ -21,43 +21,45 @@ include_once('./_head.php');
|
|||||||
$list_mod = 3; // 한줄에 이미지 몇개씩 출력?
|
$list_mod = 3; // 한줄에 이미지 몇개씩 출력?
|
||||||
$list_row = 5; // 한 페이지에 몇라인씩 출력?
|
$list_row = 5; // 한 페이지에 몇라인씩 출력?
|
||||||
|
|
||||||
$img_width = 230; // 출력이미지 폭
|
$img_width = $default['de_type'.$type.'_img_width']; // 출력이미지 폭
|
||||||
$img_height = 230; // 출력이미지 높이
|
$img_height = $default['de_type'.$type.'_img_height']; // 출력이미지 높이
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
// 상품 출력순서가 있다면
|
// 상품 출력순서가 있다면
|
||||||
if ($sort != "")
|
$order_by = ' it_order, it_id desc ';
|
||||||
$order_by = $sort . " , ";
|
if ($sort != '')
|
||||||
|
$order_by = $sort.' '.$sortodr.' , it_order, it_id desc';
|
||||||
|
|
||||||
// 상품 (하위 분류의 상품을 모두 포함한다.)
|
$error = '<img src="'.G4_SHOP_URL.'/img/no_item.gif">';
|
||||||
$sql_list1 = " select * ";
|
|
||||||
$sql_list2 = " order by $order_by it_order, it_id desc ";
|
|
||||||
|
|
||||||
$sql_common = " from {$g4['shop_item_table']} where it_type{$type} = '1' and it_use = '1' ";
|
|
||||||
if ($ca_id) {
|
|
||||||
$sql_common .= " and ca_id = '$ca_id' ";
|
|
||||||
}
|
|
||||||
|
|
||||||
$error = "<img src='".G4_SHOP_URL."/img/no_item.gif' border=0>";
|
|
||||||
|
|
||||||
if (!$skin)
|
if (!$skin)
|
||||||
$skin = "list.skin.10.php";
|
$skin = "list.10.skin.php";
|
||||||
|
|
||||||
$td_width = (int)($mod / 100);
|
|
||||||
|
|
||||||
// 리스트 유형별로 출력
|
// 리스트 유형별로 출력
|
||||||
$list_file = G4_SHOP_PATH.'/'.$skin;
|
$list_file = G4_SHOP_SKIN_PATH.'/'.$skin;
|
||||||
if (file_exists($list_file)) {
|
if (file_exists($list_file)) {
|
||||||
|
// 총몇개 = 한줄에 몇개 * 몇줄
|
||||||
|
$items = $list_mod * $list_row;
|
||||||
|
// 페이지가 없으면 첫 페이지 (1 페이지)
|
||||||
|
if ($page == "") $page = 1;
|
||||||
|
// 시작 레코드 구함
|
||||||
|
$from_record = ($page - 1) * $items;
|
||||||
|
|
||||||
include G4_SHOP_PATH."/list.sub.php";
|
$list = new item_list();
|
||||||
//include "$cart_dir/list.sort.php";
|
$list->set_type($type);
|
||||||
|
$list->set_list_mod($list_mod);
|
||||||
$sql = $sql_list1 . $sql_common . $sql_list2 . " limit $from_record, $items ";
|
$list->set_list_row($list_row);
|
||||||
$result = sql_query($sql);
|
$list->set_img_size($img_width, $img_height);
|
||||||
|
$list->set_is_page(true);
|
||||||
include $list_file;
|
$list->set_order_by($order_by);
|
||||||
|
$list->set_from_record($from_record);
|
||||||
|
echo $list->run();
|
||||||
|
|
||||||
|
// where 된 전체 상품수
|
||||||
|
$total_count = $list->total_count;
|
||||||
|
// 전체 페이지 계산
|
||||||
|
$total_page = ceil($total_count / $items);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -77,21 +79,6 @@ $qstr .= '&type='.$type.'&sort='.$sort;
|
|||||||
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=");
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<?php
|
|
||||||
// 테스트
|
|
||||||
// 분류를 링크하는 코드
|
|
||||||
/*
|
|
||||||
$bar = "";
|
|
||||||
$sql = " select ca_id from $g4[shop_item_table] where it_type{$type} = '1' and it_use = '1' group by ca_id order by ca_id ";
|
|
||||||
$result = sql_query($sql);
|
|
||||||
for($i=0;$row=sql_fetch_array($result);$i++) {
|
|
||||||
$row2 = sql_fetch(" select ca_name from $g4[shop_category_table] where ca_id = '$row[ca_id]' ");
|
|
||||||
echo $bar . "<a href='$g4[shop_path]/list.php?ca_id=$row[ca_id]'>$row2[ca_name]</a>";
|
|
||||||
$bar = " | ";
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
?>
|
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
include_once('./_tail.php');
|
include_once('./_tail.php');
|
||||||
?>
|
?>
|
||||||
|
|||||||
Reference in New Issue
Block a user