update setting admin pages

This commit is contained in:
Aung Myo
2017-10-24 18:16:03 +06:30
parent 85e2c48e5e
commit 34a4e485af
31 changed files with 263 additions and 181 deletions

View File

@@ -220,17 +220,22 @@ $(document).ready(function(){
var dining_id = $(this).attr("data-id");
var change_from = "<%= @dining.id %>";
if (dining_id == change_from) {
$.alert({
/*$.alert({
title: 'Alert!',
content: 'Please Select Another Table',
type: 'red',
typeAnimated: true,
btnClass: 'btn-danger',
});
}else{
$('#moved').text(" ' " + dining_name + " ' ")
$('#change_table_value').val(dining_id);
}
});*/
swal({
title: "Alert!!",
text: 'Please Select Another Table !',
type: 'warning',
});
}else{
$('#moved').text(" ' " + dining_name + " ' ")
$('#change_table_value').val(dining_id);
}
})
@@ -241,13 +246,11 @@ $(document).ready(function(){
var dining_id = $(this).attr("data-id");
var change_from = "<%= @dining.id %>";
if (dining_id == change_from) {
$.alert({
title: 'Alert!',
content: 'Please Select Another Table',
type: 'red',
typeAnimated: true,
btnClass: 'btn-danger',
});
swal({
title: "Alert!!",
text: 'Please Select Another Table !',
type: 'warning',
});
}else{
$('#moved').text(dining_name)
$('#change_table_value').val(dining_id);
@@ -258,18 +261,29 @@ $(document).ready(function(){
change_to = $('#change_table_value').val();
change_from = "<%= @dining.id %>";
if (change_to == ""){
alert("Please Select Table")
swal({
title: "Alert!!",
text: 'Please Select Table !',
type: 'warning',
});
}else{
$.ajax({type: "POST",
url: "<%= origami_moving_path %>",
data: "change_from="+ change_from + "&change_to=" + change_to,
success:function(result){
alert("Moving Success")
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;
}
});
}
});
}