<?php
require "db.php";

$suppliers = mysqli_query($conn,"
    SELECT id, name FROM hps_suppliers ORDER BY name
");
?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Supplier Statement</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet">
</head>
<body style="background:#f1f3f5">

<div class="container py-5">
<div class="card shadow-lg p-4 mx-auto" style="max-width:600px;border-radius:15px">

<h4 class="mb-3">Supplier Statement</h4>

<form method="get" action="hps_supplier_statement.php">

<div class="mb-2">
<label class="small">Supplier</label>
<select name="supplier_id" class="form-select form-select-sm" required>
<option value="">Select Supplier</option>
<?php while($s=mysqli_fetch_assoc($suppliers)): ?>
<option value="<?=$s['id']?>"><?=$s['name']?></option>
<?php endwhile; ?>
</select>
</div>

<div class="row g-2">
<div class="col-md-6">
<label class="small">From Date</label>
<input type="date" name="from" class="form-control form-control-sm">
</div>

<div class="col-md-6">
<label class="small">To Date</label>
<input type="date" name="to" class="form-control form-control-sm">
</div>
</div>

<div class="text-end mt-3">
<button class="btn btn-primary btn-sm">
View Statement →
</button>
</div>

</form>

</div>
</div>

</body>
</html>
