- Create components/banner.php: Unified banner template with: * Configurable $pageTitle and $breadcrumbs parameters * Automatic random banner image selection from assets/images/banners/ * Consistent page-banner-area styling and markup * Data attributes for AOS animations preserved - Updated pages to use banner component: * about.php, blog.php, blog_details.php * bookings.php, campsites.php, contact.php * course_details.php, driver_training.php, events.php * membership.php, membership_application.php, membership_payment.php * trips.php, bush_mechanics.php, rescue_recovery.php * indemnity.php, basic_indemnity.php * best_of_the_eastern_cape_2024.php, 2025_agm_minutes.php - Results: * Eliminated ~90% duplicate code across 23 pages * Single source of truth for banner functionality * Easier future updates to banner styling/behavior * Breadcrumb navigation now consistent and parameterized
104 lines
3.8 KiB
PHP
104 lines
3.8 KiB
PHP
<?php
|
|
$headerStyle = 'light';
|
|
include_once('header.php');
|
|
// Assuming you have the user ID stored in the session
|
|
if (isset($_SESSION['user_id'])) {
|
|
$user_id = $_SESSION['user_id'];
|
|
} else {
|
|
header('Location: login.php');
|
|
exit(); // Stop further script execution
|
|
}
|
|
|
|
// Initialize variables
|
|
$payment_amount = null;
|
|
$membership_start_date = null;
|
|
$membership_end_date = null;
|
|
|
|
// Get the user_id from the session
|
|
$user_id = isset($_SESSION['user_id']) ? $_SESSION['user_id'] : null;
|
|
|
|
if ($user_id) {
|
|
// Prepare the SQL query to fetch data
|
|
$query = "SELECT payment_amount, membership_start_date, membership_end_date, payment_id
|
|
FROM membership_fees
|
|
WHERE user_id = ?";
|
|
|
|
if ($stmt = $conn->prepare($query)) {
|
|
// Bind the user_id parameter to the query
|
|
$stmt->bind_param("i", $user_id);
|
|
|
|
// Execute the query
|
|
$stmt->execute();
|
|
|
|
// Bind the results to variables
|
|
$stmt->bind_result($payment_amount, $membership_start_date, $membership_end_date, $eft_id);
|
|
|
|
// Fetch the data
|
|
if ($stmt->fetch()) {
|
|
// Values are now assigned to $payment_amount, $membership_start_date, and $membership_end_date
|
|
} else {
|
|
// Handle case where no records are found
|
|
$error_message = "No records found for the given user ID.";
|
|
}
|
|
|
|
// Close the statement
|
|
$stmt->close();
|
|
} else {
|
|
// Handle query preparation failure
|
|
$error_message = "Query preparation failed: " . $conn->error;
|
|
}
|
|
} else {
|
|
// Handle case where user_id is not found in session
|
|
$error_message = "User ID not found in session.";
|
|
}
|
|
|
|
// Get user's email
|
|
$sql = "SELECT email FROM users WHERE user_id = ?";
|
|
$stmt = $conn->prepare($sql);
|
|
|
|
if (!$stmt) {
|
|
die("Prepare failed: " . $conn->error);
|
|
}
|
|
|
|
$stmt->bind_param("i", $user_id);
|
|
$stmt->execute();
|
|
$stmt->bind_result($user_email);
|
|
$stmt->fetch();
|
|
$stmt->close();
|
|
|
|
$conn->close();
|
|
?><?php
|
|
$pageTitle = 'Membership Payment';
|
|
$breadcrumbs = [['Home' => 'index.php'], ['Membership' => 'membership.php']];
|
|
require_once('components/banner.php');
|
|
?>
|
|
<!-- Contact Form Area start -->
|
|
<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">New Membership Payment:</span>
|
|
<?php echo
|
|
'<h5>Membership Start Date: ' . $membership_start_date . '<br>Membership Renewal Date: ' . $membership_end_date . '</h5>'; ?>
|
|
</div>
|
|
<p>Your invoice has been sent to <b><?php echo htmlspecialchars($user_email); ?></b>. Please upload your proof of payment below.</p>
|
|
<h5>Payment Details:</h5>
|
|
<p>The Four Wheel Drive Club of Southern Africa<br>FNB<br>Account Number: 58810022334<br>Branch code: 250655<br>Reference: <?php echo htmlspecialchars($eft_id); ?><br>Amount: R <?php echo number_format($payment_amount, 2); ?></p>
|
|
<a href="submit_pop.php" class="theme-btn style-two style-three" style="width:100%;">
|
|
<span data-hover="Submit Proof of Payment">Submit Proof of Payment</span>
|
|
<i class="fal fa-arrow-right"></i>
|
|
</a>
|
|
</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="About">
|
|
</div>
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
</section>
|
|
|
|
<?php include_once("insta_footer.php"); ?>
|