<?php

include('php/database.php');
include('php/security.php');
session_start();
if (logged_in()) {
    header('location:../login.php');
}
$id = $_SESSION['id'];
$results = mysqli_query($connection, "SELECT `date`, `id`, `name`, `email`, `number`, `password`, `phone`, `address`, `country`, `gender`, `image`, `vcode`, `verified`, `verify`, `balance`, `totalbalance`, `investbalance`, `profit`, `totaldeposit`, `totalwithdrawal`, `loanlimit`, `availableloan`, `ongoingloan`, `savings`, `idcard`, `idcardback`, `accountstatus`, `pina`, `pinb`, `pinc`, `pind` FROM users WHERE id ='$id'");
$retrive = mysqli_fetch_array($results);
$date = $retrive['date'];
$id = $retrive['id'];
$name = $retrive['name'];
$email = $retrive['email'];
$number = $retrive['number'];
$password = $retrive['password'];
$phone = $retrive['phone'];
$address = $retrive['address'];
$country = $retrive['country'];
$gender = $retrive['gender'];
$image = $retrive['image'];
$vcode = $retrive['vcode'];
$verified = $retrive['verified'];
$verify = $retrive['verify'];
$balance = $retrive['balance'];
$totalbalance = $retrive['totalbalance'];
$investbalance = $retrive['investbalance'];
$profit = $retrive['profit'];
$totaldeposit = $retrive['totaldeposit'];
$totalwithdrawal = $retrive['totalwithdrawal'];
$loanlimit = $retrive['loanlimit'];
$availableloan = $retrive['availableloan'];
$ongoingloan = $retrive['ongoingloan'];
$savings = $retrive['savings'];
$idcard = $retrive['idcard'];
$idcardback = $retrive['idcardback'];
$accountstatus = $retrive['accountstatus'];
$pina = $retrive['pina'];
$pinb = $retrive['pinb'];
$pinc = $retrive['pinc'];
$pind = $retrive['pind'];

?>


<!DOCTYPE html>
<html lang="en">


<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <!-- Mobile Specific Metas -->
    <meta name="viewport" content="width=device-width, initial-scale=0.7, viewport-fit=cover">
    <title>Success</title>
    <link rel="apple-touch-icon" sizes="192x192" href="app/icons/icon-192x192.png">
    <script src="https://cdn.tailwindcss.com"></script>

    <style>
        @keyframes fadeIn {
            from {
                opacity: 0;
            }

            to {
                opacity: 1;
            }
        }

        .preloader {
            animation: fadeIn 1s ease-in-out;
        }
    </style>
</head>

<body class="flex items-center justify-center min-h-screen bg-gray-100">
    <!-- Preloader -->
    <div class="absolute inset-0 flex items-center justify-center bg-white z-50 preloader">
        <div class="animate-spin rounded-full h-16 w-16 border-t-4 border-blue-900/80"></div>
    </div>

    <!-- Success Card -->
    <div class="bg-white w-full  shadow-lg rounded-2xl p-8 max-w-md text-center relative z-10 hidden"
        id="successMessage">
        <div class="flex items-center justify-center w-20 h-20 mx-auto bg-green-100 rounded-full">
            <svg xmlns="http://www.w3.org/2000/svg" class="w-12 h-12 text-green-600" viewBox="0 0 24 24" fill="none"
                stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
                <path d="M5 13l4 4L19 7" />
            </svg>
        </div>
        <h2 class="mt-4 text-2xl font-bold text-gray-800">Success!</h2>
        <p class="mt-2 text-gray-600"> <?php if (isset($_SESSION['status'])) {
            echo $_SESSION['status'];
            unset($_SESSION['status']);
        }

        ?></p>

        <div class="mt-6 flex flex-col gap-3">
            <a href="index.php"
                class="w-full bg-blue-300/80 text-white py-2 px-4 rounded-lg hover:bg-blue-300/40 transition">Go
                Home</a>
        </div>
        <br>
        <div class="gtranslate_wrapper"></div>
        <script>window.gtranslateSettings = { "default_language": "en", "detect_browser_language": true, "wrapper_selector": ".gtranslate_wrapper" }</script>
        <script src="https://cdn.gtranslate.net/widgets/latest/dropdown.js" defer></script>
    </div>

    <script>
        // Simulate preloader and then show success message
        setTimeout(() => {
            document.querySelector('.preloader').style.display = 'none';
            document.getElementById('successMessage').classList.remove('hidden');
        }, 2000);
    </script>
    &nbsp; &nbsp;
</body>

</html>