<?php include '_header.html.php' ?> <br> <h2>Welcome to Address Book</h2> <?php if(!empty($addresses)): ?> <form method="POST"> <table id="address_table"> <tr> <th id="first" onclick="sortBy('first')">First</th> <th id="last" onclick="sortBy('last')">Last</th> <th id="street" onclick="sortBy('street')">Street</th> <th id="zip" onclick="sortBy('zip')">Zip</th> <th id="city" onclick="sortBy('city')">City</th> <th id="phone" onclick="sortBy('phone')">Phone</th> <th colspan="2"> </th> </tr> <?php foreach ($addresses as $address): ?> <?php $id = $address->getId(); ?> <tr id="row_<?= $id ?>"> <td><input type="text" id="first_<?= $id ?>" value="<?= $address->getFirst(); ?>" disabled></td> <td><input type="text" id="last_<?= $id ?>" value="<?= $address->getLast(); ?>" disabled></td> <td><input type="text" id="street_<?= $id ?>" value="<?= $address->getStreet(); ?>" disabled></td> <td><input type="text" id="zip_<?= $id ?>" value="<?= $address->getZip(); ?>" disabled></td> <td><input type="text" id="city_<?= $id ?>" value="<?= $address->getCity(); ?>" disabled></td> <td><input type="text" id="phone_<?= $id ?>" value="<?= $address->getPhone(); ?>" disabled></td> <td> <input type="button" value="Edit" id="edit_button_<?= $id ?>" onclick="editAddress(<?= $id ?>)"> </td> <td> <input type="button" value="Delete" onclick="deleteAddress(<?= $id ?>)"> <input type="hidden" id="owner_<?= $id ?>" value="<?= $id ?>"> </td> </tr> <?php endforeach; ?> <tr style="display:none;"> <td id="first_sort">asc</td> <td id="last_sort">asc</td> <td id="street_sort">asc</td> <td id="zip_sort">asc</td> <td id="city_sort">asc</td> <td id="phone_sort">asc</td> </tr> </table> </form> <!-- TODO why is the route not found? $addPath = $router->path('/address/add'); --> <input type="button" value="Add Address" onclick="addAddress('address/add')"> <?php else: ?> Your addresses wil be listed soon … <?php endif; ?> <?php include '_footer.html.php' ?>