-
Notifications
You must be signed in to change notification settings - Fork 0
/
drivers.php
209 lines (168 loc) · 6.63 KB
/
drivers.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
<?php
session_start();
include_once 'header.php';
?>
<html>
<head>
<style>
.container-fluid {
width: 100%;
margin-right: auto;
margin-left: auto;
padding-right: 15px;
padding-left: 15px;
}
.mt--7 {
margin-top: 10px !important;
}
</style>
</head>
<body>
<div class="container-fluid mt--7">
<div class="row">
<div class="col-xl-4 order-xl-2 mb-5 mb-xl-0">
<div class="card card-profile shadow">
<div class="row justify-content-center">
<div class="col-lg-3 order-lg-2">
<div class="card-profile-image">
<a href="#">
<!--<img src="https://demos.creative-tim.com/argon-dashboard/assets/img/theme/team-4.jpg" class="rounded-circle">-->
<h3>filters</h3>
<!--<img src="<?php echo $imageURL; ?>" class="rounded-circle"> -->
</a>
</div>
</div>
</div>
<div class="card-header text-center border-0 pt-8 pt-md-4 pb-0 pb-md-4">
<div class="d-flex justify-content-between">
<form action="" method="post">
<div class="form-group">
<label for="Name">Name</label>
<input type="text" class="input" value="<?php echo isset($_POST['submit'])? $_POST['rname'] : '';?>" name="rname">
</div>
<div class="form-group">
<label for="Name">Source language</label>
<input type="text" class="input" Name="Source">
</div>
<div class="form-group">
<label for="Name">Target language</label>
<input type="text" class="input" Name="Target">
</div>
<div class="form-group">
<label for="Name">Location</label>
<input type="text" class="input" Name="Location">
</div>
<div class="form-group">
<label for="Name">Date</label>
<input type="text" class="input" Name="Date">
</div>
<div class="form-group">
<label for="Name">From</label>
<input type="text"class="input" Name="From">
</div>
<div class="form-group">
<label for="Name">To</label>
<input type="text" class="input" Name="To">
</div>
<button type="submit" name="submit" class="btn btn-default">Submit</button>
<button type="submit" name="clear" class="btn btn-default">clear</button>
</form>
</div>
</div>
<div class="card-body pt-0 pt-md-4">
<div class="text-center">
</div>
</div>
</div>
</div>
<div class="col-xl-8 order-xl-1">
<div class="card bg-secondary shadow">
<div class="card-header bg-white border-0">
<div class="row align-items-center">
<div class="col-8">
<h3 class="mb-0">Drivers</h3>
</div>
<div class="col-4 text-right">
<a href="create.php" class="btn btn-sm btn-primary">Add</a>
</div>
</div>
</div>
<div class="card-body">
<?php
include_once('Include/operation.php');
include_once('Include/dbconfig.php');
$batabase=new Database();
$db=$batabase->getConnection();
$op=new Operation($db);
if(isset($_POST['submit'])){
$dd=$op->searchDrivers($_POST['rname']);
print_r($dd);
$xx= sizeof($dd);
?>
<table class='table table-bordered table-striped'>
<thead>
<tr>
<th style="width: 6%">#</th>
<th style="width: 25%">Name</th>
<th style="width: 25%">Phone</th>
<th >Action</th>
</tr>
</thead>
<tbody>
<?php
foreach($dd as $row){
?>
<tr>
<td><?php echo $row['ID']?></td>
<td><?php echo $row['Name'] ?></td>
<td><?php echo $row['Phone'] ?></td>
<td>
<a href='read.php?id=<?php echo $row["ID"]?>' title='View Record' data-toggle='tooltip'><span class='glyphicon glyphicon-eye-open'></span></a>
<a href='update.php?id=<?php echo $row["ID"] ?>' title='Update Record' data-toggle='tooltip'><span class='glyphicon glyphicon-pencil'></span></a>
<a href='delete.php?id=<?php echo $row["ID"] ?>' title='Delete Record' data-toggle='tooltip'><span class='glyphicon glyphicon-trash'></span></a>
</td>
</tr>
<?php
}
echo "</tbody>";
echo "</table>";
}
else{
$d=$op->showAllDrivers();
?>
<table class='table table-bordered table-striped'>
<thead>
<tr>
<th style="width: 6%">#</th>
<th style="width: 25%">Name</th>
<th style="width: 25%">Phone</th>
<th >Action</th>
</tr>
</thead>
<tbody>
<?php
foreach($d as $row){
?>
<tr>
<td><?php echo $row['ID']?></td>
<td><?php echo $row['Name'] ?></td>
<td><?php echo $row['Phone'] ?></td>
<td>
<a href='read.php?id=<?php echo $row["ID"]?>' title='View Record' data-toggle='tooltip'><span class='glyphicon glyphicon-eye-open'></span></a>
<a href='update.php?id=<?php echo $row["ID"] ?>' title='Update Record' data-toggle='tooltip'><span class='glyphicon glyphicon-pencil'></span></a>
<a href='delete.php?id=<?php echo $row["ID"] ?>' title='Delete Record' data-toggle='tooltip'><span class='glyphicon glyphicon-trash'></span></a>
</td>
</tr>
<?php
}
echo "</tbody>";
echo "</table>";
}
?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>