<?php
// আউটপুট বাফারিং
ob_start();

// Session Security Settings (Anti-Hacking)
ini_set('session.cookie_httponly', 1);
ini_set('session.use_only_cookies', 1);
ini_set('session.cookie_samesite', 'Lax');

if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') {
    ini_set('session.cookie_secure', 1); 
}

// নিরাপদ Session Start (Headers sent চেক করে)
if (session_status() === PHP_SESSION_NONE && !headers_sent()) {
    session_start();
}

// Database Credentials
$host = "localhost";
$db_user = "invoiceg_myrdb-v1-v4";
$db_pass = "@##Mdhasan.com24"; // cPanel থেকে এটি পরে পরিবর্তন করে নিয়েন
$db_name = "invoiceg_myrdb-v1";

mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
try {
    $conn = new mysqli($host, $db_user, $db_pass, $db_name);
    $conn->set_charset("utf8mb4"); 
} catch (Exception $e) {
    die("Database Connection Error. Please try again later.");
}

// Google Login Credentials
define('GOOGLE_CLIENT_ID', 'YOUR_GOOGLE_CLIENT_ID');
define('GOOGLE_CLIENT_SECRET', 'YOUR_GOOGLE_CLIENT_SECRET');
define('GOOGLE_REDIRECT_URL', 'https://invoicegeneratorus.com/api/google-login.php');