-
Notifications
You must be signed in to change notification settings - Fork 0
/
cancel_tour.php
154 lines (107 loc) · 3.31 KB
/
cancel_tour.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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<div class="subcategory_container">
<div classp_id="subcategory_content">
<h3 style="width: 100%;
text-align: center;
padding: 20px;
color: #56C1E0;
font-weight: 600;
font-family: bold;
font-size: 40px;">Cancel Tour</h3>
</div>
<div class="row">
<table cellpadding="0px" cellspacing="0" width="100%">
<tr>
<td>
<div class="topnav">
<div class="search-container">
<form action="#" method="post">
<input type="text" placeholder="Search.." name="p_id">
<button type="submit" name="cacel" style="margin-left: -20px;"><i class="fa fa-search"></i></button>
</form>
</div>
</div>
</td>
</tr>
</div>
<tr>
<td style="">
<div class="container">
<?php
$cn=mysqli_connect("localhost","root","","db_ttms");
if (isset($_POST['cacel'])) {
$tour_id = $_POST['p_id'];
$query = "select * from enquiry Where Enquiryid = $tour_id";
$result = mysqli_query($cn,$query);
$row = mysqli_fetch_array($result);
if ($result && $row>0) {
$Enquiryid = $row['Enquiryid'];
$Packageid = $row['Packageid'];
$Name = $row['Name'];
$Gender = $row['Gender'];
$Mobileno = $row['Mobileno'];
$Email = $row['Email'];
$NoofDays = $row['NoofDays'];
$Child = $row['Child'];
$Adults = $row['Adults'];
$Message = $row['message'];
$Statusfield = $row['Statusfield'];
$enquiry_date = $row['enquiry_date'];
$timestamp = strtotime($enquiry_date);
// echo $date = date('d-m-Y', $timestamp);
$stop_date = $enquiry_date;
$stop_date = date('Y-m-d H:i:s', strtotime($stop_date . ' +1 day'));
}
}
if (isset($_GET['cnclid'])) {
$cnclid= $_GET['cnclid'];
$query = "select * from enquiry Where Enquiryid = $cnclid ";
$result = mysqli_query($cn,$query);
$row = mysqli_fetch_array($result);
$enquiry_date = $row['enquiry_date'];
$timestamp = strtotime($enquiry_date);
$stop_date = $enquiry_date;
$stop_date = date('Y-m-d H:i:s', strtotime($stop_date . ' +1 day'));
$now = date('Y-m-d H:i:s');
if (!empty($stop_date) && !empty($now)) {
if ($stop_date>$now) {
$query = "Update enquiry set Statusfield = 'Cancel' where Enquiryid = $cnclid ";
$result = mysqli_query($cn,$query);
if ($result) {
echo "<p style='color:red;padding:10px 10px;margin-left:250px;font-size:30px;margin-top:-40px;'>your tour is successfully canceled</p>";
}
}else{
echo "<p style='color:red;padding:10px 10px;margin-left:250px;font-size:30px;margin-top:-40px;Opps!! time over. you can't cancel you tour</p>";
}
}
}
?>
<div class="row001" >
<table>
<tr>
<th style="padding-left: 20px;">Name</th>
<th>Gender</th>
<th>Mobileno</th>
<th>Email</th>
<th>Action</th>
</tr>
<tr>
<td><?php echo !empty($Name)?$Name : ""; ?></td>
<td><?php echo !empty($Gender)?$Gender : ""; ?></td>
<td><?php echo !empty($Mobileno)?$Mobileno : ""; ?></td>
<td><?php echo !empty($Email)?$Email : ""; ?></td>
<?php
if (!empty($Enquiryid)) { ?>
<td><a href="category.php?cnclid=<?php echo $Enquiryid; ?>&key3=<?php echo $val1; ?>"><button>Cancel</button></a></td>
<?php }else{ ?>
<td></td>
<?php }
?>
</tr>
</table>
</div>
</div>
</td>
</tr>
</table>
</div>
</div>