'0' order by ca_id"; $result = sql_query($sql); for ($i=0; $row=sql_fetch_array($result); $i++) { $cate1 = $cate2 = $cate3 = $cate4 = ''; $caid1 = $caid2 = $caid3 = $caid4 = ''; $caid1 = substr($row['ca_id'],0,2); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid1' "); $cate1 = $row2['ca_name']; if (strlen($row['ca_id']) >= 8) { $caid4 = substr($row['ca_id'],0,8); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid4' "); $cate4 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 6) { $caid3 = substr($row['ca_id'],0,6); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid3' "); $cate3 = $row2['ca_name']; } if (strlen($row['ca_id']) >= 4) { $caid2 = substr($row['ca_id'],0,4); $row2 = sql_fetch(" select ca_name from {$g5['g5_shop_category_table']} where ca_id = '$caid2' "); $cate2 = $row2['ca_name']; } // 배송비계산 $delivery = get_item_sendcost2($row['it_id'], $row['it_price'], 1); // 상품이미지 $img_url = get_it_imageurl($row['it_id']); // 포인트 $it_point = get_item_point($row); $item_link = shop_item_url($row['it_id']); // 상태 $class = 'U'; $stock_qty = get_it_stock_qty($row['it_id']); if(substr($row['it_time'], 0, 10) == G5_TIME_YMD && $row['it_update_time'] >= $row['it_time']) $class = 'I'; if($row['it_soldout'] || $stock_qty < 0) $class = 'D'; // 리뷰 카운트 $review_count = (int) $row['it_use_cnt']; echo "\n{$row['it_id']}{$tab}{$row['it_name']}{$tab}{$row['it_price']}{$tab}{$item_link}{$tab}{$img_url}{$tab}{$cate1}{$tab}{$cate2}{$tab}{$cate3}{$tab}{$cate4}{$tab}{$row['it_brand']}{$tab}{$row['it_maker']}{$tab}{$row['it_origin']}{$tab}{$it_point}{$tab}{$review_count}{$tab}{$delivery}{$tab}{$class}{$tab}{$row['it_update_time']}"; } $content = ob_get_contents(); ob_end_clean(); echo $content;