Skip to main content
Sign in
Snippets Groups Projects
Commit a3254efa authored by Nigel  Sahl's avatar Nigel Sahl
Browse files

fix display gym card

parent 1b12a5fa
No related branches found
No related tags found
No related merge requests found
......@@ -35,6 +35,7 @@ $gymsFiltered = GymService::getInstance()->getFiltered(
'searching' => $searching
]
);
$gyms = $gymsFiltered['gyms'];
?>
......@@ -92,11 +93,12 @@ $gymsFiltered = GymService::getInstance()->getFiltered(
<div class="gym-card-container">
<?php
$gyms = $gymsFiltered['gyms'];
// Slice the array to display
$startIndex = ($currentPage - 1) * $itemInPage;
$slicedGyms = array_slice($gyms, $startIndex, $itemInPage);
foreach ($slicedGyms as $gym) :
if (sizeof($gymsFiltered['gyms']) == 0) {
?>
<?= "No Gym Found" ?>
<?php
}
foreach ($gyms as $gym) :
?>
<div class="gym-card" id="gym-card-<?= $gym->gym_id ?>"
onclick="window.location.href = '/admin/gym?gym_id=<?= $gym->gym_id ?>';">
......
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment