-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmembers_list.php
34 lines (32 loc) · 1.17 KB
/
members_list.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
<?php
require_once 'database.php';
$sql = "SELECT members.*, teams.name as team_name FROM members LEFT JOIN teams ON members.teams_id = teams.id";
$stmt = $conn->prepare($sql);
$stmt->execute();
$members = $stmt->fetchAll(PDO::FETCH_ASSOC);
if (!empty($members)) {
foreach ($members as $row) {
echo "<tr>
<td>{$row['firstname']}</td>
<td><a href='/crud_add_pdf_project/member_details.php?id={$row['id']}'>{$row['lastname']}</a></td>
<td>{$row['position']}</td>
<td>{$row['department']}</td>
<td>{$row['about']}</td>
<td><img src='{$row['image_url']}' width='50' height='auto'></td>
<td>
<a href='/crud_add_pdf_project/member_form.php?id={$row['id']}'>Edit</a>
<a href='/crud_add_pdf_project/delete_member.php?id={$row['id']}'>Delete</a>
</td>
</tr>";
}
} else {
echo '<script>
Swal.fire({
icon: "question",
title: "No members found!",
text: "Please add some members.",
});
</script>';
echo "<tr><td colspan='7'>No members found</td></tr>";
}
?>