-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
65 lines (57 loc) · 2.15 KB
/
Copy pathindex.php
File metadata and controls
65 lines (57 loc) · 2.15 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
session_start();
// init packages if not exist
if (!isset($_SESSION['packages'])) {
$_SESSION['packages'] = [];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="icon" href="assets/img/favicon.png">
<link rel="stylesheet" href="assets/css/style.css">
<title>Arch Package Tracker</title>
</head>
<body>
<div class="container">
<div class="wrapper">
<header>
<img src="assets/img/logo.png" alt="">
<h1>Package Tracker</h1>
</header>
<div class="section-add-button">
<a href="add.php" class="add-button">Add Package</a>
</div>
<table>
<thead>
<tr>
<th>Package Name</th>
<th>Category</th>
<th>Source</th>
<th>Notes</th>
<th colspan="2">Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($_SESSION['packages'] as $package) { ?>
<tr>
<td><?= htmlspecialchars($package['package-name']) ?></td>
<td><?= htmlspecialchars($package['category']) ?></td>
<td><?= htmlspecialchars($package['source']) ?></td>
<td><?= htmlspecialchars($package['notes']) ?></td>
<td class="edit-box">
<a href="edit.php?id=<?= htmlspecialchars($package['id']) ?>" class="edit-button">Edit</a>
</td>
<td class="delete-box">
<a href="delete-process.php?id=<?= htmlspecialchars($package['id']) ?>" class="delete-button" onclick="return confirm('Confirm to delete package');">Delete</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</div>
</div>
</body>
</html>