Fixed some bugs

This commit is contained in:
twotalesanimation
2025-12-13 19:25:47 +02:00
parent 32e50ffc39
commit a66382661d
19 changed files with 263 additions and 187 deletions

View File

@@ -38,13 +38,8 @@ if (isset($_FILES['thumbnail']) && $_FILES['thumbnail']['error'] !== UPLOAD_ERR_
}
$uploadDir = "assets/uploads/campsites/";
if (!is_dir($uploadDir)) {
mkdir($uploadDir, 0755, true);
}
if (!is_writable($uploadDir)) {
http_response_code(500);
die('Upload directory is not writable.');
if (!file_exists($uploadDir)) {
mkdir($uploadDir, 0777, true);
}
$randomFilename = $validationResult['filename'];

View File

@@ -221,6 +221,7 @@ $bannerImages = glob($bannerFolder . '*.{jpg,jpeg,png,webp}', GLOB_BRACE);
.then(response => response.json())
.then(data => {
if (data.status === 'success') {
alert('Trip deleted successfully!');
card.style.animation = 'fadeOut 0.3s ease-out';
setTimeout(() => {
card.remove();
@@ -236,21 +237,6 @@ $bannerImages = glob($bannerFolder . '*.{jpg,jpeg,png,webp}', GLOB_BRACE);
console.error('Error:', err);
alert('Delete failed due to network error.');
});
'success') {
card.fadeOut(function() {
$(this).remove();
if ($('.trip-card').length === 0) {
location.reload();
}
});
} else {
alert('Error: ' + response.message);
}
},
error: function() {
alert('Error deleting trip');
}
});
});
});
</script>