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

This commit is contained in:
whitedot
2013-05-28 18:20:07 +09:00
8 changed files with 82 additions and 48 deletions

View File

@ -56,26 +56,47 @@ for ($i=0; $i<$cnt; $i++)
{
$stock_use = 0;
// 재고에 다시 더한다.
$sql =" update {$g4['shop_item_table']} set it_stock_qty = it_stock_qty + '{$ct['ct_qty']}' where it_id = '{$ct['it_id']}' ";
if($ct['io_id']) {
$sql = " update {$g4['shop_item_option_table']}
set io_stock_qty = io_stock_qty + '{$ct['ct_qty']}'
where it_id = '{$ct['it_id']}'
and io_id = '{$ct['io_id']}'
and io_type = '{$ct['io_type']}' ";
} else {
$sql = " update {$g4['shop_item_table']}
set it_stock_qty = it_stock_qty + '{$ct['ct_qty']}'
where it_id = '{$ct['it_id']}' ";
}
sql_query($sql);
}
}
else
{
// 재고 오류로 인한 수정
// if ($ct_status == '주문' || $ct_status == '준비' || $ct_status == '배송' || $ct_status == '완료') {
if ($ct_status == '배송' || $ct_status == '완료')
{
$stock_use = 1;
// 재고에서 뺀다.
$sql =" update {$g4['shop_item_table']} set it_stock_qty = it_stock_qty - '{$ct['ct_qty']}' where it_id = '{$ct['it_id']}' ";
if($ct['io_id']) {
$sql = " update {$g4['shop_item_option_table']}
set io_stock_qty = io_stock_qty - '{$ct['ct_qty']}'
where it_id = '{$ct['it_id']}'
and io_id = '{$ct['io_id']}'
and io_type = '{$ct['io_type']}' ";
} else {
$sql = " update {$g4['shop_item_table']}
set it_stock_qty = it_stock_qty - '{$ct['ct_qty']}'
where it_id = '{$ct['it_id']}' ";
}
sql_query($sql);
}
/* 주문 수정에서 "품절" 선택시 해당 상품 자동 품절 처리하기
else if ($ct_status == '품절') {
$stock_use = 1;
// 재고에서 뺀다.
$sql =" update $g4[shop_item_table] set it_stock_qty = 0 where it_id = '$ct[it_id]' ";
$sql =" update {$g4['shop_item_table']} set it_stock_qty = 0 where it_id = '{$ct['it_id']}' ";
sql_query($sql);
} */
}

View File

@ -17,42 +17,15 @@ if ($od_send_mail)
unset($point_list);
unset($delivery_list);
$sql = " select a.*,
b.it_opt1_subject,
b.it_opt2_subject,
b.it_opt3_subject,
b.it_opt4_subject,
b.it_opt5_subject,
b.it_opt6_subject
from {$g4['shop_cart_table']} a inner join {$g4['shop_item_table']} b on (b.it_id=a.it_id)
where a.uq_id = '{$od['uq_id']}'
order by a.ct_id ";
$sql = " select *
from {$g4['shop_cart_table']}
where uq_id = '{$od['uq_id']}'
order by ct_id ";
$result = sql_query($sql);
for ($i=0; $ct=mysql_fetch_array($result); $i++) {
// 상품 옵션
$s_option = "";
$str_split = "";
for ($k=1; $k<=6; $k++) {
if ($ct["it_opt{$k}"] == "") {
continue;
}
$s_option .= $str_split;
$it_opt_subject = $ct["it_opt{$k}_subject"];
unset($opt);
$opt = explode( ";", trim($ct["it_opt{$k}"]) );
$s_option .= "$it_opt_subject = $opt[0]";
$str_split = "<br>";
}
if ($s_option == "") {
$s_option = "없음";
}
$cart_list[$i]['it_id'] = $ct['it_id'];
$cart_list[$i]['it_name'] = $ct['it_name'];
$cart_list[$i]['it_opt'] = $s_option;
$cart_list[$i]['it_opt'] = $ct['ct_option'];
$ct_status = $ct['ct_status'];
if ($ct_status == "준비") {

View File

@ -646,8 +646,9 @@ function get_item_supply($it_id, $subject)
$price = '&nbsp;&nbsp;+ '.number_format($row['io_price']).'원';
else
$price = '&nbsp;&nbsp; '.number_format($row['io_price']).'원';
$io_stock_qty = get_option_stock_qty($it_id, $row['io_id'], $row['io_type']);
$options[$opt_id[0]][] = '<option value="'.$opt_id[1].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$opt_id[1].$price.'</option>';
$options[$opt_id[0]][] = '<option value="'.$opt_id[1].','.$row['io_price'].','.$io_stock_qty.'">'.$opt_id[1].$price.'</option>';
}
}

View File

@ -2,7 +2,6 @@
include_once('./_common.php');
$it_id = $_POST['it_id'];
$idx = $_POST['idx'];
$sql = " select it_id, it_option_subject, it_supply_subject
from {$g4['shop_item_table']}
@ -33,7 +32,6 @@ if(!mysql_num_rows($result))
<input type="hidden" name="it_name" value="<?php echo $row2['it_name']; ?>">
<input type="hidden" name="total_price" value="">
<input type="hidden" name="sw_direct">
<input type="hidden" name="ct_order" value="<?php echo $idx; ?>">
<?php
$option_1 = get_item_options($it['it_id'], $it['it_option_subject']);
if($option_1) {

View File

@ -237,19 +237,22 @@ if ($s_page == 'cart.php') {
?>
<script>
$(function() {
var close_btn_idx;
// 선택사항수정
$(".mod_options").click(function() {
var it_id = $(this).closest("tr").find("input[name^=it_id]").val();
var idx = $(".mod_options").index($(this));
var $this = $(this);
close_btn_idx = $(".mod_options").index($(this));
winMask(); // 모달 윈도우 배경 출력
$.post(
"./cartoption.php",
{ it_id: it_id, idx: idx },
{ it_id: it_id },
function(data) {
$("#mod_option_frm").remove();
$(".mod_options:eq("+idx+")").after("<div id=\"mod_option_frm\"></div>");
$this.after("<div id=\"mod_option_frm\"></div>");
$("#mod_option_frm").html(data);
price_calculate();
}
@ -267,10 +270,13 @@ $(function() {
// 옵션수정 닫기
$("#mod_option_close").live("click", function() {
$("#mod_option_frm").remove();
$('#win_mask, .window').hide();
$("#win_mask, .window").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
$('#win_mask').click(function () {
$('#win_mask, #mod_option_frm').hide();
$("#win_mask").click(function () {
$("#mod_option_frm").remove();
$("#win_mask").hide();
$(".mod_options").eq(close_btn_idx).focus();
});
});

View File

@ -41,8 +41,9 @@ for($i=0; $row=sql_fetch_array($result); $i++) {
$soldout = '&nbsp;&nbsp;[품절]';
else
$soldout = '';
$io_stock_qty = get_option_stock_qty($it_id, $row['io_id'], $row['io_type']);
$str .= PHP_EOL.'<option value="'.$val[$key].','.$row['io_price'].','.$row['io_stock_qty'].'">'.$val[$key].$price.$soldout.'</otpion>';
$str .= PHP_EOL.'<option value="'.$val[$key].','.$row['io_price'].','.$io_stock_qty.'">'.$val[$key].$price.$soldout.'</otpion>';
}
}

View File

@ -32,12 +32,29 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
and uq_id = '$tmp_uq_id' ";
$sum = sql_fetch($sql);
// 옵션정보
$sql2 = " select ct_option, ct_qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}' and uq_id = '$tmp_uq_id'
order by io_type asc, ct_num asc, ct_id asc ";
$result2 = sql_query($sql2);
$options = '';
for($k=0; $row2=sql_fetch_array($result2); $k++) {
if($k == 0)
$options .= '<ul>'.PHP_EOL;
$options .= '<li>'.$row2['ct_option'].' '.$row2['ct_qty'].'개</li>'.PHP_EOL;
}
if($k > 0)
$options .= '</ul>';
$list[$i]['g_dir'] = G4_URL;
$list[$i]['it_id'] = $row['it_id'];
$list[$i]['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']);
$list[$i]['it_name'] = $row['it_name'];
$list[$i]['it_origin'] = $row['it_origin'];
$list[$i]['it_opt'] = print_item_options($row['it_id'], $tmp_uq_id);
$list[$i]['it_opt'] = $options;
$list[$i]['ct_price'] = $row['ct_price'];
$list[$i]['stotal_amount'] = $sum['price'];
$list[$i]['stotal_point'] = $sum['point'];

View File

@ -46,10 +46,27 @@ for ($i=0; $row=sql_fetch_array($result); $i++)
{
unset($list);
// 옵션정보
$sql2 = " select ct_option, ct_qty
from {$g4['shop_cart_table']}
where it_id = '{$row['it_id']}' and uq_id = '$tmp_uq_id'
order by io_type asc, ct_num asc, ct_id asc ";
$result2 = sql_query($sql2);
$options = '';
for($k=0; $row2=sql_fetch_array($result2); $k++) {
if($k == 0)
$options .= '<ul>'.PHP_EOL;
$options .= '<li>'.$row2['ct_option'].' '.$row2['ct_qty'].'개</li>'.PHP_EOL;
}
if($k > 0)
$options .= '</ul>';
$list['it_id'] = $row['it_id'];
$list['it_simg'] = get_it_image($row['it_id'], $default['de_simg_width'], $default['de_simg_height']);
$list['it_name'] = $row['it_name'];
$list['it_opt'] = print_item_options($row['it_id'], $tmp_uq_id);
$list['it_opt'] = $options;
$subject = $config['cf_title'].' - 주문 알림 메일 (주문자 '.$od_name.'님)';
ob_start();