//表單送出
function setAsiaYoOrder(returnPage){
errornum=0;
var travel_id = $("form#roomRuleForm #travel_id");
var program_choose = $("form#roomRuleForm #program_choose");
var hotel_sdate = $("form#roomRuleForm #hotel_sdate");
var hotel_edate = $("form#roomRuleForm #hotel_edate");
var room_qty = $("form#roomRuleForm #room_qty")
var adult_qty = $("form#roomRuleForm #adult_qty");
var child_qty = $("form#roomRuleForm #child_qty");
if(travel_id.val() == ""){
alert("您選擇的商品有誤,請重新選擇,謝謝。");
location.href = "/index.php";
}
//房型
if(program_choose.val() == ""){
alert("請選擇房型!");
errornum++;
return false;
}
//入住日期
if(hotel_sdate.val() == ""){
alert("請選擇入住日期!");
errornum++;
hotel_sdate.focus();
return false;
}
//退房日期
if(hotel_edate.val() == ""){
alert("請選擇退房日期!");
errornum++;
hotel_edate.focus();
return false;
}
//房間數
if(room_qty.val() == ""){
alert("請選擇房間數!");
errornum++;
room_qty.focus();
return false;
}
//成人數
if(adult_qty.val() == ""){
alert("請選擇入住成人人數!");
errornum++;
adult_qty.focus();
return false;
}
//小孩數
if(child_qty.val() == ""){
alert("請選擇入住小孩人數!");
errornum++;
child_qty.focus();
return false;
}
$.ajax({
type: "POST",
url: "/ajax/orderlist_hotel_step1.php",
dataType: "json",
cache: false,
data: $('form#roomRuleForm').serialize()
})
.done(function(data) {
if(data['status'] == "001"){
//您所填寫的資料有缺少,請重新填寫!
alert("您所填寫的資料有缺少,請重新填寫!");
}else if(data['status'] == "000"){
if($("#login_check").val() != 'Y'){
var goback = $("#goback").val();
//顯示下單提醒通知
//alert("");
//開啟登入詢問光箱
showFancyBoxByCloseBtn(275, 300, 'login_hbuy.php?goback='+goback, true, false, false);
return false;
}
//console.log("returnPage:::"+returnPage);
if(returnPage != "1"){
//console.log("returnPage:::1-----");
//顯示下單提醒通知
//alert("");
//轉到結帳頁
location.href = "h_buy_02.php";
}else{
return false;
}
}else{
alert("系統繁忙中,請稍後再試");
}
})
.fail(function() {
//console.log("error::");
});
}