您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

110 行
5.4KB

  1. <div class="page-header">
  2. <h1>Edit Household</h1>
  3. <a class="button button-secondary button-sm" href="/households/<?= e($household['id']) ?>">← Back</a>
  4. </div>
  5. <div class="section-panel">
  6. <?php if (!empty($errors['_token'])): ?>
  7. <div class="alert alert-error"><?= e($errors['_token'][0]) ?></div>
  8. <?php endif; ?>
  9. <form method="POST" action="/households/<?= e($household['id']) ?>" novalidate>
  10. <?= csrf_field() ?>
  11. <div class="form-grid">
  12. <div class="field" style="grid-column:1/-1">
  13. <label for="territory_id">Territory <span style="color:#c0392b">*</span></label>
  14. <select class="input <?= isset($errors['territory_id']) ? 'input-error' : '' ?>"
  15. id="territory_id" name="territory_id" required>
  16. <option value="">Select a territory…</option>
  17. <?php foreach ($territories as $t): ?>
  18. <option value="<?= e($t['id']) ?>"
  19. <?= (string) $household['territory_id'] === (string) $t['id'] ? 'selected' : '' ?>>
  20. <?= e($t['name']) ?>
  21. </option>
  22. <?php endforeach; ?>
  23. </select>
  24. <?php if (isset($errors['territory_id'])): ?>
  25. <span class="field-error"><?= e($errors['territory_id'][0]) ?></span>
  26. <?php endif; ?>
  27. </div>
  28. <div class="field" style="grid-column:1/-1">
  29. <label for="address">Address <span style="color:#c0392b">*</span></label>
  30. <input class="input <?= isset($errors['address']) ? 'input-error' : '' ?>"
  31. type="text" id="address" name="address"
  32. value="<?= e((string) ($household['address'] ?? '')) ?>" required autofocus>
  33. <?php if (isset($errors['address'])): ?>
  34. <span class="field-error"><?= e($errors['address'][0]) ?></span>
  35. <?php endif; ?>
  36. </div>
  37. <div class="field">
  38. <label for="street_number">Street Number</label>
  39. <input class="input" type="number" id="street_number" name="street_number"
  40. value="<?= e((string) ($household['street_number'] ?? '')) ?>">
  41. </div>
  42. <div class="field">
  43. <label for="street_name">Street Name</label>
  44. <input class="input" type="text" id="street_name" name="street_name"
  45. value="<?= e((string) ($household['street_name'] ?? '')) ?>">
  46. </div>
  47. <div class="field">
  48. <label for="latitude">Latitude</label>
  49. <input class="input" type="text" id="latitude" name="latitude"
  50. value="<?= e((string) ($household['latitude'] ?? '')) ?>">
  51. </div>
  52. <div class="field">
  53. <label for="longitude">Longitude</label>
  54. <input class="input" type="text" id="longitude" name="longitude"
  55. value="<?= e((string) ($household['longitude'] ?? '')) ?>">
  56. </div>
  57. <div class="field" style="grid-column:1/-1">
  58. <label class="checkbox-label">
  59. <input type="checkbox" name="is_business" value="1"
  60. <?= $household['is_business'] ? 'checked' : '' ?>>
  61. This is a business
  62. </label>
  63. </div>
  64. <div class="field" style="grid-column:1/-1">
  65. <label class="checkbox-label">
  66. <input type="checkbox" name="do_not_call" value="1" id="dnc_check"
  67. <?= $household['do_not_call'] ? 'checked' : '' ?>
  68. onchange="document.getElementById('dnc_fields').style.display=this.checked?'grid':'none'">
  69. Do Not Call
  70. </label>
  71. </div>
  72. <div id="dnc_fields" class="form-grid" style="grid-column:1/-1;display:<?= $household['do_not_call'] ? 'grid' : 'none' ?>">
  73. <div class="field">
  74. <label for="do_not_call_date">DNC Date</label>
  75. <input class="input" type="date" id="do_not_call_date" name="do_not_call_date"
  76. value="<?= e((string) ($household['do_not_call_date'] ?? '')) ?>">
  77. </div>
  78. <div class="field" style="grid-column:1/-1">
  79. <label for="do_not_call_notes">Public Notes</label>
  80. <textarea class="input" id="do_not_call_notes" name="do_not_call_notes"
  81. rows="2"><?= e((string) ($household['do_not_call_notes'] ?? '')) ?></textarea>
  82. </div>
  83. <div class="field" style="grid-column:1/-1">
  84. <label for="do_not_call_private_notes">Private Notes</label>
  85. <textarea class="input" id="do_not_call_private_notes" name="do_not_call_private_notes"
  86. rows="2"><?= e((string) ($household['do_not_call_private_notes'] ?? '')) ?></textarea>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="form-actions" style="margin-top:1.5rem">
  91. <button class="button button-primary" type="submit">Save Changes</button>
  92. <a class="button button-secondary" href="/households/<?= e($household['id']) ?>">Cancel</a>
  93. </div>
  94. </form>
  95. </div>

Powered by TurnKey Linux.