<?php

// ===============================================
// 1. Define Base URL for Local vs. Live Server
// ===============================================

// Check if we are on the live server
if (isset($_SERVER['HTTP_HOST']) && ($_SERVER['HTTP_HOST'] == 'www.swarnavahini.lk' || $_SERVER['HTTP_HOST'] == 'swarnavahini.lk')) {
    // Live Server
    define('BASE_URL', '/');
} else {
    // Local Server
    define('BASE_URL', '/swarnawahini_web_stable/');
}


// ===============================================
// 2. API Key Rotation (Your existing code)
// ===============================================

// Define both API keys
$api_keys = [
    'AIzaSyBtWZ66L-tJPYfTk1gHpHYpHNr5gn0KlLY',
    'AIzaSyBAON_ChCgF5BEXX7ijp--GImeRmAHdUBY'
];

// Get current hour
$currentHour = date('H'); // 00 - 23

// Rotate every 12 hours
if ($currentHour < 12) {
    $api_key = $api_keys[0]; // First key from midnight to noon
} else {
    $api_key = $api_keys[1]; // Second key from noon to midnight
}

// Use the key
// echo "Using API Key: " . $api_key;
// ?>