CSY2028-assignment-2/templates/category_table.html.php

21 lines
622 B
PHP
Raw Normal View History

2023-01-25 14:25:37 +00:00
<h2>Categories</h2>
2023-02-05 12:30:28 +00:00
<a class="new" href="/portal/addCategory">Add new category</a>
2023-01-25 14:25:37 +00:00
<table>
<thead>
<tr>
<th>Name</th>
<th style="width: 5%">&nbsp;</th>
<th style="width: 5%">&nbsp;</th>
</tr>
<?php foreach ($cats as $cat) { ?>
<tr>
2023-01-25 15:37:06 +00:00
<td><?=$cat->name?></td>
2023-02-05 15:05:54 +00:00
<td><a style="float: right" href="/portal/addCategory?cat_id=<?=$cat->id?>">Edit</a></td>
2023-01-25 15:37:06 +00:00
<td><form method="post" action="/portal/">
<input type="hidden" name="cat_id" value="<?=$cat->id?>" />
2023-02-05 14:58:16 +00:00
<input type="submit" name="submit" value="Delete" />
2023-01-25 14:25:37 +00:00
</form></td>
</tr>
<?php } ?>
</thead>
</table>