-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
66 lines (53 loc) · 1.75 KB
/
index.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
<?php
include 'includes/functions/functions.php';
include 'includes/layout/header.php';
?>
<div class="container-bar">
<h1>Address Book</h1>
</div>
<div class="bg-secundary container shadow">
<form id="contact" action="#">
<legend>Add Contact <span>All fields are required</span> </legend>
<?php include 'includes/layout/form.php'; ?>
</form>
</div>
<div class="bg-white container shadow contacts">
<div class="container-contacts">
<h2>Contacts</h2>
<input type="text" id="search" class="searcher shadow" placeholder="Search Contacts...">
<p class="total-contacts"><span></span> Contacts</p>
<div class="container-table">
<table id="list-contacts" class="list-contacts">
<thead>
<tr>
<th>Name</th>
<th>Business</th>
<th>Phone</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php $contacts = getContacts();
if ($contacts->num_rows) {
foreach ($contacts as $contact) { ?>
<tr>
<td><?php echo $contact['name']; ?></td>
<td><?php echo $contact['business']; ?></td>
<td><?php echo $contact['phone']; ?></td>
<td>
<a class="btn-update btn" href="update.php?id=<?php echo $contact['id']; ?>">
<i class="fas fa-pen-square"></i>
</a>
<button data-id="<?php echo $contact['id']; ?>" type="button" class="btn-delete btn">
<i class="fas fa-trash-alt"></i>
</button>
</td>
</tr>
<?php }
} ?>
</tbody>
</table>
</div>
</div>
</div>
<?php include 'includes/layout/footer.php'; ?>