-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcancel.php
More file actions
58 lines (36 loc) · 1.35 KB
/
cancel.php
File metadata and controls
58 lines (36 loc) · 1.35 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
<?php
include_once 'header.php';
?>
<style>
body{
background-image: url("images/cancel.jpg");
background-repeat: no-repeat;
background-size:100%;
color: white;
}
</style>
<body style="background-color: powderblue; font-family: monospace; margin: 0; padding: 0;">
<?php
$dbServername = "localhost";
$dbUsername = "root";
$dbPassword = "password";
$dbName = "test";
$conn = mysqli_connect($dbServername, $dbUsername, $dbPassword, $dbName);
$sql="call adding ('".$_SESSION['show_id']."','".$_SESSION['seats']."')";
mysqli_query($conn, $sql) or die('Error delete');
$sql1="SELECT booking_id from booking ORDER BY booking_id desc LIMIT 1";
$result1=mysqli_query($conn,$sql1) or die("error delete 1");
$row=mysqli_fetch_array($result1);
$sql2="delete from booking where booking_id='".$row['booking_id']."'";
$result2=mysqli_query($conn,$sql2) or die("error delete 2");
$id=(int)$row['booking_id'];
$sql3="ALTER TABLE booking AUTO_INCREMENT=$id";
mysqli_query($conn, $sql3) or die('Error auto_inc');
echo '<center><p style="font-family: monospace; font-size:400%;"><br><b>Tickets Cancelled!</b><p></center>';
unset($_SESSION['seats']);
unset($_SESSION['show_id']);
?>
</body>
<?php
include_once 'footer.php';
?>