<%= stylesheet_link_tag "dashboard" %>_

<%= current_user.admin? ? "" : Company.find_by(id: current_user.company_id).company_name %> Pearlception Dashboard

<% if current_user.admin? %>

Recent Results From All Companies

<% ((Company.pluck :company_name) - ["IVA"]).each do |company_name| %>
" class="panel-collapse collapse <%= (@results[company_name.gsub(/'/,'').gsub(/\s/,'')][:active] && @results[company_name.gsub(/'/,'').gsub(/\s/,'')][:name] == company_name.gsub(/'/,'').gsub(/\s/,'') ) ? "in" : ""%>">
<% @results[company_name.gsub(/'/,'').gsub(/\s/,'')][:results].each_slice(1) do |row| %> <% row.each do |result| run = result#Run.find(result.id) %> <% end %> <% end %>
Run Date Location Harvest Time Supplier Distributor Total Processed Other Oyster Info
<%= run.runDate %> <%= run.location ? run.location : "" %> <%= "" %> <%= run.supplier ? run.supplier : "" %> <%= run.distributor ? run.distributor : "" %> "result" <%= run.other ? run.other : "" %> <%= link_to "Show", oysters_index_path( :result_id => result.id, :page_num => params[:page]), :class => "btn btn-primary" %>
<%= paginate @results[company_name.gsub(/'/,'').gsub(/\s/,'')][:results] , params: {company: company_name.gsub(/'/,'').gsub(/\s/,'')} %>
<%= page_entries_info @results[company_name.gsub(/'/,'').gsub(/\s/,'')][:results] %>
<% end %>
<% else %>

Recent Results

<% @results.each_slice(1) do |row| %> <% row.each do |result| run = Run.find(result.id) %> <% end %> <% end %>
Run Date Location Harvest Time Supplier Distributor Total Processed Other Oyster Info
<%= run.runDate %> <%= run.location ? run.location : "" %> <%= "" %> <%= run.supplier ? run.supplier : "" %> <%= run.distributor ? run.distributor : "" %> "result" <%= run.other ? run.other : "" %> <%= link_to "Show", oysters_index_path( :result_id => result.id, :page_num => params[:page]), :class => "btn btn-primary" %>
<%= paginate @results %>
<%= page_entries_info @results %>
<% end %>
<%= javascript_include_tag "bootstrap.min" %>_