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