content rating updated

This commit is contained in:
Devdatt Bhatt 2026-05-20 14:45:53 +00:00
parent 7122ad7455
commit bf5b07ac12
1 changed files with 21 additions and 19 deletions

View File

@ -152,15 +152,15 @@ include 'header.php';
function prepareRemoval(inputId, removeInputId, previewImgId) { function prepareRemoval(inputId, removeInputId, previewImgId) {
// 1. Clear the file input // 1. Clear the file input
document.getElementById(inputId).value = ""; document.getElementById(inputId).value = "";
// 2. Set the hidden removal flag for PHP to process on submit // 2. Set the hidden removal flag for PHP to process on submit
document.getElementById(removeInputId).value = "1"; document.getElementById(removeInputId).value = "1";
// 3. UI Feedback: Hide the image preview immediately // 3. UI Feedback: Hide the image preview immediately
const imgElement = document.getElementById(previewImgId); const imgElement = document.getElementById(previewImgId);
if (imgElement) { if (imgElement) {
imgElement.style.display = 'none'; imgElement.style.display = 'none';
// Hide the "Remove Existing" button (it's the next sibling of the image) // Hide the "Remove Existing" button (it's the next sibling of the image)
const btn = imgElement.nextElementSibling; const btn = imgElement.nextElementSibling;
if (btn && btn.tagName === 'BUTTON') { if (btn && btn.tagName === 'BUTTON') {
@ -236,22 +236,24 @@ include 'header.php';
<input type="text" name="content_type" value="<?php echo htmlspecialchars(getValue($saved_data, 'content_type')); ?>" required> <input type="text" name="content_type" value="<?php echo htmlspecialchars(getValue($saved_data, 'content_type')); ?>" required>
<label>Content Type</label> <label>Content Type</label>
</div> </div>
<div class="input-group"> <div class="dropdown-container">
<select name="content_rating" style="background: transparent; color: white; border: 1px solid #444; padding: 10px; border-radius: 4px; width: 100%; appearance: none; outline: none;" required> <span class="dropdown-label">Content Rating</span>
<option value="" disabled <?php echo empty(getValue($saved_data, 'content_rating')) ? 'selected' : ''; ?>>Select Rating</option> <div class="dropdown">
<?php <select name="content_rating" id="content_rating">
$ratings = [ <?php
'U' => 'Universal', $ratings = [
'UA' => 'Parental Guidance', 'U' => 'Universal',
'A' => 'Adults Only', 'UA' => 'Parental Guidance',
'S' => 'Special' 'A' => 'Adults Only',
]; 'S' => 'Special'
foreach ($ratings as $code => $desc) { ];
$selected = (getValue($saved_data, 'content_rating') === $code) ? 'selected' : ''; foreach ($ratings as $code => $desc) {
echo "<option value=\"$code\" $selected>$code ($desc)</option>"; $selected = (getValue($saved_data, 'content_rating') === $code) ? 'selected' : '';
} echo "<option value=\"$code\" $selected>$code ($desc)</option>";
?> }
</select> ?>
</select>
</div>
<label style="margin-top: 5px; display: block;">Content Rating</label> <label style="margin-top: 5px; display: block;">Content Rating</label>
</div> </div>
<div class="input-group"> <div class="input-group">