some changes for order reservation

This commit is contained in:
phyusin
2018-09-06 11:45:24 +06:30
parent 6af0c40456
commit 1f03a19d5b
12 changed files with 216 additions and 67 deletions

View File

@@ -76,6 +76,11 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel'
if (typeof customTableClick !== 'undefined' && $.isFunction(customTableClick)) {
customTableClick();
}
if(parseInt(getOnlineOrderCount()) > 0){
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
}
}
});

View File

@@ -176,4 +176,25 @@ function audioPlayBackground(shop_code,audio){
audio.play();
// },10000);
}
/* end order reservation function */
/* end order reservation function */
/* online order count*/
function getOnlineOrderCount(){
var count = 0;
//Start Ajax
$.ajax({
async: false,
type: "GET",
url: "/origami/get_order_info",
dataType: "json",
success: function(data){
if(parseInt(data) > 0){
count = parseInt(data);
}
}
});
//end Ajax
// alert(count);
return count;
}
/* online order count*/

View File

@@ -20,6 +20,7 @@ $(function() {
$('#cancel').hide();
$(".tbl_customer").hide();
$(".order_close_cashier").hide();
$(".order_btns").show();
refreshDetailData();
if (type == "pending") {
$(".first-1").click();
@@ -41,6 +42,7 @@ $(function() {
}else if(type == "processed"){
$(".fifth-1").click();
$(".order_close_cashier").show();
$(".order_btns").hide();
// $('#accepted').hide();
// $('#cancel').hide();
}
@@ -501,6 +503,10 @@ function callback_url(callback,ref_no,order_id,status,min_type,time,exptime,reas
// }
// }
// });
if(parseInt(getOnlineOrderCount()) > 0){
$('.order_no').addClass("order-badge");
$('.order_no').html(parseInt(getOnlineOrderCount()));
}
}
function showNewOrderAlert(order_reservation,shop_code){
@@ -601,4 +607,25 @@ function timeFormat(date){
(isPM ? ' PM' : ' AM');
return time;
}
/* end order reservation function */
/* end order reservation function */
/* online order count*/
function getOnlineOrderCount(){
var count = 0;
//Start Ajax
$.ajax({
async: false,
type: "GET",
url: "/origami/get_order_info",
dataType: "json",
success: function(data){
if(parseInt(data) > 0){
count = parseInt(data);
}
}
});
//end Ajax
// alert(count);
return count;
}
/* online order count*/