PNG IHDR x sBIT|d pHYs + tEXtSoftware www.inkscape.org< ,tEXtComment
<?php
session_start();
require 'db.php'; // 1. Connect to the database
// --- FETCH PAYMENT SETTINGS ---
// Initialize with defaults to prevent errors if DB is empty
$paySettings = [
'usdt_wallet' => 'Address Not Set',
'cashapp_tag' => 'Tag Not Set',
'zelle_email' => 'Email Not Set',
'zelle_name' => '',
'bank_name' => 'Bank Not Set',
'bank_account_name' => '',
'bank_account_number' => '',
'bank_sort_code' => ''
];
// If DB connection exists, fetch real settings
if(isset($pdo)) {
try {
$stmt = $pdo->query("SELECT * FROM payment_settings");
while ($row = $stmt->fetch()) {
$paySettings[$row['setting_key']] = $row['setting_value'];
}
} catch (Exception $e) {
// Fallback to defaults
}
}
// --- DATA PROCESSING ---
$cartItems = [];
$total = 0.00;
$currencySymbol = '£';
if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['cart_data'])) {
$cartItems = json_decode($_POST['cart_data'], true);
$_SESSION['checkout_cart'] = $cartItems;
} elseif (isset($_SESSION['checkout_cart'])) {
$cartItems = $_SESSION['checkout_cart'];
}
// Retrieve Currency Symbol
if (isset($_POST['currency_symbol'])) {
$currencySymbol = htmlspecialchars($_POST['currency_symbol']);
$_SESSION['checkout_currency'] = $currencySymbol;
} elseif (isset($_SESSION['checkout_currency'])) {
$currencySymbol = $_SESSION['checkout_currency'];
}
foreach ($cartItems as $item) {
if (isset($item['amt'])) {
$total += (float)$item['amt'];
}
}
if (empty($cartItems)) {
header('Location: index.php');
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Secure Checkout - Global Relief Bridge</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
<style>
/* --- VARIABLES --- */
:root {
--primary: #007BFF;
--primary-dark: #0056b3;
--success-green: #28a745;
--bg-body: #f4f7f6;
--text-main: #2c3e50;
--radius: 16px;
}
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif; }
body { background-color: var(--bg-body); color: var(--text-main); min-height: 100vh; padding: 40px 20px; }
/* --- LAYOUT GRID --- */
.checkout-wrapper {
display: grid;
grid-template-columns: 1fr 1.4fr;
max-width: 1100px;
margin: 0 auto;
background: white;
border-radius: var(--radius);
box-shadow: 0 20px 60px rgba(0,0,0,0.08);
overflow: hidden;
}
/* --- LEFT SIDE: VISUAL --- */
.visual-panel {
background: linear-gradient(135deg, rgba(0, 123, 255, 0.85) 0%, rgba(0, 86, 179, 0.9) 100%),
url('https://images.unsplash.com/photo-1488521787991-ed7bbaae773c?q=80&w=800');
background-size: cover;
background-position: center;
color: white;
padding: 50px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
.back-btn {
color: white; text-decoration: none; font-weight: 600;
display: inline-flex; align-items: center; gap: 8px;
opacity: 0.8; transition: 0.3s;
}
.back-btn:hover { opacity: 1; transform: translateX(-5px); }
.trust-quote {
background: rgba(255,255,255,0.1);
backdrop-filter: blur(5px);
padding: 25px;
border-radius: 12px;
border-left: 4px solid #fff;
}
/* --- RIGHT SIDE: FORM --- */
.form-panel { padding: 50px; }
.checkout-header {
display: flex; justify-content: space-between; align-items: center;
margin-bottom: 30px; padding-bottom: 20px; border-bottom: 1px solid #eee;
}
.secure-badge {
color: var(--success-green); background: #e8f5e9;
padding: 6px 12px; border-radius: 20px;
font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
/* --- SUMMARY BOX --- */
.summary-box {
background: #f8f9fa; border: 1px solid #e9ecef;
padding: 20px; border-radius: 12px; margin-bottom: 30px;
display: flex; justify-content: space-between; align-items: center;
}
.total-amount { font-size: 1.8rem; font-weight: 800; color: var(--primary); }
/* --- INPUTS --- */
.form-group { margin-bottom: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
label { display: block; margin-bottom: 8px; font-weight: 600; font-size: 0.9rem; color: #555; }
input[type="text"], input[type="email"], textarea {
width: 100%; padding: 14px 18px;
border: 1px solid #e0e0e0; border-radius: 10px;
font-size: 1rem; transition: 0.3s; background: #fafafa;
}
input:focus, textarea:focus {
border-color: var(--primary); background: white;
box-shadow: 0 0 0 4px rgba(0, 123, 255, 0.1); outline: none;
}
/* --- PREFS --- */
.contact-prefs-grid {
display: grid; grid-template-columns: 1fr 1fr; gap: 15px; margin-top: 10px;
}
.pref-box {
border: 1px solid #ddd; border-radius: 10px; padding: 15px;
display: flex; flex-direction: column; align-items: center; text-align: center;
cursor: pointer; position: relative; transition: 0.3s;
}
.pref-box:hover { border-color: var(--primary); background: #f9fff9; }
.pref-box i { font-size: 1.5rem; color: var(--primary); margin-bottom: 10px; }
.pref-box span { font-size: 0.9rem; font-weight: 600; color: #555; }
.pref-checkbox { position: absolute; top: 10px; right: 10px; accent-color: var(--primary); cursor: pointer; }
.campaign-alert {
background-color: #3b5998; color: white; padding: 10px; text-align: center;
border-radius: 5px; font-size: 0.9rem; margin: 20px 0; font-weight: 600;
}
/* --- PAYMENT GRID --- */
.payment-methods { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 25px; }
.pm-option {
border: 2px solid #eee; border-radius: 12px; padding: 15px 5px;
cursor: pointer; text-align: center; font-size: 0.85rem; font-weight: 700; color: #555;
transition: 0.2s; background: white;
}
.pm-option:hover { border-color: var(--primary); transform: translateY(-2px); }
.pm-option.active { border-color: var(--primary); background: #f0f7ff; color: var(--primary); }
.pm-option i { display: block; font-size: 1.6rem; margin-bottom: 8px; color: #888; }
.pm-option.active i { color: var(--primary); }
/* --- DYNAMIC DETAILS --- */
.details-box { display: none; background: white; border: 1px solid #eee; padding: 25px; border-radius: 12px; margin-bottom: 25px; box-shadow: 0 5px 15px rgba(0,0,0,0.03); }
.details-box.active { display: block; animation: slideDown 0.3s ease; }
.copy-row {
background: #f4f7f6; padding: 12px; border-radius: 8px;
display: flex; justify-content: space-between; align-items: center;
font-family: monospace; font-size: 1.1rem; border: 1px solid #ddd;
}
.copy-btn { color: var(--primary); cursor: pointer; font-weight: bold; }
/* --- LOADER --- */
.loader-box { display: none; text-align: center; padding: 20px; }
.spinner { width: 30px; height: 30px; border: 3px solid #f3f3f3; border-top: 3px solid var(--primary); border-radius: 50%; margin: 0 auto 10px; animation: spin 0.8s linear infinite; }
/* --- UPLOAD --- */
.upload-area {
border: 2px dashed #cbd5e0; border-radius: 12px; padding: 25px;
text-align: center; cursor: pointer; transition: 0.3s;
}
.upload-area:hover { border-color: var(--primary); background: #f9fcff; }
/* --- BUTTON --- */
.btn-submit {
width: 100%; background: linear-gradient(135deg, #007BFF 0%, #0062cc 100%);
color: white; font-size: 1.1rem; font-weight: 700;
padding: 18px; border: none; border-radius: 50px;
cursor: pointer; box-shadow: 0 8px 20px rgba(0,123,255,0.3);
transition: 0.3s; margin-top: 20px;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(0,123,255,0.4); }
/* --- PROGRESS --- */
.progress-bar { display: flex; justify-content: space-between; margin-top: 40px; border-top: 1px solid #eee; padding-top: 20px; }
.step { flex: 1; text-align: center; font-weight: bold; color: #ccc; font-size: 0.9rem; position: relative; }
.step.active { color: var(--primary); }
.step::after { content: ''; display: block; height: 4px; background: #eee; margin-top: 10px; border-radius: 2px; }
.step.active::after { background: var(--primary); }
@media (max-width: 900px) {
.checkout-wrapper { grid-template-columns: 1fr; }
.visual-panel { padding: 30px; min-height: 200px; }
.contact-prefs-grid { grid-template-columns: 1fr; }
.payment-methods { grid-template-columns: repeat(2, 1fr); }
body { padding: 10px; }
}
@keyframes slideDown { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
</style>
</head>
<body>
<div class="checkout-wrapper">
<div class="visual-panel">
<a href="index.php" class="back-btn"><i class="fas fa-arrow-left"></i> Return to Home</a>
<div style="margin-top: auto;">
<h2 style="font-size: 2.2rem; margin-bottom: 20px; line-height:1.2;">Your generosity<br>changes everything.</h2>
<div class="trust-quote">
<p style="font-style: italic; opacity: 0.95;">"Those who spend their wealth in charity day and night, secretly and publicly, receive their reward from their Lord."</p>
</div>
<div style="margin-top: 30px; display: flex; gap: 15px;">
<i class="fab fa-cc-stripe fa-2x" style="opacity:0.7;"></i>
<i class="fab fa-cc-visa fa-2x" style="opacity:0.7;"></i>
<i class="fab fa-cc-mastercard fa-2x" style="opacity:0.7;"></i>
</div>
</div>
</div>
<div class="form-panel">
<div class="checkout-header">
<h2 style="color: #333;">Complete Donation</h2>
<div class="secure-badge"><i class="fas fa-lock"></i> SSL Secure</div>
</div>
<div class="summary-box">
<div>
<small style="text-transform: uppercase; letter-spacing: 1px; color: #777;">Total Donation</small>
<div class="total-amount"><?php echo $currencySymbol . number_format($total, 2); ?></div>
</div>
<div style="text-align: right;">
<div style="font-weight: bold; color: #333;"><?php echo count($cartItems); ?> Appeal(s) Selected</div>
<a href="index.php" style="color: var(--primary); font-size: 0.85rem; text-decoration: none;">Edit Cart</a>
</div>
</div>
<form action="process_payment.php" method="POST" enctype="multipart/form-data">
<h4 style="margin-bottom: 15px; color: #444;">1. Your Details</h4>
<div class="form-row">
<div class="form-group">
<label>First Name</label>
<input type="text" name="first_name" placeholder="e.g. John" required>
</div>
<div class="form-group">
<label>Last Name</label>
<input type="text" name="last_name" placeholder="e.g. Doe" required>
</div>
</div>
<div class="form-group">
<label>Email Address</label>
<input type="email" name="email" placeholder="name@example.com" required>
</div>
<h4 style="margin: 30px 0 15px; color: #444;">2. Additional Info</h4>
<div class="form-group">
<label>Order notes</label>
<textarea name="order_notes" placeholder="Notes about your order, e.g. special notes for delivery."></textarea>
</div>
<div class="campaign-alert">
Your contributions are saving lives. Stay involved by keeping up to date with our campaigns.
</div>
<div class="contact-prefs-grid">
<label class="pref-box">
<input type="checkbox" name="pref_email" class="pref-checkbox">
<i class="far fa-envelope"></i>
<span>Email Updates</span>
</label>
<label class="pref-box">
<input type="checkbox" name="pref_phone" class="pref-checkbox">
<i class="fas fa-phone-alt"></i>
<span>Phone Contact</span>
</label>
<label class="pref-box">
<input type="checkbox" name="pref_post" class="pref-checkbox">
<i class="far fa-file-alt"></i>
<span>Contact me by post</span>
</label>
<label class="pref-box">
<input type="checkbox" name="pref_sms" class="pref-checkbox">
<i class="far fa-comment-dots"></i>
<span>Send me updates by SMS</span>
</label>
</div>
<h4 style="margin: 35px 0 15px; color: #444;">3. Select Payment Method</h4>
<div style="background:#fff3cd; color:#856404; padding:8px; border-radius:8px; margin-bottom:15px; font-weight:bold; text-align:center;">
<i class="fas fa-stopwatch"></i> Session expires in: <span id="time">30:00</span>
</div>
<div class="payment-methods">
<div class="pm-option" onclick="setPayment('stripe', this)">
<i class="far fa-credit-card"></i> Stripe
</div>
<div class="pm-option" onclick="setPayment('bank', this)">
<i class="fas fa-university"></i> Bank
</div>
<div class="pm-option" onclick="setPayment('usdt', this)">
<i class="fas fa-coins"></i> Crypto
</div>
<div class="pm-option" onclick="setPayment('zelle', this)">
<i class="fas fa-bolt"></i> Zelle
</div>
</div>
<input type="hidden" name="payment_method" id="selected_method" required>
<div id="loader-bank" class="loader-box">
<div class="spinner"></div>
<small style="color: #777;">Secure Connection...</small>
</div>
<div id="details-stripe" class="details-box">
<div style="text-align:center; padding:15px;">
<i class="fas fa-exclamation-circle" style="font-size:3rem; color:#ffc107; margin-bottom:15px;"></i>
<h5 style="color:#333; margin-bottom:10px;">Card System Updating</h5>
<p style="color:#666; font-size:0.95rem; margin-bottom:20px;">
We are currently upgrading our secure card processor. <br>
Please make a transfer to our official bank account below:
</p>
<div style="background:#f9f9f9; padding:15px; border-radius:10px; border:1px solid #eee; text-align:left;">
<p style="margin-bottom:5px;"><strong>Bank Name:</strong> <?php echo htmlspecialchars($paySettings['bank_name']); ?></p>
<p style="margin-bottom:5px;"><strong>Account Name:</strong> <?php echo htmlspecialchars($paySettings['bank_account_name']); ?></p>
<p style="margin-bottom:5px;"><strong>Account No:</strong> <?php echo htmlspecialchars($paySettings['bank_account_number']); ?></p>
<p style="margin-bottom:0;"><strong>Sort Code:</strong> <?php echo htmlspecialchars($paySettings['bank_sort_code']); ?></p>
</div>
</div>
</div>
<div id="details-bank" class="details-box">
<h5 style="margin-bottom: 15px; color: var(--primary);">Bank Transfer Details</h5>
<p style="margin-bottom: 5px;"><strong>Bank Name:</strong> <?php echo htmlspecialchars($paySettings['bank_name']); ?></p>
<p style="margin-bottom: 5px;"><strong>Account Name:</strong> <?php echo htmlspecialchars($paySettings['bank_account_name']); ?></p>
<p style="margin-bottom: 5px;"><strong>Account No:</strong> <?php echo htmlspecialchars($paySettings['bank_account_number']); ?></p>
<p style="margin-bottom: 5px;"><strong>Sort Code/Routing:</strong> <?php echo htmlspecialchars($paySettings['bank_sort_code']); ?></p>
<div style="background:#e3f2fd; padding:10px; border-radius:6px; margin-top:10px; font-size:0.9rem;">
<i class="fas fa-info-circle"></i> Use your name as the reference.
</div>
</div>
<div id="details-usdt" class="details-box">
<h5 style="margin-bottom: 15px; color: var(--success-green);">USDT (TRC20) Address</h5>
<div class="copy-row">
<span style="overflow: hidden; text-overflow: ellipsis; white-space: nowrap;"><?php echo htmlspecialchars($paySettings['usdt_wallet']); ?></span>
<i class="far fa-copy copy-btn" onclick="copyText('<?php echo htmlspecialchars($paySettings['usdt_wallet']); ?>')"></i>
</div>
</div>
<div id="details-zelle" class="details-box">
<h5 style="margin-bottom: 15px; color: #6f00ff;">Zelle Details</h5>
<p><strong>Email:</strong> <?php echo htmlspecialchars($paySettings['zelle_email']); ?></p>
<p><strong>Registered Name:</strong> <?php echo htmlspecialchars($paySettings['zelle_name']); ?></p>
</div>
<h4 style="margin: 30px 0 15px; color: #444;">4. Confirm Payment</h4>
<div class="upload-area" onclick="document.getElementById('proof_file').click()">
<i class="fas fa-cloud-upload-alt" style="font-size: 2rem; color: #cbd5e0; margin-bottom: 10px;"></i>
<h5 style="margin-bottom: 5px;">Upload Payment Receipt</h5>
<p style="color: #999; font-size: 0.9rem;" id="file-label">Click here to browse files (JPG, PNG, PDF)</p>
<input type="file" name="payment_proof" id="proof_file" style="display: none;" onchange="updateFileLabel(this)">
</div>
<input type="hidden" name="final_total" value="<?php echo $total; ?>">
<input type="hidden" name="currency_code" value="<?php echo $currencySymbol; ?>">
<button type="submit" class="btn-submit">
Process Donation <i class="fas fa-heart" style="margin-left: 8px;"></i>
</button>
<p style="text-align: center; margin-top: 15px; font-size: 0.85rem; color: #999;">
<i class="fas fa-shield-alt"></i> Your data is processed securely.
</p>
<div class="progress-bar">
<div class="step active">Gift Aid</div>
<div class="step active">Your Details</div>
<div class="step active">Donate</div>
</div>
</form>
</div>
</div>
<?php include 'footer.php'; ?>
<script>
function setPayment(method, btn) {
// Reset active states
document.querySelectorAll('.pm-option').forEach(el => el.classList.remove('active'));
document.querySelectorAll('.details-box').forEach(el => el.classList.remove('active'));
document.getElementById('loader-bank').style.display = 'none';
// Set new active state
btn.classList.add('active');
document.getElementById('selected_method').value = method;
// Handle Logic
if(method === 'bank' || method === 'stripe') {
// Show fake security loader first
document.getElementById('loader-bank').style.display = 'block';
setTimeout(() => {
document.getElementById('loader-bank').style.display = 'none';
// Open specific box (stripe falls back to bank instruction inside its box)
document.getElementById('details-' + method).classList.add('active');
}, 1000);
} else {
// Show immediate for others
const target = document.getElementById('details-' + method);
if(target) target.classList.add('active');
}
}
function updateFileLabel(input) {
if (input.files && input.files[0]) {
document.getElementById('file-label').innerHTML =
'<span style="color:var(--success-green); font-weight:bold;"><i class="fas fa-check"></i> ' + input.files[0].name + '</span>';
document.querySelector('.upload-area').style.borderColor = 'var(--success-green)';
}
}
function copyText(text) {
navigator.clipboard.writeText(text).then(() => {
alert("Address copied to clipboard!");
});
}
</script>
</body>
</html>
b IDATxytVսϓ22 A@IR:hCiZ[v*E:WũZA ^dQeQ @ !jZ'>gsV仿$|?g)&x-E