<?php



// Database connection settings
$host = "localhost";
$dbname = "ftfcvgse_tracker";
$username = "ftfcvgse_tracker";  // Change if using a different MySQL user
$password = "ftfcvgse_tracker";  // Set password if required

try {
    $pdo = new PDO("mysql:host=$host;dbname=$dbname;charset=utf8mb4", $username, $password);
    $pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
} catch (PDOException $e) {
    die("Database connection failed: " . $e->getMessage());
}



date_default_timezone_set('Africa/Lagos');




$query = $pdo->prepare("SELECT * FROM settings ORDER BY id DESC LIMIT 1");
$query->execute();
$row = $query->fetch(PDO::FETCH_ASSOC);

if ($row) {
    // Assign fetched values to variables for site-wide use
    $title = $row['title'];
    $id = $row['id'];
    $welc_head = $row['welc_head'];
    $welc_msg = $row['welc_msg'];
    $url = $row['url'];
    $ceo = $row['ceo'];
    $domain = $row['domain'];
    $domain_name = $row['domain_name'];
    $phone = $row['phone'];
    $country = $row['country'];
    $state = $row['state'];
    $city = $row['city'];
    $address = $row['address'];
    $email = $row['email'];
    $email2 = $row['email2'];
    $copyright = $row['copyright'];
    $contact_email = $row['contact_email'];
    $developa = $row['developa'];
    
    // Exchange rates
    $sell_rate = $row['sell_rate'];
    $buy_rate = $row['buy_rate'];
    
    $GHS = $row['GHS'];
    $EUR = $row['EUR'];
    $NGN = $row['NGN'];
    $CAD = $row['CAD'];
    $GBP = $row['GBP'];
    $ZAR = $row['ZAR'];
    $USD = $row['USD'];
    $AUD = $row['AUD'];
    $JPY = $row['JPY'];
    $CNY = $row['CNY'];

    // Statistics
    $reg_clients = $row['reg_clients'];
    $btc_sold = $row['btc_sold'];
    $btc_bought = $row['btc_bought'];
    
    // Home sections
    $news_head = $row['news_head'];
    $news_msg = $row['news_msg'];
    $about_head = $row['about_head'];
    $about_msg = $row['about_msg'];

    // Services
    $service1 = $row['service1'];
    $service2 = $row['service2'];
    $service3 = $row['service3'];
    
    
     

    // WhatsApp
    $whatsapp = $row['whatsapp'];
}





?>
