-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
55 lines (42 loc) · 1.71 KB
/
index.php
File metadata and controls
55 lines (42 loc) · 1.71 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
<?php
require 'lib/functions.php';
$pets = get_pets();
$pets = array_reverse($pets);
$cleverWelcomeMessage = 'All the love, none of the crap!';
$pupCount = count($pets);
?>
<?php require 'layout/header.php'; ?>
<div class="jumbotron">
<div class="container">
<h1><?php echo strtoupper(strtolower($cleverWelcomeMessage)); ?></h1>
<p>With over <?php echo $pupCount ?> pet friends!</p>
<p><a class="btn btn-primary btn-lg">Learn more »</a></p>
</div>
</div>
<div class="container">
<div class="row">
<?php foreach ($pets as $cutePet) { ?>
<div class="col-lg-4 pet-list-item">
<h2><?php echo $cutePet['name']; ?></h2>
<img src="/images/<?php echo $cutePet['image']; ?>" class="img-rounded">
<blockquote class="pet-details">
<span class="label label-info"><?php echo $cutePet['breed']; ?></span>
<?php
if (!array_key_exists('age', $cutePet) || $cutePet['age'] == '') {
echo 'Unknown';
} elseif ($cutePet['age'] == 'hidden') {
echo '(contact owner for age)';
} else {
echo $cutePet['age'];
}
?>
<?php echo $cutePet['weight']; ?> lbs
</blockquote>
<p>
<?php echo $cutePet['bio']; ?>
</p>
</div>
<?php } ?>
</div>
<hr>
<?php require 'layout/footer.php'; ?>