// ===== DELETE ALL PHOTOS ===== if (isset($_POST['deleteAll'])) { $files = glob($uploadDir . '*.{jpg,jpeg,png,gif,webp}', GLOB_BRACE); foreach ($files as $file) { if (is_file($file)) unlink($file); } $message = "All photos deleted successfully."; } // ===== UPLOAD PHOTOS ===== if (isset($_POST['upload'])) { foreach ($_FILES["photos"]["tmp_name"] as $key => $tmpName) { $fileName = basename($_FILES["photos"]["name"][$key]); $targetFile = $uploadDir . strtolower(str_replace(" ", "-", $fileName)); if (move_uploaded_file($tmpName, $targetFile)) $message = "Images uploaded successfully."; else $message = "Upload failed."; } } // ===== GET EXISTING FILES ===== $images = glob($uploadDir . '*.{jpg,jpeg,png,gif,webp}', GLOB_BRACE); ?> Property Admin Panel

Property Admin Panel

Existing Photos