-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprocess_request.php
More file actions
26 lines (24 loc) · 833 Bytes
/
process_request.php
File metadata and controls
26 lines (24 loc) · 833 Bytes
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
<?php
session_start();
include 'includes/db_connect.php';
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$booking_id = $_POST['booking_id'];
$action = $_POST['action'];
if ($action == 'accept') {
// Update status to 'accepted'
$sql = "UPDATE bookings SET status='accepted' WHERE id=$booking_id";
if ($conn->query($sql) === TRUE) {
// UPDATED REDIRECT: Points to communication_room.php
header("Location: communication_room.php?booking_id=$booking_id");
exit();
}
} elseif ($action == 'reject') {
// Update status to 'rejected'
$sql = "UPDATE bookings SET status='rejected' WHERE id=$booking_id";
if ($conn->query($sql) === TRUE) {
header("Location: listener_dashboard.php");
exit();
}
}
}
?>