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

Today

<%= WeekdayName(Weekday(Date)) %>, <%= Date_Fmt(Date) %>
Find someone new to contact
<% If overdue.Count = 0 And dueToday.Count = 0 Then %>
You're all caught up — nothing is due. <% If upcoming.Count > 0 Then %>There <% If upcoming.Count = 1 Then Response.Write "is 1 follow-up" Else Response.Write "are " & upcoming.Count & " follow-ups" %> coming up this week.<% End If %>
<% End If %> <% Dim groups(2), gi, g, gname, gclass, items, ri, rr, daysLate, lastLine Set groups(0) = overdue : Set groups(1) = dueToday : Set groups(2) = upcoming For gi = 0 To 2 Set items = groups(gi) If items.Count > 0 Then Select Case gi Case 0: gname = "Overdue" : gclass = "text-danger" Case 1: gname = "Due today" : gclass = "text-warning-emphasis" Case 2: gname = "Coming up (next 7 days)" : gclass = "text-secondary" End Select %>

<%= gname %> <%= items.Count %>

<% For ri = 0 To items.Count - 1 Set rr = items(ri) daysLate = DateDiff("d", CDate(rr("next_action_date")), Date) %>
"><%= H(rr("name")) %> <% If rr("is_customer") = 1 Then %>Customer<% End If %>
<%= H(rr("industry_name")) %> <% If Len(rr("city") & "") > 0 Then %><% If Len(rr("industry_name") & "") > 0 Then Response.Write " · " %><%= H(rr("city")) %><% End If %> <% If Len(rr("contact_name") & "") > 0 Then %> · <%= H(rr("contact_name")) %><% End If %>
<% If Len(rr("phone") & "") > 0 Then %><% End If %> <% If Len(rr("email") & "") > 0 Then %><% End If %>
<%= Date_Fmt(rr("next_action_date")) %> <% If daysLate > 0 Then %>
<%= daysLate %> day<% If daysLate <> 1 Then Response.Write "s" %> late
<% ElseIf daysLate < 0 Then %>
in <%= -daysLate %> day<% If daysLate <> -1 Then Response.Write "s" %>
<% End If %>
<% If Len(rr("last_method") & "") > 0 Then lastLine = Businesses_Label(Businesses_Methods(), rr("last_method")) If Len(rr("last_outcome") & "") > 0 Then lastLine = lastLine & " – " & H(Businesses_Label(Businesses_Outcomes(), rr("last_outcome"))) %>
Last: <%= Date_Fmt(rr("last_contacted_at")) %> · <%= lastLine %> <% If Len(rr("last_notes") & "") > 0 Then %> — <%= H(Left(Replace(Replace(rr("last_notes"), vbCr, " "), vbLf, " "), 140)) %><% If Len(rr("last_notes")) > 140 Then Response.Write "…" %><% End If %>
<% End If %>
<% Next %>
<% End If Next %>