-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
69 lines (57 loc) · 1.27 KB
/
Copy pathindex.php
File metadata and controls
69 lines (57 loc) · 1.27 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
<?php
include 'include/db.php';
include 'include/header.php';
{
$sql =mysqli_query($conn,"
select u.id as user_id, concat(u.first_name, ' ',u.last_name) as full_name, tu.*, t.*,
GROUP_CONCAT(t.name) as 'team'
from users u
left join teams_users tu
on tu.user_id = u.id
left join teams t
on tu.team_id = t.id
where 1
GROUP BY u.id
order by u.id ASC
");
if($sql === FALSE)
{
die(mysqli_error()); // TODO: better error handling
}
?>
<div class="container">
<div class="col-md-12 top_head">
</div>
<div class="row ">
<div class="col-md-3"></div>
<div class="col-md-6 main_table panel panel-primary">
<div class="panel panel-heading">
<h2 class="top_text">Teams Detail</h2>
</div>
<table class="table table-bordered table-hoverd">
<thead>
<tr>
<th>Id</th>
<th>Name</th>
<th>Teams</th>
</tr>
</thead>
<?php
while($resultSet = mysqli_fetch_assoc($sql))
{
?>
<tbody>
<tr>
<td><?= $resultSet['user_id'];?> </td>
<td><?= $resultSet['full_name'];?></td>
<td><?= $resultSet['team'];?></td>
</tr>
</tbody>
<?php
}
}
?>
</table>
</div>
</div>
</div>