| Server IP : 127.0.0.1 / Your IP : 216.73.216.48 Web Server : Apache/2.4.58 (Win64) OpenSSL/3.1.3 PHP/8.2.12 System : Windows NT DESKTOP-3H4FHQJ 10.0 build 19045 (Windows 10) AMD64 User : win 10 ( 0) PHP Version : 8.2.12 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : D:/xampp/htdocs-coblaa/Cinevaa/ |
Upload File : |
<?php
include('db.php');
session_start();
$amount = isset($_SESSION['amount']) ? $_SESSION['amount'] : 0;
$planName = isset($_SESSION['selected_plan']) ? ucfirst($_SESSION['selected_plan']) : "Plan";
$status = isset($_GET['status']) ? $_GET['status'] : '';
$ref = isset($_GET['ref']) ? htmlspecialchars($_GET['ref']) : '';
// NEW: If status is pending, check the database to see if Admin has approved it yet
$db_status = 'pending';
if ($status == 'pending' && !empty($ref)) {
$ref_clean = mysqli_real_escape_string($con, $ref);
$check_db = mysqli_query($con, "SELECT status FROM payments WHERE transaction_ref = '$ref_clean'");
if ($row = mysqli_fetch_assoc($check_db)) {
$db_status = $row['status'];
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Mobile Payment</title>
<style>
:root {
--primary: #2563eb;
--success: #10b981;
--warning: #f59e0b;
--bg: #f3f4f6;
--text-main: #1f2937;
--text-muted: #6b7280;
}
body {
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
background-color: var(--bg);
display: flex;
align-items: center;
justify-content: center;
min-height: 100vh;
margin: 0;
padding: 20px;
}
#payment-container {
background: white;
width: 100%;
max-width: 420px;
padding: 32px;
border-radius: 20px;
box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
h2 { margin-top: 0; color: var(--text-main); font-size: 1.5rem; text-align: center; font-weight: 700; }
.instruction-card { background-color: #f8fafc; border: 1px solid #e2e8f0; padding: 20px; border-radius: 12px; margin: 24px 0; text-align: center; }
.phone-number { display: block; font-size: 1.4rem; color: var(--primary); font-weight: 800; margin-top: 10px; letter-spacing: 1px; }
label { display: block; font-size: 0.875rem; font-weight: 600; color: var(--text-main); margin-bottom: 8px; }
input[type="text"] { width: 100%; padding: 14px; border: 2px solid #e5e7eb; border-radius: 10px; font-size: 1rem; transition: border-color 0.2s; box-sizing: border-box; outline: none; }
input[type="text"]:focus { border-color: var(--primary); }
button { width: 100%; background-color: var(--primary); color: white; padding: 16px; border: none; border-radius: 10px; font-size: 1rem; font-weight: 600; cursor: pointer; margin-top: 10px; transition: transform 0.1s; }
button:active { transform: scale(0.98); }
/* Pending/Success States */
.pending-card { text-align: center; padding: 10px; }
.loader-ring { display: inline-block; width: 60px; height: 60px; border: 4px solid #fef3c7; border-top: 4px solid var(--warning); border-radius: 50%; animation: spin 1s linear infinite; margin-bottom: 20px; }
.success-icon { font-size: 60px; color: var(--success); margin-bottom: 20px; }
@keyframes spin { 0% { transform: rotate(0deg); } 100% { transform: rotate(360deg); } }
.status-badge { display: inline-block; padding: 6px 16px; border-radius: 20px; font-size: 0.85rem; font-weight: 700; text-transform: uppercase; margin-bottom: 15px; }
.badge-pending { background-color: #fffbeb; color: #92400e; border: 1px solid #fef3c7; }
.badge-approved { background-color: #ecfdf5; color: #065f46; border: 1px solid #d1fae5; }
.info-box { background: #f8fafc; border-radius: 12px; padding: 20px; margin: 25px 0; border-left: 4px solid var(--warning); text-align: left; }
.info-box.success { border-left-color: var(--success); }
.ref-text { font-family: 'Courier New', monospace; font-weight: bold; color: #1f2937; background: #e2e8f0; padding: 2px 6px; border-radius: 4px; }
</style>
</head>
<body>
<div id="payment-container">
<?php if ($status == 'pending'): ?>
<div class="pending-card">
<?php if ($db_status == 'approved'): ?>
<div class="success-icon">✓</div>
<div class="status-badge badge-approved">Payment Confirmed</div>
<h2>Thank You!</h2>
<div class="info-box success">
<p>Your payment for the <strong><?php echo $planName; ?></strong> has been verified. You now have full access.</p>
</div>
<button onclick="window.location.href='index'">Go to Dashboard</button>
<?php else: ?>
<div class="loader-ring"></div>
<div class="status-badge badge-pending">Awaiting Approval</div>
<h2>Verifying Payment</h2>
<div class="info-box">
<p><strong>Ref:</strong> <span class="ref-text"><?php echo $ref; ?></span></p>
<p><strong>Amount:</strong> UGX <?php echo number_format($amount); ?></p>
</div>
<p style="color: var(--text-muted); font-size: 0.85rem;">Checking your transaction status... Please wait.</p>
<script>
// Check database again in 10 seconds
setTimeout(function(){ window.location.reload(); }, 10000);
</script>
<?php endif; ?>
</div>
<?php else: ?>
<h2>Complete Payment</h2>
<div class="instruction-card">
<p style="font-weight: bold;">Plan: <?php echo $planName; ?> | UGX <?php echo number_format($amount); ?></p>
<p style="margin: 10px 0 0; color: var(--text-muted); font-size: 0.9rem;">Send money to:</p>
<span class="phone-number">0754 557 788</span>
</div>
<form action="process_payment.php" method="POST">
<label>Enter Transaction Reference</label>
<input type="text" name="transaction_ref" placeholder="e.g. 192837465" required>
<button type="submit">Submit for Verification</button>
</form>
<?php endif; ?>
</div>
</body>
</html>