iKhokha integration completerer...

This commit is contained in:
twotalesanimation
2025-12-15 01:24:56 +02:00
parent 477c2f2e04
commit f4934e9c13
3 changed files with 71 additions and 14 deletions

View File

@@ -188,8 +188,8 @@ if (empty($application['id_number'])) {
<td><?php echo htmlspecialchars($membership['payment_amount']); ?></td>
<td><?php echo htmlspecialchars($membership['payment_id']); ?></td>
<?php if ($membership['payment_status'] == "AWAITING PAYMENT") { ?>
<td><a href='<?= $payment_link; ?>' class='theme-btn style-two style-three' style='padding: 0px 14px;'><span data-hover='PAY NOW'>PAY NOW</span></a></td>
<?php if ($membership['payment_status'] == "AWAITING PAYMENT" || $membership['payment_status'] == "PENDING RENEWAL") { ?>
<td><a href='<?= $payment_link; ?>' class='theme-btn style-two style-three' style='padding: 0px 14px;'><span data-hover='PAY NOW'>PENDING RENEWAL</span></a></td>
<?php } else { ?>
<td><?php echo htmlspecialchars($membership['payment_status']); ?></td>
<?php } ?>
@@ -206,16 +206,26 @@ if (empty($application['id_number'])) {
</div>
<?php
// Check if membership has expired
// Show renew button when current date is within 3 months of membership end
$membership_end_date = $membership ? $membership['membership_end_date'] : null;
$today = date('Y-m-d');
if ($membership_end_date && strtotime($today) > strtotime($membership_end_date)) {
echo '
if ($membership_end_date) {
try {
$end = new DateTime($membership_end_date);
$threeMonthsBefore = (clone $end)->modify('-3 months')->format('Y-m-d');
} catch (Exception $e) {
// Fallback using strtotime if DateTime parsing fails
$threeMonthsBefore = date('Y-m-d', strtotime($membership_end_date . ' -3 months'));
}
if (strtotime($today) >= strtotime($threeMonthsBefore)) {
echo '
<a href="renew_membership" class="theme-btn style-two bgc-secondary" style="width:100%; margin-top: 20px; background-color: #63ab45; padding: 10px 20px; color: white; text-decoration: none; border-radius: 25px;">
<span data-hover="Renew Membership">Renew Membership</span>
<i class="fal fa-arrow-right"></i>
</a>';
}
}
?>