-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathe_index.php
54 lines (41 loc) · 1.36 KB
/
e_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
<?php
// connect to db
include('config/db_connect_admin.php');
//write quarry for all customers
$e_sql = 'SELECT employee_id, name, email FROM employee ORDER BY employee_id';
// make quarry & get result
$e_result = mysqli_query($connect, $e_sql);
//fetch the resulting rows as an array
$employee = mysqli_fetch_all($e_result, MYSQLI_ASSOC);
//freeing the result from memory
mysqli_free_result($e_result);
// close connection
mysqli_close($connect);
#explode function (reffer L28)
//explode(',', $pizzas[0]['ingredients'])
?>
<!DOCTYPE html>
<html>
<?php include('templates/header.php'); ?>
<h4 class="center darkred-text">Employees</h4>
<div class="container">
<div class="row">
<?php foreach ($employee as $emp): ?>
<div class="col s6 md3">
<div class="card z-depth-0">
<!-- <img src="img/Me2.jpg" class="customer"> -->
<div class="card-content center">
<h6><?php echo htmlspecialchars($emp['employee_id']); ?></h6>
<div><?php echo htmlspecialchars($emp['name']); ?></div>
<div><?php echo htmlspecialchars($emp['email']); ?></div>
</div>
<div class="card-action right-align">
<a class="brand-text" href="e_details.php?id=<?php echo $emp['employee_id']?>">more info</a>
</div>
</div>
</div>
<?php endforeach; ?>
</div>
</div>
<?php include('templates/footer.php'); ?>
</html>