add survey

This commit is contained in:
Yan
2017-11-06 18:51:15 +06:30
parent 396baee19c
commit 6917ce2612
11 changed files with 275 additions and 0 deletions

View File

@@ -319,6 +319,7 @@
Back
</button>
<button type="button" id="add_order" class="btn btn-block bg-blue waves-effect">Add Order</button>
<button type="button" id="survey" class="btn btn-block bg-blue waves-effect">Survey</button>
<% if @dining.status != "available" %>
<% if @status_order == 'order' %>
<button type="button" id="customer" class="btn btn-block bg-blue waves-effect" disabled>Customer</button>
@@ -395,6 +396,19 @@
window.location.href = '/origami/order/' + order_id;
});
// bind survey to order or sale
$("#survey").on('click', function () {
var sale = $('#sale_id').val();
if (sale) {
var sale_id = sale
} else {
var sale_id = $('#save_order_id').attr('data-order');
}
var table_id = $('.tables').attr("data-id");
window.location.href = '/origami/' + sale_id + "/survey"
});
// bind customer to order or sale
$("#customer").on('click', function () {
var sale = $('#sale_id').val();