- Updated 39 pages from old header01.php and header02.php includes - All pages now use single configurable header.php with $headerStyle variable - Light style (default): Most pages (login, register, trips, courses, etc.) - Dark style: Coming from header01 original usage Pages updated: - Admin pages: admin_*.php (10 files) - Booking pages: bookings.php, campsite_booking.php, etc. - Content pages: blog.php, blog_details.php, contact.php, events.php, etc. - User pages: account_settings.php, membership*.php, register.php, etc. - Utility pages: 404.php, payment_confirmation.php, reset_password.php, etc. All pages now maintain single header template source - easier to update navigation, styles, and functionality across the entire site.
129 lines
4.9 KiB
PHP
129 lines
4.9 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
|
|
$bannerFolder = 'assets/images/banners/';
|
|
$bannerImages = glob($bannerFolder . '*.{jpg,jpeg,png,webp}', GLOB_BRACE);
|
|
|
|
$randomBanner = 'assets/images/base4/camping.jpg'; // default fallback
|
|
if (!empty($bannerImages)) {
|
|
$randomBanner = $bannerImages[array_rand($bannerImages)];
|
|
}
|
|
?>
|
|
<section class="page-banner-area pt-50 pb-35 rel z-1 bgs-cover" style="background-image: url('<?php echo $randomBanner; ?>');">
|
|
<div class="banner-overlay"></div>
|
|
<div class="container">
|
|
<div class="banner-inner text-white">
|
|
<h2 class="page-title mb-10" data-aos="fade-left" data-aos-duration="1500" data-aos-offset="50">Payment</h2>
|
|
<nav aria-label="breadcrumb">
|
|
<ol class="breadcrumb justify-content-center mb-20" data-aos="fade-right" data-aos-delay="200" data-aos-duration="1500" data-aos-offset="50">
|
|
<li class="breadcrumb-item"><a href="index.php">Home</a></li>
|
|
<li class="breadcrumb-item ">Membership</li>
|
|
<li class="breadcrumb-item ">Application</li>
|
|
<li class="breadcrumb-item ">Indemnity</li>
|
|
<li class="breadcrumb-item active">Payment</li>
|
|
</ol>
|
|
</nav>
|
|
</div>
|
|
</div>
|
|
</section>
|
|
<!-- Page Banner End -->
|
|
<!-- 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"); ?>
|