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