-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathemployee.php
231 lines (192 loc) · 7.45 KB
/
employee.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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
<?php require_once('header.php') ?>
<style>
.switch {
position: relative;
display: inline-block;
width: 60px;
height: 34px;
}
.switch input {
opacity: 0;
width: 0;
height: 0;
}
.slider {
position: absolute;
cursor: pointer;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-color: #ccc;
-webkit-transition: .4s;
transition: .4s;
}
.slider:before {
position: absolute;
content: "";
height: 26px;
width: 26px;
left: 4px;
bottom: 4px;
background-color: white;
-webkit-transition: .4s;
transition: .4s;
}
input:checked+.slider {
background-color: #2196F3;
}
input:focus+.slider {
box-shadow: 0 0 1px #2196F3;
}
input:checked+.slider:before {
-webkit-transform: translateX(26px);
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* Rounded sliders */
.slider.round {
border-radius: 34px;
}
.slider.round:before {
border-radius: 50%;
}
#myMap{
width:100%;
height:400px;
}
</style>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<div id="layoutSidenav_content">
<main>
<div class="row">
<div class="col-xl-6">
<div class="card mb-4">
<div class="card bg-primary text-white mb-4">
<div class="card-body">My Balance
<h2><?php echo $user['balance'] ?></h2></div>
<div class="card-footer d-flex align-items-center justify-content-between">
<div class="small text-white"><i class="fas fa-angle-right"></i></div>
</div>
</div>
<div class="card-header">
<i class="fas fa-chart-area me-1"></i>
Request
</div>
<div class="card-body">
<div id="donutchart" width="100%" height="80"></div>
</div>
</div>
</div>
<div class="col-xl-6">
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-chart-bar me-1"></i>
Share Location <small>     <label class="switch">
<input type="checkbox" id="share" onchange="shareLoc()">
<span class="slider"></span>
</label></small>
</div>
<div class="card-body">
<div id="myMap" >
</div>
</div>
</div>
</div>
</div>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Pickup Pending
</div>
<table id="datatablesSimple">
<thead>
<tr>
<th>Date</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody id="newReq">
<?php
$id=$user['id'];
$sql="SELECT * FROM service where allocated_to=$id and status=3";
$res=mysqli_query($conn,$sql);
if(!$res){
echo mysqli_error($conn);
}else{
while($row=mysqli_fetch_assoc($res)){
?>
<tr>
<td><?php echo $row['date']?></td>
<td><?php echo $row['address']?></td>
<td><a href="EmpAction.php?id=<?php echo $row['id'] ?>">View </a></td>
</tr>
<?php }
}?>
</tbody>
</table>
</div>
<div class="card mb-4">
<div class="card-header">
<i class="fas fa-table me-1"></i>
Pending Request
</div>
<div class="card-body">
<div class="card-body">
<table class="table table-responsive">
<?php
$id = $_SESSION["login_user"]["id"];
$sql1 = "Select * from service where allocated_to=$id and status=2 ";
if (!$result = mysqli_query($conn, $sql1)) {
echo mysqli_errno($conn);
} else {
while ($res = mysqli_fetch_assoc($result)) {
?>
<tr>
<td>
Address:- <?php echo $res["address"]; ?>
<br>
<small>Date:- <?php echo $res["date"]; ?></small><br>
Status:
<?php if ($res["status"] == 0) { ?>
<small>
<a class="text-danger">Close </a>
</small>
<?php } else if ($res["status"] == 2) { ?>
<small>
<a class="text-success">Pending </a>
</small>
<?php } ?>
<div style="float:right;">
<small>
<a href="EmpAction.php?id=<?php echo $res['id'] ?>">View </a>
</small>
</div>
</td>
</tr>
<?php }
} ?>
</table>
</div>
</div>
</div>
</main>
<?php require_once('footer.php') ?>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
<script src="js/scripts.js"></script>
</body>
<script>
function shareLoc(){
// let val=document.getElementById("share");
if($("#share").is(":checked")){
flag=1;
}else{
flag=0;
}
}
</script>
<?php require_once('setEmpLocation.php')?>
</html>