25'ten fazla konu seçemezsiniz Konular bir harf veya rakamla başlamalı, kısa çizgiler ('-') içerebilir ve en fazla 35 karakter uzunluğunda olabilir.

76 satır
2.9KB

  1. <%
  2. '=======================================================================================================================
  3. ' BUSINESS HELPERS: domain vocabulary (touch methods, outcomes, statuses) and list query-string building
  4. '=======================================================================================================================
  5. ' Touch methods and outcomes: Array(key, label)
  6. Function Businesses_Methods()
  7. Businesses_Methods = Array(Array("call", "Call"), Array("email", "Email"), Array("visit", "Visit"), Array("mail", "Mailed"))
  8. End Function
  9. Function Businesses_Outcomes()
  10. Businesses_Outcomes = Array( _
  11. Array("no_answer", "No answer"), _
  12. Array("left_voicemail", "Left voicemail"), _
  13. Array("spoke_with_someone", "Spoke with someone"), _
  14. Array("interested", "Interested"), _
  15. Array("follow_up_later", "Follow up later"), _
  16. Array("not_interested", "Not interested"), _
  17. Array("wrong_number", "Wrong number"), _
  18. Array("remove", "Remove from list") _
  19. )
  20. End Function
  21. ' Label for a key in one of the Array(key, label) lists above (the key itself when unknown).
  22. Function Businesses_Label(list, key)
  23. Dim item
  24. Businesses_Label = key & ""
  25. For Each item In list
  26. If item(0) = key Then Businesses_Label = item(1)
  27. Next
  28. End Function
  29. Function Businesses_IsKey(list, key)
  30. Dim item
  31. Businesses_IsKey = False
  32. For Each item In list
  33. If item(0) = key Then Businesses_IsKey = True
  34. Next
  35. End Function
  36. Function Businesses_StatusLabel(s)
  37. Select Case s
  38. Case "new": Businesses_StatusLabel = "New"
  39. Case "contacted": Businesses_StatusLabel = "Contacted"
  40. Case "follow_up": Businesses_StatusLabel = "Follow-up"
  41. Case "removed": Businesses_StatusLabel = "Removed"
  42. Case Else: Businesses_StatusLabel = s & ""
  43. End Select
  44. End Function
  45. Function Businesses_StatusClass(s)
  46. Select Case s
  47. Case "new": Businesses_StatusClass = "text-bg-secondary"
  48. Case "contacted": Businesses_StatusClass = "text-bg-info"
  49. Case "follow_up": Businesses_StatusClass = "text-bg-warning"
  50. Case "removed": Businesses_StatusClass = "text-bg-dark"
  51. Case Else: Businesses_StatusClass = "text-bg-light"
  52. End Select
  53. End Function
  54. ' Query string for the list: current filters with optional page / sort overrides.
  55. Function Businesses_QS(f, page, sort, dir)
  56. Dim k, s
  57. s = ""
  58. For Each k In Array("q", "industry", "status", "show", "contacted", "phone")
  59. If f.Exists(k) Then
  60. If Len(f(k)) > 0 Then s = s & "&" & k & "=" & Server.URLEncode(f(k))
  61. End If
  62. Next
  63. If Len(sort) > 0 Then s = s & "&sort=" & Server.URLEncode(sort)
  64. If Len(dir) > 0 Then s = s & "&dir=" & Server.URLEncode(dir)
  65. If page > 1 Then s = s & "&page=" & page
  66. If Len(s) > 0 Then Businesses_QS = "?" & Mid(s, 2) Else Businesses_QS = ""
  67. End Function
  68. %>

Powered by TurnKey Linux.