-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhostBookingComplete.php
More file actions
33 lines (26 loc) · 910 Bytes
/
hostBookingComplete.php
File metadata and controls
33 lines (26 loc) · 910 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
28
29
30
31
32
33
<?php
include('dbConnect.php');
session_start();
$bID = $_GET['bID'];
$pay = $_GET['pay'];
$uID = $_GET['uID'];
$accept = "UPDATE bookings SET
BookingStatus = 'Completed'
WHERE BookingID = '$bID'";
$takeRoomaBalance = "UPDATE admins SET
RoomaBalance = RoomaBalance - $pay";
$addUserBalance = "UPDATE users SET
UserBalance = UserBalance + $pay
WHERE UserID = $uID";
$query = mysqli_query($dbConnect, $accept);
$query2 = mysqli_query($dbConnect, $takeRoomaBalance);
$query3 = mysqli_query($dbConnect, $addUserBalance);
if ($query and $query2 and $query3)
{
echo "<script>window.alert('Checked out.')</script>";
echo "<script>window.location='hostMain.php'</script>";
}
else
{
echo "<p>Something went wrong with checking out the booking.</p>";
}