updated to add country membership
This commit is contained in:
32
index.php
32
index.php
@@ -27,16 +27,32 @@ if ($showRenewModal) {
|
||||
} else {
|
||||
$showRenewModal = false;
|
||||
}
|
||||
$user_id = $_SESSION['user_id'];
|
||||
$stmt = $conn->prepare("SELECT payment_status FROM membership_fees WHERE user_id = ? LIMIT 1");
|
||||
$stmt->bind_param("i", $user_id);
|
||||
$stmt->execute();
|
||||
$stmt->bind_result($payment_status);
|
||||
$stmt->fetch();
|
||||
$stmt->close();
|
||||
|
||||
if ($payment_status === 'PENDING RENEWAL') {
|
||||
$user_id = $_SESSION['user_id'];
|
||||
|
||||
// Ensure we have a DB connection
|
||||
if (!isset($conn) || $conn === null) {
|
||||
$showRenewModal = false;
|
||||
} else {
|
||||
$stmt = $conn->prepare("SELECT payment_status FROM membership_fees WHERE user_id = ? LIMIT 1");
|
||||
$stmt->bind_param("i", $user_id);
|
||||
$stmt->execute();
|
||||
// store_result so we can check num_rows
|
||||
$stmt->store_result();
|
||||
|
||||
// If there's no membership_fees record for this user, don't show the renew modal
|
||||
if ($stmt->num_rows === 0) {
|
||||
$showRenewModal = false;
|
||||
} else {
|
||||
$stmt->bind_result($payment_status);
|
||||
$stmt->fetch();
|
||||
|
||||
if ($payment_status === 'PENDING RENEWAL') {
|
||||
$showRenewModal = false;
|
||||
}
|
||||
}
|
||||
|
||||
$stmt->close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user