GitList
Repositories
Help
Report an Issue
blackjack
Code
Commits
Branches
Tags
Search
Tree:
d7b0224
Branches
Tags
master
blackjack
UI
table.php
initial commit
Dev Ghai
commited
d7b0224
at 2014-04-17 16:55:27
table.php
Blame
History
Raw
<?php namespace Blackjack\UI; require_once '../Config/Config.php'; require_once '../Objects/Player.php'; use Blackjack\Objects\Player as Player; use Blackjack\Config\Config as Config; if(session_id()=='') session_start(); $playerName = $_SESSION['player']->GetName(); $errorString=''; if(array_key_exists('btnSave', $_REQUEST)) { $config = new Config(); $name = trim(urldecode($_REQUEST['playerName'])); $nameLength = strlen($name); if($nameLength > $config->maxNameLength || $nameLength == 0) { $errorString = "Please enter a name that is max ".$config->maxNameLength." characters long."; } else { session_regenerate_id(true); $_SESSION['player'] = new Player($config, $name); header('Location: table.php'); exit(); } } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <meta http-equiv='Content-Type' content='text/html; charset=UTF-8'></meta> <title>Blackjack | Table</title> <link type="text/css" rel="stylesheet" href="style/bjstyles.css"></link> </head> <body class="themeBasic"> <table id="bjTable"> <thead> <tr> <td><h1>Blackjack</h1></td> </tr> </thead> <tbody> <tr id="trDealerName"> <td> <h2>Dealer</h2> </td> </tr> <tr id="trDealerHand"> <td id="tdDealerHand"> </td> </tr> <tr id="trPlayerName"> <td id="tdPlayerName"> <h2><?php echo $playerName; ?></h2> </td> </tr> <tr id="trError"> <td id="tdError" class="error"> <?php echo $errorString; ?> </td> </tr> <tr id="trPlayerHands"> <td id="tdPlayerFirstHand"> </td> </tr> </tbody> </table> </body>