(airhead): ive no idea no lie
Signed-off-by: boris <boris@borishub.co.uk>
This commit is contained in:
@@ -1,15 +1,15 @@
|
||||
<?php require('template/header.phtml') ?>
|
||||
<div class="row">
|
||||
<div class="col-5">
|
||||
<div class="col-5 me-auto">
|
||||
<p><?php echo $view->dbMessage; ?></p>
|
||||
</div>
|
||||
<div class="col-auto">
|
||||
<p>Current script <?php echo $_SERVER["PHP_SELF"]; ?></p>
|
||||
</div>
|
||||
<form class="col-auto">
|
||||
<?php require_once('template/createModal.phtml') ?>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="container-fluid p-3">
|
||||
<div class="container-fluid p-3" id="facilityContent">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -28,7 +28,7 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php foreach ($view->pageData as $facilityData): ?>
|
||||
<?php foreach ($view->pageData as $facilityData): ?>
|
||||
<tr>
|
||||
<td><?= htmlspecialchars($facilityData->getId() ?? 'N/A') ?></td>
|
||||
<td><?= htmlspecialchars($facilityData->getTitle() ?? 'N/A') ?></td>
|
||||
|
@@ -14,14 +14,14 @@
|
||||
<input name="titlCreate" class="form-control rounded mb-2" placeholder="Title">
|
||||
<input name="cateCreate" class="form-control rounded mb-2" placeholder="Category">
|
||||
<input name="descCreate" class="form-control rounded mb-2" placeholder="Description">
|
||||
<input name="statCreate" class="form-control rounded mb-2" placeholder="Status">
|
||||
<input name="hnumCreate" class="form-control rounded mb-2" placeholder="House Number">
|
||||
<input name="strtCreate" class="form-control rounded mb-2" placeholder="Street Name">
|
||||
<input name="cntyCreate" class="form-control rounded mb-2" placeholder="County">
|
||||
<input name="townCreate" class="form-control rounded mb-2" placeholder="Town">
|
||||
<input name="postCreate" class="form-control rounded mb-2" placeholder="Postcode">
|
||||
<input name="contCreate" class="form-control rounded mb-2" placeholder="Contributor">
|
||||
</form>
|
||||
<button type="submit" class="btn bg-primary btn-outline-primary text-light" name="updateButton">Add</button>
|
||||
<button type="submit" class="btn bg-primary btn-outline-primary text-light" name="createButton">Add</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
@@ -9,8 +9,9 @@
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">
|
||||
<button type="submit" class="btn bg-danger btn-outline-danger text-light" name="deleteButton">Yes</button>
|
||||
<form method="post" action="">
|
||||
<button type="submit" value="delete" class="btn bg-danger btn-outline-danger text-light" name="deleteButton"">Yes</button>
|
||||
<input type="hidden" name="id" value="<?= $facilityData->getId()?>">
|
||||
<button type="button" class="btn btn-outline primary btn-primary" data-bs-dismiss="modal">No</button>
|
||||
</form>
|
||||
</div>
|
||||
|
@@ -1,5 +1,5 @@
|
||||
</div>
|
||||
<div class="fixed-bottom mt-auto">
|
||||
<div class="site-footer fixed-bottom mt-auto">
|
||||
<div class="col-auto">
|
||||
<?php require_once('pagination.phtml'); ?>
|
||||
</div>
|
||||
|
@@ -26,12 +26,6 @@
|
||||
<a class="navbar-brand" href="/index.php"><img id="navIcon" class="img-thumbnail bg-transparent border-3 border-success border-opacity-25 rounded my-1 me-2" height="64px" width="64px" src="/images/ecoBuddy_x64.png" alt=""/><span class="pt-5 mb-auto">Ecobuddy</span></a>
|
||||
<div class="collapse navbar-collapse" id="navbarTogglerDemo03">
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" aria-current="page" href="/index.php">Home</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" href="#">Link</a>
|
||||
</li>
|
||||
</ul>
|
||||
<form class="row m-0 me-2 align-content-center align-content-center align-items-center" role="search" action="" method="POST">
|
||||
<div class="col">
|
||||
@@ -102,8 +96,7 @@
|
||||
</nav>
|
||||
<body role="document">
|
||||
|
||||
<div class="container-fluid">
|
||||
<?php /*require_once("sidebar.phtml");*/?>
|
||||
<div class="main container-fluid">
|
||||
<div class="col" id="content">
|
||||
|
||||
|
||||
|
@@ -30,9 +30,9 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-warning btn-outline-warning text-light" data-bs-dismiss="modal">
|
||||
<a href="/index.php <?php unset($_GET['modal'])?>" type="button" class="btn btn-warning btn-outline-warning text-light" data-bs-dismiss="modal">
|
||||
Close
|
||||
</button>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -4,24 +4,24 @@
|
||||
<div id="paginationButtons" class="col-auto m-auto btn-group">
|
||||
|
||||
<?php
|
||||
$params = $_GET;
|
||||
unset($params['page']); // Remove the page parameter to avoid duping
|
||||
function buildUrl($page, $params): string
|
||||
$param = $_GET;
|
||||
unset($param['page']); // Remove the page parameter to avoid duping
|
||||
function buildUrl($page, $param): string
|
||||
{
|
||||
$params['page'] = $page;
|
||||
return '?' . http_build_query($params);
|
||||
$param['page'] = $page;
|
||||
return '?' . http_build_query($param);
|
||||
}
|
||||
?>
|
||||
<!-- Start Button -->
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl(0, $params) ?>0" <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-double-left"></i> Start</a>
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl(0, $param) ?>0" <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-double-left"></i> Start</a>
|
||||
<!-- Back Button -->
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl(max($view->pageNumber - 1, 0), $params)?> " <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-left"></i> Back</a>
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl(max($view->pageNumber - 1, 0), $param)?> " <?= $view->pageNumber <= 0 ? 'disabled' : '' ?>><i class="bi bi-chevron-left"></i> Back</a>
|
||||
<!-- Dynamic Page Buttons -->
|
||||
<?php
|
||||
$totalPages = $view->paginator->getTotalPages();
|
||||
for ($i = $view->pageNumber - 2; $i <= $view->pageNumber + 2; $i++) {
|
||||
if ($i >= 0 && $i < $totalPages): ?>
|
||||
<a href="<?= buildUrl($i, $params) ?>"
|
||||
<a href="<?= buildUrl($i, $param) ?>"
|
||||
class="btn <?= $i === $view->pageNumber ? 'btn-dark' : 'btn-outline-primary' ?>"
|
||||
<?= $i === $view->pageNumber ? 'disabled' : '' ?>>
|
||||
<?= $i + 1 ?>
|
||||
@@ -29,9 +29,9 @@
|
||||
<?php endif;
|
||||
} ?>
|
||||
<!-- Forward Button -->
|
||||
<a class="btn btn-outline-primary" href="<?=buildUrl(min($view->pageNumber + 1, $totalPages), $params)?>" <?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>Forward <i class="bi bi-chevron-right"></i></a>
|
||||
<a class="btn btn-outline-primary" href="<?=buildUrl(min($view->pageNumber + 1, $totalPages), $param)?>" <?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>Forward <i class="bi bi-chevron-right"></i></a>
|
||||
<!-- End Button -->
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl($totalPages - 1, $params) ?>"<?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>End <i class="bi bi-chevron-double-right"></i></a>
|
||||
<a class="btn btn-outline-primary" href="<?= buildUrl($totalPages - 1, $param) ?>"<?= $view->pageNumber >= $totalPages - 1 ? 'disabled' : '' ?>>End <i class="bi bi-chevron-double-right"></i></a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@@ -1,34 +0,0 @@
|
||||
<div class="col-2" id="sidebar">
|
||||
<div class="row mt-1 m-0 p-3 border rounded" id="loginStatus">
|
||||
<?php
|
||||
|
||||
if ($view->loginError) {
|
||||
require_once('Views/template/loginError.phtml');
|
||||
}
|
||||
if(!$user->isLoggedIn()) {
|
||||
require_once('Views/template/loginModal.phtml');
|
||||
}
|
||||
if($user->isLoggedIn()) {
|
||||
require_once('Views/template/logoutButton.phtml');
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<div class="row mt-1 m-4 p-3 border rounded" id="filters">
|
||||
<h4 class="mb-4 text-center">Filter Options</h4>
|
||||
<form class="form-inline my-2 my-lg-0" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> ">
|
||||
<!--<input class="btn bg-primary btn-outline-primary text-light" type="submit" name="addFilter" value="+">-->
|
||||
<input name="0" class="form-control rounded mb-2" placeholder="Title">
|
||||
<input name="1" class="form-control rounded mb-2" placeholder="Category">
|
||||
<input name="2" class="form-control rounded mb-2" placeholder="Description">
|
||||
<input name="3" class="form-control rounded mb-2" placeholder="Status">
|
||||
<input name="4" class="form-control rounded mb-2" placeholder="Street Name">
|
||||
<input name="5" class="form-control rounded mb-2" placeholder="County">
|
||||
<input name="6" class="form-control rounded mb-2" placeholder="Town">
|
||||
<input name="7" class="form-control rounded mb-2" placeholder="Postcode">
|
||||
<input name="8" class="form-control rounded mb-2" placeholder="Contributor">
|
||||
<button name="applyFilters" class="form-control rounded mb-2 mt-3 btn bg-primary border-primary">Update</button>
|
||||
<button name="clearFilters" class="form-control rounded mb-2 btn bg-danger border-danger">Clear</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
@@ -1,6 +1,7 @@
|
||||
<button type="button" class="col btn bg-primary btn-outline-primary text-light" data-bs-toggle="modal" data-bs-target="#updateModal">
|
||||
<span class="bi bi-pen-fill"></span>
|
||||
</button>
|
||||
|
||||
<div class="modal fade" id="updateModal" tabindex="-1" aria-labelledby="updateModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
@@ -10,18 +11,17 @@
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<form method="post" action="<?php echo htmlspecialchars($_SERVER['PHP_SELF']); ?>">
|
||||
<form class="form-inline" method="post" action="<?php echo $_SERVER['PHP_SELF']; ?> ">
|
||||
<input name="titlUpdate" class="form-control rounded mb-2" placeholder="Title">
|
||||
<input name="cateUpdate" class="form-control rounded mb-2" placeholder="Category">
|
||||
<input name="descUpdate" class="form-control rounded mb-2" placeholder="Description">
|
||||
<input name="statUpdate" class="form-control rounded mb-2" placeholder="Status">
|
||||
<input name="strtUpdate" class="form-control rounded mb-2" placeholder="Street Name">
|
||||
<input name="cntyUpdate" class="form-control rounded mb-2" placeholder="County">
|
||||
<input name="townUpdate" class="form-control rounded mb-2" placeholder="Town">
|
||||
<input name="postUpdate" class="form-control rounded mb-2" placeholder="Postcode">
|
||||
<input name="contUpdate" class="form-control rounded mb-2" placeholder="Contributor">
|
||||
</form>
|
||||
<input name="titlUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getTitle() ?? '' ?>" placeholder="Title">
|
||||
<input name="cateUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getCategory() ?? '' ?>" placeholder="Category">
|
||||
<input name="descUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getDescription() ?? '' ?>" placeholder="Description">
|
||||
<input name="hnumUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getHouseNumber() ?? '' ?>" placeholder="House Number">
|
||||
<input name="strtUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getStreetName() ?? '' ?>" placeholder="Street Name">
|
||||
<input name="cntyUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getCounty() ?? '' ?>" placeholder="County">
|
||||
<input name="townUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getTown() ?? '' ?>" placeholder="Town">
|
||||
<input name="postUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getPostcode() ?? '' ?>" placeholder="Postcode">
|
||||
<input name="contUpdate" class="form-control rounded mb-2" value="<?= $facilityData->getContributor() ?? '' ?>" placeholder="Contributor">
|
||||
<button type="submit" class="btn bg-primary btn-outline-primary text-light" name="updateButton">Update</button>
|
||||
<input type="hidden" name="idUpdate" value="<?= $facilityData->getId()?>">
|
||||
</form>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
Reference in New Issue
Block a user