119 lines
5.6 KiB
Plaintext
119 lines
5.6 KiB
Plaintext
<div class="page-header">
|
|
<ol class="breadcrumb">
|
|
<li class="breadcrumb-item"><a href="<%= dashboard_path %>"><%= t("views.right_panel.button.home") %></a></li>
|
|
<li class="breadcrumb-item active"><%= t("views.right_panel.detail.survey") %></li>
|
|
<span class="float-right">
|
|
<%= link_to 'Back', dashboard_path %>
|
|
</span>
|
|
</ol>
|
|
</div>
|
|
<div class="row">
|
|
<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12">
|
|
<div class="main-box-body clearfix p-l-15 p-r-15">
|
|
<%= form_tag transactions_surveys_path, :method => :get do %>
|
|
<div class="row clearfix">
|
|
<div class="col-lg-3 col-md-3 col-sm-3 col-xs-3">
|
|
<label class="form-control-label"><%= t("views.right_panel.button.search_keyboard") %></label>
|
|
<input type="text" id="dining_name" name="filter" placeholder="Dining Name" class="form-control input-md" >
|
|
</div>
|
|
|
|
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
|
<label class="form-control-label"><%= t("views.right_panel.detail.from") %></label>
|
|
<input class="form-control datepicker" name="from" id="from" type="text" placeholder="From date">
|
|
</div>
|
|
|
|
<div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
|
|
<label class="form-control-label"><%= t("views.right_panel.detail.to") %></label>
|
|
<input class="form-control datepicker" name="to" id="to" type="text" placeholder="To date">
|
|
</div>
|
|
|
|
<div class="form-group col-lg-1 col-md-1 col-sm-1 col-xs-1">
|
|
<label > </label>
|
|
<br> <input type="submit" value="Search" class='btn btn-primary btn-md'>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
<div class="card">
|
|
<div class="table-responsive">
|
|
<table class="table table-bordered table-striped table-hover">
|
|
<thead>
|
|
<th><%= t("views.right_panel.detail.dining") %></th>
|
|
<th><%= t("views.right_panel.detail.receipt_no") %></th>
|
|
<th><%= t("views.right_panel.detail.created_by") %></th>
|
|
<th><%= t("views.right_panel.detail.child") %></th>
|
|
<th><%= t("views.right_panel.detail.adult") %></th>
|
|
<th><%= t("views.right_panel.detail.male") %></th>
|
|
<th><%= t("views.right_panel.detail.female") %></th>
|
|
<th><%= t("views.right_panel.detail.total") %> <%= t :customer %>
|
|
<th><%= t("views.right_panel.detail.local") %></th>
|
|
</th>
|
|
<th><%= t("views.right_panel.detail.foreigner") %></th>
|
|
</thead>
|
|
<tbody>
|
|
<% total_child = 0 %>
|
|
<% total_adult = 0 %>
|
|
<% total_male = 0 %>
|
|
<% total_female = 0 %>
|
|
<% total_local = 0 %>
|
|
<% total_customer = 0 %>
|
|
<% total_foreigner = 0 %>
|
|
<% if !@surveys.nil? %>
|
|
<% @surveys.each do |survey| %>
|
|
<% total_child = total_child.to_i + survey.child.to_i %>
|
|
<% total_adult = total_adult.to_i + survey.adult.to_i %>
|
|
<% total_male = total_male.to_i + survey.male.to_i %>
|
|
<% total_female = total_female.to_i + survey.female.to_i %>
|
|
<% total_local = total_local.to_i + survey.local.to_i %>
|
|
<% total_customer = total_customer.to_i + survey.total_customer.to_i %>
|
|
<tr>
|
|
<td><%= survey.dining_name rescue ' '%></td>
|
|
<td><%= survey.receipt_no rescue '-'%></td>
|
|
<td><%= survey.created_by rescue ' '%></td>
|
|
<td><%= survey.child rescue ' '%></td>
|
|
<td><%= survey.adult rescue ' '%></td>
|
|
<td><%= survey.male rescue ' '%></td>
|
|
<td><%= survey.female rescue ' '%></td>
|
|
<td><%= survey.total_customer rescue ' '%></td>
|
|
<td><%= survey.local rescue ' '%></td>
|
|
<td>
|
|
<% if !survey.foreigner.nil? %>
|
|
<% JSON.parse(survey.foreigner).each do |foreign| %>
|
|
<% foreigner_lists = foreign.split(",") %>
|
|
<% if !foreigner_lists.empty? %>
|
|
<% foreigner_lists.each do |fgn| %>
|
|
<% unless fgn.match(/[^[:digit:]]+/)
|
|
total_foreigner = total_foreigner.to_i + fgn.to_i
|
|
end %>
|
|
<% if !fgn.scan(/\D/).empty? %>
|
|
<%= fgn %> :<% end %> <%= fgn.to_i unless fgn.match(/[^[:digit:]]+/) %><br>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
<% end %>
|
|
</td>
|
|
</tr>
|
|
<% end %>
|
|
<% end %>
|
|
<tr>
|
|
<td colspan="3"><strong><%= t("views.right_panel.detail.total") %></strong></td>
|
|
<td><strong><%= total_child %></strong></td>
|
|
<td><strong><%= total_adult %></strong></td>
|
|
<td><strong><%= total_male %></strong></td>
|
|
<td><strong><%= total_female %></strong></td>
|
|
<td><strong><%= total_customer %></strong></td>
|
|
<td><strong><%= total_local %></strong></td>
|
|
<td><strong><%= total_foreigner %></strong></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<%if !@orders.nil?%>
|
|
<%= paginate @surveys %>
|
|
<%end%>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|