diff --git a/app/assets/javascripts/channels/order_reservation.js b/app/assets/javascripts/channels/order_reservation.js index 71c6fcb7..7a6bb594 100644 --- a/app/assets/javascripts/channels/order_reservation.js +++ b/app/assets/javascripts/channels/order_reservation.js @@ -31,7 +31,7 @@ App.order_reservation = App.cable.subscriptions.create('OrderReservationChannel' if(key==0){ var order_id = value.order_reservation_id; var sr_no = rowCount; - var url = "order_reservation/get_order/"+order_id; + var url = "/origami/order_reservation/get_order/"+order_id; if (typeof show_order_detail !== 'undefined' && $.isFunction(show_order_detail)) { show_order_detail(url,sr_no); } diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index 95f7ea29..f187a2db 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -1,6 +1,3 @@ - -//= require origami.js - $(function() { $("#discount").hide(); $(".expected_time").hide(); @@ -215,7 +212,7 @@ function check_emp_access_code(access_code,type) { url: url, data: {}, success: function (result) { - console.log(result) + // console.log(result) if (result.status == true) { // createAccessCode(code); $("#approved_code").text(code); @@ -571,4 +568,15 @@ function getOrderMonth(month){ function getOrderDay(day){ var DAYS = ["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"]; return DAYS[day - 1]; -} \ No newline at end of file +} + +/* start order reservation function */ +function timeFormat(date){ + var isPM = date.getHours() >= 12; + var isMidday = date.getHours() == 12; + var time = [(date.getHours()>10? date.getHours() : '0'+date.getHours()) - (isPM && !isMidday ? 12 : 0), + (date.getMinutes()>10? date.getMinutes() : '0'+date.getMinutes()) || '00'].join(':') + + (isPM ? ' PM' : ' AM'); + return time; +} +/* end order reservation function */ \ No newline at end of file diff --git a/app/assets/javascripts/origami.js b/app/assets/javascripts/origami.js index 7ed2d0eb..67911d9e 100755 --- a/app/assets/javascripts/origami.js +++ b/app/assets/javascripts/origami.js @@ -15,6 +15,7 @@ //= require BSBMaterial/turbolink_admin.js //= require BSBMaterial/demo.js //= require custom.js +//= require order_reservation.js /* Constant Varaibles */ _CREDIT_PAYMENTS_ = "/   CREDIT PAYMENTS"; @@ -463,16 +464,4 @@ function showHideNavbar(webview,page){ function createAccessCode(code) { localStorage.setItem("access_code",code); -} - -/* start order reservation function */ -function timeFormat(date){ - var isPM = date.getHours() >= 12; - var isMidday = date.getHours() == 12; - var time = [(date.getHours()>10? date.getHours() : '0'+date.getHours()) - (isPM && !isMidday ? 12 : 0), - (date.getMinutes()>10? date.getMinutes() : '0'+date.getMinutes()) || '00'].join(':') + - (isPM ? ' PM' : ' AM'); - return time; -} - -/* end order reservation function */ \ No newline at end of file +} \ No newline at end of file