<% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>

Businesses

Export<% If total > 0 Then Response.Write " " & FormatNumber(total, 0) %> Import
" placeholder="Name, contact, email, city or phone" maxlength="100" />
/>
/>
Reset
<% ' Sort header helper values (functions cannot be declared in a view, so build the links inline) Dim cols, ci, colKey, colLabel, nextDir, arrow cols = Array(Array("name", "Business"), Array("industry", "Industry"), Array("city", "Location"), _ Array("status", "Status"), Array("last_contacted", "Last contacted"), Array("next_action", "Next action")) %>

<% If total = 0 Then %> No businesses match. <% Else %> Showing <%= FormatNumber(firstRow, 0) %>–<%= FormatNumber(lastRow, 0) %> of <%= FormatNumber(total, 0) %> <% End If %>

<% For ci = 0 To UBound(cols) colKey = cols(ci)(0) : colLabel = cols(ci)(1) nextDir = "asc" : arrow = "" If (sort = colKey) Or (sort = "" And colKey = "name") Then If dir = "asc" Then nextDir = "desc" : arrow = " " Else nextDir = "asc" : arrow = " " End If %> <% Next %> <% Dim ri, r, due For ri = 0 To rows.Count - 1 Set r = rows(ri) %> <% Next %> <% If rows.Count = 0 Then %> <% End If %>
<%= colLabel %><%= arrow %>Contact
"><%= H(r("name")) %> <% If r("is_customer") = 1 Then %>Customer<% End If %> <% If Len(r("contact_name") & "") > 0 Then %>
<%= H(r("contact_name")) %>
<% End If %>
<%= H(r("industry_name")) %> <%= H(r("city")) %><% If Len(r("city") & "") > 0 And Len(r("state") & "") > 0 Then Response.Write ", " %><%= H(r("state")) %> "><%= Businesses_StatusLabel(r("status")) %> <%= Date_Fmt(r("last_contacted_at")) %> "><%= Date_Fmt(r("next_action_date")) %> <% If Len(r("phone") & "") > 0 Then %><% End If %> <% If Len(r("email") & "") > 0 Then %><% End If %>
Nothing to show. Try different filters, or import a list.
<% If pageCount > 1 Then Dim pFrom, pTo, pi pFrom = page - 3 : If pFrom < 1 Then pFrom = 1 pTo = page + 3 : If pTo > pageCount Then pTo = pageCount %> <% End If %>