$sql = "SELECT * FROM {$g5['g5_shop_cart_table']} WHERE od_id='$tmp_cart_id'";
$result = sql_query($sql);
for ($i = 0; $row = sql_fetch_array($result); $i++) {
$od_id = get_uniqid();
$current_dday = $dday;
$sql = "INSERT INTO {$g5['g5_shop_order_table']}
SET od_id = '$od_id',
mb_id = '{$member['mb_id']}',
od_pwd = '$od_pwd',
od_name = '$od_name',
od_email = '$od_email',
od_tel = '$od_tel',
od_hp = '$od_hp',
od_zip1 = '$od_zip1',
od_zip2 = '$od_zip2',
od_addr1 = '$od_addr1',
od_addr2 = '$od_addr2',
od_addr3 = '$od_addr3',
od_addr_jibeon = '$od_addr_jibeon',
od_b_name = '$od_b_name',
od_b_tel = '$od_b_tel',
od_b_hp = '$od_b_hp',
od_b_zip1 = '$od_b_zip1',
od_b_zip2 = '$od_b_zip2',
od_b_addr1 = '$od_b_addr1',
od_b_addr2 = '$od_b_addr2',
od_b_addr3 = '$od_b_addr3',
od_b_addr_jibeon = '$od_b_addr_jibeon',
od_deposit_name = '$od_deposit_name',
od_memo = '$od_memo',
od_cart_count = 1,
od_cart_price = '" . ($row['ct_price'] * $row['ct_qty']) . "',
od_cart_coupon = '{$row['ct_coupon']}',
od_send_cost = '$i_send_cost',
od_send_coupon = '$tot_sc_cp_price',
od_send_cost2 = '$i_send_cost2',
od_coupon = '$tot_od_cp_price',
od_receipt_price = '" . ($row['ct_price'] * $row['ct_qty']) . "',
od_receipt_point = '$od_receipt_point',
od_bank_account = '$od_bank_account',
od_receipt_time = '$od_receipt_time',
od_misu = '$od_misu',
od_pg = '$od_pg',
od_tno = '$od_tno',
od_app_no = '$od_app_no',
od_escrow = '$od_escrow',
od_tax_flag = '$od_tax_flag',
od_tax_mny = '$od_tax_mny',
od_vat_mny = '$od_vat_mny',
od_free_mny = '$od_free_mny',
od_status = '$od_status',
od_shop_memo = '',
od_hope_date = '$od_hope_date',
od_time = '".G5_TIME_YMDHIS."',
od_ip = '$REMOTE_ADDR',
od_settle_case = '$od_settle_case',
od_other_pay_type = '$od_other_pay_type',
od_test = '{$default['de_card_test']}',
it_names = '{$row['it_name']}',
dday = '$current_dday'";
sql_query($sql, false);
$update_sql = "UPDATE {$g5['g5_shop_cart_table']}
SET od_id = '$od_id',
ct_status = '주문'
WHERE ct_id = '{$row['ct_id']}'";
sql_query($update_sql);
}