|
- <% Flash().ShowErrorsIfPresent : Flash().ShowSuccessIfPresent %>
-
- <div class="d-flex justify-content-between align-items-center mb-3">
- <div>
- <h1 class="h3 mb-0">Today</h1>
- <div class="text-muted small"><%= WeekdayName(Weekday(Date)) %>, <%= Date_Fmt(Date) %></div>
- </div>
- <a href="/businesses?contacted=never&show=prospects" class="btn btn-outline-primary btn-sm"><i class="bi bi-telephone-plus"></i> Find someone new to contact</a>
- </div>
-
- <% If overdue.Count = 0 And dueToday.Count = 0 Then %>
- <div class="alert alert-success">
- <i class="bi bi-check-circle"></i> 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 %>
- </div>
- <% 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
- %>
- <h2 class="h5 mt-4 <%= gclass %>"><%= gname %> <span class="badge text-bg-light border"><%= items.Count %></span></h2>
- <div class="card shadow-sm mb-3">
- <div class="list-group list-group-flush">
- <% For ri = 0 To items.Count - 1
- Set rr = items(ri)
- daysLate = DateDiff("d", CDate(rr("next_action_date")), Date)
- %>
- <div class="list-group-item">
- <div class="row g-2 align-items-center">
- <div class="col-md-5">
- <a class="fw-semibold text-decoration-none" href="/businesses/<%= rr("id") %>"><%= H(rr("name")) %></a>
- <% If rr("is_customer") = 1 Then %><span class="badge text-bg-success ms-1">Customer</span><% End If %>
- <div class="small text-muted">
- <%= 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 %>
- </div>
- </div>
- <div class="col-md-3 small">
- <% If Len(rr("phone") & "") > 0 Then %><div><i class="bi bi-telephone"></i> <a href="tel:<%= H(rr("phone")) %>" class="text-decoration-none"><%= H(rr("phone")) %></a></div><% End If %>
- <% If Len(rr("email") & "") > 0 Then %><div class="text-truncate"><i class="bi bi-envelope"></i> <a href="mailto:<%= H(rr("email")) %>" class="text-decoration-none"><%= H(rr("email")) %></a></div><% End If %>
- </div>
- <div class="col-md-2 small">
- <span class="<%= gclass %> fw-semibold"><%= Date_Fmt(rr("next_action_date")) %></span>
- <% If daysLate > 0 Then %><div class="text-danger"><%= daysLate %> day<% If daysLate <> 1 Then Response.Write "s" %> late</div>
- <% ElseIf daysLate < 0 Then %><div class="text-muted">in <%= -daysLate %> day<% If daysLate <> -1 Then Response.Write "s" %></div><% End If %>
- </div>
- <div class="col-md-2 text-md-end">
- <a href="/businesses/<%= rr("id") %>" class="btn btn-primary btn-sm">Open</a>
- </div>
- </div>
- <% 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")))
- %>
- <div class="small text-muted mt-1">
- Last: <%= Date_Fmt(rr("last_contacted_at")) %> · <%= lastLine %>
- <% If Len(rr("last_notes") & "") > 0 Then %> — <em><%= H(Left(Replace(Replace(rr("last_notes"), vbCr, " "), vbLf, " "), 140)) %><% If Len(rr("last_notes")) > 140 Then Response.Write "…" %></em><% End If %>
- </div>
- <% End If %>
- </div>
- <% Next %>
- </div>
- </div>
- <%
- End If
- Next
- %>
|