%
' Tile helper values: label, number, link, optional emphasis class
Dim tiles, ti, t, pct, pctText, barW, di, dd, barPct, oi, ob, mi, mb, ii, ir, bi_
tiles = Array( _
Array("Prospects", counts("prospects"), "/businesses?show=prospects", ""), _
Array("Previous customers", counts("customers"), "/businesses?show=customers", "text-success"), _
Array("Never contacted", counts("never_contacted"), "/businesses?show=prospects&contacted=never", ""), _
Array("Follow-ups overdue", counts("overdue"), "/", Iif_(counts("overdue") > 0, "text-danger", "")), _
Array("Due today", counts("due_today"), "/", Iif_(counts("due_today") > 0, "text-warning-emphasis", "")), _
Array("Due in the next 7 days", counts("this_week"), "/", ""), _
Array("No phone number", counts("no_phone"), "/businesses?show=prospects", "text-muted"), _
Array("Removed", counts("removed"), "/businesses?status=removed", "text-muted") _
)
%>
<% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
Dashboard
<%= FormatNumber(counts("active"), 0) %> active businesses · <%= FormatNumber(counts("total"), 0) %> including removed
<% For ti = 0 To UBound(tiles)
t = tiles(ti) %>
<% Next %>
Where everyone stands
<%
Dim stages, si, s, tot
stages = Array(Array("New", counts("st_new"), "text-bg-secondary", "new"), Array("Contacted", counts("st_contacted"), "text-bg-info", "contacted"), Array("Follow-up", counts("st_follow_up"), "text-bg-warning", "follow_up"))
tot = counts("st_new") + counts("st_contacted") + counts("st_follow_up")
If tot = 0 Then tot = 1
%>
<% For si = 0 To UBound(stages)
s = stages(si)
If s(1) > 0 Then %>
<%= s(0) %>
<% End If
Next %>
Counts include previous customers. Removed businesses are not counted here.
Contact activity
<%= FormatNumber(activity("today"), 0) %>
Today
<%= FormatNumber(activity("week"), 0) %>
Last 7 days
<%= FormatNumber(activity("month"), 0) %>
Last 30 days
Last 14 days
<% For di = 0 To daily.Count - 1
dd = daily(di)
barPct = Round(dd(1) * 100 / maxDaily, 0)
If dd(1) > 0 And barPct < 6 Then barPct = 6 %>
<% If dd(1) > 0 Then Response.Write dd(1) %>
" style="height: <%= barPct %>%; min-height: <% If dd(1) > 0 Then Response.Write "2px" Else Response.Write "1px" %>;<% If dd(1) = 0 Then Response.Write " background:#dee2e6;" %>">
<% Next %>
<% For di = 0 To daily.Count - 1 %>
<%= Day(daily(di)(0)) %>
<% Next %>
How you reached out (30 days)
<% If byMethod.Count = 0 Then %>
Nothing logged yet.
<% Else %>
<% For mi = 0 To byMethod.Count - 1
mb = byMethod(mi) %>
| <%= H(Businesses_Label(Businesses_Methods(), mb(0))) %> | <%= FormatNumber(mb(1), 0) %> |
<% Next %>
<% End If %>
Outcomes (30 days)
<% If byOutcome.Count = 0 Then %>
Nothing logged yet.
<% Else %>
<% For oi = 0 To byOutcome.Count - 1
ob = byOutcome(oi) %>
| <% If Len(ob(0)) = 0 Then Response.Write "(no outcome)" Else Response.Write H(Businesses_Label(Businesses_Outcomes(), ob(0))) %> |
<%= FormatNumber(ob(1), 0) %> |
<% Next %>
<% End If %>
Biggest industries (manage)
<% If industries.Count = 0 Then %>
No industries yet.
<% Else %>
| Industry | Businesses | Contacted |
<% For ii = 0 To industries.Count - 1
ir = industries(ii)
If ir(2) > 0 Then pct = Round(ir(3) * 100 / ir(2), 0) Else pct = 0
If ir(3) > 0 And pct = 0 Then pctText = "<1" Else pctText = CStr(pct)
If ir(3) > 0 And pct = 0 Then barW = 1 Else barW = pct %>
| <%= H(ir(1)) %> |
<%= FormatNumber(ir(2), 0) %> |
<%= FormatNumber(ir(3), 0) %> · <%= pctText %>%
|
<% Next %>
<% End If %>
Recent imports (import)
<% If imports.Count = 0 Then %>
No imports yet.
<% Else %>
<% End If %>