<?php
$mysqli = new mysqli("localhost", "root", "", "constra_db");
if ($mysqli->connect_error) die("Connection failed: " . $mysqli->connect_error);

$updates = [
    'City Center Foundation' => 'http://localhost/constra/public/uploads/banners/banner1.png',
    'Modern Villa Design' => 'http://localhost/constra/public/uploads/categories/residential.png',
    'Interior Renovation' => 'http://localhost/constra/public/uploads/services/renovation_and_remodeling.png',
    'Skyscraper Construction' => 'http://localhost/constra/public/uploads/banners/banner2.png',
    'Heavy Machinery at Work' => 'http://localhost/constra/public/uploads/categories/industrial.png',
    'Architectural Blueprint' => 'http://localhost/constra/public/uploads/services/design-build.png',
    'City Center Plaza' => 'http://localhost/constra/public/uploads/projects/city_center_plaza.png',
    'Green Valley Residences' => 'http://localhost/constra/public/uploads/projects/green_valley_residences.png',
    'Skyline Bridge' => 'http://localhost/constra/public/uploads/projects/skyline_bridge.png'
];

foreach ($updates as $title => $path) {
    $mysqli->query("UPDATE gallery SET file_path = '$path' WHERE title = '$title'");
}

echo "Gallery paths updated to local files";
$mysqli->close();
?>
