-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathget_select_client.php
More file actions
95 lines (89 loc) · 3.05 KB
/
get_select_client.php
File metadata and controls
95 lines (89 loc) · 3.05 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
<?php
require_once 'dbconnect.php';
if(isset($_POST["type"])){
$type = $_POST["type"];
if($type == "reqclient"){
$query = "SELECT * FROM req_client ORDER BY id DESC";
$result = $connect->query($query);
if($result->num_rows > 0){
$output="
<p style='text-align: center'> <b> Requested Client list </b></p>
<table class='table table-hover' style='width:100%;'>
<thead>
<tr>
<th>ID</th>
<th>Full Name</th>
<th>Email</th>
<th>Phone</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody>";
while ($row = $result->fetch_assoc()) {
$id=$row['id'];
$fullname=$row['fullname'];
$email = $row['email'];
$phone = $row['phone'];
$address = $row['address'];
$output .= "
<tr>
<td>$id</td>
<td>$fullname</td>
<td>$email</td>
<td>$phone</td>
<td>$address</td>
<td>
<button type='button' class='btn btn-danger' id='delete' data-toggle='modal' data-target='#exampleModal' data-whatever='$email deletereqclient'> Delete </button>
<button type='button' class='btn btn-success' id='approve' data-toggle='modal' data-target='#exampleModal' data-whatever='$email approvereqclient'> Approve </button>
</td>
</tr>
";
}
$output .="</tbdoy></table>";
}else{
$output = "<br><p style='text-align:center; color:red'><i>No New Client Request</i></p>";
}
echo $output;
}elseif ($type=="currentclient") {
$query = "SELECT * FROM client";
$result = $connect->query($query);
if($result->num_rows > 0){
$output="
<p style='text-align: center'> <b> Current Client list </b></p>
<table class='table table-hover' style='width:100%;'>
<thead>
<tr>
<th>ID</th>
<th>Full Name</th>
<th>Email</th>
<th>Address</th>
<th>Action</th>
</tr>
</thead>
<tbody>";
while ($row = $result->fetch_assoc()) {
$id=$row['id'];
$fullname=$row['fullname'];
$email = $row['email'];
$address = $row['address'];
$output .= "
<tr>
<td>$id</td>
<td>$fullname</td>
<td>$email</td>
<td>$address</td>
<td>
<button type='button' class='btn btn-danger' id='delete' data-toggle='modal' data-target='#exampleModal' data-whatever='$email deletecurrentclient'> Delete </button>
</td>
</tr>
";
}
$output .="</tbdoy></table>";
}else{
$output = "<br><p style='text-align:center; color:red'><i>No New Client Request</i></p>";
}
echo $output;
}
}
?>