app order with order

This commit is contained in:
Myat Zin Wai Maw
2019-12-04 16:18:06 +06:30
parent f404328089
commit 7a4db5e0f4
5 changed files with 46 additions and 44 deletions

View File

@@ -50,8 +50,7 @@
<div class="card <%= bk_color %> text-white" data-id ="<%= bk.booking_id %>">
<div class="card-block">
Cus Ph :<%= bk.contact_no %><span style="font-size:12px;float:right;line-height:inherit;">Order Time :<%= bk.checkin_at.utc.getlocal.strftime("%I:%M %p") %></span><br>
BK :<%= bk.booking_id %><span style="font-size:12px;float:right;line-height:inherit;"><%= bk_status %></span>
</div>
Order No :<%= bk.orders[0].order_id %><span style="font-size:12px;float:right;line-height:inherit;"><%= bk_status %></span> </div>
</div>
<% end %>
<% end %>
@@ -65,6 +64,7 @@
<div class="col-md-9 col-lg-9 col-sm-9">
<strong id="order-title" class="font-14 p-l-10">ORDER DETAILS </strong>| <span class="font-14">Table-<%=@booking.dining_facility.name%></span><br>
<strong class="font-14 p-l-10">Booking - <%=@booking.booking_id%></strong>
<strong class="font-14 p-l-10">Order No- <%=@booking.order_id%></strong>
</div>
<div class="col-md-3 col-lg-3 col-sm-3">
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
@@ -122,38 +122,38 @@
</div>
</div>
<script type="text/javascript">
$('#back').on('click', function () {
window.location.href ="<%=foodcourt_food_court_path %>";
});
$('#done_order').on('click', function () {
swal({
title: "Alert !",
text: 'Order Complete?',
type: "warning",
showCancelButton: true,
confirmButtonColor: "#DD6B55",
confirmButtonText: "Yes",
cancelButtonClass: 'btn btn-danger',
closeOnConfirm: false
}, function (isConfirm) {
if (isConfirm) {
$('.confirm').prop("disabled",true);
$.ajax({
type: "POST",
url: "/foodcourt/<%=@booking_id %>/completed",
data: {customer_id:"<%=@customer_id %>"},
dataType: "json",
success: function(data) {
swal({
title: "Information!",
text: 'Send sms to customer ',
type: "success",
}, function () {
window.location.href ="<%=foodcourt_app_order_by_booking_path %>";
});
}
});
}
});
});
  $('#back').on('click', function () {
     window.location.href ="<%=foodcourt_food_court_path %>";
  });
  $('#done_order').on('click', function () {
    swal({
      title: "Alert !",
      text: 'Order Complete?',
      type: "warning",
      showCancelButton: true,
      confirmButtonColor: "#DD6B55",
      confirmButtonText: "Yes",
      cancelButtonClass: 'btn btn-danger',
      closeOnConfirm: false
    }, function (isConfirm) {
      if (isConfirm) {
        $('.confirm').prop("disabled",true);
        $.ajax({
          type: "POST",
          url: "/foodcourt/<%=@booking_id %>/<%=@order_id %>/completed",
          data: {customer_id:"<%=@customer_id %>"},
          dataType: "json",
          success: function(data) {
            swal({
             title: "Information!",
             text: 'Send sms to customer ',
             type: "success",
           }, function () {
             window.location.href ="<%=foodcourt_app_order_by_booking_path %>";
           });
          }
        });
      }
    });
  });
</script>