<?= $this->extend("layouts/default") ?>
<?= $this->section("title") ?>Suppliers<?= $this->endSection() ?>
<?= $this->section("content") ?>


<?= view(
	"layouts/bcr-nav",
	[
		"title" => "Suppliers",
		"controller" => "Suppliers",
		"links" => [
			"New" =>  ["url" => url_to("Suppliers::new"), "auth_check" => true]
		]
	]
) ?>

<div class="index-div">

	<table>
		<tr>
			<th></th>
			<th>ID</th>
			<th>Supplier</th>
			<th>Last Updated</th>
			<th>Updated By</th>

			<?php
			foreach ($suppliers as $supplier) : ?>
		<tr>
			<td>
				<a href="<?= site_url('/suppliers/' . $supplier->SupplierID) ?>">
					<button class="button">View</button>
				</a>
			</td>
			<td>
				<?= $supplier->SupplierID ?>
			</td>
			<td>
				<?= esc($supplier->Supplier) ?>
			</td>
			<td>
				<?= $supplier->lastupdated ?>
			</td>
			<td>
				<?= esc($supplier->username) ?>
			</td>
		</tr>
	<?php
			endforeach; ?>

	</table>

</div>
<?= $this->endSection() ?>