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

21 lines
606 B
PHP
Raw Normal View History

2023-01-25 14:25:37 +00:00
<h2>Categories</h2>
<a class="new" href="addcategory.php">Add new category</a>
<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>
<td><?=$cat->name?></td>';
<td><a style="float: right" href="/portal/edit?id=<?=$cat->id?>">Edit</a></td>';
<td><form method="post" action="/portal">
<input type="hidden" name="id" value="<?=$cat->id?>" />
<input type="submit" name="submit" value="Delete" />
</form></td>
</tr>
<?php } ?>
</thead>
</table>