From 1262abea7f1304f1f8f2bd4f15e254e106bd60d0 Mon Sep 17 00:00:00 2001 From: unknown <13521043@std.stei.itb.ac.id> Date: Mon, 23 Oct 2023 00:15:28 +0700 Subject: [PATCH] Update index.php --- src/admin/index.php | 51 +++------------------------------------------ 1 file changed, 3 insertions(+), 48 deletions(-) diff --git a/src/admin/index.php b/src/admin/index.php index 1c54c9a..d203264 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"> -- GitLab