/
index.php
61 lines (52 loc) · 2.05 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<?php
require_once('includes.php');
$api_brands_url = "https://laudsocialdev.azurewebsites.net/Test/GetBrands";
$brands_json = callAPI("GET", $api_brands_url);
if ($brands_json) {
$brands = json_decode($brands_json);
}
$count = 0;
//echo "<pre>";
?>
<!DOCTYPE html>
<!--
To change this license header, choose License Headers in Project Properties.
To change this template file, choose Tools | Templates
and open the template in the editor.
-->
<html>
<head>
<title>Brands Display Page</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">
<!-- Latest compiled and minified JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
</head>
<body>
<div class="container">
<?php
foreach ($brands as $brand) {
$count++;
if ($count % 3 == 1) {
echo '<div class="row">';
}
?>
<div class="col-md-4">
<p class="text-center"><a href="detail.php?brandId=<?php echo $brand->Id; ?>"><?php if($brand->Logo) echo "<img src='$brand->Logo' class='img-responsive' />"; ?></a></p>
<p class="text-center"><?php echo $brand->Name; ?></p>
</div>
<?php
if ($count % 3 == 0) {
echo '</div>';
}
}
?>
</div>
</body>
</html>