-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
33 lines (24 loc) · 1.3 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
<?php require "includes/header.php"; ?>
<?php require "config/config.php"; ?>
<?php
$rows = $conn->query("SELECT * FROM products WHERE status = 1");
$rows->execute();
$allRows = $rows->fetchAll(PDO::FETCH_OBJ);
?>
<div class="row mt-5">
<?php foreach($allRows as $product) : ?>
<div class="col-lg-4 col-md-6 col-sm-10 offset-md-0 offset-sm-1">
<div class="card">
<img height="213px" class="card-img-top" src="images/<?php echo $product->image; ?>">
<div class="card-body" >
<h5 class="d-inline"><b><?php echo $product->name; ?></b> </h5>
<h5 class="d-in line"><div class="text-muted d-inline">($<?php echo $product->price; ?>/item)</div></h5>
<p><?php echo substr($product->description, 0, 120 ); ?> </p>
<a href="<?php echo APPURL; ?>/shopping/single.php?id=<?php echo $product->id; ?>" class="btn btn-primary w-100 rounded my-2"> More<i class="fas fa-arrow-right"></i> </a>
</div>
</div>
</div>
<br>
<?php endforeach; ?>
</div>
<?php require "includes/footer.php"; ?>