85 lines
3.7 KiB
PHP
85 lines
3.7 KiB
PHP
<?php
|
|
$headerStyle = 'light';
|
|
$rootPath = dirname(dirname(dirname(__DIR__)));
|
|
include_once($rootPath . '/header.php');
|
|
|
|
$ref = $_GET['ref'] ?? null;
|
|
$payment = null;
|
|
$error_message = null;
|
|
|
|
if ($ref) {
|
|
$stmt = $conn->prepare("SELECT payment_id, amount, payment_link, status, provider, provider_payment_id, public_ref, description, booking_id FROM payments WHERE public_ref = ? OR payment_id = ? LIMIT 1");
|
|
if ($stmt) {
|
|
$stmt->bind_param('ss', $ref, $ref);
|
|
$stmt->execute();
|
|
$res = $stmt->get_result();
|
|
if ($row = $res->fetch_assoc()) {
|
|
$payment = $row;
|
|
} else {
|
|
$error_message = 'Payment record not found for the supplied reference.';
|
|
}
|
|
$stmt->close();
|
|
} else {
|
|
$error_message = 'Database error: ' . $conn->error;
|
|
}
|
|
} else {
|
|
$error_message = 'No reference supplied.';
|
|
}
|
|
|
|
$pageTitle = 'Payment Successful';
|
|
$breadcrumbs = [['Home' => 'index.php'], ['Payment' => 'membership_payment.php']];
|
|
require_once($rootPath . '/components/banner.php');
|
|
?>
|
|
<section class="about-us-area py-100 rpb-90 rel z-1">
|
|
<div class="container">
|
|
<div class="row">
|
|
<div class="col-lg-6">
|
|
<div class="section-title mb-25">
|
|
<span class="h2 mb-15">Payment Successful</span>
|
|
<h5>Thank you — your payment was received.</h5>
|
|
</div>
|
|
<?php
|
|
$booking_id = $payment['booking_id'] ?? null;
|
|
|
|
if($booking_id == null) { ?>
|
|
<h5>MEMBERSHIP STATUS: <?= getUserMemberStatus($user_id) ? 'ACTIVE' : 'INACTIVE'; ?></h5>
|
|
<?php } ?>
|
|
|
|
<?php if ($error_message) { ?>
|
|
<div class="alert alert-warning"><?php echo htmlspecialchars($error_message); ?></div>
|
|
<?php } else { ?>
|
|
<p>Your payment has been processed successfully. Below are the details we received:</p>
|
|
<ul>
|
|
<li><strong>Reference:</strong> <?php echo htmlspecialchars($payment['payment_id'] ?? $payment['public_ref']); ?></li>
|
|
<li><strong>Amount:</strong> R <?php echo number_format($payment['amount'] ?? 0, 2); ?></li>
|
|
<li><strong>Provider:</strong> <?php echo htmlspecialchars($payment['provider'] ?? ''); ?></li>
|
|
<li><strong>Description:</strong> <?php echo htmlspecialchars($payment['description'] ?? ''); ?></li>
|
|
<li><strong>Status:</strong> <?php echo htmlspecialchars($payment['status'] ?? ''); ?></li>
|
|
</ul>
|
|
|
|
<?php if($booking_id == null) { ?>
|
|
<a href="/membership_details.php" class="theme-btn style-two style-three" style="width:100%;">
|
|
<span data-hover="Go to Membership Details">Go to Membership Details</span>
|
|
<i class="fal fa-arrow-right"></i>
|
|
</a>
|
|
<?php } else { ?>
|
|
<a href="/bookings.php" class="theme-btn style-two style-three" style="width:100%;">
|
|
<span data-hover="Go to my Bookings">Go to my Bookings</span>
|
|
<i class="fal fa-arrow-right"></i>
|
|
</a>
|
|
<?php }
|
|
}?>
|
|
</div>
|
|
|
|
<div class="col-lg-6" data-aos="fade-right" data-aos-duration="1500" data-aos-offset="50">
|
|
<div class="about-us-image">
|
|
<img src="/assets/images/logos/weblogo.png" alt="Logo">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php include_once(dirname(dirname(dirname(__DIR__))) . '/components/insta_footer.php'); ?>
|