Commit 85827f3e authored by arung-agamani's avatar arung-agamani
Browse files

Remake search section into columns of details

parent 4386a627
Pipeline #28530 canceled with stages
......@@ -71,6 +71,10 @@ main .heading {
font-family: "Roboto", serif;
}
.catalogue-col {
flex-direction: column;
}
.card-item {
background-color: white;
border: 1px solid rgb(235, 200, 155);
......@@ -115,6 +119,12 @@ main .heading {
margin-left: 5rem;
margin-right: 5rem;
}
.item-search {
text-decoration: none;
color: black;
border: 1px solid black;
margin-bottom: 1rem;
}
.item-wrapper {
padding: 1rem;
......
......@@ -39,3 +39,27 @@ function printChocolateDetail(string $name, string $desc, string $price, string
';
}
function printChocolateSearch(string $id, string $name, string $desc, string $price, string $sold, string $remaining, string $url)
{
$url_string = $url;
if ($url === '') {
$url_string = 'assets/img/rocher.jpg';
}
echo '
<a href="coklat.php?id=' . $id . '" class="item-search">
<div class="item-wrapper">
<div class="item-image">
<img src="' . $url_string . '" alt="">
</div>
<div class="item-contents">
<h1 class="item-heading">', $name, '</h1>
<p class="item-desc">', $desc, '</p>
<p class="item-desc">Rp<span id="item-price">', $price, '</span></p>
<p class="item-desc" >Sold: <span id="item-sold">', $sold, '</span></p>
<p class="item-desc" >Sisa Stok : <span id="item-remaining">', $remaining, '</span></p>
</div>
</div>
</a>
';
}
......@@ -53,11 +53,11 @@ echo createHeader();
<span class="pagination-control-amount" id="page-total"><?php echo ceil(count($all_chocolates) / 10); ?></span>
<div class="pagination-control-button" onclick="nextSearchPage()">&gt;&gt;</div>
</div>
<div class="catalogue" id="catalogue-container">
<div class="catalogue catalogue-col" id="catalogue-container">
<?php
include "./components/coklat_card.php";
foreach ($all_chocolates as $coklat) {
printChocolateCard($coklat[0], $coklat[1], $coklat[2], $coklat[3], $coklat[6]);
printChocolateSearch($coklat[0], $coklat[1], $coklat[2], $coklat[3], $coklat[4], $coklat[5], $coklat[6]);
}
?>
</div>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment