Files
sx-fc/app/views/origami/home/index.html.erb
2017-05-31 16:24:34 +06:30

284 lines
12 KiB
Plaintext

<div class="row">
<div class="col-lg-6 col-md-6 col-sm-8">
<!-- Column One -->
<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
<li class="nav-item">
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#rooms" role="tab">Rooms</a>
</li>
<li class="nav-item">
<a class="nav-link" data-toggle="tab" href="#orders" role="tab">Orders</a>
</li>
</ul>
<!-- Nav tabs - End -->
<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">
<% @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> -->
<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>
<%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>
<small class="text-muted">
Someone famous in <cite title="Source Title">Source Title</cite>
</small>
</footer>
</blockquote>
</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 class="card card-inverse card-primary p-3 text-center">
<blockquote class="card-blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
<footer>
<small>
Someone famous in <cite title="Source Title">Source Title</cite>
</small>
</footer>
</blockquote>
</div>
<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 class="card p-3 text-right">
<blockquote class="card-blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer>
<small class="text-muted">
Someone famous in <cite title="Source Title">Source Title</cite>
</small>
</footer>
</blockquote>
</div>
<div class="card">
<div class="card-block">
<h4 class="card-title">Card title</h4>
<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>
<!-- Panel 1 - Tables - End -->
<!-- Panel 2 - Rooms -->
<div class="tab-pane" id="rooms" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
<!--- Booking Items -->
<div class="card-columns" style="padding-top:10px">
<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 p-3">
<blockquote class="card-block card-blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat a ante.</p>
<footer>
<small class="text-muted">
Someone famous in <cite title="Source Title">Source Title</cite>
</small>
</footer>
</blockquote>
</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 class="card card-inverse card-primary p-3 text-center">
<blockquote class="card-blockquote">
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer posuere erat.</p>
<footer>
<small>
Someone famous in <cite title="Source Title">Source Title</cite>
</small>
</footer>
</blockquote>
</div>
<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>
<!-- Panel 2 - Rooms - End -->
<!-- Panel 3 - Orders -->
<div class="tab-pane" id="orders" role="tabpanel" style="min-height:670px; max-height:670px; overflow-y:scroll">
<!--- Booking Items -->
<div class="card-columns" style="padding-top:10px">
<!-- <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 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 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>
<!-- Panel 3 - Orders - End -->
</div>
</div>
<!-- Column Two -->
<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> <% if @order_details%>- Table 4<%end%></div>
</div>
<div class="card-block">
<div class="card-title">
<table class="table">
<thead>
<tr>
<th style="width:60%; text-align:left">Items</th>
<th style="width:20%; text-align:right">QTY</td>
<th style="width:20%; text-align:right">Price</td>
</tr>
</thead>
</table>
</div>
<div id="table-details" class="card-text" style="min-height:400px; max-height:400px; overflow-x:scroll">
<table class="table">
<tbody>
<% 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>
<div class="card-footer">
<table class="table" style="margin-bottom:0px">
<tfooter>
<tr>
<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>
<td style="width:20%; text-align:right">(-250.00)</td>
</tr>
<tr>
<td style="width:80%; text-align:left">Service Tax</td>
<td style="width:20%; text-align:right">50.00</td>
</tr>
<tr>
<td style="width:80%; text-align:left">Commercial Tax</td>
<td style="width:20%; text-align:right">39.50</td>
</tr>
<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> -->
</tfooter>
</table>
</div>
</div>
</div>
</div>
<!-- Column Three--->
<div class="col-lg-1 col-md-1 col-sm-1">
<!-- Waiter Buttons -->
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Add Order</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Edit</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Move</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Customer</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Req.Bill</button>
<!-- Cashier Buttons -->
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Discount</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Pay</button>
<button type="button" class="btn btn-primary btn-lg btn-block" disabled>Re.Print</button>
</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>