erm did a small amount

output database to view
added basic filters
improve bootstrap theming and positioning
added pagination
This commit is contained in:
boris
2024-11-28 23:40:06 +00:00
parent 5c24228c20
commit 4005328979
36 changed files with 6746 additions and 8223 deletions

View File

@@ -1,32 +1,63 @@
<?php require('template/header.phtml') ?>
<div class="col-auto">
<?php require('template/pagination.phtml') ?>
</div>
<div class="row">
<div class="col-5">
<p><?php echo $view->dbMessage; ?></p>
</div>
<div class="col-7">
<div class="col-auto">
<p>Current script <?php echo $_SERVER["PHP_SELF"]; ?></p>
</div>
</div>
<div class="row">
<table class="table table-bordered">
<thead> <tr> <th>Facility ID</th> <th>Title</th> <th>Category</th> <th>Description</th> <th>Address</th> <th>Postcode</th> <th>Lat/Long</th> <th>Contributor</th> </tr>
</thead>
<tbody>
<?php foreach ($view->facilityDataSet as $facilityData) {
echo '<tr> <td>' . $facilityData->getId() .
'</td> <td>' . $facilityData->getTitle() .
'</td> <td>' . $facilityData->getCategory() .
'</td> <td>' . $facilityData->getDescription() .
'</td> <td>' . $facilityData->getHouseNumber() . " " . $facilityData->getStreetName() . " " . $facilityData->getCounty() . " " . $facilityData->getTown() .
'</td> <td>' . $facilityData->getPostcode() .
'</td> <td>' . $facilityData->getLatitude() . " " . $facilityData->getLongitude() .
'</td> <td>' . $facilityData->getContributor() .
'</td> </td> </tr>';
} ?>
</tbody>
</table>
<div class="container-fluid p-3">
<table class="table table-bordered">
<thead>
<tr>
<th>Facility ID</th>
<th>Title</th>
<th>Category</th>
<th>Status</th>
<th>Description</th>
<th>Address</th>
<th>Postcode</th>
<th>Lat/Long</th>
<th>Contributor</th>
<?php if($view->user->getAccessLevel() == 1): ?>
<th>Actions</th>
<?php endif; ?>
</tr>
</thead>
<tbody>
<?php foreach ($view->pageData as $facilityData): ?>
<tr>
<td><?= htmlspecialchars($facilityData->getId() ?? 'N/A') ?></td>
<td><?= htmlspecialchars($facilityData->getTitle() ?? 'N/A') ?></td>
<td><?= htmlspecialchars($facilityData->getCategory() ?? 'N/A') ?></td>
<td><?= htmlspecialchars($facilityData->getStatus() ?? 'N/A') ?></td>
<td><?= htmlspecialchars($facilityData->getDescription() ?? 'N/A') ?></td>
<td><?= htmlspecialchars(trim(($facilityData->getHouseNumber() ?? '') . ' ' .
($facilityData->getStreetName() ?? '') . ' ' .
($facilityData->getCounty() ?? '') . ' ' .
($facilityData->getTown() ?? ''))) ?></td>
<td><?= htmlspecialchars($facilityData->getPostcode() ?? 'N/A') ?></td>
<td><?= htmlspecialchars(($facilityData->getLat() ?? 'N/A') . ', ' .
($facilityData->getLng() ?? 'N/A')) ?></td>
<td><?= htmlspecialchars($facilityData->getContributor() ?? 'N/A') ?></td>
<?php if($view->user->getAccessLevel() == 1): ?>
<td class="btn-group">
<?php require("template/updateModal.phtml") ?>
<?php require("template/deleteModal.phtml") ?>
</td>
<?php endif; ?>
</tr>
<?php endforeach; ?>
</tbody>
</table>
</div>
<?php require('template/footer.phtml') ?>
<?php require('template/footer.phtml') ?>