diff --git a/adm/shop_admin/itemlist.php b/adm/shop_admin/itemlist.php
index 3f67dd296..f75924ff1 100644
--- a/adm/shop_admin/itemlist.php
+++ b/adm/shop_admin/itemlist.php
@@ -162,21 +162,11 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$list = $i%2;
- // 리스트 썸네일 이미지
- $filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
- for($k=1; $k<=10; $k++) {
- $idx = 'it_img'.$k;
- if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) {
- $filename = $row[$idx];
- break;
- }
- }
-
echo "
$row[it_id]
- ".get_it_image($row['it_id'], $filename, 50, 50)."
+ ".get_it_image($row['it_id'], 50, 50)."
$tmp_ca_list
diff --git a/adm/shop_admin/orderlist2.php b/adm/shop_admin/orderlist2.php
index b12227b87..49e10ea08 100644
--- a/adm/shop_admin/orderlist2.php
+++ b/adm/shop_admin/orderlist2.php
@@ -1,6 +1,7 @@
$sub_menu = "400420";
include_once("./_common.php");
+include_once(G4_LIB_PATH.'/thumbnail.lib.php');
auth_check($auth[$sub_menu], "r");
@@ -25,8 +26,8 @@ if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
-$sql_common = " from $g4[yc4_order_table] a
- left join $g4[yc4_cart_table] b on (a.on_uid="b".on_uid)
+$sql_common = " from $g4[yc4_cart_table] a
+ left join $g4[yc4_order_table] b on ( a.uq_id = b.od_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@@ -38,10 +39,10 @@ $total_page = ceil($total_count / $rows); // 전체 페이지 계산
if ($page == "") { $page = 1; } // 페이지가 없으면 첫 페이지 (1 페이지)
$from_record = ($page - 1) * $rows; // 시작 열을 구함
-$sql = " select a.od_id,
- a.*, "._MISU_QUERY_."
+$sql = " select b.od_id,
+ b.*, "._MISU_QUERY_."
$sql_common
- group by a.od_id
+ group by b.od_id
order by $sort1 $sort2
limit $from_record, $rows ";
$result = sql_query($sql);
@@ -169,6 +170,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
echo " ";
$list = $i%2;
+
echo "
$row[od_id]
@@ -197,7 +199,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
$sql2 = " select c.it_name,
b.*
from $g4[yc4_order_table] a
- left join $g4[yc4_cart_table] b on (a.on_uid = b.on_uid)
+ left join $g4[yc4_cart_table] b on (a.od_id = b.uq_id)
left join $g4[yc4_item_table] c on (b.it_id = c.it_id)
where od_id = '$row[od_id]' ";
$result2 = sql_query($sql2);
@@ -216,7 +218,7 @@ for ($i=0; $row=mysql_fetch_array($result); $i++)
diff --git a/adm/shop_admin/orderstatuslist.php b/adm/shop_admin/orderstatuslist.php
index 5ef269b61..8a1b15576 100644
--- a/adm/shop_admin/orderstatuslist.php
+++ b/adm/shop_admin/orderstatuslist.php
@@ -1,6 +1,7 @@
$sub_menu = "400410";
include_once("./_common.php");
+include_once(G4_LIB_PATH.'/thumbnail.lib.php');
auth_check($auth[$sub_menu], "r");
@@ -26,9 +27,9 @@ if ($sel_field == "") $sel_field = "od_id";
if ($sort1 == "") $sort1 = "od_id";
if ($sort2 == "") $sort2 = "desc";
-$sql_common = " from $g4[yc4_order_table] a
- left join $g4[yc4_cart_table] b on (a.on_uid = b.on_uid)
- left join $g4[yc4_item_table] c on (b.it_id = c.it_id)
+$sql_common = " from {$g4['yc4_order_table']} a
+ left join {$g4['yc4_cart_table']} b on (a.od_id = b.uq_id)
+ left join {$g4['yc4_item_table']} c on (b.it_id = c.it_id)
$sql_search ";
// 테이블의 전체 레코드수만 얻음
@@ -46,26 +47,16 @@ $sql = " select a.od_id,
a.od_name,
a.od_deposit_name,
a.od_time,
- b.it_opt1,
- b.it_opt2,
- b.it_opt3,
- b.it_opt4,
- b.it_opt5,
- b.it_opt6,
+ b.ct_option,
b.ct_status,
b.ct_qty,
+ b.it_amount,
b.ct_amount,
b.ct_point,
- (b.ct_qty * b.ct_amount) as ct_sub_amount,
+ (b.ct_qty * (b.ct_amount+b.it_amount)) as ct_sub_amount,
(b.ct_qty * b.ct_point) as ct_sub_point,
c.it_id,
- c.it_name,
- c.it_opt1_subject,
- c.it_opt2_subject,
- c.it_opt3_subject,
- c.it_opt4_subject,
- c.it_opt5_subject,
- c.it_opt6_subject
+ c.it_name
$sql_common
order by $sort1 $sort2
limit $from_record, $rows ";
@@ -160,14 +151,15 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
$s_mod = icon("수정", "./orderform.php?od_id=$row[od_id]");
$list = $i%2;
+
echo "
$row[od_id]
".cut_str($row[od_name],10,"")."
$row[mb_id]
- ".get_it_image("{$row[it_id]}_s", 50, 50)."
+ ".get_it_image($row['it_id'], 50, 50)."
$it_name
- ".number_format($row[ct_amount])."
+ ".number_format($row[it_amount] + $row[ct_amount])."
$row[ct_qty]
".number_format($row[ct_sub_amount])."
".number_format($row[ct_sub_point])."
diff --git a/lib/shop.lib.php b/lib/shop.lib.php
index 2493d66d3..852f84b89 100644
--- a/lib/shop.lib.php
+++ b/lib/shop.lib.php
@@ -143,27 +143,42 @@ function get_image($img, $width=0, $height=0)
}
// 상품 이미지를 얻는다
-function get_it_image($dir, $img, $width, $height, $it_id="", $class="", $thumbnail=true)
+function get_it_image($it_id, $width, $height, $id="", $thumbnail=true)
{
+ global $g4;
+
if($thumbnail && !$width)
return "";
- $src = G4_DATA_URL.'/item/'.$dir.'/'.$img;
+ $sql = " select it_id, it_img1, it_img2, it_img3, it_img4, it_img5, it_img6, it_img7, it_img8, it_img9, it_img10
+ from {$g4['yc4_item_table']}
+ where it_id = '$it_id' ";
+ $row = sql_fetch($sql);
- if($thumbnail) {
- $filepath = G4_DATA_PATH.'/item/'.$dir;
+ if(!$row['it_id'])
+ return "";
- if(file_exists($filepath.'/'.$img) && is_file($filepath.'/'.$img)) {
- $src = G4_DATA_URL.'/item/'.$dir.'/'.it_img_thumb($img, $filepath, $width, $height);
+ $filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
+ $filename = "";
+ for($k=1; $k<=10; $k++) {
+ $idx = 'it_img'.$k;
+ if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) {
+ $filename = $row[$idx];
+ break;
}
}
- $str = " ";
+
+ if ($id) {
$str = "$str ";
}
diff --git a/shop/boxtodayview.inc.php b/shop/boxtodayview.inc.php
index 826fe9880..ffc4dfa6c 100644
--- a/shop/boxtodayview.inc.php
+++ b/shop/boxtodayview.inc.php
@@ -66,7 +66,7 @@ for ($i=1; $i<=$tv_idx; $i++)
if(file_exists($tv_filepath.'/'.$tv_filename) && $tv_filename != "")
break;
}
- $img = get_it_image($tv_it_id, $tv_filename, $tv_div['img_width'], $tv_div['img_height'], $tv_it_id);
+ $img = get_it_image($tv_it_id, $tv_div['img_width'], $tv_div['img_height'], $tv_it_id);
$img = str_replace("\"", "\\\"", $img);
$img = preg_replace("/\".cut_str($it_name,10,"")." \";\n";
diff --git a/shop/item.php b/shop/item.php
index 41baf541a..14d99f8a6 100644
--- a/shop/item.php
+++ b/shop/item.php
@@ -188,7 +188,7 @@ else
- =get_large_image($filename, $it['it_id'], false)?>=get_it_image($it['it_id'], $filename, $default['de_mimg_width'], $default['de_mimg_height']);?>
+ =get_large_image($filename, $it['it_id'], false)?>=get_it_image($it['it_id'], $default['de_mimg_width'], $default['de_mimg_height']);?>
@@ -200,8 +200,8 @@ else
if (file_exists($filepath.'/'.$filename) && $filename != "")
{
echo get_large_image($filename, $it['it_id'], false);
- echo get_it_image($it['it_id'], $filename, 40, 40, "", "item_view_thumbnail");
- echo " ";
+ echo " ";
+ echo " ";
}
}
?>
diff --git a/shop/largeimage.php b/shop/largeimage.php
index 253667d11..fd3e756a3 100644
--- a/shop/largeimage.php
+++ b/shop/largeimage.php
@@ -26,9 +26,12 @@ include_once(G4_PATH.'/head.sub.php');
for ($i=1; $i<=10; $i++)
{
+ $filepath = G4_DATA_PATH.'/item/'.$it_id;
$filename = $row['it_img'.$i];
- if (file_exists(G4_DATA_PATH."/item/{$it_id}/{$filename}") && $filename != "")
- echo get_it_image($it_id, $filename, 50, 50, "", "image_thumbnail")." ";
+ if (file_exists($filepath.'/'.$filename) && $filename != "") {
+ echo " ";
+ echo " ";
+ }
}
?>
diff --git a/shop/list.skin.10.php b/shop/list.skin.10.php
index 5b5ca33fc..a6825a733 100644
--- a/shop/list.skin.10.php
+++ b/shop/list.skin.10.php
@@ -14,21 +14,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
echo " \n";
}
- // 리스트 썸네일 이미지
- $filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
- for($k=1; $k<=10; $k++) {
- $idx = 'it_img'.$k;
- if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) {
- $filename = $row[$idx];
- break;
- }
- }
-
echo "
- ".get_it_image($row['it_id'], $filename, $img_width , $img_height, $row['it_id'])."
+ ".get_it_image($row['it_id'], $img_width , $img_height, $row['it_id'])."
".it_name_icon($row)." ";
if ($row[it_cust_amount] && !$row[it_gallery])
diff --git a/shop/maintype10.inc.php b/shop/maintype10.inc.php
index ce92bc797..ef42540a6 100644
--- a/shop/maintype10.inc.php
+++ b/shop/maintype10.inc.php
@@ -11,21 +11,11 @@ for ($i=0; $row=sql_fetch_array($result); $i++) {
}
$href = "";
-
- // 리스트 썸네일 이미지
- $filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
- for($k=1; $k<=10; $k++) {
- $idx = 'it_img'.$k;
- if(file_exists($filepath.'/'.$row[$idx]) && is_file($filepath.'/'.$row[$idx])) {
- $filename = $row[$idx];
- break;
- }
- }
?>
- =$href?>=get_it_image($row['it_id'], $filename, $img_width, $img_height)?>
+ =$href?>=get_it_image($row['it_id'], $img_width, $img_height)?>
=$href?>=stripslashes($row['it_name'])?>
=display_amount(get_amount($row), $row['it_tel_inq'])?>