update move table

This commit is contained in:
Aung Myo
2018-07-01 13:14:38 +06:30
parent 96b2be96b0
commit 80b84eb175
2 changed files with 34 additions and 21 deletions

View File

@@ -385,29 +385,37 @@ end
$('#move_table').on('click',function(){
change_to = $('#change_table_value').val();
change_from = "<%= @dining.id %>";
if (change_to == ""){
swal({
title: "Alert!!",
text: 'Please Select Table !',
type: 'warning',
});
}else{
$("#oqs_loading_wrapper").show();
$.ajax({type: "POST",
url: "<%= origami_moving_path %>",
data: "change_from="+ change_from + "&change_to=" + change_to,
success:function(result){
if (result.get_type == 'Table'){
window.location.href = '/origami/table/' + change_to;
}else{
window.location.href = '/origami/room/' + change_to;
}
// alert("Moving Success")
swal({
title: "Information!",
text: 'Moving Success',
type: 'success',
}, function (){
if (result.get_type == 'Table'){
window.location.href = '/origami/table/' + change_to;
}else{
window.location.href = '/origami/room/' + change_to;
}
});
// swal({
// title: "Information!",
// text: 'Moving Success',
// type: 'success',
// }, function (){
// if (result.get_type == 'Table'){
// window.location.href = '/origami/table/' + change_to;
// }else{
// window.location.href = '/origami/room/' + change_to;
// }
// });
}
});
}

View File

@@ -387,7 +387,7 @@ end
$('#move_table').on('click',function(){
change_to = $('#change_table_value').val();
change_from = "<%= @dining.id %>";
$("#oqs_loading_wrapper").show();
if (change_to == ""){
swal({
title: "Alert!!",
@@ -395,23 +395,28 @@ end
type: 'warning',
});
}else{
$("#oqs_loading_wrapper").show();
$.ajax({type: "POST",
url: "<%= origami_moving_path %>",
data: "change_from="+ change_from + "&change_to=" + change_to,
success:function(result){
swal({
title: "Information!",
text: 'Moving Success',
type: 'success',
}, function (){
if (result.get_type == 'Table'){
if (result.get_type == 'Table'){
window.location.href = '/origami/table/' + change_to;
}else{
window.location.href = '/origami/room/' + change_to;
}
});
// swal({
// title: "Information!",
// text: 'Moving Success',
// type: 'success',
// closeOnConfirm: false
// }, function (){
// if (result.get_type == 'Table'){
// window.location.href = '/origami/table/' + change_to;
// }else{
// window.location.href = '/origami/room/' + change_to;
// }
// });
}
});