order controller updated
This commit is contained in:
@@ -18,16 +18,23 @@
|
||||
|
||||
<div class="tab-content" style="min-height:670px; max-height:670px; overflow-y:scroll">
|
||||
<!-- Panel 1 - Tables -->
|
||||
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<% @order.each do |order| %>
|
||||
<div class="card" onclick="callOrderDetails('<%=order.order_id%>')">
|
||||
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
<!-- <h4 class="card-title">Card title that wraps to a new line</h4> -->
|
||||
|
||||
<h4 class="card-title"><span class="table-name"><%=order.table_name%></span></h4>
|
||||
<!-- <p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p> -->
|
||||
<p class="card-text"><%=order.total_price%></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card p-3">
|
||||
<%end %>
|
||||
<!-- <div class="card p-3">
|
||||
<blockquote class="card-block card-blockquote">
|
||||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
|
||||
<footer>
|
||||
@@ -78,7 +85,7 @@
|
||||
<p class="card-text">This is a wider card with supporting text below as a natural lead-in to additional content. This card has even longer content than the first to show that equal height action.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -137,27 +144,27 @@
|
||||
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<div class="card">
|
||||
<!-- <div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title that wraps to a new line</h4>
|
||||
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card">
|
||||
</div> -->
|
||||
<!-- <div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="card text-center">
|
||||
<!-- <div class="card text-center">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">Card title</h4>
|
||||
<p class="card-text">This card has supporting text below as a natural lead-in to additional content.</p>
|
||||
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
|
||||
|
||||
@@ -172,7 +179,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> - Table 4</div>
|
||||
<div id="order-title"><strong>ORDER DETAILS</strong> <% if @order_details%>- Table 4<%end%></div>
|
||||
</div>
|
||||
<div class="card-block">
|
||||
<div class="card-title">
|
||||
@@ -186,120 +193,26 @@
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
|
||||
<table class="table">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
Menu Items Name @ 50.00
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
5
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
250.00
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<% sub_total = 0%>
|
||||
<% if @order_details%>
|
||||
<% @order_details.each do |order_detail| %>
|
||||
<tr>
|
||||
<td style="width:60%; text-align:left">
|
||||
<%=order_detail.item_name%> @ <%=order_detail.price%>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<%=order_detail.qty%>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
<%=order_detail.total_price%>
|
||||
<%sub_total+=order_detail.total_price%>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
@@ -307,8 +220,13 @@
|
||||
<table class="table" style="margin-bottom:0px">
|
||||
<tfooter>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub-Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong>750.00</strong></td>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Total Amount</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><%=sub_total%></strong></td>
|
||||
</tr>
|
||||
<!--
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left; border-top:none"><strong>Sub Total</strong></td>
|
||||
<td style="width:20%; text-align:right; border-top:none"><strong><%=sub_total%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left">Discounts</td>
|
||||
@@ -325,7 +243,7 @@
|
||||
<tr>
|
||||
<td style="width:80%; text-align:left"><strong>Grand Total</strong></td>
|
||||
<td style="width:20%; text-align:right"><strong>589.50</strong></td>
|
||||
</tr>
|
||||
</tr> -->
|
||||
</tfooter>
|
||||
</table>
|
||||
</div>
|
||||
@@ -349,3 +267,18 @@
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
function callOrderDetails(order_id){
|
||||
url = "origami/"+order_id
|
||||
$.ajax({type: "GET",
|
||||
url: url,
|
||||
data: { order_id: order_id},
|
||||
success:function(result){
|
||||
alert('ok'+result);
|
||||
},
|
||||
error:function(result){
|
||||
alert('error');
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
Reference in New Issue
Block a user