first commit
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
<?= $this->extend('layout/main') ?>
|
||||
|
||||
<?= $this->section('content') ?>
|
||||
<div class="d-flex justify-content-between align-items-center mb-3">
|
||||
<h1 class="h4 mb-0">Kategorie</h1>
|
||||
<a href="<?= site_url('categories/new') ?>" class="btn btn-primary">+ Nowa kategoria</a>
|
||||
</div>
|
||||
|
||||
<div class="card shadow-sm">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-hover mb-0 align-middle">
|
||||
<thead class="table-light">
|
||||
<tr>
|
||||
<th>Nazwa</th>
|
||||
<th>Typ</th>
|
||||
<th class="text-end">Akcje</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php if (empty($categories)): ?>
|
||||
<tr><td colspan="3" class="text-center text-muted py-4">Brak kategorii.</td></tr>
|
||||
<?php else: foreach ($categories as $c): ?>
|
||||
<tr>
|
||||
<td><?= esc($c['indent_label']) ?></td>
|
||||
<td>
|
||||
<?php if ($c['type'] === 'income'): ?>
|
||||
<span class="badge bg-success">Przychód</span>
|
||||
<?php else: ?>
|
||||
<span class="badge bg-danger">Wydatek</span>
|
||||
<?php endif; ?>
|
||||
</td>
|
||||
<td class="text-end">
|
||||
<a href="<?= site_url('categories/' . $c['id'] . '/edit') ?>" class="btn btn-sm btn-outline-secondary">Edytuj</a>
|
||||
<a href="<?= site_url('categories/' . $c['id'] . '/delete') ?>" class="btn btn-sm btn-outline-danger"
|
||||
onclick="return confirm('Usunąć kategorię?')">Usuń</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach; endif; ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<?= $this->endSection() ?>
|
||||
Reference in New Issue
Block a user