add both venues

This commit is contained in:
Ben Harris 2021-07-23 13:43:17 -04:00
parent 3d6b646cff
commit 298572703e
3 changed files with 34 additions and 12 deletions

11
pin/coinslot.txt Normal file
View File

@ -0,0 +1,11 @@
Rick & Morty
Star Wars (outside)
The Mandalorian
Deadpool
Star Trek
Teenage Mutant Ninja Turtles
Jurassic Park
Monster Bash
Walking Dead
Guardians of the Galaxy
Avengers

View File

@ -1,6 +1,12 @@
<?php
$games = file("games.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$game = $games[array_rand($games)];
if (isset($_GET["location"])) {
$loc = $_GET["location"];
if (is_file("$loc.txt")) {
$games = file("$loc.txt", FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES);
$game = $games[array_rand($games)];
}
}
?>
<!DOCTYPE html>
<html>
@ -11,20 +17,25 @@ $game = $games[array_rand($games)];
</head>
<body id="top">
<main>
<h1>right brain pin picker</h1>
<p>reload the page to pick a table</p>
<h1><?=$loc ?? ""?> pin picker</h1>
<ul>
<?php foreach ($games as $g) {
if ($g === $game) { ?>
<li><strong><mark><?=$g?></mark></strong></li>
<?php } else { ?>
<li><?=$g?></li>
<?php }
<?php if (isset($loc)) { ?>
<p><a href=".">&lt;- back to list</a></p>
<p>reload the page to pick a table</p>
<br>
<?php foreach ($games as $g) {
if ($g === $game) { ?>
<li><strong><mark><?=$g?></mark></strong></li>
<?php } else { ?>
<li><?=$g?></li>
<?php }
} ?>
<?php } else {
foreach (array_map(fn($txt) => basename($txt, ".txt"), glob("*.txt")) as $l) { ?>
<li><a href="?location=<?=$l?>"><?=$l?></a></li>
<?php }} ?>
</ul>
</main>
</body>
</html>