-
Notifications
You must be signed in to change notification settings - Fork 0
/
category-list.php
61 lines (49 loc) · 1.27 KB
/
category-list.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
include_once "category-controller.php";
$controller = new CategoryController();
$rows = $controller->getList();
?>
<div class="wrap">
<h2>Kategorie <a href="admin.php?page=category&action=create" class="add-new-h2">Přidat novou</a></h2>
<?php include_once "messages.php"; ?>
<table class="wp-list-table widefat fixed posts">
<thead>
<tr>
<th>Název</th>
<th>URL</th>
<th>Ikona</th>
<th>Akce</th>
</tr>
</thead>
<tbody>
<?php
if (sizeof ($rows) == 0) {
?>
<tr class="no-items">
<td class="colspanchange" colspan="3">
Nebyla nalezena žádná kategorie.
</td>
</tr>
<?php
} else {
$barva = true;
foreach ($rows as $row) {
if ($barva) {
echo '<tr class="alternate">';
$barva = false;
} else {
echo '<tr>';
$barva = true;
}
echo '<td><strong>'.$row->nazev.'</strong></td>';
echo '<td>'.$row->url.'</td>';
echo '<td>'.$row->ikona.'</td>';
echo '<td><a href="admin.php?page=category&action=update&id='.$row->id.'" title="Upraví kategorii">Upravit</a>
· <a href="admin.php?page=category&action=delete&id='.$row->id.'" title="Smaže kategorii">Smazat</a></td>';
echo '</tr>';
}
}
?>
</tbody>
</table>
</div>