-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewItems.php
38 lines (38 loc) · 987 Bytes
/
viewItems.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
<?php
echo <<<EOT
<table class="table table-striped table-dark">
<tr>
<th> Dish Name </th>
<th> Quantity </th>
<th> Type </th>
<th> Price </th>
<th> Action</th>
</tr>
<tbody>
EOT;
// tableData and actions
foreach (reset($crud->data) as $idx => $item) :
$tData = "";
foreach ($crud->attributesList as $attribute) {
$tData .= "<td>" . $item[$attribute] . "</td>";
}
echo <<<EOT
<tr>
$tData
<td>
<a href="?action=edit&id=$idx"><button class="btn btn-primary">Edit</button></a>
<a href="?action=delete&id=$idx"><button class="btn btn-danger">Delete</button></a>
</td>
</tr>
EOT;
endforeach;
echo <<<EOT
</tbody>
</table>
<hr>
<div class="text-center">
<a href="?action=add"><button class="btn btn-success">ADD</button></a>
</div>
<hr>
EOT;
?>