Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -19,21 +19,7 @@ App.check_new_order = App.cable.subscriptions.create('CheckNewOrderChannel', {
|
||||
});
|
||||
|
||||
// alert(order_lists);
|
||||
// swal({
|
||||
// title: 'Information',
|
||||
// target: document.getElementById(shop_code+"_notify_new_order"),
|
||||
// text: "You have new orders <br/>"+
|
||||
// "Are you accept or reject for these orders <b>"+order_lists+"</b>?",
|
||||
// type: 'success',
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function (isConfirm) {
|
||||
// if(isConfirm){
|
||||
// swal.close();
|
||||
// }
|
||||
// });
|
||||
checkNewOrderAlert(shop_code, order_lists);
|
||||
// $("#notify_new_order_lists").text(order_lists);
|
||||
// if($("#"+shop_code+"_notify_new_order").hasClass("hidden")){
|
||||
// $("#"+shop_code+"_notify_new_order").removeClass("hidden");
|
||||
|
||||
@@ -19,21 +19,7 @@ App.check_order_ready_to_delivery = App.cable.subscriptions.create('CheckOrderRe
|
||||
});
|
||||
|
||||
// alert(order_lists);
|
||||
// swal({
|
||||
// title: 'Information',
|
||||
// target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
|
||||
// text: "You have orders that are ready to deliver <br/>"+
|
||||
// "Could you ready these orders <b>"+order_lists+"</b> to deliver?",
|
||||
// type: 'success',
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function (isConfirm) {
|
||||
// if(isConfirm){
|
||||
// swal.close();
|
||||
// }
|
||||
// });
|
||||
checkOrderReadyToKitchenAlert(shop_code, order_lists);
|
||||
// $("#notify_order_ready_to_delivery_lists").text(order_lists);
|
||||
// if($("#notify_order_ready_to_delivery").hasClass("hidden")){
|
||||
// $("#"+shop_code+"_notify_order_ready_to_delivery").removeClass("hidden");
|
||||
|
||||
@@ -19,21 +19,7 @@ App.check_order_send_to_kitchen = App.cable.subscriptions.create('CheckOrderSend
|
||||
});
|
||||
|
||||
// alert(order_lists);
|
||||
// swal({
|
||||
// title: 'Information',
|
||||
// target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
|
||||
// text: "You have to send order to kitchen <br/>"+
|
||||
// "Could you send these orders <b>"+order_lists+"</b> to kitchen?",
|
||||
// type: 'success',
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function (isConfirm) {
|
||||
// if(isConfirm){
|
||||
// swal.close();
|
||||
// }
|
||||
// });
|
||||
checkOrderSendToKitchen(shop_code, order_lists);
|
||||
// $("#notify_order_send_to_kitchen_lists").text(order_lists);
|
||||
// if($("#notify_order_send_to_kitchen").hasClass("hidden")){
|
||||
// $("#"+shop_code+"_notify_order_send_to_kitchen").removeClass("hidden");
|
||||
|
||||
@@ -42,6 +42,15 @@ $(document).ready(function() {
|
||||
railBorderRadius: '0',
|
||||
touchScrollStep : 50
|
||||
});
|
||||
$('#menu1-slimscroll').slimScroll({
|
||||
height: height-$('#menu1-slimscroll').attr('data-height'),
|
||||
size: '5px',
|
||||
color: 'rgba(0,0,0,0.5)',
|
||||
alwaysVisible: false,
|
||||
borderRadius: '0',
|
||||
railBorderRadius: '0',
|
||||
touchScrollStep : 50
|
||||
});
|
||||
|
||||
$('#modal-slimscroll').slimScroll({
|
||||
height: height-$('#modal-slimscroll').attr('data-height'),
|
||||
@@ -148,3 +157,12 @@ $(document).ready(function() {
|
||||
}
|
||||
//end Notificaiotn message
|
||||
});
|
||||
|
||||
function audioPlayBackground(shop_code){
|
||||
//audio play
|
||||
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
|
||||
// setTimeout(function(){
|
||||
// audio.loop = true;
|
||||
audio.play();
|
||||
// },10000);
|
||||
}
|
||||
|
||||
@@ -265,6 +265,7 @@ function show_order_detail(url,sr_no){
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
// console.log(data);
|
||||
$("#order_remark").text("");
|
||||
$(".tbl_customer").show();
|
||||
if(data.status != "delivered"){
|
||||
$('#accepted').show();
|
||||
@@ -482,46 +483,81 @@ function showNewOrder(order_reservation,shop_code){
|
||||
var date = new Date(order_reservation.requested_time);
|
||||
var time = timeFormat(date);
|
||||
var requested_date = date.getFullYear() + '-' + (date.getMonth() >= 10? date.getMonth() : '0' + (date.getMonth() + 1)) +'-'+ (date.getDate() >= 10? date.getDate() : '0' + date.getDate()) +' '+time;
|
||||
//audio play
|
||||
var audio = new Audio('/'+shop_code+'-beep.mp3'); // define your audio
|
||||
// setTimeout(function(){
|
||||
// audio.loop = true;
|
||||
audio.play();
|
||||
// },10000);
|
||||
$('.first-1').click();
|
||||
audioPlayBackground(shop_code);
|
||||
|
||||
// $("#new_order").text(order_reservation.order_reservation_id);
|
||||
// $("#new_order_date").text(requested_date);
|
||||
// if($("#"+shop_code+"_doemal_new_order").hasClass("hidden")){
|
||||
// $("#"+shop_code+"_doemal_new_order").removeClass("hidden");
|
||||
// }
|
||||
// $("#"+shop_code+"_doemal_new_order").on('shown.bs.modal', function(e){
|
||||
// // $(document).off('focusin.modal');
|
||||
// $("#"+shop_code+"_doemal_new_order").focus();
|
||||
// $("#"+shop_code+"_notify_new_order").addClass("hidden");
|
||||
// $("#"+shop_code+"_notify_order_send_to_kitchen").addClass("hidden");
|
||||
// $("#"+shop_code+"_notify_order_ready_to_delivery").addClass("hidden");
|
||||
// }).on('hide.bs.modal', function (e) {
|
||||
// $("#"+shop_code+"_doemal_new_order").addClass("hidden");
|
||||
// }).modal({show: true, keyboard: false, backdrop: false});
|
||||
// swal({
|
||||
// title: 'Information',
|
||||
// target: document.getElementById(shop_code+"_notify_new_order"),
|
||||
// text: "You have new order "+
|
||||
// "<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
|
||||
// type: 'success',
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function (isConfirm) {
|
||||
// if(isConfirm){
|
||||
// audio.pause();
|
||||
// swal.close();
|
||||
// }
|
||||
// });
|
||||
swal({
|
||||
title: 'Information',
|
||||
target: document.getElementById(shop_code+"_notify_new_order"),
|
||||
text: "You have new order "+
|
||||
"<b>"+order_reservation.order_reservation_id+"</b> requested for "+requested_date+"?",
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function checkNewOrderAlert(shop_code, order_lists){
|
||||
swal({
|
||||
title: 'Information',
|
||||
target: document.getElementById(shop_code+"_notify_new_order"),
|
||||
text: "You have new orders <br/>"+
|
||||
"Are you accept or reject for these orders <b>"+order_lists+"</b>?",
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkOrderSendToKitchen(shop_code, order_lists){
|
||||
swal({
|
||||
title: 'Information',
|
||||
target: document.getElementById(shop_code+"_notify_order_send_to_kitchen"),
|
||||
text: "You have to send order to kitchen <br/>"+
|
||||
"Could you send these orders <b>"+order_lists+"</b> to kitchen?",
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function checkOrderReadyToKitchenAlert(shop_code, order_lists){
|
||||
swal({
|
||||
title: 'Information',
|
||||
target: document.getElementById(shop_code+"_notify_order_ready_to_delivery"),
|
||||
text: "You have orders that are ready to deliver <br/>"+
|
||||
"Could you ready these orders <b>"+order_lists+"</b> to deliver?",
|
||||
type: 'success',
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function (isConfirm) {
|
||||
if(isConfirm){
|
||||
swal.close();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function getOrderMonth(month){
|
||||
var MONTHS = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sept","Oct","Nov","Dec"];
|
||||
return MONTHS[month];
|
||||
|
||||
Reference in New Issue
Block a user