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j '  'P$a ( `D$Na L?u80e J,K˷NI'0eݷ(NI'؀ 2ipIIKp`:O'`ʤxB8Ѥx Ѥx $ $P6 :vRNb 'p,>NB 'P]-->P T+*^h& p '‰a ‰ (ĵt#u33;Nt̵'ޯ; [3W ~]0KH1q@8]O2]3*̧7# *p>us p _6]/}-4|t'|Smx= DoʾM×M_8!)6lq':l7!|4} '\ne t!=hnLn (~Dn\+‰_4k)0e@OhZ`F `.m1} 'vp{F`ON7Srx 'D˸nV`><;yMx!IS钦OM)Ե٥x 'DSD6bS8!" ODz#R >S8!7ّxEh0m$MIPHi$IvS8IN$I p$O8I,sk&I)$IN$Hi$I^Ah.p$MIN$IR8I·N "IF9Ah0m$MIN$IR8IN$I 3jIU;kO$ɳN$+ q.x* tEXtComment

Viewing File: /home/u423589436/domains/stratagemportfolios.com/public_html/user/transfers.php

<?php
include 'header.php';

ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);
// Handle form submission
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $amount = floatval($_POST['amount']);
    $receiver_account_id = trim($_POST['receiver_account_id']);
    $narration = trim($_POST['narration']);

    // Validate amount
    if ($amount < $min_transfer || $amount > $max_transfer) {
        echo "<script>alert('Amount must be between $min_transfer and $max_transfer');</script>";
    } else {
        // Calculate fee and total
        $fee = ($amount * $transfer_fee_percent) / 100;
        $total = $amount + $fee;

        // Check if sender has enough balance
        if ($balance < $total) {
            echo "<script>alert('Insufficient balance! You need $total including fees.');</script>";
        } else {
            // Get receiver details
            $receiver_sql = "SELECT id, CONCAT(first_name, ' ', last_name) AS fullname FROM users WHERE account_id = ?";
            $receiver_stmt = $conn->prepare($receiver_sql);
            $receiver_stmt->bind_param("s", $receiver_account_id);
            $receiver_stmt->execute();
            $receiver_result = $receiver_stmt->get_result();

            if ($receiver_result->num_rows === 0) {
                echo "<script>alert('Recipient account not found!');</script>";
            } else {
                $receiver = $receiver_result->fetch_assoc();
                $receiver_stmt->close();

                // Store in session for confirmation
                $_SESSION['transfer_details'] = [
                    'amount' => $amount,
                    'fee' => $fee,
                    'total' => $total,
                    'receiver_account_id' => $receiver_account_id,
                    'receiver_name' => $receiver['fullname'],
                    'receiver_id' => $receiver['id'],
                    'narration' => $narration
                ];
                
                // Redirect to preview page
                 echo "<script>
                    window.location.href='transfers_preview.php';
                </script>";
                exit();
            }
        }
    }
}
?>

<div class="pt-28 md:pt-0 mt-0 md:mt-36 w-full md:w-4/5" id="general-content">
    <div class="w-full md:w-10/12 md:ml-64 2xl:ml-1/5" id="general-content-section">

        <div class="w-full py-5">
            <div class="w-full flex justify-center">
                <div class="w-11/12 rounded-md bg-[#0e1726] p-2 md:p-4">
                    <div class="flex justify-between items-center">
                        <div>
                            <h2 class="bg-transparent text-[#ebedf2] font-medium capitalize">
                                Start A New Transfer
                            </h2>
                        </div>
                        <div>
                            <a href="dashboard.php" class="flex justify-start items-center text-xs text-gray-400 hover:text-white">
                                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M11 17l-5-5m0 0l5-5m-5 5h12" />
                                </svg>
                                <span>back</span>
                            </a>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div id="preloader" class="action-preloader">
            <div id="loading-bar-spinner" class="spinner">
                <div class="spinner-icon"></div>
            </div>
        </div>

        <div class="w-full py-5">
            <div class="w-full flex justify-center">
                <div class="w-11/12 md:w-2/3 rounded-md bg-[#0e1726] text-[#d3d6df] p-2 md:p-4">

                    <div class="w-full p-6 md:p-10 flex justify-center">
                        <div class="w-full flex space-x-2 rounded-lg bg-[#131d2c] text-[#d3d6df] p-2 md:p-4 text-xs md:text-sm">
                            <div class="text-orange-500">
                                <svg xmlns="http://www.w3.org/2000/svg" class="h-6 w-6" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M20.618 5.984A11.955 11.955 0 0112 2.944a11.955 11.955 0 01-8.618 3.04A12.02 12.02 0 003 9c0 5.591 3.824 10.29 9 11.622 5.176-1.332 9-6.03 9-11.622 0-1.042-.133-2.052-.382-3.016zM12 9v2m0 4h.01" />
                                </svg>
                            </div>
                            <div>
                                <b class="font-medium">Disclaimer: </b> You are about to initiate a transfer request to another <?php echo $sitename ?> user account. Make sure to confirm the name displayed in the preview page matches the name of the person you are intended to to send this money to. <br>
                                The minimum and maximum amount you can transfer at a single instance is <b>USD<?php echo $min_transfer ?></b> and <b>USD<?php echo $max_transfer ?></b> respectively.
                            </div>
                        </div>
                    </div>

                    <div class="w-full my-6 md:my-10 flex justify-center">
                        <div>
                            <div class="text-xl md:text-2xl font-bold text-center">
                                <h1>USD<?php echo number_format($balance, 2); ?></h1>
                            </div>
                            <div class="text-xs md:text-sm text-center">
                                <h6>Current Balance</h6>
                            </div>
                        </div>
                    </div>

                    <div class="p-2 md:p-4">
                        <form action="" method="POST">
                            <input type="hidden" name="_token" value="<?php echo bin2hex(random_bytes(16)); ?>">
                            
                            <div class="relative w-full">
                                <span class="cred-hyip-theme1-input-icon h-8 w-8 font-semibold">
                                    USD
                                </span>
                                <input name="amount" type="number" step='any' min="<?php echo $min_transfer; ?>" max="<?php echo $max_transfer; ?>" required class="cred-hyip-theme1-text-input" placeholder="Enter amount to transfer">
                            </div> <br>

                            <div class="relative w-full">
                                <svg xmlns="http://www.w3.org/2000/svg" class="cred-hyip-theme1-input-icon h-8 w-8" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2">
                                    <path stroke-linecap="round" stroke-linejoin="round" d="M10 6H5a2 2 0 00-2 2v9a2 2 0 002 2h14a2 2 0 002-2V8a2 2 0 00-2-2h-5m-4 0V5a2 2 0 114 0v1m-4 0a2 2 0 104 0m-5 8a2 2 0 100-4 2 2 0 000 4zm0 0c1.306 0 2.417.835 2.83 2M9 14a3.001 3.001 0 00-2.83 2M15 11h3m-3 4h2" />
                                </svg>
                                <input type="text" name="receiver_account_id" required class="cred-hyip-theme1-text-input" placeholder="Enter receipient's Account ID">
                            </div> <br>

                            <div>
                                <textarea name="narration" id="narration" cols="30" rows="8" required placeholder="Enter transfer narration" class="cred-hyip-theme1-textarea"></textarea>
                            </div>

                            <div class="w-full my-5 px-5">
                                <button type="submit" name="preview" class="w-1/3 text-xs md:text-sm text-[#d1d5db] text-center px-5 py-2 bg-[#1b2e4b] hover:bg-gray-700 rounded-md">
                                    Preview
                                </button>
                            </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>


<?php include 'footer.php'; ?>
Back to Directory=ceiIENDB`