self.close();'; exit; } for($i = 0; $i < $count; $i++) { $sql_common = " opt_amount = '{$_POST['opt_amount'][$i]}', opt_qty = '{$_POST['opt_qty'][$i]}', opt_notice = '{$_POST['opt_notice'][$i]}', opt_use = '{$_POST['opt_use'][$i]}' "; $row = sql_fetch(" select opt_id from `{$g4['yc4_option_table']}` where it_id = '$it_id' and opt_id = '{$_POST['opt_id'][$i]}' "); if($row['opt_id']) { $sql = " update `{$g4['yc4_option_table']}` set $sql_common where it_id = '$it_id' and opt_id = '{$_POST['opt_id'][$i]}' "; } else { $sql = " insert into `{$g4['yc4_option_table']}` set it_id = '$it_id', opt_id = '{$_POST['opt_id'][$i]}', $sql_common "; } sql_query($sql); if($w == '') { set_session('ss_op_item_code', $it_id); } } echo ''; ?>