case "getLogicalGridSize": echo getLogicalGridSize(); break; case "getOrigin": echo getOrigin(); break; case "setOrigin": echo setOrigin($input); break; case "getNotesForKeys": echo getNotesForKeys(); break; case "getTick": echo getTick(); break; case "setTick": echo setTick($input); break; case "getTickInterval": echo getTickInterval(); break; case "newGame": echo newGame(""); break; case "shutdown": echo shutdown(); break; default: echo "invalid"; break; }
} else { if (empty($_SESSION[S_NAME]['player_id'])) { // Log in from code if (isset($_REQUEST['login'])) { $user = $db->select('abalone_players', array('password' => $_REQUEST['login']))->first(); if ($user) { $_SESSION[S_NAME]['player_id'] = (int) $user->id; header('Location: 143.php'); exit('Logging in...'); } header('Location: 143.php'); exit('Nope...'); } // New game if (isset($_GET['newgame'])) { $info = newGame($white, $black); $_SESSION[S_NAME]['player_id'] = (int) $info['white']; header('Location: 143.php'); exit('Game created'); } // Log in form ?> <style>html, body, h1 { margin: 0; } body { padding: 30px; }</style> <h1>Abalone: log in</h1> <form action method=post> <p>Password: <input name="login" /></p> <p><input type=submit /></p> </form>
<html> <head> <meta charset="utf-8"> <title>Bingo</title> <link href="style.css" rel="stylesheet" sizes="any" type="text/css"> </head> <body> <div class="container" style="height: 100%;"> <?php if (!checks() || isset($_POST['newGame'])) { echo "<form method='post'>"; echo "<button type='submit' name='generar'>Generar</button>"; echo "</form>"; } else { echo "<form method='post'>"; echo "<button type='submit' name='newGame'>Nueva Partida</button>"; echo "</form>"; } if (isset($_POST['generar'])) { if (!checks()) { followGame(); } else { echo "<span class='mensaje-end'>¡El cartón " . checks() . " ha cantado bingo!</span>"; } } else { newGame(); } ?> </div> </body> </html>