<?php $title='Units'; ob_start(); ?>
<div class="d-flex justify-content-between mb-3"><h3>Units</h3><a href="/samanta_crm/units/create" class="btn btn-primary btn-sm">Add</a></div>
<table class="table table-sm table-striped"><thead><tr><th>Code</th><th><?= __("common.name", "Name") ?></th><th>Scope</th><th>Order</th><th><?= __("common.active", "Active") ?></th><th></th></tr></thead><tbody><?php foreach($units as $u): ?><tr><td><?= htmlspecialchars($u['code']) ?></td><td><?= htmlspecialchars($u['name']) ?></td><td><?= htmlspecialchars($u['scope']??'product') ?></td><td><?= (int)$u['sort_order'] ?></td><td><?= $u['is_active']?'Yes':'No' ?></td><td class="text-end"><a class="btn btn-sm btn-outline-primary" href="/samanta_crm/units/<?= $u['id'] ?>/edit"><?= __("common.edit", "Edit") ?></a><form method="POST" action="/samanta_crm/units/<?= $u['id'] ?>/delete" class="d-inline" onsubmit="return confirm('Delete?')"><button class="btn btn-sm btn-outline-danger">Del</button></form></td></tr><?php endforeach; ?></tbody></table>
<?php $content=ob_get_clean(); include '../app/Views/layout.php'; ?>
