Merge branch 'master' of github.com:gnuboard/g4s

This commit is contained in:
whitedot
2013-02-04 11:59:13 +09:00
2 changed files with 29 additions and 58 deletions

View File

@ -487,13 +487,6 @@ if ($ii) {
<td rowspan=2 width=20 bgcolor=#FFFFFF>◀</td> <td rowspan=2 width=20 bgcolor=#FFFFFF>◀</td>
<td align="center">상품목록<br><span id="add_span" style="line-height:200%"></span></td> <td align="center">상품목록<br><span id="add_span" style="line-height:200%"></span></td>
<td> <td>
<script>
function search_relation(fld) {
if (fld.value) {
window.open('itemformrelation.php?it_id=<?=$it_id?>&ca_id='+fld.value, 'hiddenframe', '');
}
}
</script>
※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br> ※ 상품 선택후 <FONT COLOR="#0E87F9">더블클릭하면 왼쪽에 추가됨</FONT><br>※ 한 번 클릭시 상품이미지/상품금액 출력<br>
<select onchange="search_relation(this)"> <select onchange="search_relation(this)">
<option value=''>분류별 관련상품 <option value=''>분류별 관련상품
@ -507,30 +500,23 @@ if ($ii) {
?> ?>
</select><br> </select><br>
<select id="relation" size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);"> <select id="relation" size=8 style='width:250px; background-color:#F6F6F6;' onclick="relation_img(this.value, 'add_span')" ondblclick="relation_add(this);">
<?
/*
$sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table]
where it_id <> '$it_id'
order by ca_id, it_name ";
$result = sql_query($sql);
for ($i=0; $row=sql_fetch_array($result); $i++)
{
$sql2 = " select ca_name from $g4[yc4_category_table] where ca_id = '$row[ca_id]' ";
$row2 = sql_fetch($sql2);
// 김선용 2006.10
if(file_exists("{$g4['path']}/data/item/{$row['it_id']}_s"))
$it_image = "{$row['it_id']}_s";
else
$it_image = "";
echo "<option value='$row[it_id]/$it_image/{$row['it_amount']}'>$row2[ca_name] : ".cut_str(get_text(strip_tags($row[it_name])),30);
}
*/
?>
</select> </select>
<SCRIPT LANGUAGE="JavaScript"> <script>
function search_relation(fld)
{
var ca_id = fld.value;
if(ca_id) {
$.post(
'./itemformrelation.php',
{ it_id: '<?=$it_id?>', ca_id: ca_id },
function(data) {
if(data) {
$("#relation").html(data);
}
}
);
}
}
// 김선용 2006.10 // 김선용 2006.10
function relation_img(name, id) function relation_img(name, id)

View File

@ -2,45 +2,30 @@
$sub_menu = "400300"; $sub_menu = "400300";
include_once("./_common.php"); include_once("./_common.php");
$g4[title] = "관련 상품";
include_once (G4_PATH.'/head.sub.php');
$sql = " select ca_id, it_id, it_name, it_amount $sql = " select ca_id, it_id, it_name, it_amount
from $g4[yc4_item_table] from {$g4['yc4_item_table']}
where ca_id like '$ca_id%' where ca_id like '$ca_id%'
and it_id <> '$it_id' and it_id <> '$it_id'
order by ca_id, it_name "; order by ca_id, it_name ";
$result = sql_query($sql); $result = sql_query($sql);
$num = @mysql_num_rows($result); $num = @mysql_num_rows($result);
?>
<script> $options = "";
parent.document.getElementById('relation').length = <?=$num?>;
<?
$cnt = 0;
for($i=0;$row=sql_fetch_array($result);$i++) { for($i=0;$row=sql_fetch_array($result);$i++) {
//$sql2 = " select count(*) as cnt from $g4[yc4_item_relation_table] where it_id = '$row[it_id]' "; // 관련상품으로 등록된 상품은 제외
$sql2 = " select count(*) as cnt from $g4[yc4_item_relation_table] where it_id = '$it_id' and it_id2 = '$row[it_id]' "; $sql2 = " select count(*) as cnt from {$g4['yc4_item_relation_table']} where it_id = '$it_id' and it_id2 = '{$row['it_id']}' ";
$row2 = sql_fetch($sql2); $row2 = sql_fetch($sql2);
if ($row2[cnt]) if ($row2['cnt'])
continue; continue;
$sql2 = " select ca_name from $g4[yc4_category_table] where ca_id = '$row[ca_id]' "; $sql2 = " select ca_name from {$g4['yc4_category_table']} where ca_id = '{$row['ca_id']}' ";
$row2 = sql_fetch($sql2); $row2 = sql_fetch($sql2);
$ca_name = addslashes($row2[ca_name]); $ca_name = addslashes($row2['ca_name']);
$it_name = addslashes($row[it_name]); $it_name = addslashes($row['it_name']);
if(file_exists("{$g4['path']}/data/item/{$row['it_id']}_s"))
$it_image = "{$row['it_id']}_s"; $options .= "<option value=\"".$row['it_id']."/".$row['it_amount']."\">$ca_name : $it_name</option>\n";
else
$it_image = "";
//echo "parent.document.getElementById('relation').length++;";
echo "parent.document.getElementById('relation').options[$cnt].text = '$ca_name : $it_name';\n";
echo "parent.document.getElementById('relation').options[$cnt].value = '$row[it_id]/$it_image/$row[it_amount]';\n";
$cnt++;
} }
?>
parent.document.getElementById('relation').length = <?=$cnt?>; echo $options;
</script>
<?
include_once (G4_PATH.'/tail.sub.php');
?> ?>