<?php
include 'header.php';

$err = "";

if ($status == "Unverified") {
    echo customAlert('error', 'Please Verify Your KYC To Get full Access to the website');
    echo pageRedirect('4', 'status.php');
}
?>



<?php

    if($err != ""){
        echo customAlert('error', $err);
    }

    // if ($msg != "") {
    //  echo customAlert('success', $msg);
    //  // echo pageRedirect('3', '../wallet/index.html');
    // }

?>

<div class="appHeader" style="background-color:#161129">
    <div class="left">
        <a href="#" class="headerButton" data-bs-toggle="modal" data-bs-target="#sidebarPanel"> <i
                class="fas fa-bars text-white"></i> </a>
    </div>
    <div class="pageTitle text-white">
        Investment History
    </div>
    <div class="right">
        <a href="Notifications.php" class="headerButton"> <i class="fas fa-bell text-white"></i> <span
                class="badge badge-danger">0</span> </a>
        <a href="logout.php" class="headerButton"> <i
                class="fas fa-sign-out-alt text-white"></i></a>
    </div>
</div>
<div class="col-lg-12" style="margin-top: 50px!important;">
    <div class="card">
        <div class="card-header">
            <span><i class="fa fa-caret-down"></i> <span class="font-weight-bold">Previous Stake</span></span>
        </div>
        <div class="card-body">
            <div class="card">
                <?php
                    $stakes = mysqli_query($link, "SELECT * FROM stakes WHERE userId = '$userid' ORDER BY id DESC ");
                    if(mysqli_num_rows($stakes) > 0){
                        while ($roww = mysqli_fetch_assoc($stakes)) {
                ?>

                <div class="card-body">
                    <p>Plan - <strong><?php echo $roww['plan'] ?></strong> </p>
                    <p>Stake Amount - <strong><?php echo $roww['amount'] ?>USD</strong> </p>
                    <p>Profit Percent - <strong><?php echo $roww['percent'] ?>%</strong> </p>
                    <p>Period - <strong><?php echo $roww['period'] ?> Days</strong> </p>
                    <p>Start Date - <strong><?php echo $roww['start_date'] ?></strong> </p>
                    <p>End Date - <strong><?php echo $roww['end_date'] ?></strong> </p>
                    <p>Status - <strong class="badge badge-primary"><?php echo $roww['status'] ?></strong> </p>
                </div>
                <?php
                    }
                }else{
                ?>

                <div class="card-body" align="center">
                    <i class="fa fa-exclamation-triangle text-primary fa-2x"></i><br>
                    <strong>No Records Found!</strong>
                </div>
                <?php } ?>
            </div>
        </div>
        <div class="card-footer">
            <div class="card-footer-content text-muted">
            </div>
        </div>
    </div>
</div>

<style>
    .sidebar-balance {
        background: #000000;
    }

    .action-group {
        background: #000000;
    }

    .modal-body.p-0 {
        background: white;
    }

    ul.listview.flush.transparent.image-listview {
        background: white;
        box-shadow: 0 1px 3px 0 rgb(0 0 0 / 9%);
    }

    body.dark-mode .image-listview>li a.item {
        color: #000000 !important;
    }

    .icon-box.bg-primary {
        background: #000000 !important;
    }

    span.badge.badge-primary {
        background: #000000 !important;
    }
</style>

<?php
  include 'footer.php';
?>