-
Notifications
You must be signed in to change notification settings - Fork 0
/
cancelCabTicket.php
40 lines (26 loc) · 986 Bytes
/
cancelCabTicket.php
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
<?php session_start();
if(!isset($_SESSION["username"]))
{
header("Location:blocked.php");
$_SESSION['url'] = $_SERVER['REQUEST_URI'];
}
?>
<?php
$servername = "localhost";
$username = "root";
$password = "";
$dbname = "projectmeteor";
// Creating a connection to projectmeteor MySQL database
$conn = new mysqli($servername, $username, $password, $dbname);
// Checking if we've successfully connected to the database
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$user = $_SESSION["username"];
$id = $_POST["bookingID"];
$cancelCabBookingsSQL = "UPDATE `cabbookings` SET cancelled='yes' WHERE bookingID='$id'";
$cancelCabBookingsQuery = $conn->query($cancelCabBookingsSQL);
/*-------------------------------------------------------------------------------
Add SQL statements to delete train, bus, cabs booking too
-------------------------------------------------------------------------------*/
?>