-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpayment.php
More file actions
100 lines (84 loc) · 2.87 KB
/
Copy pathpayment.php
File metadata and controls
100 lines (84 loc) · 2.87 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include('includes/db.php');
session_start();
if(!isset($_GET['id'])) { header('Location: index.php'); exit; }
$booking_id = intval($_GET['id']);
$bq = mysqli_query($conn, "
SELECT b.*, c.name, c.email
FROM bookings b
JOIN customers c ON b.customer_id=c.customer_id
WHERE b.booking_id=$booking_id
");
if(mysqli_num_rows($bq)==0) { echo 'Booking not found'; exit; }
$booking = mysqli_fetch_assoc($bq);
// Updated bank account details using a variable
$bank_account = 'Account Name: Car Rental Pvt Ltd<br>
Account No: 12023052016025<br>
Bank: AIML<br>
IFSC: AIML122515';
// If form submitted with transaction ID
if($_SERVER['REQUEST_METHOD']=='POST') {
$tx = mysqli_real_escape_string($conn, $_POST['transaction_id']);
// Check 6 hours window
$booking_time = strtotime($booking['booking_time']);
if(time() - $booking_time > 6*3600) {
mysqli_query($conn, "UPDATE bookings SET status='Expired' WHERE booking_id=$booking_id");
$_SESSION['message'] = 'Payment window (6 hours) expired. Booking marked as Expired.';
header('Location: my_bookings.php');
exit;
} else {
mysqli_query($conn, "UPDATE bookings SET transaction_id='$tx', status='Awaiting Approval' WHERE booking_id=$booking_id");
$_SESSION['message'] = 'Transaction ID submitted. Waiting for admin approval.';
header('Location: my_bookings.php');
exit;
}
}
include('includes/header.php');
?>
<!-- Background Video -->
<video autoplay muted loop id="bgVideo">
<source src="assets/videos/background.mp4" type="video/mp4">
Your browser does not support HTML5 video.
</video>
<div class="container mt-5 content" style="max-width:500px;">
<h3 class="styled-text text-center mb-4">Payment for Booking #<?php echo $booking['booking_id']; ?></h3>
<p>Please transfer the required amount to the following bank account within <strong>6 hours</strong> from booking time.</p>
<div class="card p-3 mb-3">
<strong>Bank details:</strong><br>
<?php echo $bank_account; ?>
</div>
<form method="post">
<div class="mb-3">
<label>Transaction ID (from bank)</label>
<input type="text" name="transaction_id" class="form-control" required>
</div>
<button class="btn btn-warning w-100">Submit Transaction ID</button>
</form>
</div>
<?php include('includes/footer.php'); ?>
<style>
#bgVideo {
position: fixed;
top:0; left:0;
width:100%; height:100%;
object-fit: cover;
z-index: -1;
}
.content {
position: relative;
z-index: 1;
background-color: rgba(0,0,0,0.6);
padding: 25px;
border-radius: 12px;
}
/* Heading style */
.styled-text {
color: orange;
text-shadow: 1px 1px 2px black;
}
/* Make input visible */
input.form-control {
color: black;
background-color: #fff;
}
</style>