<?php
// db.php

$host   = 'localhost';
$port   = 5432;
$dbname = 'dimoi_accessibility';
$user   = 'postgres';
$pass   = 'postgresse!';

// Google Maps API Key
$googleMapsApiKey = 'AIzaSyBrJuLjZmJIwH8w6ZJRIEPD9OHjTlrTSs0';

try {
    $pdo = new PDO(
        "pgsql:host=$host;port=$port;dbname=$dbname",
        $user,
        $pass,
        [
            PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
            PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC
        ]
    );
} catch (PDOException $e) {
    echo json_encode([
        'status'  => 'error',
        'message' => 'DB connection failed'
    ]);
    exit;
}

?>
