<% 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("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 %>