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

fix display gym card

parent 1b12a5fa
Branches
Tags
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% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment