Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $todo = [
- [
- "description" => "Design Wallpaper",
- "category" => "School",
- "hours" => 2
- ],
- [
- "description" => "Post on Portfolio website",
- "category" => "Work",
- "hours" => 0
- ],
- [
- "description" => "Make PHP homework",
- "category" => "School",
- "hours" => 3
- ],
- [
- "description" => "Redesign Portfolio website",
- "category" => "Work",
- "hours" => 6
- ],
- [
- "description" => "Share on Twitter",
- "category" => "Home",
- "hours" => 1
- ]
- ];
- ?>
- <!doctype html>
- <html lang="en">
- <head>
- <meta charset="utf-8">
- <title>OPdracht 3</title>
- <link rel="stylesheet" type="text/css" href="css/opdracht3.css">
- </head>
- <body>
- <?php foreach($todo as $list): ?>
- <?php
- if ($list['hours'] > 5) {
- echo "<section style='background:red'>";
- }
- else if ($list['hours'] <= 1 ) {
- echo "<section style='background:green'>";
- }
- else {
- echo "<section style='background:orange'>";
- }
- ?>
- <section class="container">
- <p><?php echo $list['description'] . '<br>' ?></p>
- <p><?php echo $list['category'] . '<br>' ?></p>
- <p><?php echo $list['hours'] . '<br>' ?></p>
- </section>
- <?php endforeach; ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement