Add a counter for colors named
This commit is contained in:
3 files changed
+11
-1
No files matched your search
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
include __DIR__ . "/../config/captcha.php";
|
||||
include __DIR__ . "/../incl/db.php";
|
||||
include __DIR__ . "/../incl/util.php";
|
||||
|
||||
$conn = connectToDatabase();
|
||||
|
||||
@@ -8,6 +9,10 @@ $stmt = $conn->prepare("SELECT * FROM colors ORDER BY timestamp DESC");
|
||||
$stmt->execute();
|
||||
$result = $stmt->fetchAll(PDO::FETCH_ASSOC);
|
||||
|
||||
$total = 255 * 255 * 255;
|
||||
$named = count($result);
|
||||
$remaining = $total - $named;
|
||||
|
||||
$lastInsertId = $_GET['highlight'] ?? null;
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
@@ -111,6 +116,7 @@ $lastInsertId = $_GET['highlight'] ?? null;
|
||||
</head>
|
||||
<body>
|
||||
<h1>Name A Color!</h1>
|
||||
<p><?= formatWithCommas($named) ?>/<?= formatWithCommas($total) ?> colors named (<?= formatWithCommas($remaining) ?> left)</p>
|
||||
<hr>
|
||||
<h2>Name your own color!</h2>
|
||||
<form action="upload.php" method="post">
|
||||
|
||||
Reference in new issue
Block a user