-
Notifications
You must be signed in to change notification settings - Fork 35
Expand file tree
/
Copy pathupdate-payment.php
More file actions
27 lines (21 loc) · 828 Bytes
/
update-payment.php
File metadata and controls
27 lines (21 loc) · 828 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
27
<?php
// update-payment.php
require_once "includes/connection.php";
if ($_SERVER["REQUEST_METHOD"] === "POST" && isset($_POST['id'])) {
// Handle the AJAX request to update payment status
$id = $_POST['id'];
// Update the payment status to 1 for the specific ID
$updateQuery = "UPDATE table_booking_ground SET payment = 1 WHERE id = '$id'";
$updateResult = mysqli_query($conn, $updateQuery);
if ($updateResult) {
// Payment status updated successfully
echo "Payment status updated successfully";
} else {
// Failed to update payment status
echo "Failed to update payment status";
}
exit; // Stop further execution after handling the AJAX request
}
// Invalid request method or missing 'id' parameter
echo "Invalid request";
?>