99 lines
3.5 KiB
Plaintext
99 lines
3.5 KiB
Plaintext
<div class="modal fade" id="read_modal" tabindex="-1" role="dialog" aria-labelledby="myLargeModalLabel" aria-hidden="true" >
|
|
<div class="modal-dialog read-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header" style="background-color: #54A5AF;padding-top:10px !important;">
|
|
<h4 class="modal-title" id="defaultModalLabel" style="color:#fff;">Customer Detail</h4>
|
|
</div>
|
|
<div class="modal-body">
|
|
<p style="text-align: center; font-weight: bolder; color: black; font-size: larger">Please tap NFC Card or Scan Code</p>
|
|
<div style="text-align: center;">
|
|
<img src="/image/nfc.png" style="height: 200px"><br>
|
|
</div>
|
|
</div>
|
|
<div class="modal-footer" style="justify-content: center;">
|
|
<button type="button" class="btn btn-danger" id="close" >Cancel</button>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<style>
|
|
#read_modal {
|
|
text-align: center;
|
|
padding: 0!important;
|
|
}
|
|
|
|
#read_modal:before {
|
|
display: inline-block;
|
|
vertical-align: middle;
|
|
content: " ";
|
|
height: 100%;
|
|
}
|
|
|
|
.read-dialog {
|
|
display: inline-block;
|
|
text-align: left;
|
|
vertical-align: middle;
|
|
}
|
|
</style>
|
|
|
|
<script>
|
|
$('#mmqr').click(function() {
|
|
// alert("MMQR");
|
|
|
|
const paymentMethod = 'MMQR';
|
|
const $serverMode = $('#server_mode');
|
|
const $createOrderBtn = $('#create_order');
|
|
const $createPayOrderBtn = $('#create_pay_order');
|
|
|
|
const params = {
|
|
order_source: "food_court",
|
|
order_type: "dine_in",
|
|
customer_id: $("#customer_id").text(),
|
|
guest_info: "",
|
|
table_id: $("#table_id").text(),
|
|
order_items: JSON.stringify(get_order_item_rows()),
|
|
create_type: "create_pay",
|
|
};
|
|
|
|
$.ajax({
|
|
url: '/foodcourt/addorders/create',
|
|
method: 'POST',
|
|
contentType: 'application/json',
|
|
headers: {
|
|
'X-CSRF-Token': $('meta[name="csrf-token"]').attr('content')
|
|
},
|
|
data: JSON.stringify(params),
|
|
success: function(result) {
|
|
const booking_id = result.booking_id;
|
|
window.location.href = `/foodcourt/${result.sale_id}/qrpay/init`;
|
|
if ($serverMode.val() !== "cloud" && $("#display_type").val() === "2") {
|
|
// customer_display_view(null, "reload");
|
|
}
|
|
},
|
|
error: function(xhr) {
|
|
$('#oqs_loading_wrapper').hide();
|
|
$createOrderBtn.prop('disabled', false);
|
|
$createPayOrderBtn.prop('disabled', false);
|
|
|
|
const errorMsg = xhr.status ? `Status: ${xhr.status} - ${xhr.statusText}` : "Network error";
|
|
swal("Error", errorMsg, "error");
|
|
}
|
|
});
|
|
})
|
|
|
|
// function get_order_item_rows(){
|
|
// var order_items = [];
|
|
// var item_row = $('.summary-items tbody tr');
|
|
// $(item_row).each(function(i){
|
|
// var order_item = {};
|
|
|
|
// // order_item.item_name = $(item_row[i]).attr('data-item-name');
|
|
// order_item.item_instance_code = $(item_row[i]).attr('data-instance-code');
|
|
|
|
// order_items.push(order_item);
|
|
// });
|
|
// return order_items;
|
|
// }
|
|
</script>
|