customer_form.php 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <div class="container mt-3 py-4">
  2. <h2><?=htmlspecialchars($page_title)?></h2>
  3. <form method="post">
  4. <div class="row form-group">
  5. <label class="col-sm-4 col-form-label" for="name">Name</label>
  6. <div class="col-sm">
  7. <input class="form-control" type="text" name="name" id="name" placeholder="Enter name" value="<?=htmlspecialchars($customer->name)?>" required />
  8. </div>
  9. </div>
  10. <div class="row form-group">
  11. <label class="col-sm-4 col-form-label" for="address-1">Address Line 1</label>
  12. <div class="col-sm">
  13. <input class="form-control" type="text" name="address_1" id="address-1" placeholder="Enter address line 1" value="<?=htmlspecialchars($customer->address_1)?>" />
  14. </div>
  15. </div>
  16. <div class="row form-group">
  17. <label class="col-sm-4 col-form-label" for="address-2">Address Line 2</label>
  18. <div class="col-sm">
  19. <input class="form-control" type="text" name="address_2" id="address-2" placeholder="Enter address line 2" value="<?=htmlspecialchars($customer->address_2)?>" />
  20. </div>
  21. </div>
  22. <div class="row form-group">
  23. <label class="col-sm-4 col-form-label" for="city">City</label>
  24. <div class="col-sm">
  25. <input class="form-control" type="text" name="city" id="city" placeholder="Enter city" value="<?=htmlspecialchars($customer->city)?>" />
  26. </div>
  27. </div>
  28. <div class="row form-group">
  29. <label class="col-sm-4 col-form-label" for="county">County</label>
  30. <div class="col-sm">
  31. <input class="form-control" type="text" name="county" id="county" placeholder="Enter county" value="<?=htmlspecialchars($customer->county)?>" />
  32. </div>
  33. </div>
  34. <div class="row form-group">
  35. <label class="col-sm-4 col-form-label" for="postal-code">Postal Code</label>
  36. <div class="col-sm">
  37. <input class="form-control" type="text" name="postal_code" id="postal-code" placeholder="Enter postal code" value="<?=htmlspecialchars($customer->postal_code)?>" />
  38. </div>
  39. </div>
  40. <div class="row form-group">
  41. <label class="col-sm-4 col-form-label" for="country">Country</label>
  42. <div class="col-sm">
  43. <select class="form-control" name="country" id="country">
  44. <?=Form::renderCountryOptions($customer->country)?>
  45. </select>
  46. </div>
  47. </div>
  48. <div class="row form-group">
  49. <label class="col-sm-4 col-form-label" for="email">Email Address</label>
  50. <div class="col-sm">
  51. <input class="form-control" type="email" name="email" id="email" placeholder="Enter email address" value="<?=htmlspecialchars($customer->email)?>" />
  52. </div>
  53. </div>
  54. <div class="row form-group">
  55. <label class="col-sm-4 col-form-label" for="phone">Contact Number</label>
  56. <div class="col-sm">
  57. <input class="form-control" type="text" name="phone" id="phone" placeholder="Enter contact number" value="<?=htmlspecialchars($customer->phone)?>" />
  58. </div>
  59. </div>
  60. <div class="row form-group">
  61. <label class="col-sm-4 col-form-label" for="invoice-contact-name">Invoice Contact Name</label>
  62. <div class="col-sm">
  63. <input class="form-control" type="text" name="invoice_contact_name" id="invoice-contact-name" placeholder="Enter invoice contact name" value="<?=htmlspecialchars($customer->invoice_contact_name)?>" />
  64. </div>
  65. </div>
  66. <div class="row form-group">
  67. <label class="col-sm-4 col-form-label" for="year-cycle-month">
  68. Year Cycle Month
  69. </label>
  70. <div class="col-sm">
  71. <select class="form-control" name="year_cycle_month" id="year-cycle-month">
  72. <option value="">Select Month</option>
  73. <?php
  74. foreach(range(1, 12) as $month) {
  75. $display_month = sprintf("%02d", $month);
  76. $selected = ($customer->year_cycle_month == $month) ? "selected" : "";
  77. ?>
  78. <option value="<?=$month?>" <?=$selected?>><?=$display_month?></option>
  79. <?php
  80. }
  81. ?>
  82. </select>
  83. </div>
  84. </div>
  85. <div class="row my-3">
  86. <div class="col-sm offset-sm-4">
  87. <div class="form-check">
  88. <input class="form-check-input" type="checkbox" name="email_after_test" id="email-after-test" value="1" <?=Form::checked($customer->email_after_test)?> />
  89. <label for="email-after-test">Email After Test</label>
  90. </div>
  91. <div class="form-check">
  92. <input class="form-check-input" type="checkbox" name="email_locations_after_test" id="email-locations-after-test" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
  93. <label for="email-locations-after-test">Email to Locations After Test</label>
  94. </div>
  95. <button class="btn btn-primary" type="submit" name="submit" value="<?=$_SESSION["csrf_token"]?>">Submit</button>
  96. </div>
  97. </div>
  98. </form>
  99. </div>