This commit is contained in:
2025-04-06 19:31:59 -06:00
parent ab00581dc6
commit 84d38dbeb3
3 changed files with 38 additions and 0 deletions
+32
View File
@@ -365,6 +365,36 @@ function update_username($user_id, $new_username, $verify_new_username)
$stmt->execute();
}
function update_profile_picture_form()
{
$form = '
<div class="form_card">
<h5 class="underline">Update Profile Picture</h5>
<span class="modal_close">&times;</span>
<form method="post">
<input type="hidden" name="form_id" value="update_profile_picture_form">
<input type="hidden" name="user_id" value="' . $_GET['user_id'] . '">
<input type="hidden" name="crop_x" value="" id="crop_x">
<input type="hidden" name="crop_y" value="" id="crop_y">
<input type="hidden" name="crop_width" value="" id="crop_width">
<label for="profile_picture" class="upload_button modal_button" id="profile_cropper_button">Upload a Profile Picture</label>
<input id="profile_picture" class="file_input" name="profile_picture" type="file" accept="image/png, image/jpeg, image/jpg">
<small class="file_input_feedback">No file selected.</small>
<input type="submit" class="button" value="Update Username">
</form>
<script src="js/profile_picture_cropper_modal.js"></script>
<script src="js/upload.js"></script>
</div>
';
return $form;
}
function update_profile_picture($user_id) {}
function request_role_change_form()
{
$conn = get_connection();
@@ -565,6 +595,7 @@ function user_view($user_id)
<button id="reset_pw_form_button" class="modal_button underline">Reset Password</button>
<button id="update_email_form_button" class="modal_button underline">Update Email</button>
<button id="update_username_form_button" class="modal_button underline">Update Username</button>
<button id="update_profile_picture_form_button" class="modal_button underline">Update Profile Picture</button>
<button id="request_role_form_button" class="modal_button underline">Request Role</button>
<button id="delete_account_form_button" class="modal_button underline">Delete Account</button>
</div>
@@ -577,6 +608,7 @@ function user_view($user_id)
<div id="reset_pw_form" class="modal_form">' . reset_pw_form() . '</div>
<div id="update_email_form" class="modal_form">' . update_email_form() . '</div>
<div id="update_username_form" class="modal_form">' . update_username_form() . '</div>
<div id="update_profile_picture_form" class="modal_form">' . update_profile_picture_form() . '</div>
<div id="request_role_change_form" class="modal_form">' . request_role_change_form() . '</div>
<div id="delete_account_form" class="modal_form">' . delete_account_form() . '</div>
</div>