-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcancellation-request-successful.php
42 lines (35 loc) · 1.21 KB
/
cancellation-request-successful.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
41
42
<?php
include 'nav-bkg.php';
include 'connect.php';
echo '<div class="border border-secondary d-flex justify-content-center align-items-center h-75" >';
$conn = OpenCon();
session_start();
$email1 = $_SESSION['email'];
$_SESSION['e1'] = $_SESSION['email'];
$resr_id = $_POST["id"];
$activity_id = $_POST["activity_id"];
$sql = "Select id From management";
$result = $conn->query($sql);
$mang_id = array();
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
array_push($mang_id,$row["id"]) ;
}
}
echo "<br>";
$assigned_index = array_rand($mang_id, 1);
$assigned_id = $mang_id[$assigned_index];
echo "<br>";
$sql2 = "insert into Request_cancel values ('$resr_id','$assigned_id', '$email1')";
if ( $conn->query($sql2) === TRUE) {
header( "refresh:5;url= visitor.php" );
echo "Request for cancelling the reservation id: $resr_id is confirmed.<br><br>";
echo "The request will be processed within 24 hours.";
echo "<br>";
echo "Redirecting to the homepage...";
} else {
echo "Cancellation has already been requested for reservation id: '$resr_id'.";
header( "refresh:5;url= visitor-request-cancellation.php" );
}
CloseCon($conn);
?>