-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (51 loc) · 1.77 KB
/
Copy pathindex.php
File metadata and controls
65 lines (51 loc) · 1.77 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
<?php
require "templates/header.php";
try {
require "config.php";
require "common.php";
// $connection = new PDO ( $dsn, $username, $password, $options );
$connection = new PDO ( $dsn );
$sql = "SELECT * FROM coverage";
$statement = $connection->prepare ( $sql );
$statement->execute ();
$result = $statement->fetchAll (PDO::FETCH_ASSOC);
} catch ( PDOException $error ) {
echo $sql . "<br>" . $error->getMessage ();
}
?>
<p id="customAdd">Add Coverage: <a href="create.php">Create New Coverage</a></p>
<h2 id="customTitle">Current Coverages</h2>
<div class="table-responsive">
<table id="customers" class=".table-striped">
<thead>
<tr>
<th>#</th>
<th>Coverage Name</th>
<th>Cost</th>
<th colspan="2">Modify Coverage Records</th>
</tr>
</thead>
<tbody>
<?php
$className = "'confirmation'";
foreach ( $result as $row ) {
?>
<tr>
<td><?php echo escape($row["id"]); ?></td>
<td><?php echo escape($row["coverage_name"]); ?></td>
<td><?php echo escape($row["cost"]); ?></td>
<td><?php echo "<a href=" . "update.php?id=" . $row["id"] . ">" . "Update</a>" ?> </td>
<td><?php echo "<a href=" . "delete.php?id=" . $row["id"] . " class=" . $className . "> Delete </a>" ?> </td>
</tr>
<?php
}
?>
</tbody>
</table>
<p id="customInstall">Install Database(For Testing): <a href="install.php">New Database</a></p>
<p id="customInstall">Search Database(Ajax): <a href="ajaxsearch.php">Search Coverage By Name</a></p>
</div>
<?php
// }
?>
<?php require "templates/footer.php"; ?>