<?php
function maison() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
$page = <<<END
$haut
<center>
<center><img src="images/page/maison.jpg"></center>
Bienvenue dans votre maison $userrow[pseudo].<br>
Ici vous pouvez nourrir, soigner, laver, amuser ou promener votre goomba.<br><br>
<center>
<a href="jeu.php?page=manger"><img src="images/gestion/manger.png" border="0"></a>
<a href="jeu.php?page=boire"><img src="images/gestion/boire.png" border="0"></a>
<a href="jeu.php?page=soigner"><img src="images/gestion/soigner.png" border="0"></a>
<a href="jeu.php?page=laver"><img src="images/gestion/laver.png" border="0"></a>
<a href="jeu.php?page=jouer"><img src="images/gestion/jouer.png" border="0"></a>
<a href="#"><img src="images/gestion/promener.png" border="0"></a>
</center>
$bas
END;
echo $page;
die();
}
function boire() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
if ($userrow["boire"] == 0) { echo"$haut Vous n'avez plus de bouteille d'eau. Allez en ville en acheter.$bas"; }
$page = <<<END
$haut
<center><center><img src="images/page/goomba.jpg"></center>
Ici vous pouvez donnez à boire à l'un de vos goomba<br><br>
Choisissez votre goomba :
<form action="jeu.php?page=boire" method="post">
<select name='goomba'>
<option value='-1'>Choisissez votre goomba</option>
END;
$goomba_selection = "0";
$query = doquery("select * from {{table}} where id_joueurs=$userrow[id]", "goomba");
for ( $count = 1 ; $count <= 5 && $goomba_selection != null ; $count ++ ) {
$goomba_selection = mysql_fetch_array($query);
if ( $goomba_selection != null ) {
$page .= <<<END
<option value='$goomba_selection[id]'>$goomba_selection[nom]</option>
END;
}
}
$query2 = doquery("select * from {{table}} where id='$goomba_selection[id]'", "goomba");
$goomba = mysql_fetch_array($query2);
$page .= <<<END
</select>
<input type="submit" name="submit" class="boiteFormulaire" value="Valider" />
</form>
END;
echo $page;
if (isset($_POST["submit"])) {
$query2 = doquery("select * from {{table}} where id='$_POST[goomba]'", "goomba");
$goomba = mysql_fetch_array($query2);
$newsoif = $goomba[soif] + 20;
$newboire = $userrow[boire] - 1;
$query = doquery("UPDATE {{table}} SET soif='$newsoif' WHERE id='".$goomba[id]."'", "goomba");
$query1 = doquery("UPDATE {{table}} SET boire='$newboire' WHERE id='".$userrow[id]."'", "joueurs");
$query2 = doquery("INSERT INTO {{table}} SET id='', id_joueurs='".$userrow[id]."',action='Vous avez donné à boire à votre goomba.',date=NOW()", "historique");
$page = <<<END
<font color="#FF0000"><b>Vous venez de donnez à boire à votre goomba.</b></font>
END;
echo $page;
}
echo $bas;
die();
}
function manger() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
if ($userrow["champignon"] == 0) { echo"$haut Vous n'avez plus de champignon. Allez en ville en acheter.$bas";}
$page = <<<END
$haut
<center><center><img src="images/page/goomba.jpg"></center>
Ici vous pouvez donnez à manger à l'un de vos goomba<br><br>
Choisissez votre goomba :
<form action="jeu.php?page=manger" method="post">
<select name='goomba'>
<option value='-1'>Choisissez votre goomba</option>
END;
$goomba_selection = "0";
$query = doquery("select * from {{table}} where id_joueurs=$userrow[id]", "goomba");
for ( $count = 1 ; $count <= 5 && $goomba_selection != null ; $count ++ ) {
$goomba_selection = mysql_fetch_array($query);
if ( $goomba_selection != null ) {
$page .= <<<END
<option value='$goomba_selection[id]'>$goomba_selection[nom]</option>
END;
}
}
$query2 = doquery("select * from {{table}} where id='$goomba_selection[id]'", "goomba");
$goomba = mysql_fetch_array($query2);
$page .= <<<END
</select>
<input type="submit" name="submit" class="boiteFormulaire" value="Valider" />
</form>
END;
echo $page;
if (isset($_POST["submit"])) {
$query2 = doquery("select * from {{table}} where id='$_POST[goomba]'", "goomba");
$goomba = mysql_fetch_array($query2);
$newfaim = $goomba[faim] + 20;
$newchampignon = $userrow[champignon] - 1;
$query = doquery("UPDATE {{table}} SET faim='$newfaim' WHERE id='".$goomba[id]."'", "goomba");
$query1 = doquery("UPDATE {{table}} SET champignon='$newchampignon' WHERE id='".$userrow[id]."'", "joueurs");
$query2 = doquery("INSERT INTO {{table}} SET id='', id_joueurs='".$userrow[id]."',action='Vous avez donné à boire à votre goomba.',date=NOW()", "historique");
$page = <<<END
<font color="#FF0000"><b>Vous venez de donnez à manger à votre goomba.</b></font>
END;
echo $page;
}
echo $bas;
die();
}
function jouer() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
if ($userrow["jouets"] == 0) { echo"$haut Vous n'avez plus de jouet. Allez en ville en acheter.$bas"; }
$page = <<<END
$haut
<center><center><img src="images/page/goomba.jpg"></center>
Ici vous pouvez jouer avec l'un de vos goomba<br><br>
Choisissez votre goomba :
<form action="jeu.php?page=jouer" method="post">
<select name='goomba'>
<option value='-1'>Choisissez votre goomba</option>
END;
$goomba_selection = "0";
$query = doquery("select * from {{table}} where id_joueurs=$userrow[id]", "goomba");
for ( $count = 1 ; $count <= 5 && $goomba_selection != null ; $count ++ ) {
$goomba_selection = mysql_fetch_array($query);
if ( $goomba_selection != null ) {
$page .= <<<END
<option value='$goomba_selection[id]'>$goomba_selection[nom]</option>
END;
}
}
$query2 = doquery("select * from {{table}} where id='$goomba_selection[id]'", "goomba");
$goomba = mysql_fetch_array($query2);
$page .= <<<END
</select>
<input type="submit" name="submit" class="boiteFormulaire" value="Valider" />
</form>
END;
echo $page;
if (isset($_POST["submit"])) {
$query2 = doquery("select * from {{table}} where id='$_POST[goomba]'", "goomba");
$goomba = mysql_fetch_array($query2);
$newmoral = $goomba[moral] + 20;
$newjouets = $userrow[jouets] - 1;
$query = doquery("UPDATE {{table}} SET moral='$newmoral' WHERE id='".$goomba[id]."'", "goomba");
$query1 = doquery("UPDATE {{table}} SET jouets='$newjouets' WHERE id='".$userrow[id]."'", "joueurs");
$query2 = doquery("INSERT INTO {{table}} SET id='', id_joueurs='".$userrow[id]."',action='Vous avez donné à boire à votre goomba.',date=NOW()", "historique");
$page = <<<END
<font color="#FF0000"><b>Vous venez de donnez à manger à votre goomba.</b></font>
END;
echo $page;
}
echo $bas;
die();
}
function soigner() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
if ($userrow["soigner"] == 0) { echo"$haut Vous n'avez plus de trousse de secour. Allez en ville en acheter.$bas"; }
$page = <<<END
$haut
<center><center><img src="images/page/goomba.jpg"></center>
Ici vous pouvez soigner l'un de vos goomba<br><br>
Choisissez votre goomba :
<form action="jeu.php?page=soigner" method="post">
<select name='goomba'>
<option value='-1'>Choisissez votre goomba</option>
END;
$goomba_selection = "0";
$query = doquery("select * from {{table}} where id_joueurs=$userrow[id]", "goomba");
for ( $count = 1 ; $count <= 5 && $goomba_selection != null ; $count ++ ) {
$goomba_selection = mysql_fetch_array($query);
if ( $goomba_selection != null ) {
$page .= <<<END
<option value='$goomba_selection[id]'>$goomba_selection[nom]</option>
END;
}
}
$query2 = doquery("select * from {{table}} where id='$goomba_selection[id]'", "goomba");
$goomba = mysql_fetch_array($query2);
$page .= <<<END
</select>
<input type="submit" name="submit" class="boiteFormulaire" value="Valider" />
</form>
END;
echo $page;
if (isset($_POST["submit"])) {
$query2 = doquery("select * from {{table}} where id='$_POST[goomba]'", "goomba");
$goomba = mysql_fetch_array($query2);
$newsante = $goomba[sante] + 20;
$newsoigner = $userrow[soigner] - 1;
$query = doquery("UPDATE {{table}} SET sante='$newsante' WHERE id='".$goomba[id]."'", "goomba");
$query1 = doquery("UPDATE {{table}} SET soigner='$newsoigner' WHERE id='".$userrow[id]."'", "joueurs");
$query2 = doquery("INSERT INTO {{table}} SET id='', id_joueurs='".$userrow[id]."',action='Vous avez soigner votre goomba.',date=NOW()", "historique");
$page = <<<END
<font color="#FF0000"><b>Vous venez de soigner votre goomba.</b></font>
END;
echo $page;
}
echo $bas;
die();
}
function laver() {
global $userrow;
include('templates/haut2.php');
include('templates/bas2.php');
if ($userrow["eponge"] == 0) { echo"$haut Vous n'avez plus d'éponge. Allez en ville en acheter.$bas"; }
$page = <<<END
$haut
<center><center><img src="images/page/goomba.jpg"></center>
Ici vous pouvez jouer avec l'un de vos goomba<br><br>
Choisissez votre goomba :
<form action="jeu.php?page=laver" method="post">
<select name='goomba'>
<option value='-1'>Choisissez votre goomba</option>
END;
$goomba_selection = "0";
$query = doquery("select * from {{table}} where id_joueurs=$userrow[id]", "goomba");
for ( $count = 1 ; $count <= 5 && $goomba_selection != null ; $count ++ ) {
$goomba_selection = mysql_fetch_array($query);
if ( $goomba_selection != null ) {
$page .= <<<END
<option value='$goomba_selection[id]'>$goomba_selection[nom]</option>
END;
}
}
$query2 = doquery("select * from {{table}} where id='$goomba_selection[id]'", "goomba");
$goomba = mysql_fetch_array($query2);
$page .= <<<END
</select>
<input type="submit" name="submit" class="boiteFormulaire" value="Valider" />
</form>
END;
echo $page;
if (isset($_POST["submit"])) {
$query2 = doquery("select * from {{table}} where id='$_POST[goomba]'", "goomba");
$goomba = mysql_fetch_array($query2);
$newproprete = $goomba[proprete] + 20;
$neweponge = $userrow[eponge] - 1;
$query = doquery("UPDATE {{table}} SET proprete='$newproprete' WHERE id='".$goomba[id]."'", "goomba");
$query1 = doquery("UPDATE {{table}} SET eponge='$neweponge' WHERE id='".$userrow[id]."'", "joueurs");
$query2 = doquery("INSERT INTO {{table}} SET id='', id_joueurs='".$userrow[id]."',action='Vous avez donné à boire à votre goomba.',date=NOW()", "historique");
$page = <<<END
<font color="#FF0000"><b>Vous venez de donnez à manger à votre goomba.</b></font>
END;
echo $page;
}
echo $bas;
die();
}
?>