<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">

    <!-- google fonts -->
    <link href="https://fonts.googleapis.com/css2?family=Cabin:wght@400;500;700&display=swap" rel="stylesheet">
    
    <!-- bootstrap css -->
    <link rel="stylesheet" href="dist/css/bootstrap.min.css" crossorigin="anonymous">
    
    <!-- custom css -->
    <link rel="stylesheet" href="styles.css">

    <!--Font Awesome -->
    <link rel="stylesheet" href="fontawesome-free/css/all.css">
        
    <title>Transactions (Seller)</title>
</head>
<body onload="hide_loading()">
  <div class="load_div">
    <div class="spinner-border text-info p-4 spin-load" role="status">
      <div class="sr-only">Loading...</div>
    </div>
  </div>
  
  <section class="main-background">
  <section id="header">
    <div class="container-fluid">
        <nav class="navbar navbar-expand-lg">
            <a class="navbar-brand" href="/seller"><img src="shop.png" alt="" style="width: 40px;"> Store-On-The-Go</a>
            <button
              class="navbar-toggler"
              type="button"
              data-toggle="collapse"
              data-target="#navbarSupportedContent"
              aria-controls="navbarSupportedContent"
              aria-expanded="false"
              aria-label="Toggle navigation"
            >
            <i class="fas fa-ellipsis-v nav-toggler-icon"></i>
            <!-- <span class="navbar-toggler-icon"></span> -->
            </button>
            <div class="collapse navbar-collapse" id="navbarSupportedContent">
              <ul class="navbar-nav ml-auto">
                <li class="nav-item">
                  <a class="nav-link" href="/seller">My Products</a>
                </li>
                <li class="nav-item">
                  <a class="nav-link" href="/seller/transactions">Transactions</a>
                </li>
                <li class="nav-item">
                  <div class="dropdown">
                    <button class="btn dropdown-toggle nav-btn mx-auto" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                      Profile <i class="fas fa-user-circle"></i>
                    </button>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
                      <a class="dropdown-item" href="/seller/profile">My Account</a>
                      <div class="dropdown-divider"></div>
                      <a class="dropdown-item" href="/logout">Logout <i class="fas fa-sign-out-alt"></i></a>
                    </div>
                </li>
              </ul>
            </div>
          </nav>
    </div>
</section>
    <section id="s-transactions" class="container-fluid row">
      <h1 class="col my-auto">Your transactions</h1>
      <% transactions.forEach(element => { %>
        <div class="col-lg-10 card transactions-card">
          <div class="card-body">
          <table class="custom-table">
            <tr><td class="font-weight-bold custom-td first-col">Id</td><td class="custom-td"><%= element.id %></td></tr>
            <tr><td class="font-weight-bold custom-td first-col">Username</td><td class="custom-td"><%= user.username %></td></tr>
            <tr><td class="font-weight-bold custom-td first-col">Consumer_id</td><td class="custom-td"><%= element.consumer %></td></tr>
            <tr><td class="font-weight-bold custom-td first-col">Timestamp</td><td class="custom-td"><%= element.time %></td></tr>
            <tr><td class="font-weight-bold custom-td first-col">Product</td><td class="custom-td"> | <% element.product.forEach(element1 => { %> product: <%= element1.product %> , quantity: <%= element1.quantity %> , seller: <%= element1.seller %> | <% }); %></td></tr>
          </table>
        </div>
        </div>
        <% }); %>
  </section>
    <section id="footer">
        <div class="container-fluid">
          <p>© Copyright <span id="Copyright"></span> Store-On-The-Go</p>
        </div>
    </section>
</section>
    <script src="script.js"></script>
    <script src="dist/jquery.slim.min.js" crossorigin="anonymous"></script>
    <script src="core/dist/umd/popper.min.js" crossorigin="anonymous"></script>
    <script src="dist/js/bootstrap.min.js" crossorigin="anonymous"></script>
</body>
</html>