<?php
include("../includes/db_connection.php");
include("../includes/auth.php");
include("partials/header.php");

$client_id=$_GET['client_id'];

$result=$conn->query("
SELECT * FROM certificates
WHERE client_id=$client_id
ORDER BY id DESC
");
?>

<div class="container py-4">
<div class="card shadow">
<div class="card-header bg-dark text-white">
Client Certificates
</div>

<div class="card-body table-responsive">

<table class="table table-bordered">
<tr>
<th>No</th>
<th>Certificate No</th>
<th>Standard</th>
<th>Issue - Expiry</th>
<th>Status</th>
</tr>

<?php while($row=$result->fetch_assoc()): ?>
<tr>
<td><?= $row['id'] ?></td>
<td><?= $row['number'] ?></td>
<td><?= $row['standard'] ?></td>
<td><?= $row['rdate'] ?> - <?= $row['edate'] ?></td>
<td><?= ucfirst($row['status']) ?></td>
</tr>
<?php endwhile; ?>

</table>

</div>
</div>
</div>

<?php include("partials/footer.php"); ?>