-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathshared.php
More file actions
168 lines (131 loc) · 4.9 KB
/
Copy pathshared.php
File metadata and controls
168 lines (131 loc) · 4.9 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
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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
<?php
session_start();
include("dbconnect.php");
$uname=$_SESSION['uname'];
extract($_REQUEST);
?>
<?php include("driverheader.php");?>
<div class="container-fluid pt-5">
<div class="container pt-5">
<h2 class="display-4 text-uppercase mb-5"></h2>
<h3>Rider Request</h3>
<div class="row">
<div class="col-lg-4 mb-5">
</div>
<div class="col-lg-6 mb-5">
<form name="form1" method="post">
<?php
$q2 = mysqli_query($connect, "SELECT * FROM rs_rideshare WHERE uname='$uname' order by id desc");
$r1 = mysqli_fetch_array($q2);
?>
<h5>Ride Share on <?php echo $r1['splace']; ?>-<?php echo $r1['dplace']; ?> , <?php echo $r1['pdate']; ?>-<?php echo $r1['ptime']; ?></h5>
</form>
<?php
if ($act == "ok") {
$q22 = mysqli_query($connect, "select * from rs_request where id='$reqid'");
$mr11 = mysqli_fetch_array($q22);
$num_seats=$mr11['num_seats'];
$amount=$mr11['amount'];
/* $finalamt =$num_seats * $amount; */
mysqli_query($connect, "UPDATE rs_request SET status='1' WHERE id='$reqid'");
$q2 = mysqli_query($connect, "select * from rs_rider where uname='$rider'");
$mr1 = mysqli_fetch_array($q2);
$email = $mr1['email'];
$mess = "Dear " . $rider . ", Your booking request has been approved for " . $slotbook . " slots. The amount is " . $amount . ".";
?>
<span style="color:#006600">Booking Approved..</span>
<iframe src="http://iotcloud.co.in/testmail/testmail1.php?message=<?php echo $mess; ?>&email=<?php echo $email; ?>&subject=Seat Booking Request" width="10" height="10" frameborder="1"></iframe>
<script>
setTimeout(function() {
window.location.href = 'shared.php';
}, 4000);
</script>
<?php
} else {
echo "";
}
?>
<?php
if ($act == "no") {
$q22=mysqli_query($connect,"select * from rs_request where id='$reqid'");
$mr11=mysqli_fetch_array($q22);
$num_seats=$mr11['num_seats'];
$amount=$mr11['amount'];
/* $finalamt=$num_seats*$amount; */
mysqli_query($connect, "UPDATE rs_request SET status='2' WHERE id='$reqid'");
$q2=mysqli_query($connect,"select * from rs_rider where uname='$rider'");
$mr1=mysqli_fetch_array($q2);
$email=$mr1['email'];
$mess = "Dear " . $rider . ", Your booking request has been Rejected for " . $slotbook . " slots. The amount is " . $amount . ".";
?>
<span style="color:#006600">Booking Rejected..</span>
<iframe src="http://iotcloud.co.in/testmail/testmail1.php?message=<?php echo $mess;?>&email=<?php echo $email;?>&subject=Seat Booking Request" width="10" height="10" frameborder="1"></iframe>
<script>
setTimeout(function () {
window.location.href= 'shared.php';
}, 4000);
</script>
<?php
}
else{
echo "";
}
?>
</div>
<br>
<table class="table">
<tr>
<?php
if($rid){
$q22 = mysqli_query($connect, "SELECT * FROM rs_request WHERE ride_id='$rid' AND driver='$uname'");
}
else{
$q22 = mysqli_query($connect, "SELECT * FROM rs_request WHERE ride_id='".$r1['id']."' AND driver='$uname'");
}
$k = 1;
$headings = array("#", "Rider", "No. of Seats", "Request on", "Action");
foreach ($headings as $heading) {
?>
<th><?php echo $heading; ?></th>
<?php
}
?>
</tr>
<?php
while ($r11 = mysqli_fetch_array($q22)) {
?>
<tr>
<td><?php echo $k; ?></td>
<td><?php echo $r11['rider']; ?></td>
<td><?php echo $r11['num_seats']; ?></td>
<td><?php echo $r11['rdate']; ?> <?php echo $r11['rtime']; ?></td>
<td>
<?php
if ($r11['status'] == 1) {
echo "Accepted<br />";
echo "Amount: Rs. " . $r11['amount'] . "<br />";
echo "Pay Status: ";
if ($r11['pay_st'] == 1) {
echo "Paid";
} else {
echo "Not Paid";
}
} elseif ($r11['pay_st'] == 2) {
echo "Rejected";
} else {
?>
<a href="shared.php?act=ok&reqid=<?php echo $r11['id'];?>&rider=<?php echo $r11['rider'];?>&slotbook=<?php echo $r11['num_seats']; ?>">Accept</a> / <a href="shared.php?act=no&reqid=<?php echo $r11['id'];?>&rider=<?php echo $r11['rider'];?>">Reject</a>
<?php
}
?>
</td>
</tr>
<?php
$k++;
}
?>
</table>
</div>
</div>
</div>
<?php include("footer.php");?>