Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

82 рядки
3.2 KiB
PHP

<?php
/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
if (!defined('NICKELBOX')) {
die("Direct access denied.");
}
$item = new Item($_GET['id']);
?>
<div class="container">
<div class="row">
<div class="col-md-4">
<?php
$image = "";
if ($item->getImageCount() > 0) {
$primary = $item->getPrimaryImage();
$image = '<div id="bigImageBox"><img class="mt-4 mb-2" id="bigImage" src="' . $primary->getAbsoluteUrl() . '" alt="" data-imgid="' . $primary->getID() . '" /></div>';
echo $image;
?>
<div class="d-flex flex-wrap justify-content-center">
<?php
foreach ($item->getImages() as $img) {
?>
<div class="card m-1 item-picker<?php
if ($img->getID() == $primary->getID()) {
echo " border-primary";
}
?>" data-imgid="<?php echo $img->getID(); ?>" data-imgurl="<?php echo $img->getAbsoluteUrl(); ?>">
<img class="item-picker-img" src="<?php echo $img->getAbsoluteUrl(); ?>" />
</div>
<?php
}
?>
</div>
<?php
}
?>
</div>
<div class="col-md-8">
<div class="row mt-4">
<div class="col-sm-7 jumbotron py-4">
<h2><?php echo $item->getName(); ?></h2>
<p>in <a href="./?page=browse&cat=<?php echo $item->getCategoryId(); ?>"><?php echo $item->getCategoryName(); ?></a></p>
<h3>$<?php echo $item->getPrice(); ?></h3>
</div>
<div class="col-sm-5">
<form action="./action.php" method="POST">
<input type="number" name="qty" class="form-control mb-2" placeholder="Quantity" value="1" />
<button type="submit" class="btn btn-block btn-primary"><i class="fas fa-cart-plus"></i> Add to Cart</button>
<input type="hidden" name="item" value="<?php echo $item->getId(); ?>" />
<input type="hidden" name="action" value="addtocart" />
</form>
</div>
</div>
</div>
</div>
<div class="row mt-4 mt-sm-0">
<div class="col-12">
<div class="card mt-4">
<div class="card-body">
<h5 class="card-title">Description</h5>
<p>
<?php
$desc = $item->getDescription();
if (empty($desc)) {
echo "No item information found.";
} else {
echo htmlspecialchars($desc);
}
?>
</p>
</div>
</div>
</div>
</div>
</div>