Last change
on this file was 0791611, checked in by sstalevska <sara.stalevska@…>, 2 years ago |
Push the entire project.
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | <?php
|
---|
2 | require_once('./inc/common.php');
|
---|
3 |
|
---|
4 | $pageTitle = 'Services';
|
---|
5 | $pageSlug = 'services';
|
---|
6 |
|
---|
7 | require_once('./inc/head.php');
|
---|
8 | require_once('./inc/header.php');
|
---|
9 | ?>
|
---|
10 | <div class="container">
|
---|
11 | <h1 class="mt-5"><?= $pageTitle ?></h1>
|
---|
12 |
|
---|
13 | <?php require_once('./inc/alerts-err.php'); ?>
|
---|
14 |
|
---|
15 | <p class="lead mb-4">This is a list of all services. Select a service to view businesses offering it.</p>
|
---|
16 |
|
---|
17 | <table class="table">
|
---|
18 | <thead>
|
---|
19 | <tr>
|
---|
20 | <th width="1"><abbr title="Number">#</abbr></th>
|
---|
21 | <th>Service Name</th>
|
---|
22 | <th width="1">Action</th>
|
---|
23 | </tr>
|
---|
24 | </thead>
|
---|
25 | <tbody>
|
---|
26 | <?php
|
---|
27 | /**
|
---|
28 | * Fetch all services and display them in a tabular format.
|
---|
29 | */
|
---|
30 | $i = 0;
|
---|
31 | $sql = 'SELECT service_id, service_name FROM service ORDER BY service_name';
|
---|
32 | foreach ($conn->query($sql) as $row) {
|
---|
33 | $i++;
|
---|
34 | ?>
|
---|
35 | <tr>
|
---|
36 | <td class="text-end"><?= $i ?>.</td>
|
---|
37 | <td><a href="/service.php?id=<?= $row['service_id'] ?>"><?= $row['service_name'] ?></a></td>
|
---|
38 | <td><a class="btn btn-sm btn-dark" href="/service.php?id=<?= $row['service_id'] ?>">View</a></td>
|
---|
39 | </tr>
|
---|
40 | <?php } ?>
|
---|
41 | </tbody>
|
---|
42 | </table>
|
---|
43 | </div>
|
---|
44 | <?php
|
---|
45 | require_once('./inc/footer.php');
|
---|
Note:
See
TracBrowser
for help on using the repository browser.