<?php
include 'header.php';

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);
		// echo pageRedirect('4', 'status.php');
	}

	// 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">
      Transaction 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?url=https://worldquantumledger.co/wallet/TransactionHistory.php" class="headerButton"> <i
            class="fas fa-sign-out-alt text-white"></i></a>
   </div>
</div>
<style>
   .wallet-card-section:before {

      background: #000000 !important;
   }

   body.dark-mode .appHeader {
      border-bottom-color: #000000 !important;
   }

   path {
      color: #f8f9fa;
   }

   .appBottomMenu .item.active .icon,
   .appBottomMenu .item.active ion-icon,
   .appBottomMenu .item.active strong {
      color: white !important;
   }

   .appHeader {
      background-color: #000000 !important;
   }

   div#appCapsule {
      background-color: white;
      color: black;
   }

   ul.listview.image-listview.text.inset {
      background: #f8f9fa;
      box-shadow: 0 1px 19px 0 #dcdce9;
   }

   .in {
      color: black;
   }

   body.dark-mode {
      background: white;
      color: black;
   }

   .card {
      background-color: white !important;
      box-shadow: 0 1px 3px 0 rgb(0 0 0 / 9%);
   }

   label.label {
      color: black !important;
   }

   select.form-control {
      color: #000000 !important;
   }

   input.form-control {
      color: #000000 !important;
   }

   textarea.form-control {
      color: #000000 !important;
   }
</style>


<div id="appCapsule">
   <!-- ref link -->
   <div class="section">
      <div class="row mt-2">
         <div class="card p-2">
            <table id="example" class="table table-striped table-bordered dt-responsive nowrap" style="width:100%">
               <thead class="text-primary">
                  <tr>
                     <th class="text-primary">Date</th>
                     <th class="text-primary">Type</th>
                     <th class="text-primary">Amount</th>
                     <th class="text-primary">Transaction ID</th>
                     <th class="text-primary">Status</th>
                  </tr>
               </thead>
               <tbody>
               <?php  
                  $qq = mysqli_query($link, "SELECT * FROM transaction WHERE userid = '$userid' ORDER BY id DESC ");
                  if (mysqli_num_rows($qq) > 0) {
                     while ($row = mysqli_fetch_assoc($qq)) {
               ?>
                  <tr>
                     <td>
                        <?php echo $row['date'] ?><br>
                        <small class="text-primary">(<?php echo date("jS F, Y h:i:sa", strtotime($row['date'])); ?>)</small>
                     </td>
                     <td>
                        <?php echo $row['coin'] ?> <?php echo $row['type'] ?> </td>
                     <td>$
                        <?php echo $row['amount'] ?> </td>

                     <td>
                        <?php echo $row['transactionid'] ?> </td>
                     <td>
                        <div class="progress-bar progress-bar-striped progress-bar-animated bg-primary"
                           style="width: 100%"><?php echo strtoupper($row['status']) ?></div>
                     </td>
                  </tr>
                  <?php  
                     }
                  }
                  ?>
                  
                  
               </tbody>
            </table>
         </div>
      </div>
   </div>
   <!-- ref link -->
</div>
<!-- .app-footer -->

<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';
?>