user_edit_form.php 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <div class="container mt-3 py-4">
  2. <h2>Edit User</h2>
  3. <form method="post">
  4. <div class="row">
  5. <div class="col-md-2">
  6. <div class="form-group">
  7. <label for="title">Title</label>
  8. <select class="form-control" name="title" id="title" required>
  9. <option value="">Select Title</option>
  10. <?php
  11. foreach(User::TITLES as $title) {
  12. $selected = ($user->title == $title) ? "selected" : "";
  13. ?>
  14. <option value="<?=htmlspecialchars($title)?>" <?=$selected?>><?=htmlspecialchars($title)?></option>
  15. <?php
  16. }
  17. ?>
  18. </select>
  19. </div>
  20. </div>
  21. <div class="col-md">
  22. <div class="form-group">
  23. <label for="first-name">First Name</label>
  24. <input class="form-control" type="text" name="first_name" id="first-name" placeholder="Enter first name" value="<?=htmlspecialchars($user->first_name)?>" required />
  25. </div>
  26. </div>
  27. <div class="col-md">
  28. <div class="form-group">
  29. <label for="last-name">Last Name</label>
  30. <input class="form-control" type="text" name="last_name" id="last-name" placeholder="Enter last name" value="<?=htmlspecialchars($user->last_name)?>" required />
  31. </div>
  32. </div>
  33. </div>
  34. <div class="row">
  35. <div class="col-md">
  36. <div class="form-group">
  37. <label for="email">Email Address</label>
  38. <input class="form-control" type="email" name="email" id="email" value="" placeholder="Enter email address" value="<?=htmlspecialchars($user->email)?>" required />
  39. </div>
  40. </div>
  41. <div class="col-md">
  42. <div class="form-group">
  43. <label for="phone">Mobile Number</label>
  44. <input class="form-control" type="phone" name="phone" id="phone" value="" placeholder="Enter mobile number" value="<?=htmlspecialchars($user->phone)?>" required />
  45. </div>
  46. </div>
  47. </div>
  48. <div class="row">
  49. <div class="col-md">
  50. <div class="form-group">
  51. <label for="password">Password (if changing)</label>
  52. <input class="form-control" type="password" name="password" id="password" placeholder="Enter password" required />
  53. </div>
  54. </div>
  55. <div class="col-md">
  56. <div class="form-group">
  57. <label for="password-confirm">Confirm Password</label>
  58. <input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="Confirm password" required />
  59. </div>
  60. </div>
  61. </div>
  62. <div class="row">
  63. <div class="col-md">
  64. <div class="form-group">
  65. <label for="date-of-birth">Date of Birth</label>
  66. <input class="form-control" type="date" name="date_of_birth" id="date-of-birth" placeholder="YYYY-MM-DD" value="<?=htmlspecialchars($user->date_of_birth)?>" required />
  67. </div>
  68. </div>
  69. </div>
  70. <button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">Submit</button>
  71. </form>
  72. </div>