-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathget_select_job.php
45 lines (42 loc) · 1.15 KB
/
get_select_job.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
<?php
require_once 'dbconnect.php';
if(isset($_POST["type"])){
$type = $_POST["type"];
$query = "SELECT * FROM employee WHERE job_type='$type' ORDER BY id ASC";
if($type=="all"){
$query = "SELECT * FROM employee ORDER BY id ASC";
}
$result = $connect->query($query);
$output="<table class='table table-hover' style='width:100%;'>
<thead>
<tr>
<th>ID</th>
<th>Full Name</th>
<th>Job Type</th>
<th>Email</th>
<th>Image</th>
<th>Action</th>
</tr>
</thead>
<tbody>";
while ($row = $result->fetch_assoc()) {
$id=$row['id'];
$fullname=$row['fullname'];
$job_type = $row['job_type'];
$email = $row['email'];
$image = $row['image'];
$output .= "
<tr>
<td>$id</td>
<td>$fullname</td>
<td>$job_type</td>
<td>$email</td>
<td>$image</td>
<td><button type='button' class='btn btn-danger' id='submit' value='$id'> Delete</button></td>
</tr>
";
}
$output .="</tbdoy></table>";
echo $output;
}
?>