-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathusrride.php
176 lines (152 loc) · 5.47 KB
/
usrride.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
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
<?php
session_start();
if(!isset($_SESSION['userdata']))
{
header('Location: index.php');
}
if($_SESSION['userdata']['is_admin']==1)
{
include('header.php');
include('adminwrk.php');
?>
<header>
<nav class="navbar navbar-expand-lg">
<a class="navbar-brand nos" href="#">Ced<span class="gree">Cab</span></a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation">
<span><i class="fas fa-bars logo text-dark"></i></span>
</button>
<div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav ml-auto">
<li class="nav-item rbtn">
<a class="btn" href="admin.php">Dashboard</a>
<a class="btn" href="logout.php">Logout</a>
</li>
</ul>
</div>
</nav>
</header>
<?php
echo '<h1 class="text-center text-weight-bold text-dark">ADMIN can not Enter User Area</h1>';
}
else {
include('user.php');
if(isset($_GET['action']))
{
if($_GET['action']=='blk')
{
$id= $_GET['id'];
$ap=1;
$adm = new user();
$admc = new dbcon();
$sho = $adm->ridec($ap,$id,$admc->conn);
}
}
include('header.php');
include('navs.php');
include('ussidebar.php');
?>
<nav class="nav nav-pills nav-justified col-sm-10">
<button class="nav-link btn btn-light " id="allridu">All Rides</button>
<a class="nav-link btn btn-light " href="upenride.php">Pending Rides</a>
<a class="nav-link btn btn-light " href="ucanride.php">Cancelled Rides</a>
<a class="nav-link btn btn-light " href="ucomride.php">Completed Rides</a>
<button class="nav-link btn btn-light " id="ernridu">Total Spending</button>
</nav>
<div id="drp" class="row p-2">
<div class="mr-2" id="srt">
<label for="sorting">FILTER BY</label>
<select name="sortu" id="sortu">
<option value="" selected hidden disabled>FILTER BY</option>
<option value="none">None</option>
<option value="week">Week</option>
<option value="month">Month</option>
</select>
</div>
<div class="mr-2" id="cstats">
<label for="stat">Booking Status</label>
<select name="cstat" id="cstat">
<option value="" selected>All</option>
<option value="Pending">Pending</option>
<option value="Canceled">Canceled</option>
<option value="Completed">Completed</option>
</select>
</div>
<div class="mr-2" id="cfilt" >
<label for="filter">FILTER BY CAB</label>
<select name="cfil" id="cfil">
<option value="" selected>NONE</option>
<option value="CedMini">CedMini</option>
<option value="CedMicro">CedMicro</option>
<option value="CedRoyal">CedRoyal</option>
<option value="CedSUV">CedSUV</option>
</select>
</div>
</div>
<div id="allru">
<h3 class="text-center">All Rides</h3>
<table id="tbl" class="container-fluid col-lg-10 mr-lg-2 table table-responsive table-hover table-bordered table-striped">
<thead>
<th onclick="sortTable(0,tbl)">Ride Date ⇩</th>
<th>Pickup Point</th>
<th>Drop Point</th>
<th>Cab Type</th>
<th onclick="sortTablen(4,tbl)">Distance ⇩</th>
<th onclick="sortTablen(5,tbl)">Luggage ⇩</th>
<th onclick="sortTablen(6,tbl)">Ride Fare ⇩</th>
<th>Status</th>
<th>User id</th>
<th>Cancel</th>
<th>Invoice</th>
</thead>
<tbody id="tblc">
<?php
$id=$_SESSION['userdata']['user_id'];
$adm = new user();
$admc = new dbcon();
$showr = $adm->allride($id,$admc->conn);
foreach($showr as $key=>$val)
{
echo "<tr><td>".$val['ride_date']."</td><td>".$val['from_distance']."</td><td>".$val['to_distance']."</td><td>".$val['cab_type']."</td><td>".$val['total_distance']." Km</td><td>".$val['luggage']." Kg</td><td>".$val['total_fare']." Rs</td><td>";
if($val['status']==1)
{
echo "Pending</td>";
}
if($val['status']==0)
{
echo "Canceled</td>";
}
if($val['status']==2)
{
echo "Completed</td>";
}
echo "<td>".$val['customer_user_id']."</td>";
if($val['status']==1)
{
echo "<td><a class='btn btn-warning' href='usrride.php?action=blk&id=".$val['ride_id']."'>Cancel</a></td>";
}
else{
echo "<td><a class='btn btn-warning disabled' >Cancel</a></td>";
}
if($val['status']==2)
{
echo "<td><a class='btn btn-info' href='invoiceu.php?id=".$val['ride_id']."'>Invoice</a></td>";
}
else{
echo "<td><a class='btn btn-info disabled'>Invoice</a></td>";
}
}
?>
</tbody>
</table>
</div>
<div id="ernru">
<h3 class="text-center">Total Spending</h3>
<?php
$id=$_SESSION['userdata']['user_id'];
$adm = new user();
$admc = new dbcon();
$en = $adm->earn($id,$admc->conn);
?>
<h1 class="text-center font-weight-bold text-dark">₹<?php echo $en; ?></h1>
</div>
<?php include('adfoot.php');} ?>