
<!Doctype html>
<html>
 <head>
   <meta charset="utf-8">
   <title>Home Page</title>
   <link rel="icon" href="favicon.ico">
      <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-BmbxuPwQa2lc/FVzBcNJ7UAyJxM6wuqIj61tLrc4wSX0szH/Ev+nYRRuWlolflfl" crossorigin="anonymous">
   <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.0-beta2/dist/js/bootstrap.bundle.min.js" integrity="sha384-b5kHyXgcpbZJO/tY9Ul7kGkf1S0CWuKcCD38l8YkeH8z8QjE0GmW1gYU5S9FOnJ0" crossorigin="anonymous"></script>
   <link rel="stylesheet" href="/css/admins.css">
 </head>
 <body>
  <div id="Heading Box">
   <h1 id="Heading">Organ Donation Management System</h1>
 </div>

<!-- Navbar -->
<div class="navbar navbar-expand-lg navbar-light bg-light">
  <div class="container-fluid">
        <a class="navbar-brand" href="#">
        <img src="/css/logo.png" alt=""  height="20">
        </a>
        <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
        </button>
        <div class="collapse navbar-collapse" id="navbarSupportedContent">
            <ul class="navbar-nav mr-auto mb-2 mb-lg-0">
                <li class="nav-item" id="nav-logo">
                <a class="nav-link active" aria-current="page" href="#Heading Box"></a>
                </li>
                <li class="nav-item">
                <a class="nav-link" href="/organavail">Check for Organ Availability</a>
                </li>
                <li class="nav-item">
                <a class="nav-link" href="/logind">Login for Donor</a>
                </li>
                <li class="nav-item">
                <a class="nav-link" href="/register">Sign-up for Donor</a>
                </li>
                <li class="nav-item">
                <a class="nav-link" href="/loginad">Admin Login</a>
                </li>
            </ul>
        </div>
        <div class="log"><a class="nav-link" href="/logout">LOGOUT</a></div>
  </div>
</div>
<br>
<br>

<div class="container">
  <div class="row">
    <div class="col-6">
        <form action="/auth/update" method="POST">
            <h2> Update Record </h2>
            <label for="donorid" class="form-label">Enter Donor ID</label>
            <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="donor_up">
            <label for="field" class="form-label">Choose field</label>
            <select id="field" name="field" size="1">
            <option value="Email">Email</option>
            <option value="Ailments">Ailments</option>
            <option value="Contact">Contact</option>
            <option value="Password">Password</option>
            </select>
            <br>
            <label for="New Value" class="form-label">New value</label>
            <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="newvalue">
            <% if(mu){ %>
              <div class="err"><%= mu  %></div>
            <% } %>
        <br>
        <input type="submit">

        </form>
    </div>
    <div class="col-6">
      <form action="/auth/delete" method="POST">
        <h2> Delete Record </h2>
        <label for="donorid" class="form-label">Enter Donor ID</label>
        <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="donor_del">
        <% if(md){ %>
          <div class="err"><%= md  %></div>
        <% } %>
        <br>
        <input type="submit">
    </form>
    </div>
      <% if(users.length > 0){ %>
      <table class="det">
        <tr>
          <th>DonorID</th>
          <th>Reason of Withdraw</th>
        </tr>
        <% users.forEach(function(user){ %>
          <tr>
          <td><%= user.Username %></td>
          <td><%= user.Reason %></td>
        </tr>
          <%  }); %>
      </table>
      <% } %>
    


</div>
<br><br><br><br>
    <div class="row">
        <div class="col-12">
            <form action="/auth/addorgan" method="POST">
                <h2> Add Organ to Waiting list  </h2>
                <label for="donorid" class="form-label">Enter Donor ID</label>
                <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="donorid">
                <label for="donorid" class="form-label">Organ/Tissue Name</label>
                <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="organ">
                <label for="donorid" class="form-label">Hospital</label>
                <input type="text" class="form-control" placeholder="XXXXXX" value="" required name="Hospital">
                <label for="donorid" class="form-label">Procurement date </label>
                <input type="date" class="form-control" placeholder="XXXXXX" value="" required name="ProDate">
                <% if(mo){ %>
                  <div class="err"><%= mo  %></div>
                <% } %>

                <br>
                <input type="submit">
            </form>
        </div>
    </div>
</div>
 </body>
</html>