<!DOCTYPE html>
<html>

<head>
<?php include 'header.php'; ?>
</head>

<body id="page-top" class="bgb">
    <div id="wrapper">
    <?php include 'sidebar.php';    ?> 


    <div class="d-flex flex-column" id="content-wrapper"
        style="background-image: url('/account/tm-bg-slide-3.jpg?h=f3530972ac2620357b48b5e8cd817fd4');">

        <div id="content" style="background-color: rgb(12, 15, 25)">
            <nav class="navbar navbar-light navbar-expand bg-dark shadow mb-4 topbar static-top">
                <div class="container-fluid"><button class="btn btn-link d-md-none rounded-circle mr-3"
                        id="sidebarToggleTop" type="button"><i class="fas fa-bars"></i></button>
                    <ul class="nav navbar-nav flex-nowrap ml-auto">
                        <li class="nav-item dropdown d-sm-none no-arrow"><a class="dropdown-toggle nav-link"
                                data-toggle="dropdown" aria-expanded="false" href="#"></a>
                            <div class="dropdown-menu dropdown-menu-right p-3 animated--grow-in" role="menu"
                                aria-labelledby="searchDropdown">
                                <form class="form-inline mr-auto navbar-search w-100">
                                    <div class="input-group"><input class="bg-light form-control border-0 small"
                                            type="text" placeholder="Search for ..." />
                                        <div class="input-group-append"><button class="btn btn-primary py-0"
                                                type="button"><i class="fas fa-search"></i></button></div>
                                    </div>
                                </form>
                            </div>
                        </li>
                        <li class="nav-item dropdown no-arrow mx-1" role="presentation">
                            <div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link"
                                    data-toggle="dropdown" aria-expanded="false" href="#"><span
                                        class="badge badge-danger badge-counter">0</span><i
                                        class="fas fa-bell fa-fw"></i></a>
                                <div class="dropdown-menu dropdown-menu-right dropdown-list dropdown-menu-right animated--grow-in"
                                    role="menu">
                                    <h6 class="dropdown-header">alerts center</h6>

                                    <a class="text-center dropdown-item small text-gray-500" href="#">Show All
                                        Alerts</a>
                                </div>
                            </div>
                        </li>

                        <div class="d-none d-sm-block topbar-divider"></div>
                        <li class="nav-item dropdown no-arrow" role="presentation">
                            <div class="nav-item dropdown no-arrow"><a class="dropdown-toggle nav-link"
                                    data-toggle="dropdown" aria-expanded="false" href="#"><span
                                        class="d-none d-lg-inline mr-2 text-gray-600 small"><?php echo $user->getFullname() ?></span><img class="border rounded-circle img-profile"
                                        src="default.png" /></a>
                                <div class="dropdown-menu shadow dropdown-menu-right animated--grow-in" role="menu"><a
                                        class="dropdown-item" role="presentation" href="profile.php"><i
                                            class="fas fa-user fa-sm fa-fw mr-2 text-gray-400"></i>Profile - <?php echo $user->getFullname() ?>
                                        </a><a class="dropdown-item" role="presentation"
                                        href="profile.php"><i
                                            class="fas fa-cogs fa-sm fa-fw mr-2 text-gray-400"></i>Update Password</a>
                                    <a class="dropdown-item" role="presentation" href="trade_history.php"><i
                                            class="fas fa-list fa-sm fa-fw mr-2 text-gray-400"></i>History</a>
                                    <div class="dropdown-divider"></div><a class="dropdown-item" role="presentation"
                                        href="logout.php"><i
                                            class="fas fa-sign-out-alt fa-sm fa-fw mr-2 text-gray-400"></i>Logout</a>
                                </div>
                            </div>
                        </li>
                    </ul>
                </div>
            </nav>

            <div class="container-fluid" style="background-color: rgb(12, 15, 25)">
                <div class="" style="margin: -1em; margin-bottom: 1em;">
  <div class="card shadow">
    <div class="card-header">
      <p class="font-weight-bold"><i class="fa fa-list text-primary"></i>
        YOUR NFT TRANSACTION RECORDS</p>

        <a href="nft.php" class="btn btn-primary">Buy NFT</a>
    </div>
    <div class="card-body">
      

      <table
        class="table table-responsive-sm table-bordered table-striped table-hover"
      >
        <thead>
          <tr>
            <th>NFT</th>
            <th>Amount (Eth)</th>
            <th>Paid</th>
            <th>Status</th>
            <th>Date bought</th>
          </tr>
        </thead>

        <tbody>
            <?php
                                                            $rs= mysqli_query($link, "SELECT * FROM nft WHERE email = '".$user->getEmail()."' ");
                                                            if ($rs AND mysqli_num_rows($rs) > 0) {
                                                                while ($row = mysqli_fetch_assoc($rs)){
                                                                    $sn++;
                                                                    echo "
                                                                       <tr> 
                                            <td>".$row['nft_name']."</td> 
											<td>".$row['amount']."</td>
											<td>Yes</td>
											<td>".$row['status']."</td> 
											<td>".$row['date']."</td> 
										</tr> ";
                                                                }
                                                            }else{
                                                                echo "<tr>
            <td colspan='6' style='text-align: center;'>You don't have any transaction currently.</td>
          </tr>";
                                                            }

                                                        ?>
          
        </tbody>
      </table>
    </div>
  </div>
</div>
            </div>
        </div>

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

</html>