yeajh
This commit is contained in:
parent
5a83ee91db
commit
fc53a55c4d
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
41
catalog.php
41
catalog.php
|
|
@ -75,20 +75,49 @@ $getitstarted->header();
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="row row-cols-xl-6 row-cols-lg-4 row-cols-md-3 row-cols-sm-2 g-4" style="margin-left: 200px; margin-top: 1px;">
|
<div class="row row-cols-xl-6 row-cols-lg-4 row-cols-md-3 row-cols-sm-2 g-4" style="margin-left: 200px; margin-top: 1px;">
|
||||||
<?php $x = 40; for ($i = 1; $i <= $x; $i++) { ?>
|
<?php
|
||||||
|
$sql = "SELECT allStar FROM catalog";
|
||||||
|
$q = $con->prepare(str_replace('allStar', 'count(*)', $sql));
|
||||||
|
$q->execute();
|
||||||
|
$numberOfItems = $q->fetchColumn();
|
||||||
|
$q = $con->prepare(str_replace('allStar', '*', $sql));
|
||||||
|
$q->execute();
|
||||||
|
if ($numberOfItems >= 1) {
|
||||||
|
while ($item = $q->fetch()) {
|
||||||
|
$qq = $con->prepare("SELECT * FROM users WHERE id = :id");
|
||||||
|
$qq->bindParam(':id', $item["creator"], PDO::PARAM_INT);
|
||||||
|
$qq->execute();
|
||||||
|
$creator = $qq->fetch();
|
||||||
|
if(!$creator) {
|
||||||
|
$creator = [
|
||||||
|
"id" => 0,
|
||||||
|
"username" => "[ unknown user ]"
|
||||||
|
];
|
||||||
|
}
|
||||||
|
$x = 40;
|
||||||
|
for ($i = 1; $i <= $x; $i++) {
|
||||||
|
?>
|
||||||
<div class="position-relative col">
|
<div class="position-relative col">
|
||||||
<div class="card shadow-sm h-100">
|
<div class="card shadow-sm h-100">
|
||||||
<img src="https://tr.rbxcdn.com/7ea42f95bb986a33dbd2dc391a3ee744/420/420/Gear/Png" class="card-img-top">
|
<img src="<?php if (!empty($item["thumbnail"])) {echo htmlspecialchars($item["thumbnail"]);} else {echo "assets/placeholder.png";} ?>" class="card-img-top<?php if(empty($item["thumbnail"])){echo " placeholder";} ?>">
|
||||||
<p class="me-1 mt-1 position-absolute top-0 end-0"><?php if(rand(1, $x) == $x) { echo '<span class="badge bg-success">Limited</span>'; }; ?></p>
|
<p class="me-1 mt-1 position-absolute top-0 end-0"><?php if(rand(1, $x) == $x) { echo '<span class="badge bg-success">Limited</span>'; }; ?></p>
|
||||||
<span class="fs-6 mt-2 ms-2 opacity-75 position-absolute top-50 start-0 translate-middle-y bg-success badge">$1</span></img>
|
<span class="fs-6 mt-2 ms-2 opacity-75 position-absolute top-50 start-0 translate-middle-y bg-success badge">$<?php echo (int)htmlspecialchars($item["price"]); ?></span></img>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h5 class="card-title">Minion</h5>
|
<h5 class="card-title"><?php echo htmlspecialchars($item["name"]); ?></h5>
|
||||||
<p class="card-text">
|
<p class="card-text">
|
||||||
By <a class="btn-link">someone</a>
|
By <a href="user.php?id=<?php echo (int)htmlspecialchars($creator["id"]); ?>" class="btn-link"><?php echo htmlspecialchars($creator["username"]); ?></a>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div> <?php if ($i == $x) { break; } }?> </div>
|
</div>
|
||||||
|
<?php
|
||||||
|
if ($i == $x) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
echo "no items";} ?> </div>
|
||||||
<br>
|
<br>
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ $getitstarted->header();
|
||||||
for ($i = 1; $i <= $x; $i++) { ?>
|
for ($i = 1; $i <= $x; $i++) { ?>
|
||||||
<div class="card bg-dark border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
|
<div class="card bg-dark border-start rounded shadow-sm" style="max-width: 170px; margin-right: 9px;">
|
||||||
<a href="game?id=<?php echo (int)htmlspecialchars($game["id"]); ?>" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
|
<a href="game?id=<?php echo (int)htmlspecialchars($game["id"]); ?>" style="text-decoration: none; text-align: left; margin-bottom: 9px;">
|
||||||
<img src="<?php if (!empty($game["thumbnail"])) {echo htmlspecialchars($game["thumbnail"]);} else {echo "https://media.discordapp.net/attachments/1051588176805892156/1071555366887891064/placeholder.png";} ?>" class="card-img-top rounded-top<?php if(empty($game["thumbnail"])){echo " placeholder";} ?>" alt="<?php echo htmlspecialchars($game["name"]); ?>">
|
<img src="<?php if (!empty($game["thumbnail"])) {echo htmlspecialchars($game["thumbnail"]);} else {echo "assets/placeholder.png";} ?>" class="card-img-top rounded-top<?php if(empty($game["thumbnail"])){echo " placeholder";} ?>" alt="<?php echo htmlspecialchars($game["name"]); ?>">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<small class="card-title text-white" style="font-size: 1rem;"><?php echo htmlspecialchars($game["name"]); ?></small>
|
<small class="card-title text-white" style="font-size: 1rem;"><?php echo htmlspecialchars($game["name"]); ?></small>
|
||||||
<br>
|
<br>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue