옵션항목 수정 시 기존 설정값 있으면 적용되도록 수정

This commit is contained in:
chicpro
2014-01-02 14:28:51 +09:00
parent ed913ca1ea
commit 0cd084cc2a
3 changed files with 34 additions and 2 deletions

View File

@ -648,6 +648,7 @@ $(function(){
<?php } ?>
// 옵션목록생성
$("#option_table_create").click(function() {
var it_id = $.trim($("input[name=it_id]").val());
var opt1_subject = $.trim($("#opt1_subject").val());
var opt2_subject = $.trim($("#opt2_subject").val());
var opt3_subject = $.trim($("#opt3_subject").val());
@ -663,7 +664,7 @@ $(function(){
$.post(
"<?php echo G5_ADMIN_URL; ?>/shop_admin/itemoption.php",
{ opt1_subject: opt1_subject, opt2_subject: opt2_subject, opt3_subject: opt3_subject, opt1: opt1, opt2: opt2, opt3: opt3 },
{ it_id: it_id, w: "<?php echo $w; ?>", opt1_subject: opt1_subject, opt2_subject: opt2_subject, opt3_subject: opt3_subject, opt1: opt1, opt2: opt2, opt3: opt3 },
function(data) {
$option_table.empty().html(data);
}
@ -821,6 +822,7 @@ $(function(){
// 옵션목록생성
$("#supply_table_create").click(function() {
var it_id = $.trim($("input[name=it_id]").val());
var subject = new Array();
var supply = new Array();
var subj, spl;
@ -847,7 +849,7 @@ $(function(){
$.post(
"<?php echo G5_ADMIN_URL; ?>/shop_admin/itemsupply.php",
{ 'subject[]': subject, 'supply[]': supply },
{ it_id: it_id, w: "<?php echo $w; ?>", 'subject[]': subject, 'supply[]': supply },
function(data) {
$supply_table.empty().html(data);
}

View File

@ -128,6 +128,21 @@ if($po_run) {
$opt_stock_qty = 0;
$opt_noti_qty = 0;
$opt_use = 1;
// 기존에 설정된 값이 있는지 체크
if($_POST['w'] == 'u') {
$sql = " select io_price, io_stock_qty, io_noti_qty, io_use
from {$g5['g5_shop_item_option_table']}
where it_id = '{$_POST['it_id']}'
and io_id = '$opt_id'
and io_type = '0' ";
$row = sql_fetch($sql);
$opt_price = (int)$row['io_price'];
$opt_stock_qty = (int)$row['io_stock_qty'];
$opt_noti_qty = (int)$row['io_noti_qty'];
$opt_use = (int)$row['io_use'];
}
?>
<tr>
<td class="td_chk">

View File

@ -96,6 +96,21 @@ if($ps_run) {
$spl_stock_qty = 0;
$spl_noti_qty = 0;
$spl_use = 1;
// 기존에 설정된 값이 있는지 체크
if($_POST['w'] == 'u') {
$sql = " select io_price, io_stock_qty, io_noti_qty, io_use
from {$g5['g5_shop_item_option_table']}
where it_id = '{$_POST['it_id']}'
and io_id = '$spl_id'
and io_type = '1' ";
$row = sql_fetch($sql);
$spl_price = (int)$row['io_price'];
$spl_stock_qty = (int)$row['io_stock_qty'];
$spl_noti_qty = (int)$row['io_noti_qty'];
$spl_use = (int)$row['io_use'];
}
?>
<tr>
<td class="td_chk">