<?php
/**
 * Rig N Dig - Mobile API v1 / Global Config
 */
header('Content-Type: application/json');
require_once '../../config/config.php';
require_once '../../includes/functions.php';
require_once 'api_helper.php';

try {
    $config = [
        'company_name' => setting('company_name', 'Rig N Dig'),
        'support_email' => setting('email', 'support@rigndig.com'),
        'support_phone' => setting('phone', ''),
        'whatsapp' => setting('whatsapp', ''),
        'address' => setting('address', ''),
        'api_version' => APP_VERSION,
        'site_url' => SITE_URL,
        'logo_url' => rtrim(SITE_URL, '/') . '/uploads/' . setting('logo', 'logo.png'),
    ];

    apiResponse(true, 'Configuration loaded', $config);
} catch (Exception $e) {
    apiResponse(false, 'Failed to load configuration');
}
