diff --git a/src/admin/index.php b/src/admin/index.php index 1c54c9af96e82df0f87c872a858722569a47c43e..d203264c5fbce1284c3c048954b5b54e07fcec9d 100644 --- a/src/admin/index.php +++ b/src/admin/index.php @@ -97,55 +97,10 @@ $gymsFiltered = GymService::getInstance()->getFiltered( <?= "No Gym Found" ?> <?php } - foreach ($gymsFiltered['gyms'] as $gym) : + foreach ($gymsFiltered['gyms'] as $gym) { + echo GymCardAdmin($gym); + } ?> - <div class="gym-card" id="gym-card-<?= $gym->gym_id ?>" - onclick="window.location.href = '/admin/gym?gym_id=<?= $gym->gym_id ?>';"> - <a class="content-gym-card" id="content-gym-card" href="/admin/gym?gym_id=<?= $gym->gym_id ?>"> - <img class="gym-card-picture" src="/public/image/gym/<?= $gym->picture_id ?>.png" - alt="Gym Image-<?= $gym->picture_id ?>"> - <div class="gym-card-text-admin"> - <div class="gym-card-name"> - <?= truncateText($gym->name, 16) ?> - </div> - <div class="gym-card-text-bottom"> - <div class="gym-card-text-bottom-left"> - <?= $gym->average_rating ?> - <img src="/public/icon/star.svg" alt="Star Icon"> - </div> - <div class="gym-card-text-bottom-right"> - <?= formatPrice($gym->monthly_price) ?> - </div> - </div> - </div> - <div class="button-gym-card"> - <a class="button-edit-delete-gym" id="edit-gym" href="/admin/edit?gym_id=<?= $gym->gym_id ?>"> - <img src="/public/icon/edit.svg" alt="Edit Gym Icon"> - </a> - <button class="button-edit-delete-gym" id="delete-gym-<?= $gym->gym_id ?>" - onclick="event.stopPropagation();showPopupDel(<?= (int) $gym->gym_id ?>);"> - <img src="/public/icon/trash.svg" alt="Trash Gym Icon"> - </button> - </div> - <!-- Pop up delete --> - </a> - </div> - <div class="popup" id="pop-up-delete-<?= $gym->gym_id ?>" onclick="hidePopupDel(<?= (int) $gym->gym_id ?>)"> - <div class="popup-content" onclick="event.stopPropagation();"> - <div class="popup-title" id="pop-up-title-edit-delete"> - Do you want to delete - <?= $gym->name ?> - </div> - <div class="space2"></div> - <button class="search-filter" onclick="deleteGymCall(<?= (int) $gym->gym_id ?>);" - id="yes-btn-del">Yes</button> - <div class="space3"></div> - <button class="cancel-filter" id="cancel-btn-del" - onclick="hidePopupDel(<?= (int) $gym->gym_id ?>);">Cancel</button> - </div> - </div> - - <?php endforeach; ?> </div> <div class="pagination-container">