1
0

Added DB Access + Error page

This commit is contained in:
2014-05-12 10:11:20 +02:00
parent 3efba81ebc
commit ffdc17efd5
124 changed files with 6346 additions and 82 deletions

View File

@@ -0,0 +1,21 @@
<h2>Please make a guess</h2>
<h3 style="letter-spacing: 4px;"><?php echo $this->guessWord; ?></h3>
<p>You have made <?php echo $this->misses; ?> bad guesses out of a maximum of <?php echo $this->level; ?>.</p>
<?php echo CHtml::statefulForm(); ?>
<p>Guess:
<?php
for($i=ord('A');$i<=ord('Z');++$i)
{
if(!$this->isGuessed(chr($i)))
echo "\n".CHtml::linkButton(chr($i),array('submit'=>array('guess','g'=>chr($i))));
}
?>
</p>
<p><?php echo CHtml::linkButton('Give up?',array('submit'=>array('giveup'))); ?></p>
</form>

View File

@@ -0,0 +1,5 @@
<h2>You Lose!</h2>
<p>The word was: <?php echo $this->word; ?>.</p>
<p><?php echo CHtml::link('Start Again',array('play')); ?></p>

View File

@@ -0,0 +1,15 @@
<p>This is the game of Hangman. You must guess a word, a letter at a time.
If you make too many mistakes, you lose the game!</p>
<?php echo CHtml::beginForm(); ?>
<?php echo CHtml::radioButtonList('level', null, $levels); ?>
<br/>
<?php echo CHtml::submitButton('Play!'); ?>
<?php if($error): ?>
<span style="color:red">You must choose a difficulty level!</span>
<?php endif; ?>
<?php echo CHtml::endForm(); ?>

View File

@@ -0,0 +1,5 @@
<h2>You Win!</h2>
<p>The word was: <?php echo $this->word; ?>.</p>
<p><?php echo CHtml::link('Start Again',array('play')); ?></p>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Hangman Game</title>
</head>
<body>
<h1>Hangman Game</h1>
<?php echo $content; ?>
</body>
</html>