관련상품등록 관련 스크립트 수정

This commit is contained in:
chicpro
2013-02-04 14:00:57 +09:00
parent 335f5975c6
commit 31ebc0df87
4 changed files with 59 additions and 36 deletions

View File

@ -1,8 +1,9 @@
<?
$sub_menu = "400300";
include_once("./_common.php");
include_once(G4_LIB_PATH.'/thumbnail.lib.php');
$sql = " select ca_id, it_id, it_name, it_amount
$sql = " select ca_id, it_id, it_name, it_amount, 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 ca_id like '$ca_id%'
and it_id <> '$it_id'
@ -24,7 +25,18 @@ for($i=0;$row=sql_fetch_array($result);$i++) {
$it_name = addslashes($row['it_name']);
$options .= "<option value=\"".$row['it_id']."/".$row['it_amount']."\">$ca_name : $it_name</option>\n";
// 상품이미지
for($i=1; $i<=10; $i++) {
$idx = 'it_img'.$i;
$filepath = G4_DATA_PATH.'/item/'.$row['it_id'];
$filename = $row[$idx];
if(file_exists($filepath.'/'.$filename) && $filename != "")
break;
}
$it_img = it_img_thumb($filename, $filepath, 100, 80);
$options .= "<option value=\"".$row['it_id']."/".$it_img."/".$row['it_amount']."\">$ca_name : $it_name</option>\n";
}
echo $options;