| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <div class="container mt-3 py-4">
- <h2>Edit User</h2>
- <form method="post">
- <div class="row">
- <div class="col-lg-8 offset-lg-2">
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="title">Title</label>
- <div class="col-sm">
- <select class="form-control" name="title" id="title" required>
- <option value="">Select title</option>
- <?php
- foreach(User::TITLES as $title) {
- $selected = ($user->title == $title) ? "selected" : "";
- ?>
- <option value="<?=htmlspecialchars($title)?>" <?=$selected?>><?=htmlspecialchars($title)?></option>
- <?php
- }
- ?>
- </select>
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="first-name">First Name</label>
- <div class="col-sm">
- <input class="form-control" type="text" name="first_name" id="first-name" placeholder="Enter first name" value="<?=htmlspecialchars($user->first_name)?>" required />
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="last-name">Last Name</label>
- <div class="col-sm">
- <input class="form-control" type="text" name="last_name" id="last-name" placeholder="Enter last name" value="<?=htmlspecialchars($user->last_name)?>" required />
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="gender">Gender</label>
- <div class="col-sm">
- <select class="form-control" name="gender" id="gender" required>
- <option value="">Select gender</option>
- <?php
- foreach(User::GENDERS as $gender) {
- $display = $gender;
- $value = substr($gender, 0, 1);
- $selected = ($user->gender == $value) ? "selected" : "";
- ?>
- <option value="<?=htmlspecialchars($value)?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
- <?php
- }
- ?>
- </select>
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="email">Email Address</label>
- <div class="col-sm">
- <input class="form-control" type="email" name="email" id="email" placeholder="Enter email address" value="<?=htmlspecialchars($user->email)?>" required />
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="phone">Mobile Number</label>
- <div class="col-sm">
- <input class="form-control" type="phone" name="phone" id="phone" placeholder="Enter mobile number" value="<?=htmlspecialchars($user->phone)?>" required />
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="password">Password (if changing)</label>
- <div class="col-sm">
- <input class="form-control" type="password" name="password" id="password" placeholder="Enter password" />
- <small class="text-muted form-text">At least <span data-length-requirement>6 characters</span>. Must contain at least one <span data-lowercase-requirement>lowercase</span>, <span data-uppercase-requirement>uppercase</span>, <span data-number-requirement>number</span> and <span data-special-requirement>special</span> character.</small>
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="password-confirm">Confirm Password</label>
- <div class="col-sm">
- <input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="Confirm password" />
- </div>
- </div>
- <div class="row mb-1">
- <label class="col-sm-4 col-form-label" for="date-of-birth">Date of Birth</label>
- <div class="col-sm">
- <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 />
- </div>
- </div>
- <button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">Submit</button>
- <a class="btn btn-secondary" href="<?=htmlspecialchars($_SERVER["HTTP_REFERER"] ?? "/account/users/$user->id")?>">Cancel</a>
- </div>
- </div>
- </form>
- </div>
|