59 lines
2.4 KiB
PHP
59 lines
2.4 KiB
PHP
<?php
|
|
session_start();
|
|
require_once 'db/config.php';
|
|
|
|
if (!isset($_SESSION['user_id'])) {
|
|
header('Location: login.php');
|
|
exit;
|
|
}
|
|
|
|
$user_id = $_SESSION['user_id'];
|
|
$stmt = $pdo->prepare('SELECT * FROM users WHERE id = ?');
|
|
$stmt->execute([$user_id]);
|
|
$user = $stmt->fetch();
|
|
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Pay Merchant - UBPay</title>
|
|
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css">
|
|
</head>
|
|
<body>
|
|
<div class="container">
|
|
<div class="row justify-content-center">
|
|
<div class="col-md-6">
|
|
<div class="card mt-5">
|
|
<div class="card-body">
|
|
<h3 class="card-title text-center mb-4">Pay Merchant</h3>
|
|
<div class="text-center mb-4">
|
|
<p class="text-muted mb-0">Your current balance:</p>
|
|
<h4 class="fw-bold">$<?php echo number_format($user['balance'], 2); ?></h4>
|
|
</div>
|
|
<form action="process-pay-merchant.php" method="post">
|
|
<div class="mb-3">
|
|
<label for="merchant-code" class="form-label">Merchant Code</label>
|
|
<input type="text" class="form-control" id="merchant-code" name="merchant_code" required>
|
|
</div>
|
|
<div class="mb-3">
|
|
<label for="amount" class="form-label">Amount</label>
|
|
<input type="number" class="form-control" id="amount" name="amount" step="0.01" required>
|
|
</div>
|
|
<div class="d-grid">
|
|
<button type="submit" class="btn btn-primary">Pay Now</button>
|
|
</div>
|
|
<p class="text-center mt-3">
|
|
<a href="dashboard.php">Back to Dashboard</a>
|
|
</p>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"></script>
|
|
</body>
|
|
</html>
|