This commit is contained in:
ui0ppk 2023-02-06 22:18:36 +02:00
parent 5f02ba2687
commit a02080c455
4 changed files with 40 additions and 8 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.0 KiB

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 7.0 KiB

View File

@ -105,7 +105,7 @@ $getitstarted->header();
<span class="badge bg-success" >Limited</span>
<br>
<p class="text-white">Limited Items </p>
<p>Owners of these discontinued items can re-sell them to other users at any price.</p>
<p>Items sold by people that are available for a limited time.</p>
<div class="pt-2"></div>
<span class="badge bg-success">Limited <span class="badge bg-warning text-dark">U</span>
</span>
@ -146,12 +146,12 @@ $getitstarted->header();
<div class="d-inline-block card-img-top border border-1">
<img src="<?php if (!empty($item["thumbnail"])) {echo htmlspecialchars($item["thumbnail"]);} else {echo "assets/placeholder.png";} ?>" height=150 width=150></a>
<p class="me-1 mt-1 position-absolute top-0 end-0"><?php if($item['limited'] == 1) { echo '<span class="badge bg-success">Limited</span>'; }; ?></p>
<span class="fs-6 mb-2 ms-2 opacity-75 bg-success badge"><span class="grufont fs-5">@ </span><?php echo getMoney((int)htmlspecialchars($item["price"])); ?></span>
</div>
<div class="card-body">
<h5 class="card-title"><?php echo htmlspecialchars($item["name"]); ?></h5>
<p class="card-text">
By <a href="user.php?id=<?php echo (int)htmlspecialchars($creator["id"]); ?>" class="btn-link"><?php echo htmlspecialchars($creator["username"]); ?></a>
By <a href="user.php?id=<?php echo (int)htmlspecialchars($creator["id"]); ?>" class="btn-link"><?php echo htmlspecialchars($creator["username"]); ?></a><br>
<span class="text-success"><span class="grufont fs-5">@ </span><?php echo getMoney((int)htmlspecialchars($item["price"])); ?></span>
</p>
</div>
</div>

View File

@ -10,6 +10,20 @@ if(!isset($_GET["id"])) {
} else {
$id = (int)$_GET["id"];
}
function getMoney($money) {
if ($money < 1000000) {
// Anything less than a million
return number_format($money);
} else if ($money < 1000000000) {
// Anything less than a billion
return number_format($money / 1000000, 1) . 'M';
} else {
// At least a billion
return number_format($money / 1000000000, 1) . 'B';
}
}
$q = $con->prepare("SELECT * FROM catalog WHERE id = :id");
$q->bindParam(':id',$id,PDO::PARAM_INT);
$q->execute();
@ -29,12 +43,30 @@ $getitstarted->header();
</head>
<title><?php echo htmlspecialchars($item["name"]); ?> | <?php echo $sitename; ?></title>
<body>
<main class="container mx-auto" style="width: 100%;">
<main class="container d-flex justify-content-center">
<h1 class="mt-3"><?php echo htmlspecialchars($item["name"]); ?></h1>
<h1>this item is called <?php echo htmlspecialchars($item["name"]); ?></h1>
<h1>with id <?php echo (int)htmlspecialchars($item["id"]); ?></h1>
<h1>and he costs $<?php echo (int)htmlspecialchars($item["price"]); ?></h1>
<p>thats all i have to say</p>
<div class="d-flex flex-row mb-3">
<img src="<?php if (!empty($item["thumbnail"])) {echo htmlspecialchars($item["thumbnail"]);} else {echo "assets/placeholder.png";} ?>">
<div>
sdasdas
</div>
<div class="border border-2 bg-light-subtle" style="width: 13rem; height: 8.4rem;">
<div class="mx-auto text-center p-2">
<p>Price: <span class="text-success"><span class="grufont fs-5">@ </span><?php echo getMoney(htmlspecialchars($item["price"]))." (".htmlspecialchars($item["price"]).")"; ?></span></p>
<button class="btn btn-success" style="width: 10rem;">Buy with <span class="grufont fs-5">@</span></button>
<p>(0 sold)</p>
</div>
</div>
</div>
</div>
</main>
</body>
</html>