-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
30 lines (30 loc) · 1.06 KB
/
index.php
File metadata and controls
30 lines (30 loc) · 1.06 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
<?php
$data = file_get_contents('https://www.codeschool.com/users/dharillo.json');
$json_data = json_decode($data, true);
// var_dump($json_data['courses']['completed']);
$completed_courses = $json_data['courses']['completed'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Badges viewer - <?php echo $json_data['user']['username'] ?>'s badges</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="css/style.css" rel="stylesheet">
</head>
<body>
<header>Badges</header>
<div class="container">
<div class="grid">
<?php
foreach($completed_courses as $course) {
echo '<div class="grid-cell">';
echo '<img src="' . $course['badge'] . '" />';
echo '<a href="' . $course['url'] . '">' . $course['title'] . '</a>';
echo '</div>';
}
?>
</div>
</div>
</body>
</html>