상품보관하기 오류 수정 중

This commit is contained in:
chicpro
2013-01-31 16:18:23 +09:00
parent 65a97746d5
commit c8338e2946
3 changed files with 48 additions and 56 deletions

View File

@ -1,18 +1,6 @@
<? <?
include_once('./_common.php'); include_once('./_common.php');
// wish item 처리
if(trim($wish_update) || $submit_button == 'wish_update') {
include($g4['shop_path'].'/wishupdate.php');
}
if (trim($direct_buy) || $submit_button == 'direct_buy') { // 바로구매
$sw_direct = 1;
}
else {
$sw_direct = 0;
}
$uq_id = get_session('ss_uniqid'); $uq_id = get_session('ss_uniqid');
// 브라우저에서 쿠키를 허용하지 않은 경우라고 볼 수 있음. // 브라우저에서 쿠키를 허용하지 않은 경우라고 볼 수 있음.

View File

@ -169,8 +169,8 @@ else
<form name=fitem id="fitem" method="post" action="<?php echo $action_url?>"> <form name=fitem id="fitem" method="post" action="<?php echo $action_url?>">
<input type="hidden" name="it_id" value='<?=$it['it_id']?>'> <input type="hidden" name="it_id" value='<?=$it['it_id']?>'>
<input type="hidden" name="it_name" value='<?=$it['it_name']?>'> <input type="hidden" name="it_name" value='<?=$it['it_name']?>'>
<input type="hidden" name="submit_button" value="" />
<input type="hidden" name="total_amount" value="0" /> <input type="hidden" name="total_amount" value="0" />
<input type="hidden" name="sw_direct" value="0" />
<table width=100% cellpadding=0 cellspacing=0> <table width=100% cellpadding=0 cellspacing=0>
<tr> <tr>
@ -434,13 +434,13 @@ else
<tr> <tr>
<td> <td>
<? if (!$it['it_tel_inq'] && !$it['it_gallery']) { ?> <? if (!$it['it_tel_inq'] && !$it['it_gallery']) { ?>
<input type="submit" id="direct_buy" name="direct_buy" value="direct_buy" /> <input type="image" src="<?=G4_SHOP_IMG_URL?>/btn2_now_buy.gif" id="direct_buy" />
<input type="submit" id="cart_update" name="cart_update" value="cart_update" /> <input type="image" src="<?=G4_SHOP_IMG_URL?>/btn2_cart.gif" id="cart_update" />
<? } ?> <? } ?>
<? if (!$it['it_gallery']) { ?> <? if (!$it['it_gallery']) { ?>
<input type="submit" name="wish_update" value="wish_update" /> <input type="image" src="<?=G4_SHOP_IMG_URL?>/btn2_wish.gif" id="item_wish" />
<a href="javascript:popup_item_recommend('<?=$it['it_id']?>');"><img src='<?=G4_SHOP_IMG_URL?>/btn_item_recommend.gif' border=0></a> <a href="<?=G4_SHOP_URL?>/shop/itemrecommend.php?it_id=<?=$it['it_id']?>" target="_blank" onclick="popup_item_recommend(this.href); return false;"><img src='<?=G4_SHOP_IMG_URL?>/btn_item_recommend.gif' border=0></a>
<? } ?> <? } ?>
</td></tr> </td></tr>
</table></td> </table></td>
@ -786,22 +786,26 @@ $(function() {
calculatePrice(); calculatePrice();
}); });
$("form#fitem input:submit").click(function(e) { // 바로구매, 장바구니, 보관하기 click
$("form#fitem input:image").click(function(e) {
e.preventDefault(); e.preventDefault();
var parent_form = $(this).closest("form"); var id = $(this).attr("id");
var name = $(this).attr("name");
parent_form.data("submit_button", name);
$("input[name=submit_button]").val(name);
$("form#fitem").submit(); if(id == "item_wish") {
$("#fitem").attr("action", "./wishupdate.php");
} else if(id == "direct_buy") {
$("input[name=sw_direct]").val(1);
}
$("form#fitem").data("act", id).submit();
}); });
// 바로구매, 장바구니, 보관하기 // 바로구매, 장바구니, 보관하기 submit
$("form#fitem").submit(function() { $("form#fitem").submit(function() {
var form_ok = true; var form_ok = true;
if($(this).data("submit_button") != "wish_update") { if($(this).data("act") != "item_wish") {
// 가격체크 // 가격체크
if(parseInt($("input[name=it_amount]").val()) < 0) { if(parseInt($("input[name=it_amount]").val()) < 0) {
alert("전화로 문의해 주시면 감사하겠습니다."); alert("전화로 문의해 주시면 감사하겠습니다.");
@ -989,16 +993,15 @@ function calculatePrice()
} }
// 추천메일 // 추천메일
function popup_item_recommend(it_id) function popup_item_recommend(url)
{ {
if (!g4_is_member) if (!g4_is_member)
{ {
if (confirm("회원만 추천하실 수 있습니다.")) if (confirm("회원만 추천하실 수 있습니다."))
document.location.href = "<?=$g4[bbs_path]?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>"; document.location.href = "<?=G4_BBS_URL?>/login.php?url=<?=urlencode("$g4[shop_path]/item.php?it_id=$it_id")?>";
} }
else else
{ {
url = "./itemrecommend.php?it_id=" + it_id;
opt = "scrollbars=yes,width=616,height=420,top=10,left=10"; opt = "scrollbars=yes,width=616,height=420,top=10,left=10";
popup_window(url, "itemrecommend", opt); popup_window(url, "itemrecommend", opt);
} }

View File

@ -1,17 +1,18 @@
<? <?
include_once("./_common.php"); include_once("./_common.php");
include_once(G4_LIB_PATH.'/thumbnail.lib.php');
if (!$is_member) if (!$is_member)
goto_url("$g4[bbs_path]/login.php?url=".urlencode("$g4[shop_path]/mypage.php")); goto_url(G4_BBS_URL."/login.php?url=".urlencode("$g4[shop_path]/mypage.php"));
$g4[title] = "보관함"; $g4['title'] = "보관함";
include_once("./_head.php"); include_once("./_head.php");
?> ?>
<img src="<?=$g4[shop_img_path]?>/top_wishlist.gif" border="0"><p> <img src="<?=G4_SHOP_IMG_URL?>/top_wishlist.gif" border="0"><p>
<form name=fwishlist method=post action="" style="padding:0px;"> <form name=fwishlist method=post action="" style="padding:0px;">
<input type=hidden name=w value="multi"> <input type=hidden name=act value="multi">
<input type=hidden name=sw_direct value=''> <input type=hidden name=sw_direct value=''>
<input type=hidden name=prog value='wish'> <input type=hidden name=prog value='wish'>
<table width=100% align=center cellpadding=0 cellspacing=0> <table width=100% align=center cellpadding=0 cellspacing=0>
@ -25,9 +26,9 @@ include_once("./_head.php");
<tr><td colspan=6 height=1 class=c1></td></tr> <tr><td colspan=6 height=1 class=c1></td></tr>
<? <?
$sql = " select * $sql = " select *
from $g4[yc4_wish_table] a, from {$g4['yc4_wish_table']} a,
$g4[yc4_item_table] b {$g4['yc4_item_table']} b
where a.mb_id = '$member[mb_id]' where a.mb_id = '{$member['mb_id']}'
and a.it_id = b.it_id and a.it_id = b.it_id
order by a.wi_id desc "; order by a.wi_id desc ";
$result = sql_query($sql); $result = sql_query($sql);
@ -44,32 +45,32 @@ for ($i=0; $row = mysql_fetch_array($result); $i++) {
$it_amount = get_amount($row); $it_amount = get_amount($row);
if ($row[it_tel_inq]) $out_cd = "tel_inq"; if ($row['it_tel_inq']) $out_cd = "tel_inq";
if ($i > 0) if ($i > 0)
echo "<tr><td colspan=20 height=1 background='$g4[shop_img_path]/dot_line.gif'></td></tr>\n"; echo "<tr><td colspan=20 height=1 background='".G4_SHOP_IMG_URL."/dot_line.gif'></td></tr>\n";
$image = get_it_image($row[it_id]."_s", 50, 50, $row[it_id]); $image = get_it_image($row['it_id'], 50, 50, $row['it_id']);
$s_del = "<a href='./wishupdate.php?w=d&wi_id=$row[wi_id]'><img src='$g4[shop_img_path]/btn_del.gif' border='0' align=absmiddle alt='삭제'></a>"; $s_del = "<a href='./wishupdate.php?w=d&wi_id={$row['wi_id']}'><img src='".G4_SHOP_IMG_URL."/btn_del.gif' border='0' align=absmiddle alt='삭제'></a>";
echo "<tr>\n"; echo "<tr>\n";
echo "<td align=center style='padding-top:5px; padding-bottom:5px;'>$image</td>\n"; echo "<td align=center style='padding-top:5px; padding-bottom:5px;'>$image</td>\n";
echo "<td><a href='./item.php?it_id=$row[it_id]'>".stripslashes($row[it_name])."</a></td>\n"; echo "<td><a href='./item.php?it_id=$row[it_id]'>".stripslashes($row['it_name'])."</a></td>\n";
echo "<td align=center>$row[wi_time]</td>\n"; echo "<td align=center>{$row['wi_time']}</td>\n";
echo "<td align=center>"; echo "<td align=center>";
// 품절검사 // 품절검사
$it_stock_qty = get_it_stock_qty($row[it_id]); $it_stock_qty = get_it_stock_qty($row['it_id']);
if($it_stock_qty <= 0) if($it_stock_qty <= 0)
{ {
echo "<img src='$g4[shop_img_path]/icon_pumjul.gif' border=0 align=absmiddle>"; echo "<img src='".G4_SHOP_IMG_URL."/icon_pumjul.gif' border=0 align=absmiddle>";
echo "<input type=hidden name=it_id[$i] >"; echo "<input type=hidden name=it_id[$i] >";
} else { //품절이 아니면 체크할수 있도록한다 } else { //품절이 아니면 체크할수 있도록한다
echo "<input type=checkbox name=it_id[$i] value='$row[it_id]' onclick=\"out_cd_check(this, '$out_cd');\">"; echo "<input type=checkbox name=it_id[$i] value='$row[it_id]' onclick=\"out_cd_check(this, '$out_cd');\">";
} }
echo "<input type=hidden name=it_name[$i] value='$row[it_name]'>"; echo "<input type=hidden name=it_name[$i] value='{$row['it_name']}'>";
echo "<input type=hidden name=it_amount[$i] value='$it_amount'>"; echo "<input type=hidden name=it_amount[$i] value='$it_amount'>";
echo "<input type=hidden name=it_point[$i] value='$row[it_point]'>"; echo "<input type=hidden name=it_point[$i] value='{$row['it_point']}'>";
echo "<input type=hidden name=ct_qty[$i] value='1'>"; echo "<input type=hidden name=ct_qty[$i] value='1'>";
echo "</td>\n"; echo "</td>\n";
echo "<td align=center>$s_del</td>\n"; echo "<td align=center>$s_del</td>\n";
@ -85,8 +86,8 @@ if ($i == 0)
</form> </form>
<div align=right> <div align=right>
<a href="javascript:fwishlist_check(document.fwishlist,'');"><img src='<?=$g4[shop_img_path]?>/btn_cart_in.gif' border=0></a> <a href="javascript:fwishlist_check(document.fwishlist,'');"><img src='<?=G4_SHOP_IMG_URL?>/btn_cart_in.gif' border=0></a>
<a href="javascript:fwishlist_check(document.fwishlist,'direct_buy');"><img src='<?=$g4[shop_img_path]?>/btn_buy.gif' border=0></a>&nbsp; <a href="javascript:fwishlist_check(document.fwishlist,'direct_buy');"><img src='<?=G4_SHOP_IMG_URL?>/btn_buy.gif' border=0></a>&nbsp;
</div> </div>
<script language="JavaScript"> <script language="JavaScript">