<?php
// Database configuration
$host = 'dprintdgwdev.mysql.db';
$dbname = 'dprintdgwdev';
$username = 'dprintdgwdev';
$password = 'hv6ABD9zK4tKGaLP';

// Email configuration
$recipient_email = 'twoja@partyplanerka.pl';
$sender_domain = 'partyplanerka.pl';
$company_name = 'Intersnack Poland';

function getDatabaseConnection()
{
    global $host, $dbname, $username, $password;
    try {
        $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
        $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
        return $pdo;
    } catch (PDOException $e) {
        http_response_code(500);
        header('Content-Type: application/json');
        echo json_encode(['success' => false, 'message' => 'Database connection failed: ' . $e->getMessage()]);
        exit;
    }
}
?>