crm home view
This commit is contained in:
@@ -1,6 +1,17 @@
|
||||
class Crm::HomeController < BaseCrmController
|
||||
def index
|
||||
@bookings = Booking.all
|
||||
|
||||
@booking = Booking.select("bookings.id as booking_id,
|
||||
bookings.checkin_at,
|
||||
od.customer_id as customer,
|
||||
odt.id")
|
||||
.joins("join booking_orders as bko ON bko.booking_id = bookings.id")
|
||||
.joins("right join orders as od ON od.id = bko.order_id")
|
||||
.joins("right join order_items as odt ON odt.order_id=od.id")
|
||||
.order("bookings.id DESC")
|
||||
|
||||
|
||||
|
||||
end
|
||||
def show
|
||||
end
|
||||
|
||||
@@ -54,15 +54,20 @@
|
||||
<div class="tab-pane active" id="tables" role="tabpanel">
|
||||
<!--- Booking Items -->
|
||||
<div class="card-columns" style="padding-top:10px">
|
||||
<% @bookings.each do |booking| %>
|
||||
|
||||
<% @i = 0 %>
|
||||
<% @booking.each do |booking| %>
|
||||
<div class="card">
|
||||
<div class="card-block">
|
||||
<h4 class="card-title">1. <%= booking.dining_facility.name %> - Beef Steak [x1]</h4>
|
||||
<p class="card-text">fries, Salad</p>
|
||||
<h4 class="card-title">
|
||||
saf
|
||||
</h4>
|
||||
<p class="card-text">fries, Salad
|
||||
asdf
|
||||
</p>
|
||||
<p class="card-text">
|
||||
<small class="text-muted">
|
||||
Order at <%= booking.created_at.strftime("%H:%M") %>,
|
||||
<%= booking.checkin_by %>
|
||||
adf
|
||||
</small>
|
||||
</p>
|
||||
</div>
|
||||
@@ -71,6 +76,19 @@
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-block order-void">
|
||||
<h4 class="card-title">9. Table 4 - Beef Steak [x3]</h4>
|
||||
<p class="card-text">Well Done, Fries, Salad</p>
|
||||
<p class="card-text"><small class="text-muted">Order at 12:23, Kyaw Lwin</small></p>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<button id="#id" class="btn btn-primary btn-lg btn-block">COMPLETE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<!--- end of Items-->
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user