<%= wicked_pdf_stylesheet_link_tag "application" %> <%@top_aps_usage = top_aps_usage%> <%@top_clients_usage = top_clients_usage %> <%@usage_per_ssid = usage_per_ssid%> <%@report_obj = report_obj %> <%@no_of_clients_per_ssids = no_of_clients_per_ssids %> <%@aps_in_network = aps_in_network %> <%@ap_versions = ap_versions %> <%@ap_geo_loc = ap_geo_loc %> <%@no_of_clients = no_of_clients %>

PCC Report

<%= wicked_pdf_image_tag 'logo.png' %>
Report Name : <%= @report_obj.title%>
Network Name : <%= @report_obj.location_network.network_name %>
Time Range : <%= @report_obj.from_time.strftime("%b %d %Y")+" to "+ @report_obj.to_time.strftime("%b %d %Y") %>
<% unless @top_aps_usage.blank? %>
Top 5 APs by Usage
<%legend = [];data=[];url=""%> <% (@top_aps_usage || []).each do |x| %> <% data.push(x["total_usage"]) legend.push(x["_id"]) %> <% end %>
MAC ID Down Stream Up Stream Total Usage
<%= x["_id"]%> <%= number_to_human_size(x["rx"])%> <%= number_to_human_size(x["tx"])%> <%= number_to_human_size(x["total_usage"])%>
<% url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %>
<% end %> <% unless @top_clients_usage.blank? %>
Top 5 Clients by Usage
<%legend = [];data=[];url=""%> <% (@top_clients_usage || []).each do |x| %> <% data.push(x["total_usage"]) legend.push(x["_id"])%> <% end %>
MAC ID Down Stream Up Stream Total Usage
<%= x["_id"]%> <%= number_to_human_size(x["rx"])%> <%= number_to_human_size(x["tx"])%> <%= number_to_human_size(x["total_usage"])%>
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %>
<% end %> <% unless @usage_per_ssid.blank? %>
Usage per SSID
<%legend = [];data=[];url=""%> <% (@usage_per_ssid || []).each do |x| %> <% data.push(x["total_usage"]) legend.push(x["_id"]["name"])%> <% end %>
SSID Name Down Stream Up Stream Total Usage
<%= x["_id"]["name"]%> <%= number_to_human_size(x["rx"])%> <%= number_to_human_size(x["tx"])%> <%= number_to_human_size(x["total_usage"])%>
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data,:axis_range => [nil, [2,17,5]]) %>
<%= image_tag(url) unless url.blank? %>
<%end%> <% unless @no_of_clients.blank? %>
Number of connected Clients
<%legend = [];data=[];url=""%> <% (@no_of_clients || []).each do |x| %> <% if x["_id"]['day'] date = x["_id"]['month'].to_s+"-"+x["_id"]['day'].to_s elsif x["_id"]['week'] date = x["_id"]['year'].to_s[-2,4]+" ,"+x["_id"]['week'].to_s elsif x["_id"]['month'] date = x["_id"]['year'].to_s[-2,4]+"-"+x["_id"]['month'].to_s elsif x["_id"]['year'] date = x["_id"]['year'].to_s end %> <% data.push(x["macs"].count) legend.push(date) %> <% end %>
SSID NAME Date Clients
<%= x["_id"]['name']%><%= date%> <%= x["macs"].count%>
<%url = Gchart.bar(:data => data,:axis_with_labels => ['x', 'y'],:axis_labels => [legend], :encoding => 'text', :max_value =>:auto, :bar_width_and_spacing => '55,6') %>
<%= image_tag(url) unless url.blank? %>
<%end%> <% unless @no_of_clients_per_ssids.blank? %>
Number of connected Clients per SSID
<% sum = 0%> <% (@no_of_clients_per_ssids || []).each do |x| sum += x["macs"].size end %> <%legend = [];data=[];url=""%> <% (@no_of_clients_per_ssids || []).each do |x| %> <% count = x["macs"].size %> <% data.push(count) legend.push(x["_id"]["name"])%> <% end %>
SSID NAME Clients Percentage
<%= x["_id"]["name"]%><%= count %> <%= ((count*100)/sum).round(1) %> %
<%url = Gchart.pie_3d(:title=>"", :legend => legend, :data => data, :size => '220x220') %>
<%= image_tag(url) unless url.blank? %>
<%end%> <%unless @aps_in_network.blank?%> <% (@aps_in_network || []).each do |x| %> <% end %>
AP List
AP
<%= x %>
<%end%> <%unless @ap_versions.blank?%> <% (@ap_versions || []).each do |x| %> <% end %>
AP List by Version
AP Version
<%= x["_id"]["ap_mac"] %> <%= x["version"].last.gsub('"',"") unless x["version"].blank? %>
<%end%> <%unless @ap_geo_loc.blank?%> <% (@ap_geo_loc || []).each do |x| %> <% ri = RouterInventory.where(mac_id: x["_id"]["ap_mac"]).last %> <% end %>
AP List by Geo Location
AP Address
<%= x["_id"]["ap_mac"] %><%= ri.city %>,<%= ri.country %>
<%end%>