-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
executable file
·42 lines (42 loc) · 1.33 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
<!DOCTYPE html>
<html lang="en">
<head>
<title>Dijkstra's Algorithm</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/css/materialize.min.css" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.97.7/js/materialize.min.js"></script>
</head>
<body>
<?php
$json = json_decode(file_get_contents("result.json"));
foreach ($json as $path):
?>
<div class="card horizontal">
<h5>
<i class="material-icons" style="font-size: 36px">router</i><br />
<?php echo 'Router ' . $path->from . ' ' ?>
</h5>
<table class="striped responsive-table" style="width: calc(100% - 110px)">
<thead>
<tr>
<th>Destination</th>
<th>Distance</th>
<th>Next Hop</th>
</tr>
</thead>
<tbody>
<?php foreach($path->data as $data): ?>
<tr>
<td><?php echo $data->to ?></td>
<td><?php echo $data->distance ?></td>
<td><?php echo $data->next_hop ?></td>
</tr>
<?php endforeach ?>
</tbody>
</table>
</div>
<?php endforeach ?>
</body>
</html>