update quickservice

This commit is contained in:
Aung Myo
2018-02-09 11:32:29 +06:30
parent a64fc8a4f5
commit edade3662b
9 changed files with 243 additions and 74 deletions

View File

@@ -5,7 +5,9 @@
</div>
<% type = request.path_info.include?('quick_service')%>
<% modify_order = request.path_info.include?('modify_order')%>
<input type="hidden" name="type" id="type" value="<%=type%>">
<input type="hidden" name="type" id="modify_order" value="<%=modify_order%>">
<div class="row m-t--20">
<div class="col-lg-2 col-md-2 col-sm-2">
<ul class="nav nav-tabs flex-column" role="tablist" id="ul-navbar">
@@ -78,15 +80,20 @@
<div class="col-md-6 col-lg-6 col-sm-12">
<strong id="order-title" class="font-14">ORDER DETAILS </strong>
</div>
<div class="col-md-2 col-lg-2 col-sm-6">Table</div>
<div class="col-md-4 col-lg-4 col-sm-6 m-t--5">
<a class="btn btn-block bg-blue waves-effect select_table" data-toggle="modal" data-target="#TableModal">Select</a>
<input type="hidden" name="table_id" value="" id="table_id">
<%if @booking_id %>
<p class="hidden" id="booking_id"><%=@booking_id%></p>
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
<%end%>
</div>
<% if modify_order %>
<div class="col-md-6 col-lg-6 col-sm-6">Table : <%=@table.name%></div>
<p class="hidden" id="table_id"><%=@table_id%></p>
<p class="hidden" id="table_type"><%=@table.type%></p>
<p class="hidden" id="booking_id"><%=@booking_id%></p>
<p class="hidden" id="customer_id"><%=@customer ? @customer.customer_id : ''%></p>
<p class="hidden" id="sale_id"><%=@sale_id%></p>
<% else%>
<div class="col-md-2 col-lg-2 col-sm-6">Table</div>
<div class="col-md-4 col-lg-4 col-sm-6 m-t--5">
<a class="btn btn-block bg-blue waves-effect select_table" data-toggle="modal" data-target="#TableModal">Select</a>
<input type="hidden" name="table_id" value="" id="table_id">
</div>
<% end%>
</div>
<% else %>
<div>
@@ -125,24 +132,13 @@
</table>
<% if type %>
<div class="row clearfix hidden">
<div class="col-md-4 ">
<strong id="order-title" class="font-14">Customer</strong>
</div>
<!-- <div class="col-md-3">Table -</div> -->
<div class="col-md-8">
<select class="form-control m-t--5" id="customer_id" name="customer_id" >
<option value="">Select Customer</option>
<% @customer.each do |cus| %>
<option <%=(cus.customer_id == 'CUS-000000000001')? 'selected':''%> value="<%= cus.customer_id %>"><%= cus.name %></option>
<%end %>
</select>
</div>
</div>
<button type="button" class="btn btn-primary btn-block create" id="create_pay_order" disabled="disabled">Create Order & Pay</button>
<input type="hidden" name="customer_id" id="customer_id" value="CUS-000000000001">
<button type="button" class="btn btn-primary btn-block create" id="create_pay_order" disabled="disabled"><%if modify_order%>Update Order & Pay<%else%>Create Order & Pay<%end%></button>
<% end %>
<% if !modify_order %>
<button type="button" class="btn btn-primary btn-block create m-t-5" id="create_order" disabled="disabled">Create Order</button>
<% end %>
</div>
</div>
</div>
@@ -333,7 +329,7 @@
</div>
</div>
<% if type %>
<% if type && !modify_order%>
<div class="modal fade" id="TableModal" tabindex="-1" role="dialog">
<div class="modal-dialog" role="document">
<div class="modal-content">

View File

@@ -116,7 +116,7 @@
<!-- Column Three -->
<div class="col-lg-1 col-md-1 col-sm-1">
<button type="button" class="btn btn-default btn-block" id='back'><i class="material-icons">reply</i>Back</button>
<button type="button" id="addorder" class="btn bg-blue btn-block">Pay</button>
<button type="button" id="addorder" class="btn bg-blue btn-block">Add Order</button>
<button type="button" id="pay" class="btn bg-blue btn-block">Pay</button>
</div>
</div>
@@ -136,7 +136,7 @@ $(document).ready(function(){
});
$('#addorder').on('click', function () {
var table_id = "<%=@table_id%>";
window.location.href = '/origami/quick_service/modify_order/' + table_id;
window.location.href = '/origami/quick_service/modify_order/' + table_id+"/"+$('#sale_id').val();
});
});
</script>