Version 2007-10-27

This commit is contained in:
nemunaire 2007-10-27 12:00:00 +02:00
parent b8e951f59d
commit 4909921671
98 changed files with 6074 additions and 2246 deletions

View file

@ -1,16 +1,13 @@
<? <?php
echo "<HTML> //define('DESIGN', 'pages/design/design1.css');
<HEAD> require('securitebanni.php');
<title>Halo battle</title> require('header.php');
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
</HEAD>
<FRAMESET COLS='180,*' frameborder=0 border=0 Noresize>
<FRAME SRC=pages/menu.php frameborder0 border=0 Noresize>
<FRAME SRC=depart.php NAME=changement frameborder=0 border=0 Noresize>
</FRAMESET>
</HTML>";
?> ?>
<frameset cols="180,*" frameborder="0" border="0" noresize>
<frame src="pages/menu.php" frameborder="0" border="0" noresize>
<frame src="pages/depart.php" name="changement" frameborder="0" border="0" noresize>
</frameset>
<body>
<p> </p>
</body>
</html>

41
connectBDD.php Normal file
View file

@ -0,0 +1,41 @@
<?php
//Connexion MySQL
//Serveur localhost
//$db = mysql_connect('localhost','hb','bddhb') or die ("erreur de connexion");
//mysql_select_db('wars',$db) or die ("erreur de connexion base");
//Serveur Halo.fr
$db = mysql_connect(':/var/lib/mysql/mysql3.sock','halobattle','m8zFmdtm9PftrcHb') or die ("erreur de connexion");
mysql_select_db('halobattle',$db) or die ("erreur de connexion base");
if (!isset($dejadefi)) {
function realip() {
if (isSet($_SERVER)) {
if (isSet($_SERVER["HTTP_X_FORWARDED_FOR"])) {
$realip = $_SERVER["HTTP_X_FORWARDED_FOR"];
} elseif (isSet($_SERVER["HTTP_CLIENT_IP"])) {
$realip = $_SERVER["HTTP_CLIENT_IP"];
} else {
$realip = $_SERVER["REMOTE_ADDR"];
}
} else {
if ( getenv( 'HTTP_X_FORWARDED_FOR' ) ) {
$realip = getenv( 'HTTP_X_FORWARDED_FOR' );
} elseif ( getenv( 'HTTP_CLIENT_IP' ) ) {
$realip = getenv( 'HTTP_CLIENT_IP' );
} else {
$realip = getenv( 'REMOTE_ADDR' );
}
}
return $realip;
}
function setHistorique($titre, $contenu){
$time = time();
$ip = $_SERVER["REMOTE_ADDR"];
$realip = realip();
mysql_query("INSERT INTO historique VALUES ('','$titre','$contenu','$time','$ip','$realip');");
}
}
$dejadefi = 1;
?>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 822 B

55
fonctions.php Normal file
View file

@ -0,0 +1,55 @@
<?php
function vais_tempsDeplacement($start_galaxie,$start_ss,$start_position,$end_galaxie,$end_ss,$end_position,$vitesse,$chauffe = 0) {
if ($end_galaxie-$start_galaxie == 0 && $end_ss-$start_ss == 0 && $end_position-$start_position == 0) $temps = 0;
elseif ($end_galaxie-$start_galaxie == 0 && $end_ss-$start_ss == 0) $temps = 900+abs($end_position-$start_position)*300/$vitesse;
elseif ($end_galaxie-$start_galaxie == 0) {
if ($end_ss-$start_ss < 25) $temps = 20*60/$vitesse;
elseif ($end_ss-$start_ss < 75) $temps = 35*60/$vitesse;
else $temps = 50*60/$vitesse;
}
else {
if ($end_galaxie-$start_galaxie < 10) $temps = 3600/$vitesse;
elseif ($end_galaxie-$start_galaxie < 25) $temps = 4500/$vitesse;
else $temps = 5400/$vitesse;
}
if ($chauffe != 0 && abs($temps) > 120) {
if ($end_galaxie-$start_galaxie == 0 && $end_ss-$start_ss == 0) $temps += 2*1*60/$chauffe;
elseif ($end_galaxie-$start_galaxie == 0) $temps += 2*2.5*60/$chauffe;
else $temps += 2*5*60/$chauffe;
}
return $temps;
}
function vais_conso($tempsDeplacement){
return $tempsDeplacement/6*100;
}
function vais_tempsArrivee($start_time,$start_galaxie,$start_ss,$start_position,$end_galaxie,$end_ss,$end_position,$vitesse,$chauffe = 0){
return ($start_time+vais_tempsDeplacement($start_galaxie,$start_ss,$start_position,$end_galaxie,$end_ss,$end_position,$vitesse,$chauffe));
}
function combat_maxressources($capacite, $metal, $cristal, $hydrogene){
$metal /= 2;
$cristal /= 2;
$hydrogene /= 2;
if ($metal + $cristal + $hydrogene > $capacite) {
if ($capacite/3 > $metal && $capacite/3 > $cristal && $capacite/3 > $hydrogene) {
}
}
else {
$ressources['metal'] = $metal;
$ressources['cristal'] = $cristal;
$ressources['hydrogene'] = $hydrogene;
}
}
function txtmission($mission){
if ($mission == 0) return 'Stationner';
elseif ($mission == 1) return 'Attaquer';
elseif ($mission == 2) return 'Transporter';
else return 'Erreur';
}
?>

31
header.php Normal file
View file

@ -0,0 +1,31 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<title><?php
if (defined('TITLE')) echo TITLE;
else print 'Halo Battle';
?></title>
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="Title" lang="fr" content="Bigorneaux VS Bulots">
<meta name="Description" lang="fr" content="Jeu en php de simulation de guerre spatiale">
<meta name="Abstract" content="Jeu en php de simulation de guerre spatiale">
<meta name="Category" content="Jeu php">
<meta name="Date-Creation-yyyymmdd" content="20070621">
<meta name="Author" content="Halo Battle">
<meta name="Distribution" content="Global">
<meta name="Rating" content="General">
<meta name="Robots" content="noindex, follow">
<meta name="Revisit-After" content="10 days">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico">
<?php
if (defined('DESIGN')) echo '<link rel="stylesheet" media="screen" type="text/css" href="'.DESIGN.'">';
?>
<?php
if (defined('HEAD')) echo HEAD;
?>
</head>

BIN
images/Thumbs.db Normal file

Binary file not shown.

BIN
images/background.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 236 KiB

41
index.anc.php Normal file
View file

@ -0,0 +1,41 @@
<?php
define('DESIGN', 'pages/descriptions/diz/base.css');
require('header.php');
define('HEAD', '<script language=javascript>
function clearText(thefield){
if (thefield.defaultValue == thefield.value)
thefield.value = "";
}
function initText(thefield){
if (thefield.value == "" || thefield.value == " ")
thefield.value = thefield.defaultValue;
}
</script>');
?>
<body>
<form method="post" action="verifLogin.php">
<table border="0" width="400" align="center">
<?php if (isset($_GET['erreur']) && $_GET['erreur'] != '') print '<tr><td colspan="2" style="text-align: center;"><b><font color="#FF0000">Impossible de valider la session, veuillez vous reconnecter.</font></b><br></td></tr>'; ?>
<tr>
<td width="200"><b>Votre login</b></td>
<td width="200">
<input type=text name="login" onfocus="clearText(this)" onblur="initText(this)" value="Login" class="zone_texte">
</td>
</tr>
<tr>
<td width="200"><b>Votre mot de passe<b></td>
<td width="200">
<input type=password name="password" onfocus="clearText(this)" onblur="initText(this)" value="Password" class="zone_texte">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Connexion" class="bouton">
</td>
</tr>
<tr><td colspan="2"><a href="inscription.php">Inscription</a></td></tr>
</table>
</form>
</body>
</html>

View file

@ -1,59 +0,0 @@
<html>
<head>
<title>Halo battle</title>
<link rel="stylesheet" media="screen" name="design" href="pages/descriptions/diz/base.css">
<meta http-equiv="Content-Language" content="fr">
<meta http-equiv="Content-Script-Type" content="text/javascript">
<meta name="Title" lang="fr" content="Bigorneaux VS Bulots">
<meta name="Description" lang="fr" content="Jeu en php de simulation de guerre spatiale">
<meta name="Abstract" content="Jeu en php de simulation de guerre spatiale">
<meta name="Category" content="Jeu php">
<meta name="Date-Creation-yyyymmdd" content="20070621">
<meta name="Author" lang="fr" content="master Leon">
<meta name="Publisher" content="master Leon">
<meta name="Distribution" content="Global">
<meta name="Rating" content="General">
<meta name="Robots" content="noindex, follow">
<meta name="Revisit-After" content="10 days">
<meta http-equiv="Cache-Control" content="no-cache">
<meta http-equiv="Pragma" content="no-cache">
<script language=javascript>
function clearText(thefield){
if (thefield.defaultValue == thefield.value)
thefield.value = "";
}
function initText(thefield){
if (thefield.value == "" || thefield.value == " ")
thefield.value = thefield.defaultValue;
}
</script>
</head>
<body>
<form method="post" action="verifLogin.php">
<table border="0" width="400" align="center">
<tr>
<td width="200"><b>Vôtre login</b></td>
<td width="200">
<input type=text name="login" onfocus="clearText(this)" onblur="initText(this)" value="Login" class="zone_texte">
</td>
</tr>
<tr>
<td width="200"><b>Vôtre mot de passe<b></td>
<td width="200">
<input type=password name="password" onfocus="clearText(this)" onblur="initText(this)" value="Password" class="zone_texte">
</td>
</tr>
<tr>
<td colspan="2">
<input type="submit" name="submit" value="Connexion" class="bouton">
</td>
</tr>
<tr><td colspan="2"><a href="inscription.php">Inscription</a></td></tr>
</table>
</form>
</body>
</html>

179
index.html.anc Normal file
View file

@ -0,0 +1,179 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!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" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: Bêta - Login</title>
<style type="text/css">
body
{
background-color:black;
background-image:url(images/background.jpg);
background-attachment: fixed ;
background-position:center 10%;
background-repeat: no-repeat;
text-align: center;
}
.contenu
{
width:790px;
margin-top: 260px;
margin-left: auto;
margin-right: auto;
}
.texte
{
background-color:black;
filter:alpha(opacity=90);
-moz-opacity:0.90;
opacity: 0.90;
border: 1px solid #383C51;
float: left;
width:450px;
height:330px;
padding: 5px;
padding-top: 5%;
text-align: center;
color: white;
font-family:"verdana";
font-size: 12px;
line-height:20px;
}
.login
{
background-color:black;
filter:alpha(opacity=50);
-moz-opacity:0.50;
opacity: 0.50;
border: 1px solid #383C51;
padding: 10px;
float: right;
width: 275px;
height: 375px;
margin: 1px;
}
.cellulestxt
{
text-align: right;
color: white;
font-family:"verdana";
font-weight: bold;
font-size: 12px;
}
.connexion
{
color: white;
font-family:"verdana";
font-size: 12px;
font-weight: bold;
text-decoration:none;
background: transparent;
border: 0px;
cursor: pointer;
}
.connexion:hover
{
color: #519FFF;
font-size: 12px;
font-weight: bold;
text-decoration: none;
background: transparent;
border: 0px;
cursor: pointer;
}
.footer
{
position: absolute;
top: 690px;
left:0px;
width:100%;
text-align: center;
color: #B0B0B0;
font-family:"verdana";
font-size: 10px;
font-weight: bold;
}
input.champ {
border:1px solid #B0B0B0;
background-color:white;
color:#B0B0B0;
}
input.champ:hover {
border:1px solid black;
background-color:white;
color:black;
}
input.champ:focus {
border:1px solid #071831;
background-color:#B9C0E6;
color:black;
}
.lien
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:visited
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:hover
{
color:white;
font-weight: bold;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="contenu">
<div class="texte">
Bienvenue&nbsp;sur&nbsp;la&nbsp;page&nbsp;de&nbsp;connexion&nbsp;de&nbsp;la&nbsp;version&nbsp;Beta&nbsp;d&#39;Halo&#45;Battle&#44;<br />
Comme&nbsp;la&nbsp;<a class="lien" href="http://battle.halo.fr">Beta</a>&nbsp;n&#39;est&nbsp;pas&nbsp;sortie&#44;&nbsp;vous&nbsp;ne&nbsp;pouvez&nbsp;pas&nbsp;vous&nbsp;connectez&#46;<br />
Pour&nbsp;suivre&nbsp;l&#39;avancement&nbsp;du&nbsp;projet&#44;&nbsp;rendez&#45;vous&nbsp;sur&nbsp;le&nbsp;<a class="lien" target="_blank" href="http://www.halo-battle.com/forum/">forum</a>&#46;<br /><br />
<div style="text-align:left; text-indent:10%;font-weight: bold;">Staff&nbsp;Halo&#45;Battle</div>
</div>
<div class="login">
<form name="login" method="post">
<table>
<tr>
<td class="cellulestxt">&#58;&#58;&nbsp;Pseudo&nbsp;&#58;&#58;&nbsp;</td><td><input type="text" class="champ" /></td></tr>
<tr><td class="cellulestxt">&#58;&#58;&nbsp;Mot&nbsp;de&nbsp;Passe&nbsp;&#58;&#58;&nbsp;</td><td><input type="password" class="champ" /></td></tr>
<tr><td align="center" colspan="2"><br /><br />
<input class="connexion" type="submit" value="&rsaquo;&nbsp;Connexion&nbsp;&lsaquo;" /></td></tr></table>
</form>
</div>
</div>
<div class="footer">
Design by Odst &#124; Halo&#45;Battle&#46;com Tous Droits R&eacute;serv&eacute;s&#46; Halo&#44; Bungie et Microsoft sont des marques et logos d&eacute;pos&eacute;s par Microsoft Corporation&#46; Tous droits r&eacute;serv&eacute;s Copyright &copy; 2007&#45;2008
</div>
<div id="player">
<object id="mediaplayer" width="0" height="0" type="audio/mpeg" data="08_ost_sacred_icon_suite.mp3">
<param name="filename" value="08_ost_sacred_icon_suite.mp3" />
<param name="autostart" value="true" />
<param name="repeat" value="true"/>
</object>
</div>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés. -->
</body>
</html>

200
index.php Normal file
View file

@ -0,0 +1,200 @@
<?php
session_start();
?>
<!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" xml:lang="fr">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<meta http-equiv="Content-Language" content="fr" />
<title> ::Halo-Battle:: Bêta - Login</title>
<style type="text/css">
body
{
background-color:black;
background-image:url(images/background.jpg);
background-attachment: fixed ;
background-position:center 10%;
background-repeat: no-repeat;
text-align: center;
}
.contenu
{
width:790px;
margin-top: 260px;
margin-left: auto;
margin-right: auto;
}
.texte
{
background-color:black;
filter:alpha(opacity=90);
-moz-opacity:0.90;
opacity: 0.90;
border: 1px solid #383C51;
float: left;
width:450px;
height:330px;
padding: 5px;
padding-top: 5%;
text-align: center;
color: white;
font-family:"verdana";
font-size: 12px;
line-height:20px;
}
.login
{
background-color:black;
filter:alpha(opacity=50);
-moz-opacity:0.50;
opacity: 0.50;
border: 1px solid #383C51;
padding: 10px;
float: right;
width: 275px;
height: 375px;
margin: 1px;
}
.cellulestxt
{
text-align: right;
color: white;
font-family:"verdana";
font-weight: bold;
font-size: 12px;
}
.connexion
{
color: white;
font-family:"verdana";
font-size: 12px;
font-weight: bold;
text-decoration:none;
background: transparent;
border: 0px;
cursor: pointer;
}
.connexion:hover
{
color: #519FFF;
font-size: 12px;
font-weight: bold;
text-decoration: none;
background: transparent;
border: 0px;
cursor: pointer;
}
.footer
{
position: absolute;
top: 690px;
left:0px;
width:100%;
text-align: center;
color: #B0B0B0;
font-family:"verdana";
font-size: 10px;
font-weight: bold;
}
input.champ {
border:1px solid #B0B0B0;
background-color:white;
color:#B0B0B0;
}
input.champ:hover {
border:1px solid black;
background-color:white;
color:black;
}
input.champ:focus {
border:1px solid #071831;
background-color:#B9C0E6;
color:black;
}
.lien
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:visited
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:hover
{
color:white;
font-weight: bold;
text-decoration: underline;
}
</style>
</head>
<body>
<div class="contenu">
<div class="texte">
<?php
if (isset($_GET['erreur'])) {
if ($_GET['erreur'] == '0') print '<b><font color="#FF0000">Nom d\'utilisateur ou mot de passe incorrect.</font><br /><br />Cliquez ici si vous avez perdu votre mot de passe.</b>';
elseif (strtolower($_GET['erreur']) == 'b2') print '<b><font color="#FF0000">Vous n\'avez pas trouvé votre mot de passe au bout de 15 essais. Par mesure de sécurité, vous avez été banni 3 heures.</font></b>';
elseif ($_GET['erreur'] == '2') print '<script type="text/javascript">var i = 0; function gen() { i++;
//<![CDATA[
document.getElementById(\'gen\').innerHTML=\'<img src="ab/ab.php?\'+i+\'" alt="Captcha"\\/>\';
//]]>
}</script><b><font color="#FF0000">Le texte situ&eacute; dans l\'image ne correspond pas, r&eacute;essayez.</font></b><br /><br />Vous pouvez générer une nouvelle image en <a href="javascript:gen();" class="lien">cliquant ici</a><br /><br />Si vous &ecirc;tes visuellement déficient, contactez un <a href="mailto:staffhb@hotmail.fr" class="lien">administrateur</a>.';
elseif ($_GET['erreur'] == '3') print '<b><font color="#FF0000">Veuillez vous connecter depuis le formulaire d\'identification ci-contre.</font></b>';
elseif ($_GET['erreur'] == '1') print '<b><font color="#FF0000">Impossible de valider la session, veuillez vous reconnecter.</font></b>';
elseif ($_GET['erreur'] == '4') print '<b><font color="#FF0000">Veuillez vous connecter depuis le formulaire d\'identification ci-contre.</font></b>';
elseif (strtolower($_GET['erreur']) == 'b') print '<b><font color="#FF0000">Vous êtes banni du jeu. Vous ne pouvez pas vous identifier</font></b>';
else print '<b><font color="#FF0000">Erreur !</font></b>';
}
else print 'Bienvenue&nbsp;sur&nbsp;la&nbsp;page&nbsp;de&nbsp;connexion&nbsp;de&nbsp;la&nbsp;version&nbsp;Beta&nbsp;d&#39;Halo&#45;Battle&#44;<br />
La b&eacute;ta &eacute;tant r&eacute;serv&eacute;e &agrave; certains utilisateurs, vous ne pouvez pas encore vous inscrire pour jouer.<br />
Si vous possèdez un code d\'activation de compte béta-testeur, <a href="inscription.php" class="lien">cliquez ici pour activer votre compte</a><br />
Pour&nbsp;suivre&nbsp;l&#39;avancement&nbsp;du&nbsp;projet&#44;&nbsp;rendez&#45;vous&nbsp;sur&nbsp;le&nbsp;<a class="lien" target="_blank" href="http://halo-battle.s-fr.com/forum/">forum</a>&#46;<br /><br />
<div style="text-align:left; text-indent:10%;font-weight: bold;">Staff&nbsp;Halo&#45;Battle</div>';
?>
</div>
<div class="login">
<form name="login" method="post" action="verifLogin.php">
<table>
<tr>
<td class="cellulestxt">&#58;&#58;&nbsp;Pseudo&nbsp;&#58;&#58;&nbsp;</td><td><input type="text" class="champ" name="login" /></td></tr>
<tr><td class="cellulestxt">&#58;&#58;&nbsp;Mot&nbsp;de&nbsp;Passe&nbsp;&#58;&#58;&nbsp;</td><td><input type="password" class="champ" name="password" /></td></tr>
<?php
if (isset($_SESSION['essaimdp']) && $_SESSION['essaimdp'] >= 3 && strtolower($_GET['erreur']) != 'b') print '<tr><td class="cellulestxt" colspan="2" style="text-align: center;"><br />Veuillez recopier le texte de cette image<br /><br /><span id="gen"><img src="ab/ab.php" alt="Captcha" /></span><br /><input type="text" class="champ" name="captcha" /></td></tr>';
?>
<tr><td align="center" colspan="2"><br />
<input class="connexion" type="submit" value="&rsaquo;&nbsp;Connexion&nbsp;&lsaquo;" /></td></tr></table>
</form>
</div>
</div>
<div class="footer">
Design by Odst &#124; Halo&#45;Battle&#46;com Tous Droits R&eacute;serv&eacute;s&#46; Halo&#44; Bungie et Microsoft sont des marques et logos d&eacute;pos&eacute;s par Microsoft Corporation&#46; Tous droits r&eacute;serv&eacute;s Copyright &copy; 2007&#45;2008
</div>
<div id="player">
<object id="mediaplayer" width="0" height="0" type="audio/mpeg" data="08_ost_sacred_icon_suite.mp3">
<param name="filename" value="08_ost_sacred_icon_suite.mp3" />
<param name="autostart" value="true" />
<param name="repeat" value="true"/>
</object>
</div>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés. -->
</body>
</html>

39
inscription.anc.php Normal file
View file

@ -0,0 +1,39 @@
<html>
<head>
<title>Inscription</title>
<link rel="stylesheet" media="screen" name="design" href="pages/descriptions/diz/base.css">
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
</head>
<body>
<br>
<br>
<br>
<br>
<br>
<center>
<table>
<form method="post" action="inscription_validation.php">
<tr><td colspan="3">Inscription</td></tr>
<tr><td>Pseudo : </td><td><input type="text" class="zone_texte" size="20" maxlength="15" name="pseudo" /></td></tr>
<tr><td>Mot de passe : </td><td><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp" /></td></tr>
<tr><td>Confirmer le mot de passe : </td><td><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp2" /></td></tr>
<tr><td>Adresse mail : </td><td><input type="text" class="zone_texte" size="20" maxlength="30" name="mail" /></td></tr>
<tr><td>Race : </td><td><label><input type="radio" name="race" value="covenant" /> Covenant</label><br>
<label><input type="radio" name="race" value="humain" /> Humain</label><br>
<tr><td colspan="3"><INPUT TYPE="button" VALUE="Retour" onClick="history.back()" class="bouton">
<input type="reset" value="Recommencer" class="bouton">
<input type="submit" value="Envoyer" class="bouton">
</td></tr>
</form>
</table>
</center>
</body>
</html>

View file

@ -1,39 +1,188 @@
<html> <?php
session_start();
?>
<!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" xml:lang="fr">
<head> <head>
<title>Inscription</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" media="screen" name="design" href="pages/descriptions/diz/base.css"> <meta http-equiv="Content-Language" content="fr" />
<meta http-equiv=pragma content=no-cache > <title> ::Halo-Battle:: Bêta - Login</title>
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 > <style type="text/css">
<link rel=shortcut icon type=image/x-icon href=favicon.ico > body
{
background-color:black;
background-image:url(images/background.jpg);
background-attachment: fixed ;
background-position:center 10%;
background-repeat: no-repeat;
text-align: center;
}
.contenu
{
width:790px;
margin-top: 260px;
margin-left: auto;
margin-right: auto;
}
.texte
{
background-color:black;
filter:alpha(opacity=90);
-moz-opacity:0.90;
opacity: 0.90;
border: 1px solid #383C51;
float: left;
width:450px;
height:330px;
padding: 5px;
padding-top: 5%;
text-align: center;
color: white;
font-family:"verdana";
font-size: 12px;
line-height:20px;
}
.login
{
background-color:black;
filter:alpha(opacity=50);
-moz-opacity:0.50;
opacity: 0.50;
border: 1px solid #383C51;
padding: 10px;
float: right;
width: 275px;
height: 375px;
margin: 1px;
}
.cellulestxt
{
text-align: right;
color: white;
font-family:"verdana";
font-weight: bold;
font-size: 12px;
}
.connexion
{
color: white;
font-family:"verdana";
font-size: 12px;
font-weight: bold;
text-decoration:none;
background: transparent;
border: 0px;
cursor: pointer;
}
.connexion:hover
{
color: #519FFF;
font-size: 12px;
font-weight: bold;
text-decoration: none;
background: transparent;
border: 0px;
cursor: pointer;
}
.footer
{
position: absolute;
top: 690px;
left:0px;
width:100%;
text-align: center;
color: #B0B0B0;
font-family:"verdana";
font-size: 10px;
font-weight: bold;
}
input.champ {
border:1px solid #B0B0B0;
background-color:white;
color:#B0B0B0;
}
input.champ:hover {
border:1px solid black;
background-color:white;
color:black;
}
input.champ:focus {
border:1px solid #071831;
background-color:#B9C0E6;
color:black;
}
.lien
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:visited
{
color:white;
font-weight: bold;
text-decoration: none;
}
.lien:hover
{
color:white;
font-weight: bold;
text-decoration: underline;
}
</style>
</head> </head>
<body> <body>
<br> <div class="contenu">
<br> <div class="texte">
<br> <div style="text-align: center;">
<br> <table style="margin-left: auto; margin-right: auto;">
<br>
<center>
<table>
<form method="post" action="inscription_validation.php"> <form method="post" action="inscription_validation.php">
<tr><td colspan="3">Inscription</td></tr> <tr><td colspan="3"><b>Inscription</b></td></tr>
<tr><td class="cellulestxt">Code d'activation : </td><td class="cellulestxt"><input type="text" class="zone_texte" size="20" maxlength="15" name="code" /></td></tr>
<tr><td>Pseudo : </td><td><input type="text" class="zone_texte" size="20" maxlength="15" name="pseudo" /></td></tr> <tr><td class="cellulestxt">Pseudo : </td><td class="cellulestxt"><input type="text" class="zone_texte" size="20" maxlength="15" name="pseudo" /></td></tr>
<tr><td class="cellulestxt">Mot de passe : </td><td class="cellulestxt"><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp" /></td></tr>
<tr><td>Mot de passe : </td><td><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp" /></td></tr> <tr><td class="cellulestxt">Confirmer le mot de passe : </td><td class="cellulestxt"><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp2" /></td></tr>
<tr><td class="cellulestxt">Adresse mail : </td><td class="cellulestxt"><input type="text" class="zone_texte" size="20" maxlength="30" name="mail" /></td></tr>
<tr><td>Confirmer le mot de passe : </td><td><input type="password" class="zone_texte" size="20" maxlength="30" name="mdp2" /></td></tr> <tr><td class="cellulestxt">Race : </td><td class="cellulestxt"><label><input type="radio" name="race" value="covenant" /> Covenant</label><br>
<tr><td>Adresse mail : </td><td><input type="text" class="zone_texte" size="20" maxlength="30" name="mail" /></td></tr>
<tr><td>Race : </td><td><label><input type="radio" name="race" value="covenant" /> Covenant</label><br>
<label><input type="radio" name="race" value="humain" /> Humain</label><br> <label><input type="radio" name="race" value="humain" /> Humain</label><br>
<tr><td colspan="3"><INPUT TYPE="button" VALUE="Retour" onClick="history.back()" class="bouton"> <tr><td colspan="3" class="cellulestxt"><input type="button" VALUE="Retour" onClick="history.back()" class="bouton">
<input type="reset" value="Recommencer" class="bouton"> <input type="reset" value="Recommencer" class="bouton">
<input type="submit" value="Envoyer" class="bouton"> <input type="submit" value="Envoyer" class="bouton">
</td></tr> </td></tr>
</form> </form>
</table> </table>
</center> </div>
</div>
<div class="login">
</div>
</div>
<div class="footer">
Design by Odst &#124; Halo&#45;Battle&#46;com Tous Droits R&eacute;serv&eacute;s&#46; Halo&#44; Bungie et Microsoft sont des marques et logos d&eacute;pos&eacute;s par Microsoft Corporation&#46; Tous droits r&eacute;serv&eacute;s Copyright &copy; 2007&#45;2008
</div>
<div id="player">
<object id="mediaplayer" width="0" height="0" type="audio/mpeg" data="08_ost_sacred_icon_suite.mp3">
<param name="filename" value="08_ost_sacred_icon_suite.mp3" />
<param name="autostart" value="true" />
<param name="repeat" value="true"/>
</object>
</div>
<!-- \\******* By Phantom *******// Halo-Battle, Tous droits réservés. -->
</body> </body>
</html> </html>

View file

@ -16,140 +16,103 @@
<br> <br>
<center> <center>
<?php <?php
//define('DESIGN', 'pages/design/design.css');
// CONNECION SQL //define('TITLE', 'Space battleship');
mysql_connect("localhost", "root", ""); //require('header.php');
mysql_select_db("wars"); ?>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" style="background-color: #0A2F59;">
<div style="text-align: center;">
<br>
<br>
<br>
<br>
<br>
<br>
<?php
require_once('connectBDD.php');
if (isset($_POST['code']) && $_POST['code'] == 'new staff' && isset($_POST['pseudo']) && isset($_POST['mail']) && isset($_POST['mdp2']) && isset($_POST['mdp']) && isset($_POST['race'])) {
$pseudo = $_POST['pseudo']; $pseudo = $_POST['pseudo'];
$mail = $_POST['mail']; $mail = addslashes($_POST['mail']);
$mdp = addslashes($_POST['mdp']);
$mdp2 = addslashes($_POST['mdp2']);
$race = addslashes($_POST['race']);
$code = addslashes($_POST['code']);
$v1=0; $erreurs = '<table style="width: 75%; margin-left: auto; margin-right: auto;">';
$v3=0; $inscriptOk = true;
$v4=0;
$v5=0;
// Diverses vérification pour savoir si tous les champs sont remplis et s'ils ont tous les données valides
// VERIFICATION DU PSEUDO if (addslashes(preg_replace('@[^a-zA-Z0-9_]@i', '', $pseudo)) != $pseudo || $pseudo == '') {
if ($pseudo =="") $inscriptOk = false;
{echo "Vous devez rentrer un pseudo"; $erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>Le pseudo contient des caractères incorrects.</b><br>Les caractères autorisés sont les lettres minuscules ou majuscules de A à Z sans les accents, ainsi que les chiffres et les caractères . _</font></td></tr>';
?><br><br><?
} }
else else {
{ $result = mysql_query("SELECT pseudo FROM user WHERE pseudo='$pseudo'");
$result = mysql_query("SELECT pseudo FROM user WHERE pseudo='".$_POST["pseudo"]."'"); if(mysql_num_rows($result) >= 1) {
if(mysql_num_rows($result)>=1) $inscriptOk = false;
{echo "Ce pseudo est déja pris"; $erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>Le pseudo est déjà utilisé par un joueur.</b><br>Vous devez choisir un autre pseudo.</font></td></tr>';
?><br><br><?
}
else
{$v3=1;}
}
// VERIFICATION DU password
if (isset($_POST['mdp'])){$mdp = $_POST['mdp'];}else{ $mdp = ''; }
if (isset($_POST['mdp2'])){$mdp2 = $_POST['mdp2'];}else{ $mdp2 = ''; }
if ($mdp =='')
{echo "Vous devez rentrer un mot de passe";
?><br><br><?
}
if ($mdp2 =='')
{echo "Vous devez confirmer votre mot de passe";
?><br><br><?
}
if ($_POST['mdp'] != $_POST['mdp2']) { echo "Vos mots de passe ne sont pas identiques";
?><br><br><?
}
else{$v4=1;}
// VERIFICATION DU mail
if (isset($_POST['mail']))
{
if (preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $_POST['mail']))
{
$result = mysql_query("SELECT mail FROM user WHERE mail='".$_POST["mail"]."'");
if(mysql_num_rows($result)>=1)
{echo "Cette adresse mail est déja utilisé";
?><br><br><?
}
else
{ $v1=1; }
}
else
{
echo 'L\'adresse ' . $_POST['mail'] . ' n\'est pas valide';
?><br><br><?
} }
} }
if (!preg_match('#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#i', $mail) || $mail == '') {
$inscriptOk = false;
$erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>L\'adresse électronique n\'est pas valide.</b><br>L\'adresse électronique que vous avez tappé est invalide ou contient des caractères interdits, recommencez.</font></td></tr>';
// VERIFICATION DE la race
if (isset($_POST['race'])){$race = $_POST['race'];}else{ $race = ''; }
if ($race == '')
{echo "Vous devez choisir une race";
?><br><br><?
} }
else if ($race == "covenant") else {
{$v5=1;} $result = mysql_query("SELECT mail FROM user WHERE mail='$mail'");
else if ($race == "humain") if(mysql_num_rows($result) >= 1) {
{$v5=1;} $inscriptOk = false;
else $erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>L\'adresse électronique que vous avez indiqué est déjà associée à un compte.</b><br>Vous devez choisir une autre adresse électronique.</font></td></tr>';
{echo "Vous devez choisir une race"; }
?><br><br><? }
if (ereg('hotmail',$mail) || ereg('msn',$mail)) {
$erreurs .= '<tr><td style="text-align: left;"><font color="#FFCC00"><b>Adresse MSN/Hotmail détectée</b><br>Nous avons remarqué un ralentissement de la réception des courriels d\'activation des comptes sur les adresses hotmail ou MSN. Nous vous recommandons d\'indiquez une adresse différente. Vous pouvez néanmoins l\'utiliser mais il faudra un certain temps avant de recevoir le courriel.</font></td></tr>';
}
if ($mdp == '' || $mdp != $mdp2) {
$inscriptOk = false;
$erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>Mots de passe différents ou vides</b><br>Vous devez impérativement choisir un mot de passe pour sécuriser votre compte. Si vous avez spécifié un mot de passe, il se peut que vous n\'ayez pas indiqué le même mot de passe dans la case de confirmation.</font></td></tr>';
}
if ($race != 'covenant' && $race != 'humain') {
$inscriptOk = false;
$erreurs .= '<tr><td style="text-align: left;"><font color="#FF0000"><b>Aucune race choisie</b><br>Vous devez choisir la race que vuos désirez incarner dans le jeu.</font></td></tr>';
} }
if ($inscriptOk != true) {
// Affichage des erreurs en cas d'impossibilité à procéder à l'inscription
print $erreurs.'</table>';
}
else {
$time = time();
$ip = $_SERVER["REMOTE_ADDR"];
// Activer la ligne suivante pour crypter les mots de passe dans la base de données
$mdp = sha1(strtoupper($pseudo).':'.$mdp); // Cryptage du mot de passe pour éviter le piratage de compte
// inscription ds la bdd $planete_trouvee = false;
while ($planete_trouvee != true) {
if ($v1==1 && $v3==1 && $v4==1 && $v5==1) $galaxie = mt_rand(2,4);
{
$temps = time();
$coo=2;
while ($coo > 1) {
$galaxy = mt_rand(2,4);
$ss = mt_rand(1,150); $ss = mt_rand(1,150);
$pos = mt_rand(1,12); $pos = mt_rand(1,12);
$result = mysql_query("SELECT pseudo FROM planete WHERE galaxy='".$galaxy."' AND ss='".$ss."' AND pos='".$pos."'"); // Test pour savoir si la planète est déjà habitée
if(mysql_num_rows($result)>=1) { $coo=2; } $result = mysql_query("SELECT id FROM planete WHERE galaxie='$galaxie' AND ss='$ss' AND position='$pos'");
else { $coo=1; } if(mysql_num_rows($result)>=1) $planete_trouvee = false;
else $planete_trouvee = true;
} }
$image = mt_rand(1,12); $image = mt_rand(1,12);
mysql_query("INSERT INTO user VALUES('', '$pseudo', '$mdp', '$race', '$mail', '', '0', '$temps', '0', '0', '0', '0', '0', '0', '0', '0')"); mysql_query("INSERT INTO user (`pseudo`, `race`, `mdp`, `mail`, `last_ip`, `time_inscription`, `last_visite`) VALUES ('$pseudo', '$race', '$mdp', '$mail', '$ip', '$time', '$time')") or die ("erreur sql ".mysql_error());
$req = mysql_query("SELECT id FROM user WHERE pseudo='$pseudo'");
$resultat = mysql_fetch_array($req);
$id_user = $resultat['id'];
$cases = mt_rand(150,250);
mysql_query("INSERT INTO planete (`id_user`, `nom_planete`, `galaxie`, `ss`, `position`, `image`, `cases`, `timestamp`, `metal`, `cristal`) VALUES ('$id_user', 'Planète mère', '$galaxie', '$ss', '$pos', '$image', '$cases', '$time', '1000', '700')") or die ("erreur sql ".mysql_error());
$z = mysql_query("SELECT id FROM user WHERE pseudo='".$pseudo."'"); echo "<a href='index.php'><center><font color=red >Enregistrement OK<br><br>Cliquez ici pour vous loguer</font></center></a>";
$donnees = mysql_fetch_array($z);
$id = $donnees['id'];
mysql_query("INSERT INTO planete VALUES('$id', '1', '$galaxie', '$ss', '$pos', '$pseudo', 'Planète mère', '$image', '200', '0', '0',
'1000', '700', '0', '$temps', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0',
'0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0')");
mysql_query("INSERT INTO classement VALUES('$pseudo', '$race', '0', '0', '0', '0')");
@header("Location: index.html");
echo "<a href='index.html'><center><font color=red >Enregistrement OK<br><br>Cliquez ici pour vous loguer</font></center></a>";
} }
else
{
echo "<INPUT TYPE=button VALUE=Retour onClick='history.back()' class=bouton>";
} }
else print '<font color="#FF0000"><b>Aucune donnée n\'a été tramise au serveur.</b></font>';
mysql_close(); mysql_close();
?> ?>
</BODY> </div>
</HTML> </body>
</html>

30
pages/ajout_terrestre.php Normal file
View file

@ -0,0 +1,30 @@
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require('../connectBDD.php');
if ((time()) >= $temps_t && !empty($temps_t)) {
switch ($unit_t) {
case 1: $vaisseau_att += $cons_terrestre; mysql_query("UPDATE planete SET vais_0='$vaisseau_att' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 2: $vaisseau_1 += $cons_terrestre; mysql_query("UPDATE planete SET vais_1='$vaisseau_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 3: $vaisseau_2 += $cons_terrestre; mysql_query("UPDATE planete SET vais_2='$vaisseau_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 4: $vaisseau_3 += $cons_terrestre; mysql_query("UPDATE planete SET vais_3='$vaisseau_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 5: $vcl_1 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_1='$vcl_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 6: $vcl_2 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_2='$vcl_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 7: $vcl_3 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_3='$vcl_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 8: $vcl_4 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_4='$vcl_4' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 9: $def_1 += $cons_terrestre; mysql_query("UPDATE planete SET def_1='$def_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 10: $def_2 += $cons_terrestre; mysql_query("UPDATE planete SET def_2='$def_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 11: $def_3 += $cons_terrestre; mysql_query("UPDATE planete SET def_3='$def_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 12: $def_4 += $cons_terrestre; mysql_query("UPDATE planete SET def_4='$def_4' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 13: $def_5 += $cons_terrestre; mysql_query("UPDATE planete SET def_5='$def_5' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
}
mysql_query("UPDATE planete SET temps_t='0', unit_t='0', cons_terrestre='0' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
// if ($unit_t < 9 && $unit_t > 0) header("Location: chantier_terrestre.php");
// else if ($unit_t >= 9) header("Location: defense.php");
}
?>

129
pages/anul_tec.php Normal file
View file

@ -0,0 +1,129 @@
<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$race=$_SESSION['race'];
require('bdd.php');
require('../connectBDD.php');
if ($_GET['tec'] == 1) {
$n=($informatique-1);
$metal += ceil(pow(2,$n)*500);
$cristal += ceil(pow(2,$n)*150);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 2) {
$n=($detection-1);
$metal += ceil(pow(2,$n)*500);
$cristal += ceil(pow(2,$n)*750);
$hydrogene += ceil(pow(2,$n)*100);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 3) {
$n=($armement-1);
$metal += ceil(pow(2,$n)*2500);
$cristal += ceil(pow(2,$n)*500);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 5) {
$n=($energie_t-1);
$metal += ceil(pow(2,$n)*2000);
$cristal += ceil(pow(2,$n)*1500);
$hydrogene += ceil(pow(2,$n)*300);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 6) {
$n=($reacteur-1);
$metal += ceil(pow(2,$n)*1400);
$cristal += ceil(pow(2,$n)*400);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 7) {
$n=($reacteur_f-1);
$metal += ceil(pow(2,$n)*3000);
$cristal += ceil(pow(2,$n)*2100);
$hydrogene += ceil(pow(2,$n)*750);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 8) {
$n=($reacteur_ff-1);
$metal += ceil(pow(2,$n)*5000);
$cristal += ceil(pow(2,$n)*4000);
$hydrogene += ceil(pow(2,$n)*1500);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 9) {
$n=($medecine-1);
$metal += ceil(pow(2,$n)*800);
$cristal += ceil(pow(2,$n)*1000);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 10) {
$n=($tactique-1);
$metal += ceil(pow(2,$n)*2600);
$cristal += ceil(pow(2,$n)*2600);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 11) {
$n=($developpement-1);
$metal += ceil(pow(2,$n)*10000);
$cristal += ceil(pow(2,$n)*10000);
$hydrogene += ceil(pow(2,$n)*5000);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 12) {
$n=($blindage-1);
$metal += ceil(pow(2,$n)*3700);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 13) {
$n=($spartan-1);
$metal += ceil(pow(3,$n)*5200);
$cristal += ceil(pow(3,$n)*4250);
$hydrogene += ceil(pow(3,$n)*850);
$temps_t = 0;
$tec = 0;
mysql_query("UPDATE planete SET metal ='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id='$planete_source'");
mysql_query("UPDATE user SET temps_t='$temps_t', tec='$tec' WHERE id='$id'");
}
mysql_close();
@header("Location: laboratoire.php");
?>

View file

@ -6,7 +6,7 @@ $galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss']; $ss=$_SESSION['ss'];
$pos=$_SESSION['pos']; $pos=$_SESSION['pos'];
echo"<html> echo'<html>
<head> <head>
<title>Halo Battle</title> <title>Halo Battle</title>
@ -50,25 +50,25 @@ TD.e {
background-color: #000151; background-color: #000151;
border: 1px solid #00007D; border: 1px solid #00007D;
} }
</style>"; </style>';
function techno($nom, $niveau, $niveau_ress) function techno($nom, $niveau, $niveau_ress)
{ {
if ($niveau < $niveau_ress) if ($niveau < $niveau_ress)
{ {
echo "<font color=red >".$nom." ".$niveau_ress."</font>"; echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
} }
else else
{ {
echo "<font color=#00CC99 >".$nom." ".$niveau_ress."</font>"; echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
} }
} }
include 'bdd.php'; include 'bdd.php';
echo"</head> echo'</head>
<body> <body>
<table align=center id=tablo> <table align=center id=tablo>
@ -83,72 +83,72 @@ echo"</head>
<tr> <tr>
<td class=c>Bâtiment</td> <td class=c>Bâtiment</td>
<td class=c>Niveau</td> <td class=c>Niveau</td>
<td class=e>Technologies nécessaires</td> <td class=e>Technologies nécessaires (niveau actuel)</td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Purificateur de métal</a></td> <td class=c><a href=descriptions/.php>Purificateur de métal</a></td>
<td class=d>".$mine_m."</td> <td class=d>'.$mine_m.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td> <td class=e><font color=#00CC99>Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Purificateur de cristal</a></td> <td class=c><a href=descriptions/.php>Purificateur de cristal</a></td>
<td class=d>".$mine_c."</td> <td class=d>'.$mine_c.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td> <td class=e><font color=#00CC99>Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Ionisateur</a></td> <td class=c><a href=descriptions/.php>Ionisateur</a></td>
<td class=d>".$mine_h."</td> <td class=d>'.$mine_h.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td> <td class=e><font color=#00CC99>Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Centrale solaire</a></td> <td class=c><a href=descriptions/.php>Centrale solaire</a></td>
<td class=d>".$centrale_s."</td> <td class=d>'.$centrale_s.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td> <td class=e><font color=#00CC99>Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Centrale de fusion</a></td> <td class=c><a href=descriptions/.php>Centrale de fusion</a></td>
<td class=d>".$centrale_f."</td> <td class=d>'.$centrale_f.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td> <td class=e>'; @techno(Energie,$energie_t, 5); echo'<br>'; @techno('Centrale solaire',$centrale_s, 12); echo'</td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Oeil des prophètes</a></td> <td class=c><a href=descriptions/.php>Oeil des prophètes</a></td>
<td class=d>".$radar."</td> <td class=d>'.$radar.'</td>
<td class=e>"; @techno(Détection,$detection, 1); echo"</td> <td class=e>'; @techno(Détection,$detection, 1); echo'</td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Centre de recherches</a></td> <td class=c><a href=descriptions/.php>Centre de recherches</a></td>
<td class=d>".$labo."</td> <td class=d>'.$labo.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td> <td class=e><font color=#00CC99 >Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Chantier terrestre</a></td> <td class=c><a href=descriptions/.php>Chantier terrestre</a></td>
<td class=d>".$chantier_terrestre."</td> <td class=d>'.$chantier_terrestre.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td> <td class=e><font color=#00CC99 >Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Chantier spatial</a></td> <td class=c><a href=descriptions/.php>Chantier spatial</a></td>
<td class=d>".$chantier_spatial."</td> <td class=d>'.$chantier_spatial.'</td>
<td class=e>"; @techno("Chantier terrestre",$chantier_terrestre, 2); echo"</font></td> <td class=e>'; @techno('Chantier terrestre',$chantier_terrestre, 2); echo'</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Caserne</a></td> <td class=c><a href=descriptions/.php>Caserne</a></td>
<td class=d>".$caserne."</td> <td class=d>'.$caserne.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td> <td class=e><font color=#00CC99 >Débloqué</font></td>
</tr> </tr>
<tr> <tr>
<td class=c><a href=descriptions/.php>Entrepôt</a></td> <td class=c><a href=descriptions/.php>Entrepôt</a></td>
<td class=d>".$silo."</td> <td class=d>'.$silo.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td> <td class=e><font color=#00CC99 >Débloqué</font></td>
</tr> </tr>
@ -157,4 +157,4 @@ echo"</head>
</body> </body>
</html>"; ?> </html>'; ?>

160
pages/arbre_bat_humain.php Normal file
View file

@ -0,0 +1,160 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_humain.php>Batiments</a> |
<a href=arbre_techno_humain.php>Technologies</a> |
<a href=arbre_unitees_humain.php>Ecole militaire</a> |
<a href=arbre_vehicules_humain.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_humain.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Bâtiment</td>
<td class=c>Niveau</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Usine de méttalurgie</a></td>
<td class=d>'.$mine_m.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Usine de cristal</a></td>
<td class=d>'.$mine_c.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Synchronisateur d\'hydrogène</a></td>
<td class=d>'.$mine_h.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Centrale solaire</a></td>
<td class=d>'.$centrale_s.'</td>
<td class=e><font color=#00CC99>Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Centrale énergetique</a></td>
<td class=d>'.$centrale_f.'</td>
<td class=e>'; @techno('Maitrise de l\'energie',$energie_t, 5); echo'<br>'; @techno('Centrale solaire',$centrale_s, 12); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Base radar</a></td>
<td class=d>'.$radar.'</td>
<td class=e>'; @techno(Radar,$detection, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Laboratoire</a></td>
<td class=d>'.$labo.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Chantier terrestre</a></td>
<td class=d>'.$chantier_terrestre.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Chantier spatial</a></td>
<td class=d>'.$chantier_spatial.'</td>
<td class=e>'; @techno('Chantier terrestre',$chantier_terrestre, 2); echo'</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Ecole militaire</a></td>
<td class=d>'.$caserne.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Silo de stockage</a></td>
<td class=d>'.$silo.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,157 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_covenant.php>Batiments</a> |
<a href=arbre_techno_covenant.php>Technologies</a> |
<a href=arbre_unitees_covenant.php>Caserne</a> |
<a href=arbre_vehicules_covenant.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_covenant.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Technologie</td>
<td class=c>Niveau</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Informatique</a></td>
<td class=d>'.$informatique.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Détection</a></td>
<td class=d>'.$detection.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 2); echo'<br>'; @techno(Informatique ,$informatique, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Armement</a></td>
<td class=d>'.$armement.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 5); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Bouclier</a></td>
<td class=d>'.$blindage.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Maitrise de l\'énergie</a></td>
<td class=d>'.$energie_techno.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à antigravité</a></td>
<td class=d>'.$reacteur.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à fusion</a></td>
<td class=d>'.$reacteur_f.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 4); echo'<br>';
@techno("Maitrise de l'énergie",$energie_t, 2); echo'<br>';
@techno("Réacteur à antigravité",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à fusion Forruneur</a></td>
<td class=d>'.$reacteur_ff.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 6); echo'<br>';
@techno("Maitrise de l'énergie",$energie_t, 5); echo'<br>';
@techno("Réacteur à fusion",$reacteur_f, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Médecine</a></td>
<td class=d>'.$medecine.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Commandemant militaire</a></td>
<td class=d>'.$tactique.'</td>
<td class=e>'; @techno('Centre de recherches',$labo, 3); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,157 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_humain.php>Batiments</a> |
<a href=arbre_techno_humain.php>Technologies</a> |
<a href=arbre_unitees_humain.php>Ecole militaire</a> |
<a href=arbre_vehicules_humain.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_humain.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Technologie</td>
<td class=c>Niveau</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>IA</a></td>
<td class=d>'.$informatique.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Détection</a></td>
<td class=d>'.$detection.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 2); echo'<br>'; @techno(IA ,$informatique, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Armement</a></td>
<td class=d>'.$armement.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 5); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Blindage</a></td>
<td class=d>'.$blindage.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Maitrise de l\'énergie</a></td>
<td class=d>'.$energie_techno.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à combustion</a></td>
<td class=d>'.$reacteur.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à fusion</a></td>
<td class=d>'.$reacteur_f.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 4); echo'<br>';
@techno("Maitrise de l'énergie",$energie_t, 2); echo'<br>';
@techno("Réacteur à combustion",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Réacteur à fusion de type II</a></td>
<td class=d>'.$reacteur_ff.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 6); echo'<br>';
@techno("Maitrise de l'énergie",$energie_t, 5); echo'<br>';
@techno("Réacteur à fusion",$reacteur_f, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Médecine</a></td>
<td class=d>'.$medecine.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Commandemant militaire</a></td>
<td class=d>'.$tactique.'</td>
<td class=e>'; @techno('Laboratoire',$labo, 3); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,140 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_covenant.php>Batiments</a> |
<a href=arbre_techno_covenant.php>Technologies</a> |
<a href=arbre_unitees_covenant.php>Caserne</a> |
<a href=arbre_vehicules_covenant.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_covenant.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Unitée</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Grunt</a></td>
<td class=e>'; @techno(Caserne,$caserne, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Jackal</a></td>
<td class=e>'; @techno(Caserne,$caserne, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Drone</a></td>
<td class=e>'; @techno(Caserne,$caserne, 2); echo'<br>'; @techno(Armement,$armement, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Elite</a></td>
<td class=e>'; @techno(Caserne,$caserne, 5); echo'<br>'; @techno(Armement,$armement, 3);
echo'<br>'; @techno("Commandement militaire",$tactique,2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Sniper</a></td>
<td class=e>'; @techno(Caserne,$caserne, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Hunter</a></td>
<td class=e>'; @techno(Caserne,$caserne, 10); echo'<br>'; @techno(Armement,$armement, 5);
echo'<br>'; @techno(Bouclier,$blindage, 5); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Médecin</a></td>
<td class=e>'; @techno(Caserne,$caserne, 2); echo'<br>'; @techno(Médecine,$medecine, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Ingénieur</a></td>
<td class=e>'; @techno(Caserne,$caserne, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Brute</a></td>
<td class=e>'; @techno(Caserne,$caserne, 5); echo'<br>'; @techno(Armement,$armement, 4);
echo'<br>'; @techno(Bouclier,$blindage, 2); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,140 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_humain.php>Batiments</a> |
<a href=arbre_techno_humain.php>Technologies</a> |
<a href=arbre_unitees_humain.php>Ecole militaire</a> |
<a href=arbre_vehicules_humain.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_humain.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Unitée</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Marine</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Fusiller</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Grenadier</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 2); echo'<br>'; @techno(Armement,$armement, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>TCAO</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 5); echo'<br>'; @techno(Armement,$armement, 3);
echo'<br>'; @techno("Tactiques de combats",$tactique,2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Sniper</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Spartan</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 10); echo'<br>'; @techno(Armement,$armement, 7);
echo'<br>'; @techno(Blindage,$blindage, 7); echo'<br>'; @techno("Tactiques de combats",$tactique,2); echo'<br>'; echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Médecin</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 2); echo'<br>'; @techno(Médecine,$medecine, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Ingénieur</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Marine exosquelette</a></td>
<td class=e>'; @techno('Ecole militaire',$caserne, 5); echo'<br>'; @techno(Armement,$armement, 4);
echo'<br>'; @techno(Blindage,$blindage, 2); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,154 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_covenant.php>Batiments</a> |
<a href=arbre_techno_covenant.php>Technologies</a> |
<a href=arbre_unitees_covenant.php>Caserne</a> |
<a href=arbre_vehicules_covenant.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_covenant.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Vaisseaux</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Transporteur</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 1); echo'<br>'; @techno("Réacteur à antigravité",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Grand transporteur</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Vaisseau de colonisation</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion Forruneur",$reacteur_ff, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Sonde</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 3); echo'<br>'; @techno("Réacteur à antigravité",$reacteur, 5);
echo'<br>'; @techno(Détection,$detection, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Recycleur</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 4);
echo'<br>'; @techno(Bouclier,$blindage, 5); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Seraph</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 1); echo'<br>'; @techno("Réacteur à antigravité",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Frégate</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 3); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 3);
echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Croiseur de classe CSS</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 6); echo'<br>'; @techno("Réacteur de fusion Forruneur",$reacteur_ff, 2);
echo'<br>'; @techno(Armement,$armement, 3); echo'<br>'; @techno(Bouclier,$blindage, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Croiseur de classe Reverence</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 6); echo'<br>'; @techno("Réacteur de fusion Forruneur",$reacteur_ff, 3);
echo'<br>'; @techno(Armement,$armement, 4); echo'<br>'; @techno(Bouclier,$blindage, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Porte vaisseaux</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 8); echo'<br>'; @techno("Réacteur de fusion Forruneur",$reacteur_ff, 5);
echo'<br>'; @techno(Armement,$armement, 6); echo'<br>'; @techno(Bouclier,$blindage, 6); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Station orbitale covenant</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 12); echo'<br>'; @techno("Réacteur de fusion Forruneur",$reacteur_ff, 10);
echo'<br>'; @techno(Armement,$armement, 12); echo'<br>'; @techno(Bouclier,$blindage, 12); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,154 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_humain.php>Batiments</a> |
<a href=arbre_techno_humain.php>Technologies</a> |
<a href=arbre_unitees_humain.php>Ecole militaire</a> |
<a href=arbre_vehicules_humain.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_humain.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Vaisseaux</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Cargos de classe Parabola</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 1); echo'<br>'; @techno("Réacteur à combustion",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Cargos de classe Laden</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Vaisseau de colonisation de classe Odyssey</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion de type II",$reacteur_ff, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Drones despionnage de classe Clarion</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 3); echo'<br>'; @techno("Réacteur à cmbustion",$reacteur, 5);
echo'<br>'; @techno(Radar,$detection, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Recycleur de classe Minotaure</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 5); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 4);
echo'<br>'; @techno(Blindage,$blindage, 5); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>C079 Longsword Interceptor</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 1); echo'<br>'; @techno("Réacteur à combustion",$reacteur, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Frégate</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 3); echo'<br>'; @techno("Réacteur de fusion",$reacteur_f, 3);
echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Croiseur de classe Halcyon</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 6); echo'<br>'; @techno("Réacteur de fusion de type II",$reacteur_ff, 2);
echo'<br>'; @techno(Armement,$armement, 3); echo'<br>'; @techno(Blindage,$blindage, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Croiseur de classe Marathon</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 6); echo'<br>'; @techno("Réacteur de fusion de type II",$reacteur_ff, 3);
echo'<br>'; @techno(Armement,$armement, 4); echo'<br>'; @techno(Blindage,$blindage, 4); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Porte vaisseaux</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 8); echo'<br>'; @techno("Réacteur de fusion de type II",$reacteur_ff, 5);
echo'<br>'; @techno(Armement,$armement, 6); echo'<br>'; @techno(Blindage,$blindage, 6); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Station orbitale humaine</a></td>
<td class=e>'; @techno("Chantier spatial",$chantier_spatial, 12); echo'<br>'; @techno("Réacteur de fusion de type II",$reacteur_ff, 10);
echo'<br>'; @techno(Armement,$armement, 12); echo'<br>'; @techno(Blindage,$blindage, 12); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,161 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_covenant.php>Batiments</a> |
<a href=arbre_techno_covenant.php>Technologies</a> |
<a href=arbre_unitees_covenant.php>Ecole militaire</a> |
<a href=arbre_vehicules_covenant.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_covenant.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Véhicules</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Banshee</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Spirit</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Phantom</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno("Réacteur à antigravité",$reacteur, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Boarding craft</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 6); echo'<br>'; @techno("Réacteur à antigravité",$reacteur, 3); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Ghost</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Shadow</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Spectre</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Appariton</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 5); echo'<br>'; @techno(Armement,$armement, 2);
echo'<br>'; @techno(Bouclier,$blindage, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Shade</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Stong shade</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno("Maitrise de l'énergie",$energie_t, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Tourelle à barreau de combustible</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Tourelle à plasma</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno(Armement,$armement, 3);
echo'<br>'; @techno("Maitrise de l'énergie",$energie_t, 3); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Lanceur de torpilles plasma</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 8); echo'<br>'; @techno(Armement,$armement, 5);
echo'<br>'; @techno(Informatique,$informatique, 4); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -0,0 +1,161 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo'<html>
<head>
<title>Halo Battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
.g {
width: 200;
margin-left: 115;
}
.h {
text-align: center;
width: 30;
}
.j {
text-align: left;
width: 200;
}
#tablo {
margin-bottom: 20px;
}
TD.c {
background-color: #00024A;
border: 1px solid #02058A;
}
TD.d {
background-color: #000151;
border: 1px solid #00007D;
color: #ff8040;
}
TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo'</head>
<body>
<table align=center id=tablo>
<tr><td><a href=arbre_bat_humain.php>Batiments</a> |
<a href=arbre_techno_humain.php>Technologies</a> |
<a href=arbre_unitees_humain.php>Ecole militaire</a> |
<a href=arbre_vehicules_humain.php>Chantier terrestre</a> |
<a href=arbre_vaisseaux_humain.php>Chantier spatial</a></td></tr></table>
<table align=center>
<tr>
<td class=c>Véhicules</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Sparrowhawk</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>077-TC Pelican</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>C703 Shortsword Bomber</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno("Réacteur à combustion",$reacteur, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>SHD Albatros</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 6); echo'<br>'; @techno("Réacteur à combustion",$reacteur, 3); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>M12 LRV Warthogs</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>M12G1 LAAV Warthogs</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>M12A1 LAAV Warthogs</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Scorpion</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 5); echo'<br>'; @techno(Armement,$armement, 2);
echo'<br>'; @techno(Blindage,$blindage, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Mitrailleuse automatique M247 GP</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>DCA légère</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 3); echo'<br>'; @techno("Maitrise de l'énergie",$energie_t, 2); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>DCA lourde</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno(Armement,$armement, 1); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Canon Gauss</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 4); echo'<br>'; @techno(Armement,$armement, 3);
echo'<br>'; @techno("Maitrise de l'énergie",$energie_t, 3); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Lanceur de missiles</a></td>
<td class=e>'; @techno("Chantier terrestre",$chantier_terrestre, 8); echo'<br>'; @techno(Armement,$armement, 5);
echo'<br>'; @techno(IA,$informatique, 4); echo'</td>
</tr>
</table>
</body>
</html>'; ?>

View file

@ -1,4 +1,4 @@
<? <?php
session_start(); session_start();
$id=$_SESSION['id']; $id=$_SESSION['id'];
@ -8,15 +8,24 @@ $pos=$_SESSION['pos'];
echo"<html> echo"<html>
<head> <head>
<title>Space battleship</title> <title>Halo battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css > <link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache > <meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 > <meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >"; <link rel=shortcut icon type=image/x-icon href=favicon.ico >
include 'bdd.php'; <style TYPE=text/css>
include 'batiment_ajout.php'; TD {
border: 0px;
background-color: transparent;
}
</style>";
require_once 'bdd.php';
require_once 'ressource.php';
require_once 'batiment_ajout.php';
require_once 'noms.php';
function sec($time) { function sec($time) {
$output = ''; $output = '';
@ -50,408 +59,354 @@ else
function ressources($fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro, $mine_m, $mine_c, $mine_h) { function ressources($fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro, $mine_m, $mine_c, $mine_h) {
if ($need_fer > 0) { if ($need_fer > 0) {
if ($fer <= $need_fer) if ($fer <= $need_fer) {
{
$z=floor($fer)-$need_fer; $z=floor($fer)-$need_fer;
echo '<font color=red >Fer : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> '; echo '<font color=red >Fer : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> ';
} }
else {echo "Fer : <span class=rc>".$need_fer." </span>";}} else echo "Fer : <span class=rc>".$need_fer." </span>";
}
if ($need_cristal > 0) { if ($need_cristal > 0) {
if ($cristal <= $need_cristal) if ($cristal <= $need_cristal) {
{
$z=floor($cristal)-$need_cristal; $z=floor($cristal)-$need_cristal;
echo '<font color=red >Cristal : <ACRONYM title="'.$z.'">'.$need_cristal.'</ACRONYM></font> '; echo '<font color=red >Cristal : <ACRONYM title="'.$z.'">'.$need_cristal.'</ACRONYM></font> ';
} }
else {echo "Cristal : <span class=rc>".$need_cristal." </span>";}} else echo "Cristal : <span class=rc>".$need_cristal." </span>";
}
if ($need_ro > 0) { if ($need_ro > 0) {
if ($ro <= $need_ro) if ($ro <= $need_ro) {
{
$z=floor($ro)-$need_ro; $z=floor($ro)-$need_ro;
echo '<font color=red >Hydrogène : <ACRONYM title="'.$z.'">'.$need_ro.'</ACRONYM></font>'; echo '<font color=red >Hydrogène : <ACRONYM title="'.$z.'">'.$need_ro.'</ACRONYM></font>';
} }
else {echo "Hydrogène : <span class=rc>".$need_ro."</span>";}} else echo "Hydrogène : <span class=rc>".$need_ro."</span>";
}
} }
$case = $cases - ($mine_m + $mine_c + $mine_h + $centrale_s + $centrale_f + $radar + $labo + $chantier_terrestre + $chantier_spatial + $caserne + $silo); $case = $cases - ($mine_m + $mine_c + $mine_h + $centrale_s + $centrale_f + $radar + $labo + $chantier_terrestre + $chantier_spatial + $caserne + $silo);
echo "<script language=javascript src=time.js></script> echo '<script language="javascript" src="time.js"></script>
</head> </head>
<body> <body>
<div class=d><a href="arbre_bat_'.$race.'.php">Arbre des technologies</a></div>
<div class=d><a href=arbre_bat.php>Arbre des technologies</a></div> <br class="a">
<div class="a">
<br class=a> <img src="images/batiments/'.$batimeni[0].'" alt="" />
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[0].'">'.$batiment[0].'</a> '; if ($mine_m > 0) echo '(Niveau '.$mine_m.')'; echo '<br>
<a href=descriptions/.php>Purificateur de métal</a> "; if ($mine_m > 0) { echo "( Niveau ".$mine_m." )"; } echo "<br> Toute construction demande des quantités énormes de fer, pour cela des centaines de milliers d\'ouvriers
Toute construction demande des quantités énormes de fer, pour cela des centaines de milliers d'ouvriers travaillent dans ces mines afin d\'assurer le bon fonctionnement de votre empire.<br>
travaillent dans ces mines afin d'assurer le bon fonctionnement de votre empire.<br> Besoin de : ';
Besoin de : "; $a=ceil(pow(1.5,$mine_m)*70);
$a=ceil(exp(($mine_m*0.400))*200); $b=ceil(pow(1.55,$mine_m)*35);
$b=ceil(exp(($mine_m*0.400))*100); ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> Temps de construction : '; sec(ceil(pow(1.7,$mine_m)*120));
Temps de construction : "; sec(ceil(pow(1.7,$mine_m)*120)); echo '</div>
echo "</div> <div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==1) { if ($bat==1) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=1\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color="red">Planète pleine</font>';
else { verification_des_ress(1, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(1, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div>
<br class="a">
<br class=a> <div class="a">
<img src="images/batiments/'.$batimeni[1].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[1].'">'.$batiment[1].'</a> '; if ($mine_c > 0) echo '(Niveau '.$mine_c.')'; echo '<br>
<a href=descriptions/.php>Purificateur de cristal</a> "; if ($mine_c > 0) { echo "( Niveau ".$mine_c." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(exp(($mine_c*0.430))*210); $a=ceil(pow(1.55,$mine_c)*105);
$b=ceil(exp(($mine_c*0.430))*120); $b=ceil(pow(1.55,$mine_c)*60);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo'<br>
Temps de construction : "; sec(ceil(pow(1.72,$mine_c)*160)); Temps de construction : '; sec(ceil(pow(1.72,$mine_c)*160));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==2) { if ($bat==2) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=2\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color=red>Planète pleine</font>';
else { verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div>
<br class="a">
<br class=a> <div class="a">
<img src="images/batiments/'.$batimeni[2].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[2].'">'.$batiment[2].'</a> '; if ($mine_h > 0) echo '(Niveau '.$mine_h.')'; echo '<br>
<a href=descriptions/.php>Ionisateur</a> "; if ($mine_h > 0) { echo "( Niveau ".$mine_h." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(exp(($mine_h*0.445))*250); $a=floor(pow(1.53,$mine_h)*82);
$b=ceil(exp(($mine_h*0.445))*170); $b=floor(pow(1.5,$mine_h)*80);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(1.75,$mine_h)*180)); Temps de construction : '; sec(ceil(pow(1.75,$mine_h)*180));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==3) { if ($bat==3) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=3\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color=red>Planète pleine</font>';
else { verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div>
<br class="a">
<br class=a> <div class="a">
<img src="images/batiments/'.$batimeni[3].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[3].'">'.$batiment[3].'</a> '; if ($centrale_s > 0) echo '(Niveau '.$centrale_s.')'; echo '<br>
<a href=descriptions/.php>Centrale solaire</a> "; if ($centrale_s > 0) { echo "( Niveau ".$centrale_s." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$centrale_s)*300); $a=ceil(pow(2,$centrale_s)*300);
$b=ceil(pow(2,$centrale_s)*230); $b=ceil(pow(2,$centrale_s)*230);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(pow(1.68,$centrale_s)*190); Temps de construction : '; sec(pow(1.68,$centrale_s)*190);
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==4) { if ($bat==4) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=4\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color=red>Planète pleine</font>';
else { verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div><br class="a">';
if ($centrale_s >= 12 && $energie_t >= 5) {
<br class=a> echo '<div class="a">
<img src="images/batiments/'.$batimeni[4].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[4].'">'.$batiment[4].'</a> '; if ($centrale_f > 0) echo '(Niveau '.$centrale_f.')'; echo '<br>
<a href=descriptions/.php>Centrale de fusion</a> "; if ($centrale_f > 0) { echo "( Niveau ".$centrale_f." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$centrale_f)*165); $a=ceil(pow(2,$centrale_f)*165);
$b=ceil(pow(2,$centrale_f)*99); $b=ceil(pow(2,$centrale_f)*99);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(pow(1.8,$centrale_f)*300); Temps de construction : '; sec(pow(1.8,$centrale_f)*300);
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==5) { if ($bat==5) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=5\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color=red>Planète pleine</font>';
else { verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div><br class="a">';
}
<br class=a>";
if ($detection >= 1) { if ($detection >= 1) {
echo "<div class=a> echo '<div class=a>
<img src=descriptions/diz/batiment> <img src="images/batiments/'.$batimeni[5].'" alt="">
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[5].'">'.$batiment[5].'</a> '; if ($radar > 0) echo '(Niveau '.$radar.')'; echo '<br>
<a href=descriptions/.php>Oeil des prophètes</a> "; if ($radar > 0) { echo "( Niveau ".$radar." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$radar)*750); $a=ceil(pow(2,$radar)*750);
$b=ceil(pow(2,$radar)*500); $b=ceil(pow(2,$radar)*500);
$c=ceil(pow(2,$radar)*50); $c=ceil(pow(2,$radar)*50);
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$radar)*720)); Temps de construction : '; sec(ceil(pow(2,$radar)*720));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==6) { if ($bat==6) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=6\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color="red">Planète pleine</font>';
else { verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, $c); } } else verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, $c);
echo "</div><br class=a>"; } }
echo '</div><br class="a">';
}
echo '<div class="a">
echo "<div class=a> <img src="images/batiments/'.$batimeni[6].'" alt="">
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[6].'">'.$batiment[6].'</a> '; if ($labo > 0) echo '(Niveau '.$labo.')'; echo '<br>
<a href=descriptions/.php>Centre de recherches</a> "; if ($labo > 0) { echo "( Niveau ".$labo." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$labo)*200); $a=ceil(pow(2,$labo)*200);
$b=ceil(pow(2,$labo)*150); $b=ceil(pow(2,$labo)*150);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$labo)*720)); Temps de construction : '; sec(ceil(pow(2,$labo)*720));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==7) { if ($bat==7) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=7\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo "<font color=red>Planète pleine</font>";
else { if($temps_t > 0) { else {
echo "<font color=red><br><br>Recherche en cours dans le </font><a href=labo.php>laboratoire</a>"; } else { if($temps_t > 0) echo '<font color="red"><br><br>Recherche en cours dans le </font><a href="laboratoire.php">laboratoire</a>';
verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0); } } } else verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
}
echo '</div>
<br class=a> <br class="a">
<div class="a">
<img src="images/batiments/'.$batimeni[7].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[7].'">'.$batiment[7].'</a> '; if ($chantier_terrestre > 0) echo '(Niveau '.$chantier_terrestre.')'; echo '<br>
<a href=descriptions/.php>Chantier terrestre</a> "; if ($chantier_terrestre > 0) { echo "( Niveau ".$chantier_terrestre." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$chantier_terrestre)*520); $a=ceil(pow(2,$chantier_terrestre)*520);
$b=ceil(pow(2,$chantier_terrestre)*380); $b=ceil(pow(2,$chantier_terrestre)*380);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_terrestre)*420)); Temps de construction : '; sec(ceil(pow(2,$chantier_terrestre)*420));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==8) { if ($bat==8) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=8\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color="red">Planète pleine</font>';
else {if($unit_s > 0) { else {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; } if($unit_s > 0) echo '<font color="red"><br><br>Construction en cours dans le </font><a href="chantier_spatial.php">chantier spatial</a>';
else { verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, 0); }}} else verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
}
echo '</div>
<br class=a>"; <br class="a">';
if ($chantier_terrestre >= 2) { if ($chantier_terrestre >= 2) {
echo "<div class=a> echo '<div class="a">
<img src=descriptions/diz/batiment> <img src="images/batiments/'.$batimeni[8].'">
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[8].'">'.$batiment[8].'</a> '; if ($chantier_spatial > 0) echo '(Niveau '.$chantier_spatial.')'; echo '<br>
<a href=descriptions/.php>Chantier spatial</a> "; if ($chantier_spatial > 0) { echo "( Niveau ".$chantier_spatial." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$chantier_spatial)*600); $a=ceil(pow(2,$chantier_spatial)*600);
$b=ceil(pow(2,$chantier_spatial)*450); $b=ceil(pow(2,$chantier_spatial)*450);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_spatial)*600)); Temps de construction : '; sec(ceil(pow(2,$chantier_spatial)*600));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==9) { if ($bat==9) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=9\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo "<font color=red>Planète pleine</font>";
else {if($unit_s > 0) { else {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; } if($unit_t > 0) echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_terrestre.php>chantier terrestre</a>";
else {verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0); } } } else verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div><br class=a>"; } }
}
echo '</div><br class="a">';
}
echo "<br class=a> echo '<div class="a">
<img src="images/batiments/'.$batimeni[9].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[9].'">'.$batiment[9].'</a> '; if ($caserne > 0) echo '(Niveau '.$caserne.')'; echo '<br>
<a href=descriptions/.php>Caserne</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$caserne)*200); $a=ceil(pow(2,$caserne)*200);
$b=ceil(pow(2,$caserne)*100); $b=ceil(pow(2,$caserne)*100);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$caserne)*300)); Temps de construction : '; sec(ceil(pow(2,$caserne)*300));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==10) { if ($bat==10) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=10\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color="red">Planète pleine</font>';
else {if($unit > 0) { else {
echo "<font color=red><br><br>Entrainement en cours dans la </font><a href=caserne.php>caserne</a>"; } if($unit > 0) echo '<font color="red"><br><br>Entrainement en cours dans la </font><a href="caserne.php">caserne</a>';
else { verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0); }}} else verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
}
echo '</div>
<br class=a> <br class="a">
<div class="a">
<img src="images/batiments/'.$batimeni[10].'" alt="">
<div class=a>
<img src=descriptions/diz/batiment>
</div> </div>
<div class="b">
<div class=b> <a href="descriptions.php?bat='.$batimend[10].'">'.$batiment[10].'</a> '; if ($silo > 0) echo '(Niveau '.$silo.')'; echo '<br>
<a href=descriptions/.php>Entrepôt</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
Description.<br> Description.<br>
Besoin de : "; Besoin de : ';
$a=ceil(pow(2,$silo)*400); $a=ceil(pow(2,$silo)*400);
$b=ceil(pow(2,$silo)*260); $b=ceil(pow(2,$silo)*260);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br> ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo '<br>
Temps de construction : "; sec(ceil(pow(2,$silo)*1200)); Temps de construction : '; sec(ceil(pow(2,$silo)*1200));
echo "</div> echo '</div>
<div class="c">';
<div class=c>";
if ($temps_b > 0) { if ($temps_b > 0) {
if ($bat==11) { if ($bat==11) {
$tr=$temps_b-time(); $tr=$temps_b-time();
echo '<div id="axion"></div>'; echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>'; echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>"; echo "<tr><td><a href=\"batiment_anul.php?bat=11\">Annuler</a></td></tr></table>";
} }
else {}
} }
else { else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; } if ($case <= 0) echo '<font color="red">Planète pleine</font>';
else { verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0); } } else verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0);
echo "</div> }
echo '</div>
</body> </body>
</html>"; ?> </html>';
?>

View file

@ -1,14 +1,12 @@
<? <?php
$id=$_SESSION['id']; $id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy']; $galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss']; $ss=$_SESSION['ss'];
$pos=$_SESSION['pos']; $pos=$_SESSION['pos'];
$race=$_SESSION['race']; $race=$_SESSION['race'];
require('../connectBDD.php');
mysql_connect("localhost", "root", ""); $x = mysql_query("SELECT * FROM planete WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_select_db("wars");
$x = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x); $donnees = mysql_fetch_array($x);
$temps_b = $donnees['temps_b']; $temps_b = $donnees['temps_b'];
@ -26,52 +24,18 @@ $caserne = $donnees['caserne'];
$silo = $donnees['silo']; $silo = $donnees['silo'];
if ((time())>=$temps_b) { if ((time())>=$temps_b) {
switch ($bat) { switch ($bat) {
case 1: case 1: $mine_m++; mysql_query("UPDATE planete SET mine_m='".$mine_m."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
$mine_m++; case 2: $mine_c++; mysql_query("UPDATE planete SET mine_c='".$mine_c."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
mysql_query("UPDATE planete SET mine_m='".$mine_m."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); case 3: $mine_h++; mysql_query("UPDATE planete SET mine_h='".$mine_h."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
break; case 4: $centrale_s++; mysql_query("UPDATE planete SET centrale_s='".$centrale_s."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 2: case 5: $centrale_f++; mysql_query("UPDATE planete SET centrale_f='".$centrale_f."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
$mine_c++; case 6: $radar++; mysql_query("UPDATE planete SET radar='".$radar."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
mysql_query("UPDATE planete SET mine_c='".$mine_c."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); case 7: $labo++; mysql_query("UPDATE planete SET labo='".$labo."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
break; case 8: $chantier_terrestre++; mysql_query("UPDATE planete SET chantier_terrestre='".$chantier_terrestre."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 3: case 9: $chantier_spatial++; mysql_query("UPDATE planete SET chantier_spatial='".$chantier_spatial."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
$mine_h++; case 10: $caserne++; mysql_query("UPDATE planete SET caserne='".$caserne."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
mysql_query("UPDATE planete SET mine_h='".$mine_h."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); case 11: $silo++; mysql_query("UPDATE planete SET silo='".$silo."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
break;
case 4:
$centrale_s++;
mysql_query("UPDATE planete SET centrale_s='".$centrale_s."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 5:
$centrale_f++;
mysql_query("UPDATE planete SET centrale_f='".$centrale_f."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 6:
$radar++;
mysql_query("UPDATE planete SET radar='".$radar."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 7:
$labo++;
mysql_query("UPDATE planete SET labo='".$labo."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 8:
$chantier_terrestre++;
mysql_query("UPDATE planete SET chantier_terrestre='".$chantier_terrestre."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 9:
$chantier_spatial++;
mysql_query("UPDATE planete SET chantier_spatial='".$chantier_spatial."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 10:
$caserne++;
mysql_query("UPDATE planete SET caserne='".$caserne."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 11:
$silo++;
mysql_query("UPDATE planete SET silo='".$silo."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
} }
if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); } else { $energie_f =0;} if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); } else { $energie_f =0;}
@ -80,10 +44,9 @@ if ($centrale_s > 0 ) {$energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*
$energie = $energie_s + $energie_f; $energie = $energie_s + $energie_f;
mysql_query("UPDATE planete SET temps_b='0', bat='0', energie='".$energie."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET temps_b='0', bat='0', energie='".$energie."' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_close();
@header("Location: batiment_".$race.".php"); @header("Location: batiment_".$race.".php");
} }
mysql_close();
?> ?>

View file

@ -1,4 +1,4 @@
<? <?php
session_start(); session_start();
$id=$_SESSION['id']; $id=$_SESSION['id'];
@ -7,131 +7,95 @@ $ss=$_SESSION['ss'];
$pos=$_SESSION['pos']; $pos=$_SESSION['pos'];
$race=$_SESSION['race']; $race=$_SESSION['race'];
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars"); $x = mysql_query("SELECT * FROM planete WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
$x = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x); $donnees = mysql_fetch_array($x);
$metal = $donnees['metal']; $metal = $donnees['metal'];
$cristal = $donnees['cristal']; $cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene']; $hydrogene = $donnees['hydrogene'];
$temps_b = $donnees['temps_b']; require ('bdd.php');
$bat = $donnees['bat'];
$mine_m = $donnees['mine_m'];
$mine_c = $donnees['mine_c'];
$mine_h = $donnees['mine_h'];
$centrale_s = $donnees['centrale_s'];
$centrale_f = $donnees['centrale_f'];
$radar = $donnees['radar'];
$labo = $donnees['labo'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$silo = $donnees['silo'];
if ( $_GET['bat'] == 1) if ($_GET['bat'] == 1) {
{
$metal += ceil(pow(1.5,$mine_m)*70); $metal += ceil(pow(1.5,$mine_m)*70);
$cristal += ceil(pow(1.55,$mine_m)*35); $cristal += ceil(pow(1.55,$mine_m)*35);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 2) {
elseif ( $_GET['bat'] == 2)
{
$metal += ceil(pow(1.55,$mine_c)*105); $metal += ceil(pow(1.55,$mine_c)*105);
$cristal += ceil(pow(1.55,$mine_c)*60); $cristal += ceil(pow(1.55,$mine_c)*60);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 3) {
elseif ( $_GET['bat'] == 3)
{
$metal += floor(pow(1.53,$mine_h)*82); $metal += floor(pow(1.53,$mine_h)*82);
$cristal += floor(pow(1.5,$mine_h)*80); $cristal += floor(pow(1.5,$mine_h)*80);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 4) {
elseif ( $_GET['bat'] == 4)
{
$metal += ceil(pow(2,$centrale_s)*300); $metal += ceil(pow(2,$centrale_s)*300);
$cristal += ceil(pow(2,$centrale_s)*230); $cristal += ceil(pow(2,$centrale_s)*230);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 5) {
elseif ( $_GET['bat'] == 5)
{
$metal += ceil(pow(2,$centrale_f)*165); $metal += ceil(pow(2,$centrale_f)*165);
$cristal += ceil(pow(2,$centrale_f)*99); $cristal += ceil(pow(2,$centrale_f)*99);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 6) {
elseif ( $_GET['bat'] == 6)
{
$metal += ceil(pow(2,$radar)*750); $metal += ceil(pow(2,$radar)*750);
$cristal += ceil(pow(2,$radar)*500); $cristal += ceil(pow(2,$radar)*500);
$hydrogene += ceil(pow(2,$radar)*50); $hydrogene += ceil(pow(2,$radar)*50);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 7) {
elseif ( $_GET['bat'] == 7)
{
$metal += ceil(pow(2,$labo)*200); $metal += ceil(pow(2,$labo)*200);
$cristal += ceil(pow(2,$labo)*150); $cristal += ceil(pow(2,$labo)*150);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 8 ) {
elseif ( $_GET['bat'] == 8 )
{
$metal += ceil(pow(2,$chantier_terrestre)*520); $metal += ceil(pow(2,$chantier_terrestre)*520);
$cristal += ceil(pow(2,$chantier_terrestre)*380); $cristal += ceil(pow(2,$chantier_terrestre)*380);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 9) {
elseif ( $_GET['bat'] == 9)
{
$metal += ceil(pow(2,$chantier_spatial)*600); $metal += ceil(pow(2,$chantier_spatial)*600);
$cristal += ceil(pow(2,$chantier_spatial)*450); $cristal += ceil(pow(2,$chantier_spatial)*450);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 10) {
elseif ( $_GET['bat'] == 10)
{
$metal += ceil(pow(2,$caserne)*200); $metal += ceil(pow(2,$caserne)*200);
$cristal += ceil(pow(2,$caserne)*100); $cristal += ceil(pow(2,$caserne)*100);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 11) {
elseif ( $_GET['bat'] == 11)
{
$metal += ceil(pow(2,$silo)*400); $metal += ceil(pow(2,$silo)*400);
$cristal += ceil(pow(2,$silo)*260); $cristal += ceil(pow(2,$silo)*260);
$temps = 0; $temps = 0;
$bat = 0; $bat = 0;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
mysql_close(); mysql_close();
@header("Location: batiment_".$race.".php"); @header("Location: batiment.php");
?> ?>

View file

@ -1,462 +0,0 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo"<html>
<head>
<title>Halo battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
TD {
border: 0px;
background-color: transparent;
}
</style>";
include 'bdd.php';
include 'ressource.php';
include 'batiment_ajout.php';
function sec($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
function verification_des_ress($num, $fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro)
{
if ($fer >= $need_fer && $cristal >= $need_cristal && $ro >= $need_ro)
{
echo "<br><br><br><font color=#0080c0><a href=\"batiment_validation.php?bat=".$num."\">Construire</a></font>";
}
else
{
echo "<br><br><br><font color=red>Construire</font>";
}
}
function ressources($fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro, $mine_m, $mine_c, $mine_h) {
if ($need_fer > 0) {
if ($fer <= $need_fer)
{
$z=floor($fer)-$need_fer;
echo '<font color=red >Fer : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> ';
}
else {echo "Fer : <span class=rc>".$need_fer." </span>";}}
if ($need_cristal > 0) {
if ($cristal <= $need_cristal)
{
$z=floor($cristal)-$need_cristal;
echo '<font color=red >Cristal : <ACRONYM title="'.$z.'">'.$need_cristal.'</ACRONYM></font> ';
}
else {echo "Cristal : <span class=rc>".$need_cristal." </span>";}}
if ($need_ro > 0) {
if ($ro <= $need_ro)
{
$z=floor($ro)-$need_ro;
echo '<font color=red >Hydrogène : <ACRONYM title="'.$z.'">'.$need_ro.'</ACRONYM></font>';
}
else {echo "Hydrogène : <span class=rc>".$need_ro."</span>";}}
}
$case = $cases - ($mine_m+$mine_c+$mine_h+$centrale_s+$centrale_f+$radar+$labo+$chantier_terrestre+$chantier_spatial+$caserne+$silo );
echo "<script language=javascript src=time.js></script>
</head>
<body>
<div class=d><a href=arbre_bat_".$race.".php>Arbre des technologies</a></div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/purificateur_m.png>
</div>
<div class=b>
<a href=descriptions/.php>Purificateur de métal</a> "; if ($mine_m > 0) { echo "( Niveau ".$mine_m." )"; } echo "<br>
Toute construction demande des quantités énormes de fer, pour cela des centaines de milliers d'ouvriers
travaillent dans ces mines afin d'assurer le bon fonctionnement de votre empire.<br>
Besoin de : ";
$a=ceil(pow(1.5,$mine_m)*70);
$b=ceil(pow(1.55,$mine_m)*35);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.7,$mine_m)*120));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==1) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=1\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(1, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/purificateur_c.png>
</div>
<div class=b>
<a href=descriptions/.php>Purificateur de cristal</a> "; if ($mine_c > 0) { echo "( Niveau ".$mine_c." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(1.55,$mine_c)*105);
$b=ceil(pow(1.55,$mine_c)*60);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.72,$mine_c)*160));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==2) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=2\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/ionisateur.png>
</div>
<div class=b>
<a href=descriptions/.php>Ionisateur</a> "; if ($mine_h > 0) { echo "( Niveau ".$mine_h." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=floor(pow(1.53,$mine_h)*82);
$b=floor(pow(1.5,$mine_h)*80);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.75,$mine_h)*180));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==3) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=3\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/centrale_s.JPG>
</div>
<div class=b>
<a href=descriptions/.php>Centrale solaire</a> "; if ($centrale_s > 0) { echo "( Niveau ".$centrale_s." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$centrale_s)*300);
$b=ceil(pow(2,$centrale_s)*230);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(pow(1.68,$centrale_s)*190);
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==4) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=4\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/centrale_f.png>
</div>
<div class=b>
<a href=descriptions/.php>Centrale de fusion</a> "; if ($centrale_f > 0) { echo "( Niveau ".$centrale_f." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$centrale_f)*165);
$b=ceil(pow(2,$centrale_f)*99);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(pow(1.8,$centrale_f)*300);
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==5) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=5\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>";
if ($detection >= 1) {
echo "<div class=a>
<img src=descriptions/diz/batiment/oeil.png>
</div>
<div class=b>
<a href=descriptions/.php>Oeil des prophètes</a> "; if ($radar > 0) { echo "( Niveau ".$radar." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$radar)*750);
$b=ceil(pow(2,$radar)*500);
$c=ceil(pow(2,$radar)*50);
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$radar)*720));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==6) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=6\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, $c); } }
echo "</div><br class=a>"; }
echo "<div class=a>
<img src=descriptions/diz/batiment/recherches.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Centre de recherches</a> "; if ($labo > 0) { echo "( Niveau ".$labo." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$labo)*200);
$b=ceil(pow(2,$labo)*150);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$labo)*720));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==7) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=7\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { if($temps_t > 0) {
echo "<font color=red><br><br>Recherche en cours dans le </font><a href=labo.php>laboratoire</a>"; } else {
verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0); } } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/chantier_terrestre.png>
</div>
<div class=b>
<a href=descriptions/.php>Chantier terrestre</a> "; if ($chantier_terrestre > 0) { echo "( Niveau ".$chantier_terrestre." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$chantier_terrestre)*520);
$b=ceil(pow(2,$chantier_terrestre)*380);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_terrestre)*420));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==8) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=8\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit_s > 0) {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; }
else { verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, 0); }}}
echo "</div>
<br class=a>";
if ($chantier_terrestre >= 2) {
echo "<div class=a>
<img src=descriptions/diz/batiment/>
</div>
<div class=b>
<a href=descriptions/.php>Chantier spatial</a> "; if ($chantier_spatial > 0) { echo "( Niveau ".$chantier_spatial." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$chantier_spatial)*600);
$b=ceil(pow(2,$chantier_spatial)*450);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_spatial)*600));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==9) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=9\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit_s > 0) {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; }
else {verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0); } } }
echo "</div><br class=a>"; }
echo "<div class=a>
<img src=descriptions/diz/batiment/caserne.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Caserne</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$caserne)*200);
$b=ceil(pow(2,$caserne)*100);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$caserne)*300));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==10) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=10\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit > 0) {
echo "<font color=red><br><br>Entrainement en cours dans la </font><a href=caserne.php>caserne</a>"; }
else { verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0); }}}
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/entrepot.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Entrepôt</a> "; if ($silo > 0) { echo "( Niveau ".$silo." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$silo)*400);
$b=ceil(pow(2,$silo)*260);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$silo)*1200));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==11) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=11\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
</body>
</html>"; ?>

View file

@ -1,462 +0,0 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
echo"<html>
<head>
<title>Halo battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
TD {
border: 0px;
background-color: transparent;
}
</style>";
include 'bdd.php';
include 'ressource.php';
include 'batiment_ajout.php';
function sec($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
function verification_des_ress($num, $fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro)
{
if ($fer >= $need_fer && $cristal >= $need_cristal && $ro >= $need_ro)
{
echo "<br><br><br><font color=#0080c0><a href=\"batiment_validation.php?bat=".$num."\">Construire</a></font>";
}
else
{
echo "<br><br><br><font color=red>Construire</font>";
}
}
function ressources($fer, $cristal, $ro, $need_fer, $need_cristal, $need_ro, $mine_m, $mine_c, $mine_h) {
if ($need_fer > 0) {
if ($fer <= $need_fer)
{
$z=floor($fer)-$need_fer;
echo '<font color=red >Fer : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> ';
}
else {echo "Fer : <span class=rc>".$need_fer." </span>";}}
if ($need_cristal > 0) {
if ($cristal <= $need_cristal)
{
$z=floor($cristal)-$need_cristal;
echo '<font color=red >Cristal : <ACRONYM title="'.$z.'">'.$need_cristal.'</ACRONYM></font> ';
}
else {echo "Cristal : <span class=rc>".$need_cristal." </span>";}}
if ($need_ro > 0) {
if ($ro <= $need_ro)
{
$z=floor($ro)-$need_ro;
echo '<font color=red >Hydrogène : <ACRONYM title="'.$z.'">'.$need_ro.'</ACRONYM></font>';
}
else {echo "Hydrogène : <span class=rc>".$need_ro."</span>";}}
}
$case = $cases - ($mine_m+$mine_c+$mine_h+$centrale_s+$centrale_f+$radar+$labo+$chantier_terrestre+$chantier_spatial+$caserne+$silo );
echo "<script language=javascript src=time.js></script>
</head>
<body>
<div class=d><a href=arbre_bat_".$race.".php>Arbre des technologies</a></div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/mine_m.png>
</div>
<div class=b>
<a href=descriptions/.php>Usine de méttalurgie</a> "; if ($mine_m > 0) { echo "( Niveau ".$mine_m." )"; } echo "<br>
Toute construction demande des quantités énormes de fer, pour cela des centaines de milliers d'ouvriers
travaillent dans ces mines afin d'assurer le bon fonctionnement de votre empire.<br>
Besoin de : ";
$a=ceil(pow(1.5,$mine_m)*70);
$b=ceil(pow(1.55,$mine_m)*35);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.7,$mine_m)*120));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==1) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=1\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(1, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/mine_c.png>
</div>
<div class=b>
<a href=descriptions/.php>Usine de cristal</a> "; if ($mine_c > 0) { echo "( Niveau ".$mine_c." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(1.55,$mine_c)*105);
$b=ceil(pow(1.55,$mine_c)*60);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.72,$mine_c)*160));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==2) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=2\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/>
</div>
<div class=b>
<a href=descriptions/.php>Synchronisateur d'hydrogène</a> "; if ($mine_h > 0) { echo "( Niveau ".$mine_h." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=floor(pow(1.53,$mine_h)*82);
$b=floor(pow(1.5,$mine_h)*80);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(1.75,$mine_h)*180));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==3) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=3\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/>
</div>
<div class=b>
<a href=descriptions/.php>Centrale solaire</a> "; if ($centrale_s > 0) { echo "( Niveau ".$centrale_s." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$centrale_s)*300);
$b=ceil(pow(2,$centrale_s)*230);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(pow(1.68,$centrale_s)*190);
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==4) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=4\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/centrale_fusion.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Centrale énergétique</a> "; if ($centrale_f > 0) { echo "( Niveau ".$centrale_f." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$centrale_f)*165);
$b=ceil(pow(2,$centrale_f)*99);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(pow(1.8,$centrale_f)*300);
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==5) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=5\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
<br class=a>";
if ($detection >= 1) {
echo "<div class=a>
<img src=descriptions/diz/batiment/radar.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Base radar</a> "; if ($radar > 0) { echo "( Niveau ".$radar." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$radar)*750);
$b=ceil(pow(2,$radar)*500);
$c=ceil(pow(2,$radar)*50);
ressources($metal, $cristal, $hydrogene, $a, $b, $c, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$radar)*720));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==6) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=6\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, $c); } }
echo "</div><br class=a>"; }
echo "<div class=a>
<img src=descriptions/diz/batiment/>
</div>
<div class=b>
<a href=descriptions/.php>Centre de recherches</a> "; if ($labo > 0) { echo "( Niveau ".$labo." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$labo)*200);
$b=ceil(pow(2,$labo)*150);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$labo)*720));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==7) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=7\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { if($temps_t > 0) {
echo "<font color=red><br><br>Recherche en cours dans le </font><a href=labo.php>laboratoire</a>"; } else {
verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0); } } }
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/chantier_terrestre.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Chantier terrestre</a> "; if ($chantier_terrestre > 0) { echo "( Niveau ".$chantier_terrestre." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$chantier_terrestre)*520);
$b=ceil(pow(2,$chantier_terrestre)*380);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_terrestre)*420));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==8) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=8\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit_s > 0) {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; }
else { verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, 0); }}}
echo "</div>
<br class=a>";
if ($chantier_terrestre >= 2) {
echo "<div class=a>
<img src=descriptions/diz/batiment/>
</div>
<div class=b>
<a href=descriptions/.php>Chantier spatial</a> "; if ($chantier_spatial > 0) { echo "( Niveau ".$chantier_spatial." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$chantier_spatial)*600);
$b=ceil(pow(2,$chantier_spatial)*450);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$chantier_spatial)*600));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==9) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=9\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit_s > 0) {
echo "<font color=red><br><br>Construction en cours dans le </font><a href=chantier_spatial.php>chantier spatial</a>"; }
else {verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0); } } }
echo "</div><br class=a>"; }
echo "<div class=a>
<img src=descriptions/diz/batiment/ecole_militaire.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Ecole militaire</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$caserne)*200);
$b=ceil(pow(2,$caserne)*100);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$caserne)*300));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==10) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=10\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else {if($unit > 0) {
echo "<font color=red><br><br>Entrainement en cours dans la </font><a href=caserne.php>caserne</a>"; }
else { verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0); }}}
echo "</div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment/silo.jpg>
</div>
<div class=b>
<a href=descriptions/.php>Silo de stockage</a> "; if ($silo > 0) { echo "( Niveau ".$silo." )"; } echo "<br>
Description.<br>
Besoin de : ";
$a=ceil(pow(2,$silo)*400);
$b=ceil(pow(2,$silo)*260);
ressources($metal, $cristal, $hydrogene, $a, $b, 0, $mine_m, $mine_c, $mine_h); echo"<br>
Temps de construction : "; sec(ceil(pow(2,$silo)*1200));
echo "</div>
<div class=c>";
if ($temps_b > 0) {
if ($bat==11) {
$tr=$temps_b-time();
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<tr><td><a href=\"batiment_anul.php?bat=11\">Annuler</a></td></tr></table>";
}
else {}
}
else {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
</body>
</html>"; ?>

View file

@ -1,4 +1,4 @@
<? <?php
session_start(); session_start();
$id=$_SESSION['id']; $id=$_SESSION['id'];
@ -7,9 +7,8 @@ $ss=$_SESSION['ss'];
$pos=$_SESSION['pos']; $pos=$_SESSION['pos'];
$race=$_SESSION['race']; $race=$_SESSION['race'];
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars"); $x = mysql_query("SELECT * FROM planete WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
$x = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x); $donnees = mysql_fetch_array($x);
$metal = $donnees['metal']; $metal = $donnees['metal'];
@ -30,109 +29,87 @@ $chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne']; $caserne = $donnees['caserne'];
$silo = $donnees['silo']; $silo = $donnees['silo'];
if ( $_GET['bat'] == 1) if ($_GET['bat'] == 1) {
{
$metal -= ceil(pow(1.5,$mine_m)*70); $metal -= ceil(pow(1.5,$mine_m)*70);
$cristal -= ceil(pow(1.55,$mine_m)*35); $cristal -= ceil(pow(1.55,$mine_m)*35);
$temps = time() + ceil(pow(1.7,$mine_m)*120); $temps = time() + ceil(pow(1.7,$mine_m)*120);
$bat = 1; $bat = 1;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 2) {
elseif ( $_GET['bat'] == 2)
{
$metal -= ceil(pow(1.55,$mine_c)*105); $metal -= ceil(pow(1.55,$mine_c)*105);
$cristal -= ceil(pow(1.55,$mine_c)*60); $cristal -= ceil(pow(1.55,$mine_c)*60);
$temps = time() + (ceil(pow(1.72,$mine_c)*160)); $temps = time() + (ceil(pow(1.72,$mine_c)*160));
$bat = 2; $bat = 2;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 3) {
elseif ( $_GET['bat'] == 3)
{
$metal -= floor(pow(1.53,$mine_h)*82); $metal -= floor(pow(1.53,$mine_h)*82);
$cristal -= floor(pow(1.5,$mine_h)*80); $cristal -= floor(pow(1.5,$mine_h)*80);
$temps = time() + (ceil(pow(1.75,$mine_h)*180)); $temps = time() + (ceil(pow(1.75,$mine_h)*180));
$bat = 3; $bat = 3;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 4) {
elseif ( $_GET['bat'] == 4)
{
$metal -= ceil(pow(2,$centrale_s)*300); $metal -= ceil(pow(2,$centrale_s)*300);
$cristal -= ceil(pow(2,$centrale_s)*230); $cristal -= ceil(pow(2,$centrale_s)*230);
$temps = time() + (ceil(pow(1.68,$centrale_s)*190)); $temps = time() + (ceil(pow(1.68,$centrale_s)*190));
$bat = 4; $bat = 4;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 5) {
elseif ( $_GET['bat'] == 5)
{
$metal -= ceil(pow(2,$centrale_f)*165); $metal -= ceil(pow(2,$centrale_f)*165);
$cristal -= ceil(pow(2,$centrale_f)*99); $cristal -= ceil(pow(2,$centrale_f)*99);
$temps = time() + (ceil(pow(1.8,$centrale_f)*300)); $temps = time() + (ceil(pow(1.8,$centrale_f)*300));
$bat = 5; $bat = 5;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 6) {
elseif ( $_GET['bat'] == 6)
{
$metal -= ceil(pow(2,$radar)*750); $metal -= ceil(pow(2,$radar)*750);
$cristal -= ceil(pow(2,$radar)*500); $cristal -= ceil(pow(2,$radar)*500);
$hydrogene -= ceil(pow(2,$radar)*50); $hydrogene -= ceil(pow(2,$radar)*50);
$temps = time() + ceil(pow(2,$radar)*720); $temps = time() + ceil(pow(2,$radar)*720);
$bat = 6; $bat = 6;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 7) {
elseif ( $_GET['bat'] == 7)
{
$metal -= ceil(pow(2,$labo)*200); $metal -= ceil(pow(2,$labo)*200);
$cristal -= ceil(pow(2,$labo)*150); $cristal -= ceil(pow(2,$labo)*150);
$temps = time() + (ceil(pow(2,$labo)*720)); $temps = time() + (ceil(pow(2,$labo)*720));
$bat = 7; $bat = 7;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ( $_GET['bat'] == 8 ) elseif ($_GET['bat'] == 8 ) {
{
$metal -= ceil(pow(2,$chantier_terrestre)*520); $metal -= ceil(pow(2,$chantier_terrestre)*520);
$cristal -= ceil(pow(2,$chantier_terrestre)*380); $cristal -= ceil(pow(2,$chantier_terrestre)*380);
$temps = time() + (ceil(pow(2,$chantier_terrestre)*420)); $temps = time() + (ceil(pow(2,$chantier_terrestre)*420));
$bat = 8; $bat = 8;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 9) {
elseif ( $_GET['bat'] == 9)
{
$metal -= ceil(pow(2,$chantier_spatial)*600); $metal -= ceil(pow(2,$chantier_spatial)*600);
$cristal -= ceil(pow(2,$chantier_spatial)*450); $cristal -= ceil(pow(2,$chantier_spatial)*450);
$temps = time() + (ceil(pow(2,$chantier_spatial)*600)); $temps = time() + (ceil(pow(2,$chantier_spatial)*600));
$bat = 9; $bat = 9;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 10) {
elseif ( $_GET['bat'] == 10)
{
$metal -= ceil(pow(2,$caserne)*200); $metal -= ceil(pow(2,$caserne)*200);
$cristal -= ceil(pow(2,$caserne)*100); $cristal -= ceil(pow(2,$caserne)*100);
$temps = time() + (ceil(pow(2,$caserne)*300)); $temps = time() + (ceil(pow(2,$caserne)*300));
$bat = 10; $bat = 10;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
elseif ($_GET['bat'] == 11) {
elseif ( $_GET['bat'] == 11)
{
$metal -= ceil(pow(2,$silo)*400); $metal -= ceil(pow(2,$silo)*400);
$cristal -= ceil(pow(2,$silo)*260); $cristal -= ceil(pow(2,$silo)*260);
$temps = time() + (ceil(pow(2,$silo)*1200)); $temps = time() + (ceil(pow(2,$silo)*1200));
$bat = 11; $bat = 11;
mysql_query("UPDATE planete SET metal='".$metal."', cristal='".$cristal."', temps_b='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', temps_b='$temps', bat='$bat' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
} }
mysql_close(); mysql_close();
@header("Location: batiment_".$race.".php"); @header("Location: batiment.php");
?> ?>

View file

@ -1,8 +1,7 @@
<? <?php
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
$z = mysql_query("SELECT * FROM user WHERE id='".$id."' "); $z = mysql_query("SELECT * FROM user WHERE id='$id' ");
$donnees = mysql_fetch_array($z); $donnees = mysql_fetch_array($z);
$id = $donnees['id']; $id = $donnees['id'];
@ -22,12 +21,27 @@ $place_flotte = $donnees['place_flotte'];
$terrestre = $donnees['terrestre']; $terrestre = $donnees['terrestre'];
$place_terrestre = $donnees['place_terrestre']; $place_terrestre = $donnees['place_terrestre'];
$y = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); $temps_tec = $donnees['temps_t'];
$tec = $donnees['tec'];
$planete_source = $donnees['planete_source'];
$informatique = $donnees['informatique'];
$detection = $donnees['detection'];
$armement = $donnees['armement'];
$energie_t = $donnees['energie_t'];
$reacteur = $donnees['reacteur'];
$reacteur_f = $donnees['reacteur_f'];
$reacteur_ff = $donnees['reacteur_ff'];
$medecine = $donnees['medecine'];
$tactique = $donnees['tactique'];
$developement = $donnees['developement'];
$blindage = $donnees['blindage'];
$y = mysql_query("SELECT * FROM planete WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
$donnees = mysql_fetch_array($y); $donnees = mysql_fetch_array($y);
$galaxy = $donnees['galaxy']; $galaxy = $donnees['galaxie'];
$ss = $donnees['ss']; $ss = $donnees['ss'];
$pos = $donnees['pos']; $pos = $donnees['position'];
$nb = $donnees['nb']; $nb = $donnees['nb'];
$nom_planete = $donnees['nom_planete']; $nom_planete = $donnees['nom_planete'];
$image = $donnees['image']; $image = $donnees['image'];
@ -55,20 +69,6 @@ $chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne']; $caserne = $donnees['caserne'];
$silo = $donnees['silo']; $silo = $donnees['silo'];
$temps_t = $donnees['temps_t'];
$tec = $donnees['tec'];
$informatique = $donnees['informatique'];
$detection = $donnees['detection'];
$armement = $donnees['armement'];
$energie_t = $donnees['energie_t'];
$reacteur = $donnees['reacteur'];
$reacteur_f = $donnees['reacteur_f'];
$reacteur_ff = $donnees['reacteur_ff'];
$medecine = $donnees['medecine'];
$tactique = $donnees['tactique'];
$developement = $donnees['developement'];
$blindage = $donnees['blindage'];
$transporteur = $donnees['transporteur']; $transporteur = $donnees['transporteur'];
$gtransporteur = $donnees['gtransporteur']; $gtransporteur = $donnees['gtransporteur'];
$vcolo = $donnees['vcolo']; $vcolo = $donnees['vcolo'];
@ -81,6 +81,9 @@ $croiseur2 = $donnees['croiseur2'];
$pv = $donnees['pv']; $pv = $donnees['pv'];
$sto = $donnees['sto']; $sto = $donnees['sto'];
$temps_caserne = $donnees['cas_contruct_time'];
$cons_caserne = $donnees['cas_contruct_nb'];
$unit = $donnees['cas_contruct'];
$soldat1 = $donnees['soldat1']; $soldat1 = $donnees['soldat1'];
$soldat2 = $donnees['soldat2']; $soldat2 = $donnees['soldat2'];
$soldat3 = $donnees['soldat3']; $soldat3 = $donnees['soldat3'];
@ -91,10 +94,32 @@ $medecin = $donnees['medecin'];
$ingenieur = $donnees['ingenieur']; $ingenieur = $donnees['ingenieur'];
$soldat_lourd = $donnees['soldat_lourd']; $soldat_lourd = $donnees['soldat_lourd'];
$vaisseau_att = $donnees['vaisseau_att']; $cons_spatial = $donnees['cons_spatial'];
$unit_s = $donnees['unit_s'];
$temps_spatial = $donnees['temps_spatial'];
$vaisseau_1 = $donnees['vaisseau_1']; $vaisseau_1 = $donnees['vaisseau_1'];
$vaisseau_2 = $donnees['vaisseau_2']; $vaisseau_2 = $donnees['vaisseau_2'];
$vaisseau_3 = $donnees['vaisseau_3']; $vaisseau_3 = $donnees['vaisseau_3'];
$vaisseau_4 = $donnees['vaisseau_4'];
$vaisseau_5 = $donnees['vaisseau_5'];
$vaisseau_6 = $donnees['vaisseau_6'];
$vaisseau_7 = $donnees['vaisseau_7'];
$vaisseau_8 = $donnees['vaisseau_8'];
$vaisseau_9 = $donnees['vaisseau_9'];
$vaisseau_10 = $donnees['vaisseau_10'];
$vaisseau_11 = $donnees['vaisseau_11'];
$vais_0 = $donnees['vais_0'];
$vais_1 = $donnees['vais_1'];
$vais_2 = $donnees['vais_2'];
$vais_3 = $donnees['vais_3'];
$vais_4 = $donnees['vais_4'];
$cons_terrestre = $donnees['cons_terrestre'];
$unit_t = $donnees['unit_t'];
$temps_t = $donnees['temps_t'];
$temps_terrestre = $temps_t;
$vcl_1 = $donnees['vcl_1']; $vcl_1 = $donnees['vcl_1'];
$vcl_2 = $donnees['vcl_2']; $vcl_2 = $donnees['vcl_2'];
$vcl_3 = $donnees['vcl_3']; $vcl_3 = $donnees['vcl_3'];
@ -105,4 +130,10 @@ $def_2 = $donnees['def_2'];
$def_3 = $donnees['def_3']; $def_3 = $donnees['def_3'];
$def_4 = $donnees['def_4']; $def_4 = $donnees['def_4'];
$def_5 = $donnees['def_5']; $def_5 = $donnees['def_5'];
require_once('caserne_ajout.php');
require_once('chantier_spacial_ajout.php');
require_once('chantier_terrestre_ajout.php');
require_once('laboratoire_ajout.php');
require_once('ajout_terrestre.php');
?> ?>

59
pages/carte.php Normal file
View file

@ -0,0 +1,59 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
require('../connectBDD.php');
if (isset($_GET['galaxy'])) $g=$_GET['galaxy']; else $g=$_SESSION['galaxy'];
if (isset($_GET['ss'])) $s=$_GET['ss']; else $s=$_SESSION['ss'];
?>
<body>
<?php
echo'<style TYPE=text/css>
TD.z {
border: 0px;
}
</style>
<form action="carte.php" method="get">
<table border="0" align="center">
<tbody>
<tr><td>
<table>
<tbody>
<tr><td class="z" colspan="3">Galaxie</td></tr>
<tr><td class="z"><input name="galaxy" value="'.$g.'" size="5" maxlength="1" type="text" class="zone_texte"></td></tr>
</tbody></table></td>
<td><table><tbody>
<tr><td class="z" colspan="3">Système solaire</td></tr>
<tr><td class="z"><input name="ss" value="'.$s.'" size="5" maxlength="3" type="text" class="zone_texte"></td></tr>
</tbody></table></td></tr>
<tr><td colspan="2" align="center"><input value="Afficher" type="submit" class="bouton"></td></tr>
</tbody></table>
</form>
<br>
<table align="center">
<tr><td colspan="6" class="z" align="left">Système '.$g.' : '.$s.'</td></tr>
<tr><td>Position</td><td>Nom</td><td>Débris métal</td><td>Débris cristal</td><td>Joueur</td><td>Message</td></tr>';
for ($i=1; $i<=12; $i++) {
$resultat = mysql_query("SELECT * FROM planete WHERE galaxie='$g' AND ss='$s' AND position='$i' ");
if(mysql_num_rows($resultat)>=1) {
$x = mysql_query("SELECT * FROM planete WHERE galaxie='$g' AND ss='$s'AND position='$i' ");
$d = mysql_fetch_array($x);
if ($d['race'] == 'covenant') $ra='(c)';
else $ra='(h)';
echo '<tr><td height="20">'.$i.'</td><td>'.$d['nom'].'</td><td>'.$d['debris_met'].'</td><td>'.$d['debris_cri'].'</td><td>'.$ra.' '.$d['pseudo'].'</td><td><a href="envoyer_message.php?pseudo='.$d['pseudo'].'"><img src="descriptions/diz/m.gif"></a></td></tr>';
}
else echo '<tr><td height="20">'.$i.'</td><td></td><td></td><td></td><td></td><td></td></tr>';
}
echo '</table>';
mysql_close();
?>
</body>
</html>

194
pages/caserne.php Normal file
View file

@ -0,0 +1,194 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
require('noms.php');
function sec($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil(60/pow(1.25,$caserne));
$g = ceil(240/pow(1.25,$caserne));
$h = ceil(240/pow(1.25,$caserne));
$i = ceil(720/pow(1.25,$caserne));
$j = ceil(300/pow(1.25,$caserne));
$k = ceil(29700/pow(1.25,$caserne));
$l = ceil(90/pow(1.25,$caserne));
$m = ceil(90/pow(1.25,$caserne));
$n = ceil(900/pow(1.25,$caserne));
if ($temps_caserne>0) {
$unit = $casernea[--$unit];
/* switch ($unit) {
case 1: $unit= "marines"; break;
case 2: $unit= "fusillers"; break;
case 3: $unit= "grenadiers"; break;
case 4: $unit= "T.C.A.O."; break;
case 5: $unit= "snipers"; break;
case 6: $unit= "spartans"; break;
case 7: $unit= "médecins"; break;
case 8: $unit= "ingénieurs"; break;
case 9: $unit= "soldats exo squellette"; break;
}*/
}
?>
<body>
<script language="javascript" src="time.js"></script>
<?php
if ($caserne > 0) {
if ($temps_caserne >0) {
echo "<table align=center><tr><td>Entrainement terminé dans : ";
$tr=$temps_caserne-time();
echo '<span id="axion"></span>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Entrainement de : ".$cons_caserne." ".$unit."</td></tr></table><br>";
}
echo"<table align=center><tr><td>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($caserne >= 1) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[0]."</a>"; if ($soldat1 > 0) { echo" (".$soldat1." unités)"; } echo"<br>Métal : 80<br>Cristal : 45<br>Temps : "; sec($f); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat1 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[1]."</a> "; if ($soldat2 > 0) { echo" (".$soldat2." unités)"; } echo"<br>Métal : 110<br>Cristal : 90<br>Temps : "; sec($g); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 110 && $cristal >= 90) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat2 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo "</td></tr></form>";
}
if ($caserne >= 3 && $armement >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[2]."</a>"; if ($soldat3 > 0) { echo" (".$soldat3." unités)"; } echo"<br>Métal : 150<br>Cristal : 105<br>Hydrogène : 20<br>Temps : "; sec($h); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 150 && $cristal >= 105) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat3 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 5 && $armement >= 3 && $tactique >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[3]."</a>"; if ($soldat4 > 0) { echo" (".$soldat4." unités)"; } echo"<br>Métal : 220<br>Cristal : 150<br>Temps : "; sec($i); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 220 && $cristal >= 150) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat4 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 3 && $armement >= 1) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[4]."</a>"; if ($sniper > 0) { echo" (".$sniper." unités)"; } echo"<br>Métal : 180<br>Cristal : 100<br>Temps : "; sec($j); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 180 && $cristal >= 100) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_sniper /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 10 && $armement >= 5 && $blindage >= 5 && $spartan >= 3) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[5]."</a>"; if ($spartam > 0) { echo" (".$spartam." unités)"; } echo"<br>Métal : 25000<br>Cristal : 10000<br>Temps : "; sec($k); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 25000 && $cristal >= 10000) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_spartan /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2 && $medecine >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[6]."</a>"; if ($medecin > 0) { echo" (".$medecin." unités)"; } echo"<br>Métal : 100<br>Cristal : 100<br>Temps : "; sec($l); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 100 && $cristal >= 100) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_medecin /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[7]."</a>"; if ($ingenieur > 0) { echo" (".$ingenieur." unités)"; } echo"<br>Métal : 90<br>Cristal : 105<br>Temps : "; sec($m); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_ingenieur /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 5 && $armement >= 4 && $blindage >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$casernen[8]."</a>"; if ($soldat_lourd > 0) { echo" (".$soldat_lourd." unités)"; } echo"<br>Métal : 300<br>Cristal : 250<br>Temps : "; sec($n); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat_lourd /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
} else { ?><center><table><tr><td>Vous devez d'abord construire une caserne !</td></tr></table></center><?php }
echo "</table>"; ?>
</body>
</html>

27
pages/caserne_ajout.php Normal file
View file

@ -0,0 +1,27 @@
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require('../connectBDD.php');
if (time() >= $temps_caserne && !empty($temps_caserne)) {
switch ($unit) {
case 1: $soldat1 += $cons_caserne; mysql_query("UPDATE planete SET soldat1='$soldat1' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error()); break;
case 2: $soldat2 += $cons_caserne; mysql_query("UPDATE planete SET soldat2='$soldat2' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 3: $soldat3 += $cons_caserne; mysql_query("UPDATE planete SET soldat3='$soldat3' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 4: $soldat4 += $cons_caserne; mysql_query("UPDATE planete SET soldat4='$soldat4' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 5: $sniper += $cons_caserne; mysql_query("UPDATE planete SET sniper='$sniper' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 6: $spartam += $cons_caserne; mysql_query("UPDATE planete SET spartam='$spartam' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 7: $medecin += $cons_caserne; mysql_query("UPDATE planete SET medecin='$medecin' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 8: $ingenieur += $cons_caserne; mysql_query("UPDATE planete SET ingenieur='$ingenieur' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 9: $soldat_lourd += $cons_caserne; mysql_query("UPDATE planete SET soldat_lourd='$soldat_lourd' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
}
mysql_query("UPDATE planete SET cas_contruct_time='0', cas_contruct='0', cas_contruct_nb='0' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
// @header("Location: troupes.php");
}
mysql_close();
?>

190
pages/caserne_covenant.php Normal file
View file

@ -0,0 +1,190 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
function sec($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil((60 - (0.1*$caserne*60)));
$g = ceil((240 - (0.1*$caserne*240)));
$h = ceil((240 - (0.1*$caserne*240)));
$i = ceil((720 - (0.1*$caserne*720)));
$j = ceil((300 - (0.1*$caserne*300)));
$k = ceil((29700 - (0.1*$caserne*29700)));
$l = ceil((90 - (0.1*$caserne*90)));
$m = ceil((90 - (0.1*$caserne*90)));
$n = ceil((900 - (0.1*$caserne*900)));
if ($temps_caserne > 0) {
switch ($unit) {
case 1: $unit= "grunts"; break;
case 2: $unit= "jackals"; break;
case 3: $unit= "drones"; break;
case 4: $unit= "élites"; break;
case 5: $unit= "snipers"; break;
case 6: $unit= "hunters"; break;
case 7: $unit= "médecins"; break;
case 8: $unit= "ingénieurs"; break;
case 9: $unit= "brutes"; break;
}
}
?>
<body>
<script language="javascript" src="time.js"></script>
<?php
if ($caserne > 0) {
if ($temps_caserne >0) {
echo "<table align=center><tr><td>Entrainement terminé dans : ";
$tr=$temps_caserne-time();
echo '<span id="axion"></span>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Entrainement de : ".$cons_caserne." ".$unit."</td></tr></table><br>";
}
echo"<table align=center><tr><td width=134>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($caserne >= 1) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Grunt</a>"; if ($soldat1 > 0) { echo"( ".$soldat1." unités )"; } echo"<br>Métal : 80<br>Cristal : 45<br>Temps : "; sec($f); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat1 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Jackal</a> "; if ($soldat2 > 0) { echo"( ".$soldat2." unités )"; } echo"<br>Métal : 110<br>Cristal : 90<br>Temps : "; sec($g); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 110 && $cristal >= 90) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat2 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo "</td></tr></form>";
}
if ($caserne >= 3 && $armement >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Drones</a>"; if ($soldat3 > 0) { echo"( ".$soldat3." unités )"; } echo"<br>Métal : 150<br>Cristal : 105<br>Hydrogène : 20<br>Temps : "; sec($h); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 150 && $cristal >= 105) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat3 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 5 && $armement >= 3 && $tactique >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Elites</a>"; if ($soldat4 > 0) { echo"( ".$soldat4." unités )"; } echo"<br>Métal : 220<br>Cristal : 150<br>Temps : "; sec($i); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 220 && $cristal >= 150) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat4 /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 3 && $armement >= 1) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Sniper</a>"; if ($sniper > 0) { echo"( ".$sniper." unités )"; } echo"<br>Métal : 180<br>Cristal : 100<br>Temps : "; sec($j); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 180 && $cristal >= 100) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_sniper /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 10 && $armement >= 5 && $blindage >= 5 && $spartan >= 3) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Hunter</a>"; if ($spartam > 0) { echo"( ".$spartam." unités )"; } echo"<br>Métal : 25000<br>Cristal : 10000<br>Temps : "; sec($k); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 25000 && $cristal >= 10000) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_spartan /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2 && $medecine >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Médecin</a>"; if ($medecin > 0) { echo"( ".$medecin." unités )"; } echo"<br>Métal : 100<br>Cristal : 100<br>Temps : "; sec($l); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 100 && $cristal >= 100) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_medecin /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Ingenieur</a>"; if ($ingenieur > 0) { echo"( ".$ingenieur." unités )"; } echo"<br>Métal : 90<br>Cristal : 105<br>Temps : "; sec($m); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_ingenieur /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
if ($caserne >= 5 && $armement >= 4 && $blindage >= 2) {
echo "<form method=\"post\" action=\"validation_soldat.php\">
<tr>
<td><img src=\"descriptions/diz/caserne/.jpg\"></td>
<td align=left><a href=\"descriptions/.php\">Brute</a>"; if ($soldat_lourd > 0) { echo"( ".$soldat_lourd." unités )"; } echo"<br>Métal : 300<br>Cristal : 250<br>Temps : "; sec($n); echo"<br></td>
<td>";
if ($bat == 10) echo "Caserne en construction";
else {
if ($metal >= 80 && $cristal >= 45) { if ($temps_caserne < time()) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_soldat_lourd /><br><input type=submit value=Envoyer class=bouton>"; }}
}
echo"</td></tr></form>";
}
} else { ?><center><table><tr><td>Vous devez d'abord construire une caserne !</td></tr></table></center><?php }
echo "</table>"; ?>
</body>
</html>

View file

@ -0,0 +1,28 @@
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require('../connectBDD.php');
if ((time()) >= $temps_spatial && !empty($temps_spatial)) {
switch ($unit_s) {
case 1: $vaisseau_1 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_1='$vaisseau_1' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 2: $vaisseau_2 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_2='$vaisseau_2' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 3: $vaisseau_3 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_3='$vaisseau_3' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 4: $vaisseau_4 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_4='$vaisseau_4' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 5: $vaisseau_5 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_5='$vaisseau_5' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 6: $vaisseau_6 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_6='$vaisseau_6' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 7: $vaisseau_7 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_7='$vaisseau_7' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 8: $vaisseau_8 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_8='$vaisseau_8' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 9: $vaisseau_9 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_9='$vaisseau_9' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 10: $vaisseau_10 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_10='$vaisseau_10' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
case 11: $vaisseau_11 += $cons_spatial; mysql_query("UPDATE planete SET vaisseau_11='$vaisseau_11' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'"); break;
}
mysql_query("UPDATE planete SET cons_spatial='0', unit_s='0', temps_spatial='0' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
// @header("Location: troupes.php");
}
?>

212
pages/chantier_spatial.php Normal file
View file

@ -0,0 +1,212 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
//include 'ajout_vaisseaux.php';
require_once('noms.php');
require_once('bdd.php');
require_once('ressource.php');
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil(1080/pow(1.25,$chantier_spatial));
$g = ceil(6300/pow(1.25,$chantier_spatial));
$h = ceil(8280/pow(1.25,$chantier_spatial));
$i = ceil(1440/pow(1.25,$chantier_spatial));
$j = ceil(7380/pow(1.25,$chantier_spatial));
$k = ceil(1200/pow(1.25,$chantier_spatial));
$l = ceil(4680/pow(1.25,$chantier_spatial));
$m = ceil(16800/pow(1.25,$chantier_spatial));
$n = ceil(18060/pow(1.25,$chantier_spatial));
$p = ceil(32400/pow(1.25,$chantier_spatial));
$q = ceil(117000/pow(1.25,$chantier_spatial));
if ($temps_spatial > 0) {
$unit = $nomvaisa[--$unit_s];
/* switch ($unit_s) {
case 1: $unit= "cargos de classe Parabola"; break;
case 2: $unit= "cargos de classe Laden"; break;
case 3: $unit= "vaisseaux de colonisation de classe Odyssey"; break;
case 4: $unit= "drones despionnage de classe Clarion"; break;
case 5: $unit= "recycleurs de classe Minotaur"; break;
case 6: $unit= "C709 Longsword Interceptor"; break;
case 7: $unit= "frégates"; break;
case 8: $unit= "croiseurs de classe Halcyon"; break;
case 9: $unit= "croiseurs de classe Marathon"; break;
case 10: $unit= "porte vaisseaux"; break;
case 11: $unit= "stations orbitale"; break;
}*/
}
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<?php if ($chantier_spatial > 0) {
if ($temps_spatial > 0) {
echo "<table align=center><tr><td>Construction terminé dans : ";
$tr=$temps_spatial-time();
echo '<span id="axion"></span>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Construction de : ".$cons_spatial." ".$unit."</td></tr></table><br>";
}
echo"<table align=center><tr><td>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($chantier_spatial >= 1 && $reacteur >= 4) {
echo "<form method=\"post\" action=\"validation_vaisseaux.php\">
<tr>
<td><img src=\"images/".$nomvaisi[0].".jpg\"></td>
<td align=\"left\"><a href=\"descriptions/.php\">".$nomvaisn[0]."</a>"; if ($vaisseau_1 > 0) { echo" (".$vaisseau_1." vaisseaux)"; } echo"<br>Métal : 1000<br>Cristal : 800<br>Temps : "; sec($f); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_transporteur /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 5 && $reacteur_f >= 2) {
echo "<form method=\"post\" action=\"validation_vaisseaux.php\">
<tr>
<td><img src=\"images/".$nomvaisi[1].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[1]."</a>"; if ($vaisseau_2 > 0) { echo" (".$vaisseau_2." vaisseaux)"; } echo"<br>Métal : 4000<br>Cristal : 3000<br>Temps : "; sec($g); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_gtransporteur /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 5 && $reacteur_ff >= 1) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[2].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[2]."</a>"; if ($vaisseau_3 > 0) { echo" (".$vaisseau_3." vaisseaux)"; } echo"<br>Métal : 9000<br>Cristal : 9000<br>Hydrogène : 1000<br>Temps : "; sec($h); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vcolo /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 3 && $reacteur >= 5 && $detection >=2) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[3].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[3]."</a>"; if ($vaisseau_4 > 0) { echo" (".$vaisseau_4." vaisseaux)"; } echo"<br>Métal : 1000<br>Cristal : 1200<br>Hydrogène : 100<br>Temps : "; sec($i); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_sonde /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 5 && $reacteur_f >= 4 && $blindage >= 5) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[4].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[4]."</a>"; if ($vaisseau_5 > 0) { echo" (".$vaisseau_5." vaisseaux)"; } echo"<br>Métal : 15000<br>Cristal : 9000<br>Hydrogène : 1000<br>Temps : "; sec($j); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_recycleur /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 1 && $reacteur >= 4) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[5].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[5]."</a>"; if ($vaisseau_6 > 0) { echo" (".$vaisseau_6." vaisseaux)"; } echo"<br>Métal : 1700<br>Cristal : 1220<br>Temps : "; sec($k); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_chasseur /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 3 && $reacteur_f >= 3 && $armement >=1) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[6].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[6]."</a>"; if ($vaisseau_7 > 0) { echo" (".$vaisseau_7." vaisseaux)"; } echo"<br>Métal : 5800<br>Cristal : 1400<br>Temps : "; sec($l); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_fregate /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 6 && $reacteur_ff >= 2 && $armement >=3 && $blindage >= 4) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[7].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[7]."</a>"; if ($vaisseau_8 > 0) { echo" (".$vaisseau_8." vaisseaux)"; } echo"<br>Métal : 20000<br>Cristal : 16000<br>Hydrogène : 1600<br>Temps : "; sec($m); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_croiseur /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 6 && $reacteur_ff >= 3 && $armement >=4 && $blindage >= 4) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[8].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[8]."</a>"; if ($vaisseau_9 > 0) { echo" (".$vaisseau_9." vaisseaux)"; } echo"<br>Métal : 26000<br>Cristal : 16400<br>Hydrogène : 1600<br>Temps : "; sec($n); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_croiseur2 /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 8 && $reacteur_ff >= 5 && $armement >=6 && $blindage >= 6) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[9].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[9]."</a>"; if ($vaisseau_10 > 0) { echo" (".$vaisseau_10." vaisseaux)"; } echo"<br>Métal : 60000<br>Cristal : 40000<br>Hydrogène : 3000<br>Temps : "; sec($p); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_pv /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
if ($chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >=12 && $blindage >= 12) {
echo "<form method=post action=validation_vaisseaux.php>
<tr>
<td><img src=\"images/".$nomvaisi[10].".jpg\"></td>
<td align=left><a href=\"descriptions/.php\">".$nomvaisn[10]."</a>"; if ($vaisseau_11 > 0) { echo" (".$vaisseau_11." vaisseaux)"; } echo"<br>Cette station reste en orbite autour de la planète et ne peut plus y bouger.<br>Métal : 500000<br>Cristal : 400000<br>Hydrogène : 250000<br>Temps : "; sec($q); echo"<br></td>
<td>";
if ($bat == 9) echo "Chantier spatial en construction";
else {
if ($temps_spatial < time()) echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_sto /><br><input type=submit value=Envoyer class=bouton>";
}
echo"</td></tr></form>";
}
} else echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>";
echo "</table>"; ?>
</body>
</html>

View file

@ -0,0 +1,195 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
define('HEAD', '<script language="javascript" src="time.js"></script>');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
require('noms.php');
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
return $output;
}
$f = ceil(720/pow(1.25,$chantier_terrestre));
$g = ceil(2040/pow(1.25,$chantier_terrestre));
$h = ceil(7200/pow(1.25,$chantier_terrestre));
$i = ceil(3960/pow(1.25,$chantier_terrestre));
$j = ceil(600/pow(1.25,$chantier_terrestre));
$k = ceil(1080/pow(1.25,$chantier_terrestre));
$l = ceil(2160/pow(1.25,$chantier_terrestre));
$m = ceil(4680/pow(1.25,$chantier_terrestre));
if ($temps_t > 0) {
$unit = $nomterra[--$unit_t];
/*switch ($unit_t) {
case 1: $unit = "sparrowhawk"; break;
case 2: $unit = "077-TC Pelican"; break;
case 3: $unit = "C703 Shortsword Bomber"; break;
case 4: $unit = "SHD Albatros"; break;
case 5: $unit = "M12 LRV Warthogs"; break;
case 6: $unit = "M12G1 LAAV Warthogs"; break;
case 7: $unit = "M12A1 LAAV Warthogs"; break;
case 8: $unit = "M808B Scorpions MBT"; break;
case 9: $unit = "mitrailleuses automatique M247 GP"; break;
case 10: $unit = "canons Gauss"; break;
case 11: $unit = "DCA légères"; break;
case 12: $unit = "DCA lourdes"; break;
case 13: $unit = "lanceurs de missiles"; break;
}*/
}
?>
<body>
<?php
if ($chantier_terrestre > 0) {
if ($temps_t > 0) {
echo '<table align="center"><tr><td>Construction terminé dans : ';
$tr=$temps_t-time();
echo '<span id="axion"></span>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo '</td></tr><tr><td>Entrainement de : '.$cons_terrestre.' '.$unit.'</td></tr></table><br>';
}
echo '<table align="center"><tr><td>Images</td><td width="350">Description</td><td width="120">Nombre</td></tr>';
if ($chantier_terrestre >= 1) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[0].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[0].'</a>'; if ($vais_0 > 0) { echo' ('.$vais_0.' vaisseaux)'; } echo'<br>Métal : 500<br>Cristal : 300<br>Temps : '.sec($f).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vaisseau_att"/><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t >= 9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[1].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[1].'</a>'; if ($vais_1 > 0) { echo' ('.$vais_1.' vaisseaux)'; } echo'<br>Métal : 680<br>Cristal : 420<br>Temps : '.sec($g).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vaisseau_1" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 4 && $reacteur >= 1) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[2].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[2].'</a>'; if ($vais_2 > 0) { echo' ('.$vais_2.' vaisseaux)'; } echo'<br>Métal : 1000<br>Cristal : 600<br>Temps : '.sec($h).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vaisseau_2" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 6 && $reacteur >= 3) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[3].'.jpg" alt=""></td>
<td align=left><a href=\"descriptions/.php\">'.$nomterrn[3].'</a>'; if ($vais_3 > 0) { echo' ('.$vais_3.' vaisseaux)'; } echo'<br>Métal : 1400<br>Cristal : 950<br>Temps : '.sec($i).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vaisseau_3" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 1) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[4].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[4].'</a>'; if ($vcl_1 > 0) { echo' ('.$vcl_1.' véhicules)'; } echo'<br>Métal : 400<br>Cristal : 240<br>Temps : '.sec($j).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vcl_1" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 2) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[5].'.jpg" alt=""></td>
<td align=left><a href=\"descriptions/.php\">'.$nomterrn[5].'</a>'; if ($vcl_2 > 0) { echo' ('.$vcl_2.' véhicules)'; } echo'<br>Métal : 480<br>Cristal : 260<br>Temps : '.sec($k).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time() ) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vcl_2" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[6].'.jpg" alt=""></td>
<td align=left><a href=\"descriptions/.php\">'.$nomterrn[6].'</a>'; if ($vcl_3 > 0) { echo' ('.$vcl_3.' véhicules)'; } echo'<br>Métal : 600<br>Cristal : 420<br>Temps : '.sec($l).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vcl_3" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 5 && $blindage >=2 && $armement >=2) {
echo '<form method="post" action="validation_terrestre.php">
<tr><td><img src="images/'.$nomterrn[7].'.jpg" alt=""></td>
<td align=left><a href=\"descriptions/.php\">'.$nomterrn[7].'</a>'; if ($vcl_4 > 0) { echo' ('.$vcl_4.' véhicules)'; } echo'<br>Métal : 1000<br>Cristal : 500<br>Temps : '.sec($m).'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_terrestre < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_vcl_4" /><br><input type="submit" value="Envoyer" class="bouton">';
else {
if ($unit_t>=9) echo '<font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</td></tr></form>';
}
}
else echo '<center><table><tr><td>Vous devez d\'abord construire un chantier terrestre !</td></tr></table></center>';
echo '</table>'; ?>
</body>
</html>

View file

@ -0,0 +1,30 @@
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require('../connectBDD.php');
if ((time()) >= $temps_terrestre && !empty($temps_terrestre)) {
switch ($unit_t) {
case 1: $vais_0 += $cons_terrestre; mysql_query("UPDATE planete SET vais_0='$vais_0' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 2: $vais_1 += $cons_terrestre; mysql_query("UPDATE planete SET vais_1='$vais_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 3: $vais_2 += $cons_terrestre; mysql_query("UPDATE planete SET vais_2='$vais_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 4: $vais_3 += $cons_terrestre; mysql_query("UPDATE planete SET vais_3='$vais_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 5: $vcl_1 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_1='$vcl_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 6: $vcl_2 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_2='$vcl_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 7: $vcl_3 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_3='$vcl_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 8: $vcl_4 += $cons_terrestre; mysql_query("UPDATE planete SET vcl_4='$vcl_4' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 9: $def_1 += $cons_terrestre; mysql_query("UPDATE planete SET def_1='$def_1' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 10: $def_2 += $cons_terrestre; mysql_query("UPDATE planete SET def_2='$def_2' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 11: $def_3 += $cons_terrestre; mysql_query("UPDATE planete SET def_3='$def_3' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 12: $def_4 += $cons_terrestre; mysql_query("UPDATE planete SET def_4='$def_4' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
case 13: $def_5 += $cons_terrestre; mysql_query("UPDATE planete SET def_5='$def_5' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'"); break;
}
mysql_query("UPDATE planetes SET terr_contruct_time='0', terr_contruct='0', terr_contruct_nb='0' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos' AND id_user='$id'");
// if ($unit_t < 9 && $unit_t > 0) header("Location: chantier_terrestre.php");
// else if ($unit_t >= 9) header("Location: defense.php");
}
?>

134
pages/construction.php Normal file
View file

@ -0,0 +1,134 @@
<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$race=$_SESSION['race'];
require('bdd.php');
require('../connectBDD.php');
$x = mysql_query("SELECT * FROM planete WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
$donnees = mysql_fetch_array($x);
$y = mysql_query("SELECT * FROM user WHERE id='$id'");
$donneesy = mysql_fetch_array($y);
if ($_GET['tec'] == 1) {
$n=($informatique-1);
$metal -= ceil(pow(2,$n)*500);
$cristal -= ceil(pow(2,$n)*150);
$temps_tec = time() + (ceil((pow(2,$labo)*840) - ((pow(2,$labo)*840)*0.07*$labo)));
$tec = 1;
mysql_query("UPDATE planete SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 2) {
$n=($detection-1);
$metal -= ceil(pow(2,$n)*500);
$cristal -= ceil(pow(2,$n)*750);
$hydrogene -= ceil(pow(2,$n)*100);
$temps_tec = time() + (ceil((pow(2,$labo)*1200) - ((pow(2,$labo)*1200)*0.07*$labo)));
$tec = 2;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 3) {
$n=($armement-1);
$metal -= ceil(pow(2,$n)*2500);
$cristal -= ceil(pow(2,$n)*500);
$temps_tec = time() + (ceil((pow(2,$labo)*3000) - ((pow(2,$labo)*3000)*0.07*$labo)));
$tec = 3;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 5) {
$n=($energie_t-1);
$metal -= ceil(pow(2,$n)*2000);
$cristal -= ceil(pow(2,$n)*1500);
$hydrogene -= ceil(pow(2,$n)*300);
$temps_tec = time() + (ceil((pow(2,$labo)*1800) - ((pow(2,$labo)*1800)*0.07*$labo)));
$tec = 5;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 6) {
$n=($reacteur-1);
$metal -= ceil(pow(2,$n)*1400);
$cristal -= ceil(pow(2,$n)*400);
$temps_tec = time() + (ceil((pow(2,$labo)*1020) - ((pow(2,$labo)*1020)*0.07*$labo)));
$tec = 6;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 7) {
$n=($reacteur_f-1);
$metal -= ceil(pow(2,$n)*3000);
$cristal -= ceil(pow(2,$n)*2100);
$hydrogene -= ceil(pow(2,$n)*750);
$temps_tec = time() + (ceil((pow(2,$labo)*3300) - ((pow(2,$labo)*3300)*0.07*$labo)));
$tec = 7;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 8) {
$n=($reacteur_ff-1);
$metal -= ceil(pow(2,$n)*5000);
$cristal -= ceil(pow(2,$n)*4000);
$hydrogene -= ceil(pow(2,$n)*1500);
$temps_tec = time() + (ceil((pow(2,$labo)*4800) - ((pow(2,$labo)*4800)*0.07*$labo)));
$tec = 8;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ( $_GET['tec'] == 9) {
$n=($medecine-1);
$metal -= ceil(pow(2,$n)*800);
$cristal -= ceil(pow(2,$n)*1000);
$temps_tec = time() + (ceil((pow(2,$labo)*720) - ((pow(2,$labo)*720)*0.07*$labo)));
$tec = 9;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 10) {
$n=($tactique-1);
$metal -= ceil(pow(2,$n)*2600);
$cristal -= ceil(pow(2,$n)*2600);
$temps_tec = time() + (ceil((pow(2,$labo)*22800) - ((pow(2,$labo)*2280)*0.07*$labo)));
$tec = 10;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 11) {
$n=($developpement-1);
$metal -= ceil(pow(2,$n)*10000);
$cristal -= ceil(pow(2,$n)*10000);
$hydrogene -= ceil(pow(2,$n)*5000);
$temps_tec = time() + (ceil((pow(2,$labo)*8220) - ((pow(2,$labo)*8220)*0.07*$labo)));
$tec = 11;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 12) {
$n=($blindage-1);
$metal -= ceil(pow(2,$n)*3700);
$temps_tec = time() + (ceil((pow(2,$labo)*3420) - ((pow(2,$labo)*3420)*0.07*$labo)));
$tec = 12;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
else if ($_GET['tec'] == 13) {
$n=($spartan-1);
$metal -= ceil(pow(3,$n)*5200);
$cristal -= ceil(pow(3,$n)*4250);
$hydrogene -= ceil(pow(3,$n)*850);
$temps_tec = time() + (ceil((pow(2,$labo)*10000) - ((pow(3,$labo)*10000)*0.07*$labo)));
$tec = 13;
mysql_query("UPDATE planetes SET metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos';");
mysql_query("UPDATE user SET temps_t='$temps_tec', tec='$tec' WHERE id='$id'");
}
mysql_close();
header('Location: laboratoire.php');
?>

182
pages/creerflotte.php Normal file
View file

@ -0,0 +1,182 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
define('HEAD', '<script type="text/javascript">
var vitesse = 1;
var chauffe = 0;
var start_galaxie = '.$_SESSION['galaxy'].';
var start_ss = '.$_SESSION['ss'].';
var start_position = '.$_SESSION['pos'].';
function reste(zetime) {
if (zetime>0) {
var heures = Math.floor(zetime / 3600);
var minutes = Math.floor(((zetime / 3600) - Math.floor(zetime / 3600)) * 60);
var secondes = parseInt(zetime - ((Math.floor(zetime / 60)) * 60));
if (heures < 10) heures = "0" + heures;
if (minutes < 10) minutes = "0" + minutes;
if (secondes < 10) secondes = "0" + secondes;
document.getElementById(\'temps\').innerHTML = heures + ":" + minutes + ":" + secondes;
var restant = zetime - 1;
}
else {
document.getElementById(\'temps\').innerHTML = "Les vaisseaux se trouvent déjà sur cette planète";
}
}
function consomation(zetime) {
if (zetime > 0) document.getElementById(\'conso\').innerHTML = parseInt(zetime/6*100);
else document.getElementById(\'conso\').innerHTML = 0;
}
function vaisTempsDeplacement(end_galaxie,end_ss,end_position) {
if (end_galaxie-start_galaxie == 0 && end_ss-start_ss == 0 && end_position-start_position == 0) temps = 0;
else if (end_galaxie-start_galaxie == 0 && end_ss-start_ss == 0) temps = 900+Math.abs(end_position-start_position)*300/vitesse;
else if (end_galaxie-start_galaxie == 0) {
if (end_ss-start_ss < 25) temps = 20*60/vitesse;
else if (end_ss-start_ss < 75) temps = 35*60/vitesse;
else temps = 50*60/vitesse;
}
else {
if (end_galaxie-start_galaxie < 10) temps = 3600/vitesse;
else if (end_galaxie-start_galaxie < 25) temps = 4500/vitesse;
else temps = 5400/vitesse;
}
if (chauffe != 0 && Math.abs(temps) > 120) {
if (end_galaxie-start_galaxie == 0 && end_ss-start_ss == 0) temps += 2*1*60/chauffe;
else if (end_galaxie-start_galaxie == 0) temps += 2*2.5*60/chauffe;
else temps += 2*5*60/chauffe;
}
reste(Math.abs(temps));
consomation(Math.abs(temps));
}
</script>');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('noms.php');
require_once('bdd.php');
require_once('../fonctions.php');
require('../connectBDD.php');
if (isset($_POST['action']) && $_POST['action'] == 'avt') {
require('../header.php');
require_once('ressource.php');
?>
<form method="post" action="creerflotte.php">
<input type="hidden" name="action" value="apr">
<?php
if (isset($_POST['vaisseau1'])) print '<input type="hidden" name="vaisseau1" value="'.$_POST['vaisseau1'].'">';
if (isset($_POST['vaisseau2'])) print '<input type="hidden" name="vaisseau2" value="'.$_POST['vaisseau2'].'">';
if (isset($_POST['vaisseau3'])) print '<input type="hidden" name="vaisseau3" value="'.$_POST['vaisseau3'].'">';
if (isset($_POST['vaisseau4'])) print '<input type="hidden" name="vaisseau4" value="'.$_POST['vaisseau4'].'">';
if (isset($_POST['vaisseau5'])) print '<input type="hidden" name="vaisseau5" value="'.$_POST['vaisseau5'].'">';
if (isset($_POST['vaisseau6'])) print '<input type="hidden" name="vaisseau6" value="'.$_POST['vaisseau6'].'">';
if (isset($_POST['vaisseau7'])) print '<input type="hidden" name="vaisseau7" value="'.$_POST['vaisseau7'].'">';
if (isset($_POST['vaisseau8'])) print '<input type="hidden" name="vaisseau8" value="'.$_POST['vaisseau8'].'">';
if (isset($_POST['vaisseau9'])) print '<input type="hidden" name="vaisseau9" value="'.$_POST['vaisseau9'].'">';
if (isset($_POST['vaisseau10'])) print '<input type="hidden" name="vaisseau10" value="'.$_POST['vaisseau10'].'">';
if (isset($_POST['vaisseau11'])) print '<input type="hidden" name="vaisseau11" value="'.$_POST['vaisseau11'].'">';
?>
<table align="center" width="500">
<tr><td colspan="2">Pr&eacute;paration de la flotte</td></tr>
<tr><td width="50%">Nom</td><td width="50%"><input type="text" name="nom" maxlength="255" size="20"></td></tr>
<tr><td width="50%">Destination</td><td width="50%"><input type="text" name="galaxie" maxlength="1" size="2" onchange="vaisTempsDeplacement(document.getElementById('end_galaxie').value, document.getElementById('end_ss').value, document.getElementById('end_position').value);" id="end_galaxie" value="<?php print $_SESSION['galaxy']; ?>">:<input type="text" name="ss" maxlength="2" size="2" onchange="vaisTempsDeplacement(document.getElementById('end_galaxie').value, document.getElementById('end_ss').value, document.getElementById('end_position').value);" id="end_ss" value="<?php print $_SESSION['ss']; ?>">:<input type="text" name="position" maxlength="1" size="2" onchange="vaisTempsDeplacement(document.getElementById('end_galaxie').value, document.getElementById('end_ss').value, document.getElementById('end_position').value);" id="end_position" value="<?php print $_SESSION['pos']; ?>"></td></tr>
<tr><td width="50%">Vitesse</td><td width="50%"><select name="speed"><option value="100">100%</option></select></td></tr>
<tr><td width="50%">Temps de d&eacute;placement</td><td width="50%" id="temps"></td></tr>
<tr><td width="50%">Consomation</td><td width="50%" id="conso"></td></tr>
<tr><td colspan="2">Mission & Contenu</td></tr>
<tr><td width="50%">Mission</td><td width="50%"><select name="mission"><option value="1">Attaquer</option><option value="2">Transporter</option><option value="0">Stationner</option></select></td></tr>
<tr><td width="50%"> </td><td width="50%"> </td></tr>
<tr><td width="50%">M&eacute;tal</td><td width="50%"><input type="text" name="metal" maxlength="6" size="10"></td></tr>
<tr><td width="50%">Cristal</td><td width="50%"><input type="text" name="cristal" maxlength="6" size="10"></td></tr>
<tr><td width="50%">Hydrog&egrave;ne</td><td width="50%"><input type="text" name="hydrogene" maxlength="6" size="10"></td></tr>
<tr><td colspan="2"><input type="submit" value="Envoyer la flotte"></td></tr>
</table>
</form>
<?php
}
elseif (isset($_POST['action']) && $_POST['action'] == 'apr') {
// Vérification que le nombre de slots ne soit pas dépassé
$req = mysql_query("SELECT * FROM flottes WHERE `id_user` = '$id'");
if (mysql_num_rows($req) + 1 > $informatique + 1) {
header('Location: flotte.php?err=0');
exit;
}
if (!isset($_POST['vaisseau1'])) $_POST['vaisseau1'] = 0;
if (!isset($_POST['vaisseau2'])) $_POST['vaisseau2'] = 0;
if (!isset($_POST['vaisseau3'])) $_POST['vaisseau3'] = 0;
if (!isset($_POST['vaisseau4'])) $_POST['vaisseau4'] = 0;
if (!isset($_POST['vaisseau5'])) $_POST['vaisseau5'] = 0;
if (!isset($_POST['vaisseau6'])) $_POST['vaisseau6'] = 0;
if (!isset($_POST['vaisseau7'])) $_POST['vaisseau7'] = 0;
if (!isset($_POST['vaisseau8'])) $_POST['vaisseau8'] = 0;
if (!isset($_POST['vaisseau9'])) $_POST['vaisseau9'] = 0;
if (!isset($_POST['vaisseau10'])) $_POST['vaisseau10'] = 0;
if (!isset($_POST['vaisseau11'])) $_POST['vaisseau11'] = 0;
$vaisseau1 = $_POST['vaisseau1'];
$vaisseau2 = $_POST['vaisseau2'];
$vaisseau3 = $_POST['vaisseau3'];
$vaisseau4 = $_POST['vaisseau4'];
$vaisseau5 = $_POST['vaisseau5'];
$vaisseau6 = $_POST['vaisseau6'];
$vaisseau7 = $_POST['vaisseau7'];
$vaisseau8 = $_POST['vaisseau8'];
$vaisseau9 = $_POST['vaisseau9'];
$vaisseau10 = $_POST['vaisseau10'];
$vaisseau11 = $_POST['vaisseau11'];
// Vérification qu'il y ait suffisament de vaisseaau pour le joueur
if ($vaisseau_1 - $vaisseau1 < 0 || $vaisseau_2 - $vaisseau2 < 0 || $vaisseau_3 - $vaisseau3 < 0 || $vaisseau_4 - $vaisseau4 < 0 || $vaisseau_5 - $vaisseau5 < 0 || $vaisseau_6 - $vaisseau6 < 0 || $vaisseau_7 - $vaisseau7 < 0 || $vaisseau_8 - $vaisseau8 < 0 || $vaisseau_9 - $vaisseau9 < 0 || $vaisseau_10 - $vaisseau10 < 0 || $vaisseau_11 - $vaisseau11 < 0) { header('Location: flotte.php?err=2'); exit; }
$nbvais = $vaisseau1 + $vaisseau2 + $vaisseau3 + $vaisseau4 + $vaisseau5 + $vaisseau6 + $vaisseau7 + $vaisseau8 + $vaisseau9 + $vaisseau10 + $vaisseau11;
$nomFlotte = $_POST['nom'];
$Cgalaxie = $_POST['galaxie'];
$Css = $_POST['ss'];
$Cposition = $_POST['position'];
$mission = $_POST['mission'];
$Cmetal = $_POST['metal'];
$Ccristal = $_POST['cristal'];
$Chydrogene = $_POST['hydrogene'];
if (!isset($_POST['galaxie']) || empty($_POST['galaxie'])) { header('Location: flotte.php?err=1'); exit; }
if (!isset($_POST['ss']) || empty($_POST['ss'])) { header('Location: flotte.php?err=1'); exit; }
if (!isset($_POST['position']) || empty($_POST['position'])) { header('Location: flotte.php?err=1'); exit; }
$timeDep = vais_tempsDeplacement($galaxy, $ss, $pos, $_POST['galaxie'],$_POST['ss'],$_POST['position'],1, 0);
$metal -= $Cmetal;
$cristal -= $Ccristal;
$hydrogene -= vais_conso($timeDep) + $Chydrogene;
$start_time = time();
$end_time = $timeDep;
if ($hydrogene < 0) { header('Location: flotte.php?err=3'); exit; }
if ($cristal < 0 || $metal < 0) { header('Location: flotte.php?err=4'); exit; }
mysql_query("INSERT INTO `flottes` VALUES ('','$id','$mission','$start_time','$galaxy','$ss','$pos','$end_time','$Cgalaxie','$Css','$Cposition','1','$Cmetal','$Ccristal','$Chydrogene','$nbvais','$vaisseau1','$vaisseau2','$vaisseau3','$vaisseau4','$vaisseau5','$vaisseau6','$vaisseau7','$vaisseau8','$vaisseau9','$vaisseau10','$vaisseau11','$nomFlotte');");
$vaisseau_1 -= $vaisseau1;
$vaisseau_2 -= $vaisseau2;
$vaisseau_3 -= $vaisseau3;
$vaisseau_4 -= $vaisseau4;
$vaisseau_5 -= $vaisseau5;
$vaisseau_6 -= $vaisseau6;
$vaisseau_7 -= $vaisseau7;
$vaisseau_8 -= $vaisseau8;
$vaisseau_9 -= $vaisseau9;
$vaisseau_10 -= $vaisseau10;
$vaisseau_11 -= $vaisseau11;
$vaisseau_11 -= $vaisseau11;
mysql_query("UPDATE `planete` SET `vaisseau_1` = '$vaisseau_1', `vaisseau_2` = '$vaisseau_2', `vaisseau_3` = '$vaisseau_3', `vaisseau_4` = '$vaisseau_4', `vaisseau_5` = '$vaisseau_5', `vaisseau_6` = '$vaisseau_6', `vaisseau_7` = '$vaisseau_7', `vaisseau_8` = '$vaisseau_8', `vaisseau_9` = '$vaisseau_9', `vaisseau_10` = '$vaisseau_10', `vaisseau_11` = '$vaisseau_11', `metal` = '$metal', `cristal` = '$cristal', `hydrogene` = '$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
header('Location: flotte.php?err=ok');
}
else header('Location: flotte.php');
?>
</body>
</html>

151
pages/defense.php Normal file
View file

@ -0,0 +1,151 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('noms.php');
require_once('bdd.php');
require_once('ressource.php');
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil(480/pow(1.25,$chantier_terrestre));
$g = ceil(1560/pow(1.25,$chantier_terrestre));
$h = ceil(1800/pow(1.25,$chantier_terrestre));
$i = ceil(6720/pow(1.25,$chantier_terrestre));
$j = ceil(12960/pow(1.25,$chantier_terrestre));
if ($temps_t > 0) {
$unit = $nomterra[--$unit_t];
/*switch ($unit_t) {
case 1: $unit= "sparrowhawk"; break;
case 2: $unit= "077-TC Pelican"; break;
case 3: $unit= "C703 Shortsword Bomber "; break;
case 4: $unit= "SHD Albatros"; break;
case 5: $unit= "M12 LRV Warthogs"; break;
case 6: $unit= "M12G1 LAAV Warthogs"; break;
case 7: $unit= "M12A1 LAAV Warthogs"; break;
case 8: $unit= "M808B Scorpions MBT"; break;
case 9: $unit= "mitrailleuses automatique M247 GP"; break;
case 10: $unit= "canons Gauss"; break;
case 11: $unit= "DCA légères"; break;
case 12: $unit= "DCA lourdes"; break;
case 13: $unit= "lanceurs de missiles"; break;
}*/
}
?>
<body>
<script language="javascript" src="time.js"></script>
<?php
if ($chantier_terrestre > 0) {
if ($temps_t > 0) {
echo "<table align=center><tr><td>
Construction terminé dans : ";
$tr=$temps_t-time();
echo '<span id="axion"></span>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo '</td></tr><tr><td>Construction de : '.$cons_terrestre.' '.$unit.'</td></tr></table><br>';
}
echo '<table align="center"><tr><td>lmages</td><td width="350">Description</td><td width="120">Nombre</td></tr>';
if ($chantier_terrestre >= 1) {
echo '<form method="post" action="validation_def.php"><tr><td><img src="images/'.$nomterrn[8].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[8].'</a>'; if ($def_1 > 0) { echo' ('.$def_1.' unitées)'; } echo'<br>Métal : 500<br>Cristal : 200<br>Temps : '; sec($f); echo '<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_t < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_def_1" /><br><input type="submit" value="Envoyer" class="bouton"">';
else {
if ($unit_t<9 && $unit_t>0) echo '<font color="red">Construction en cours dans le </font><a href="chantier_terrestre.php">chantier terrestre</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 3 && $energie_t >=2) {
echo '<form method="post" action="validation_def.php"><tr><td><img src="images/'.$nomterrn[9].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[9].'</a>'; if ($def_2 > 0) { echo' ('.$def_2.' unitées)'; } echo'<br>Métal : 4000<br>Cristal : 2000<br>Temps : '; sec($g); echo'<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_t < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_def_2" /><br><input type="submit" value="Envoyer" class="bouton"">';
else {
if ($unit_t<9 && $unit_t>0) echo '<font color="red">Construction en cours dans le </font><a href="chantier_terrestre.php">chantier terrestre</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 4 && $armement >= 1) {
echo '<form method="post" action="validation_def.php"><tr><td><img src="images/'.$nomterrn[10].'.jpg" alt=""></td>
<td align=left><a href=\"descriptions/.php\">'.$nomterrn[10].'</a>'; if ($def_3 > 0) { echo' ('.$def_3.' unitées)'; } echo'<br>Métal : 4500<br>Cristal : 800<br>Hydrogène : 600<br>Temps : '; sec($h); echo '<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_t < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_def_3" /><br><input type="submit" value="Envoyer" class="bouton"">';
else {
if ($unit_t<9 && $unit_t>0) echo '<font color="red">Construction en cours dans le </font><a href="chantier_terrestre.php">chantier terrestre</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 6 && $armement >=3 && $enerigie_t >= 4) {
echo '<form method="post" action="validation_def.php"><tr><td><img src="images/'.$nomterrn[11].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[11].'</a>'; if ($def_4 > 0) { echo' ('.$def_4.' unitées)'; } echo'<br>Métal : 12000<br>Cristal : 10000<br>Hydrogène : 1000<br>Temps : '; sec($i); echo '<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_t < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_def_4" /><br><input type="submit" value="Envoyer" class="bouton"">';
else {
if ($unit_t<9 && $unit_t>0) echo '<font color="red">Construction en cours dans le </font><a href="chantier_terrestre.php">chantier terrestre</a>';
}
}
echo '</td></tr></form>';
}
if ($chantier_terrestre >= 8 && $armement >=5 && $informatique >= 3) {
echo '<form method="post" action="validation_def.php"><tr><td><img src="images/'.$nomterrn[11].'.jpg" alt=""></td>
<td align="left"><a href=\"descriptions/.php\">'.$nomterrn[12].'</a>'; if ($def_5 > 0) { echo' ('.$def_5.' unitées)'; } echo'<br>Métal : 15000<br>Cristal : 9500<br>Hydrogène : 1500<br>Temps : '; sec($j); echo '<br></td>
<td>';
if ($bat == 8) echo 'Chantier terrestre en construction';
else {
if ($temps_t < time()) echo '<input type="text" class="zone_texte" size="4" maxlength="4" name="cons_def_5" /><br><input type="submit" value="Envoyer" class="bouton"">';
else {
if ($unit_t<9 && $unit_t>0) echo '<font color="red">Construction en cours dans le </font><a href="chantier_terrestre.php">chantier terrestre</a>';
}
}
echo '</td></tr></form>';
}
}
else { ?><script language="javascript">
parent.frames["changement"].window.location="sans_terrestre.php"
</script> <?php
echo '<center><table><tr><td>Vous devez d\'abord construire un chantier spatial !</td></tr></table></center>'; }
echo '</table>'; ?>
</body>
</html>

View file

@ -1,4 +1,4 @@
<? <?php
session_start(); session_start();
$id=$_SESSION['id']; $id=$_SESSION['id'];
@ -40,12 +40,11 @@ include 'ressource.php';
$case = $cases - ($mine_m +$mine_c +$mine_h +$centrale_s +$centrale_f +$radar+$labo+$chantier_terrestre +$chantier_spatial+$caserne+$silo ); $case = $cases - ($mine_m +$mine_c +$mine_h +$centrale_s +$centrale_f +$radar+$labo+$chantier_terrestre +$chantier_spatial+$caserne+$silo );
$diametre = $cases * 92; $diametre = $cases * 92;
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
$nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='".$pseudo."' AND vu='1'"); $nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='".$pseudo."' AND vu='1'");
$nbre_non = mysql_fetch_assoc($nbr); $nbre_non = mysql_fetch_assoc($nbr);
$ee = mysql_query("SELECT points, place_points FROM user WHERE pseudo='".$pseudo."' AND id='".$id."'"); $ee = mysql_query("SELECT pseudo, points, place_points FROM user WHERE id='".$id."'");
$data = mysql_fetch_array($ee); $data = mysql_fetch_array($ee);
function convert_ts_fr($tstamp) { echo date('H:i:s d/m/Y', $tstamp); } function convert_ts_fr($tstamp) { echo date('H:i:s d/m/Y', $tstamp); }
@ -65,7 +64,7 @@ echo"</head>
if ($nbre_non['nbre'] == 1) { echo "<tr><td colspan=2><a href=lire_message.php>Vous avez 1 nouveau message</a></td></tr>"; } if ($nbre_non['nbre'] == 1) { echo "<tr><td colspan=2><a href=lire_message.php>Vous avez 1 nouveau message</a></td></tr>"; }
else if ($nbre_non['nbre'] > 1) {echo "<tr><td colspan=2><a href=lire_message.php>Vous avez ".$nbre_non['nbre']." nouveaux messages</a></td></tr>"; } else if ($nbre_non['nbre'] > 1) {echo "<tr><td colspan=2><a href=lire_message.php>Vous avez ".$nbre_non['nbre']." nouveaux messages</a></td></tr>"; }
echo "<tr><td colspan=2 align=left class=c><a href=rename.php>".$nom_planete."</a> (".$pseudo.")</td></tr> echo "<tr><td colspan=2 align=left class=c><a href=rename.php>".$nom_planete."</a> (".$data['pseudo'].")</td></tr>
<tr><td align=center colspan=2 height=220><div id=img><img src='descriptions/diz/planete/".$image.".jpg' height=200 width=200></div></td></tr> <tr><td align=center colspan=2 height=220><div id=img><img src='descriptions/diz/planete/".$image.".jpg' height=200 width=200></div></td></tr>

View file

@ -35,6 +35,10 @@ text-decoration: underline;
border: none; border: none;
} }
img {
border: 0;
}
a:hover { a:hover {
cursor: pointer; cursor: pointer;
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

33
pages/envoyer_message.php Normal file
View file

@ -0,0 +1,33 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
if (isset($_GET['pseudo'])) $p=$_GET['pseudo']; else $p='';
if (isset($_GET['ok'])) $_GET['ok']=1; else $_GET['ok']=0;
if (isset($_POST)) {
if (isset($_POST['message_destinataire']) && $_POST['message_destinataire'] !='') {
$resultat = mysql_query("SELECT pseudo FROM user WHERE pseudo='".$_POST['message_destinataire']."'"); // on vérifie l'existance
if(mysql_num_rows($resultat)>=1) { // si c'est bon on passe a la suite
if (isset($_POST['sujet_message']) && $_POST['sujet_message'] !='' ) { mysql_query("INSERT INTO mail VALUES('', '1', '".htmlspecialchars($_POST['message_destinataire'])."', '".$pseudo."', '".htmlspecialchars($_POST['sujet_message'])."', '".htmlspecialchars($_POST['message'])."', '".$temps."')"); header('Location: envoyer_message.php?ok=5'); exit; }
else echo "Précisez le nom du sujet";
}
else echo "Précisez le nom du destinataire";
}
else "Ce joueur n'existe pas";
}
?>
<body>
<form method="post" action="message.php">
<br><br><br><br>
<TABLE align=center>
<? if ($_GET['ok'] == 1) { echo "<tr><td colspan=2><font color=lime>Message envoyé</font></td></tr>"; } ?>
<tr><td>Nom du destinataire</td><td><input type="text" class="zone_texte" size="40" maxlength="20" name="message_destinataire" <? echo "value=".$p;?> ></td></tr>
<tr><td>Sujet</td><td><input type="text" class="zone_texte" size="40" maxlength="20" name="sujet_message"></td></tr>
<tr><td>Texte</td><td><textarea cols="30" rows="10" name="message" class="zone_texte"></textarea></td></tr>
<tr><td colspan="2"><input type="submit" value="Envoyer" class="bouton"></td></tr>
</TABLE>
</form>
</body>
</html>

155
pages/flotte.php Normal file
View file

@ -0,0 +1,155 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
define('HEAD', '<script language="javascript">
function maxvaisseau(id) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName(id)[0].value = document.getElementsByName("max" + id)[0].value;
}
}
function maxvaisseaux() {
var id;
for (i=1; i < 12; i++) {
id = "vaisseau"+i;
maxvaisseau(id);
}
}
function aucunvaisseau(id) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName(id)[0].value = \'\';
}
}
function aucunvaisseaux (){
var id;
for (i=1; i<12; i++) {
id = "vaisseau"+i;
aucunvaisseau(id);
}
}
</script>');
require('../header.php');
require('../fonctions.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('noms.php');
require_once('bdd.php');
require_once('ressource.php');
require('../connectBDD.php');
$retour = mysql_query("SELECT COUNT(*) AS nbre_entrees FROM bug WHERE pseudo='$pseudo'");
$donnees = mysql_fetch_array($retour);
$nbr = $donnees['nbre_entrees'];
$trez = $informatique+1;
?>
<body>
<?php
if (isset($_GET['err'])) {
if ($_GET['err'] == 'ok') print '<table align="center"><tr><td><font color="#00FF00"><b>Votre flotte a correctement été envoyé</b></font></td></tr></table><br>';
elseif ($_GET['err'] == 0) print '<table align="center"><tr><td><font color="#FF0000"><b>Vous n\'avez pas assez de slots disponible pour lancer cette flotte</b></font></td></tr></table><br>';
elseif ($_GET['err'] == 1) print '<table align="center"><tr><td><font color="#FF0000"><b>Vous ne pouvez pas envoyer une flotte sur votre planète</b></font></td></tr></table><br>';
elseif ($_GET['err'] == 2) print '<table align="center"><tr><td><font color="#FF0000"><b>Vous n\'avez pas assez de vaisseaux.</b></font></td></tr></table><br>';
elseif ($_GET['err'] == 3) print '<table align="center"><tr><td><font color="#FF0000"><b>Vous n\'avez pas suffisament d\'hydrogène pour envoyer cette flotte.</b></font></td></tr></table><br>';
elseif ($_GET['err'] == 4) print '<table align="center"><tr><td><font color="#FF0000"><b>Vous n\'avez pas suffisament de ressources dans vos réserve pour les transporter.</b></font></td></tr></table><br>';
}
$req = mysql_query("SELECT * FROM flottes WHERE `id_user` = '$id'");
print '<table align="center"><tr><td colspan="7"><b>Flottes en action</b></td></tr><tr><td>Nom</td><td>Mission</td><td>Nb. vaisseaux</td><td>Destination</td><td>Heure d\'arrivée</td><td>Retour</td><td>Heure de retour</td></tr>';
while ($resultat = mysql_fetch_array($req)) {
print '<tr><td>'.$resultat['nom'].'</td><td>'.txtmission($resultat['mission']).'</td><td>'.$resultat['nb_vais'].'</td><td>'.$resultat['end_galaxie'].':'.$resultat['end_ss'].':'.$resultat['end_position'].'</td><td>'.date('d/m H:i:s',$resultat['start_time']+$resultat['end_time']).'</td><td>'.$resultat['start_galaxie'].':'.$resultat['start_ss'].':'.$resultat['start_position'].'</td><td>'.date('d/m H:i:s',$resultat['start_time']+2*$resultat['end_time']).'</td></tr>';
}
print '</table><br>';
?>
<form method="post" action="creerflotte.php">
<input type="hidden" name="action" value="avt">
<table align="center">
<td width="200">Vaisseaux</td><td width="150">Nombre disponible</td><td width="50">Max</td><td width="100">A envoyer<br><?php echo 'Flottes : '.$nbr.'/'.$trez.'</td></tr>'; ?>
<?php
if($vaisseau_1 > 0) { ?>
<tr><td><?php print $nomvaisa[0]; ?></td>
<td><?php echo $vaisseau_1; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau1');">max</a></td>
<td><input name="maxvaisseau1" value="<?php echo $vaisseau_1; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau1" /></td>
</tr><?php }
if($vaisseau_2 > 0) { ?>
<tr><td><?php print $nomvaisa[1]; ?></td>
<td><?php echo $vaisseau_2; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau2');">max</a></td>
<td><input name="maxvaisseau2" value="<?php echo $vaisseau_2; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau2" /></td>
</tr><?php }
if($vaisseau_3 > 0) { ?>
<tr><td>Vaisseaux de colonisation de classe Odyssey</td>
<td><?php echo $vaisseau_3; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau3');">max</a></td>
<td><input name="maxvaisseau3" value="<?php echo $vaisseau_3; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau3" /></td>
</tr><?php }
if($vaisseau_4 > 0) { ?>
<tr><td>Drones despionnage de classe Clarion</td>
<td><?php echo $vaisseau_4; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau4');">max</a></td>
<td><input name="maxvaisseau4" value="<? echo $vaisseau_4; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau4" /></td>
</tr><?php }
if($vaisseau_5 > 0) { ?>
<tr><td>Recycleurs de classe Minotaur </td>
<td><?php echo $vaisseau_5; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau5');">max</a></td>
<td><input name="maxvaisseau5" value="<? echo $vaisseau_5; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau5" /></td>
</tr><?php }
if($vaisseau_6 > 0) { ?>
<tr><td>C709 Longsword Interceptor</td>
<td><?php echo $vaisseau_6; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau6');">max</a></td>
<td><input name="maxvaisseau6" value="<?php echo $vaisseau_6; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau6" /></td>
</tr><?php }
if($vaisseau_7 > 0) { ?>
<tr><td>Frégate</td>
<td><?php echo $vaisseau_7; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau7');">max</a></td>
<td><input name="maxvaisseau7" value="<?php echo $vaisseau_7; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau7" /></td>
</tr><?php }
if($vaisseau_8 > 0) { ?>
<tr><td>Croiseurs de classe Halcyon</td>
<td><?php echo $vaisseau_8; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau8');">max</a></td>
<td><input name="maxvaisseau8" value="<?php echo $vaisseau_8; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau8" /></td>
</tr><?php }
if($vaisseau_9 > 0){ ?>
<tr><td>Croiseurs de classe Marathon</td>
<td><?php echo $vaisseau_9; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau9');">max</a></td>
<td><input name="maxvaisseau9" value="<?php echo $vaisseau_9; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau9" /></td>
</tr><?php }
if($vaisseau_10 > 0){ ?>
<tr><td>Portes vaisseaux</td>
<td><?php echo $vaisseau_10; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau10');">max</a></td>
<td><input name="maxvaisseau10" value="<?php echo $vaisseau_10; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau10" /></td>
</tr><?php }
if($vaisseau_11 > 0){ ?>
<tr><td>Stations orbitales</td>
<td><?php echo $vaisseau_11; ?></a></td>
<td width="70" ></td>
<td></td>
</tr><?php } ?>
<tr><td colspan="2"><a href="javascript:maxvaisseaux();">Tous les vaisseaux</a></td><td colspan="2">
<a href="javascript:aucunvaisseaux();">Aucun vaisseau</a></TD></TR>
<tr><td colspan="4"><?php if ($nbr < ($trez)) echo '<input type="submit" value="Envoyer" class="bouton">'; else echo 'Nombre de flotte total atteint'; ?></td></tr>
</table>
</form>
</body>
</html>

Binary file not shown.

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 21 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 18 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 25 KiB

After

Width:  |  Height:  |  Size: 25 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 26 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 22 KiB

After

Width:  |  Height:  |  Size: 22 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 24 KiB

After

Width:  |  Height:  |  Size: 24 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 19 KiB

After

Width:  |  Height:  |  Size: 19 KiB

Before After
Before After

317
pages/laboratoire.php Normal file
View file

@ -0,0 +1,317 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
define('HEAD', '<script language="javascript" src="time.js"></script>');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('noms.php');
require_once('bdd.php');
print '<body>';
require_once('ressource.php');
function verification_des_ress($numtec, $metal, $calcium, $nourriture, $ress_ness_metal, $ress_ness_calcium, $ress_ness_nourriture) {
if ($metal >= $ress_ness_metal && $calcium >= $ress_ness_calcium && $nourriture >= $ress_ness_nourriture) echo "<font color=teal><a href=\"construction.php?tec=".$numtec."\">Construire</a></font>";
else echo "<font color=red>Construire</font>";
}
function ressources($metal, $calcium, $nourriture, $ress_ness_metal, $ress_ness_calcium, $ress_ness_nourriture) {
if ($ress_ness_metal > 0) {
if ($metal <= $ress_ness_metal) {
$z=floor($metal)-$ress_ness_metal;
echo "<font color=red >Métal : <ACRONYM title=".$z.">".$ress_ness_metal."</ACRONYM> </font>";
}
else echo "<font color=teal >Métal : ".$ress_ness_metal." </font>"; }
if ($ress_ness_calcium > 0) {
if ($calcium <= $ress_ness_calcium) {
$z=floor($calcium)-$ress_ness_calcium;
echo "<font color=red >Cristal : <ACRONYM title=".$z.">".$ress_ness_calcium."</ACRONYM> </font>";
}
else echo "<font color=teal >Cristal : ".$ress_ness_calcium." </font>"; }
if ($ress_ness_nourriture > 0) {
if ($nourriture <= $ress_ness_nourriture) {
$z=floor($nourriture)-$ress_ness_nourriture;
echo "<font color=red >Hydrogène : <ACRONYM title=".$z.">".$ress_ness_nourriture."</ACRONYM> </font>";
}
else echo "<font color=teal >Hydrogène : ".$ress_ness_nourriture." </font>"; }
}
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
?>
<table align=center>
<tr>
<?php
if ($labo > 0) {
if ($labo >= 1) {
echo"<tr><td>lmages</td><td width=350>Description</td><td width=120>Rechercher</td></tr>
<tr><td><img src=images/".$technolo[0].".jpg ></td><td>".$technolo[0]." niveau ".$informatique."<br><br>Coût: "; $n=($informatique-1);
$b=ceil(pow(2,$n)*500); $c=ceil(pow(2,$n)*150);
ressources($metal, $cristal, $hydrogene, 0, $b, $c);
echo"<br>Temps : "; sec(ceil((pow(2,$labo)*840) - ((pow(2,$labo)*840)*0.07*$labo))); echo"</td><td>";
if ($temps_tec > 0) {
if ($tec==1) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=1\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(1, $metal, $cristal, $hydrogene, 0, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 2 && $informatique >=2) {
echo "<tr><td><img src=images/".$technolo[1].".jpg ></td><td>".$technolo[1]." niveau ".$detection."<br><br>Coût: "; $n=($detection-1);
$a=ceil(pow(2,$n)*500); $b=ceil(pow(2,$n)*750); $c=ceil(pow(2,$n)*100);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : "; sec(ceil((pow(2,$labo)*1200) - ((pow(2,$labo)*1200)*0.07*$labo))); echo"<td>";
if ($temps_tec > 0) {
if ($tec==2) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=2\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 5) {
echo "<tr><td><img src=images/".$technolo[2].".jpg ></td><td>".$technolo[2]." niveau ".$armement."<br><br>Coût: ";$n=($armement-1);
$a=ceil(pow(2,$n)*2500); $b=ceil(pow(2,$n)*500);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>Temps : "; sec(ceil((pow(2,$labo)*3000) - ((pow(2,$labo)*3000)*0.07*$labo))); echo"<td>";
if ($temps_tec > 0) {
if ($tec==3) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=3\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0);
}
echo"</td></tr>";
}
if ($labo >= 4) {
echo "<tr><td><img src=images/".$technolo[3].".jpg ></td><td>".$technolo[3]." niveau ".$blindage."<br><br>Coût: ";$n=($blindage-1);
$a=ceil(pow(2,$n)*4000); $b=ceil(pow(2,$n)*1500);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*3420) - ((pow(2,$labo)*3420)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==12) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=12\">Annuler</a>";
}
}
else { if($bat == 7) {echo "Le laboratoire est en cours d'évolution"; } else {verification_des_ress(12, $metal, $cristal, $hydrogene, $a, $b,0); } }
echo"</td></tr>";
}
if ($labo >= 2) {
echo "<tr><td><img src=images/".$technolo[4].".jpg ></td><td>".$technolo[4]." niveau ".$energie_t."<br><br>Coût: ";
$n=($energie_t-1); $a=ceil(pow(2,$n)*2000); $b=ceil(pow(2,$n)*1500); $c=ceil(pow(2,$n)*300);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*1800) - ((pow(2,$labo)*1800)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==5) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=5\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 2) {
echo "<tr><td><img src=images/".$technolo[5].".jpg ></td><td>".$technolo[5]." niveau ".$reacteur."<br><br>Coût: ";
$n=($reacteur-1); $a=ceil(pow(2,$n)*1400); $b=ceil(pow(2,$n)*400);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*1020) - ((pow(2,$labo)*1020)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==6) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=6\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, 0);
}
echo"</td></tr>";
}
if ($labo >= 4 && $energie_t >=2 && $reacteur >= 4) {
echo "<tr><td><img src=images/".$technolo[6].".jpg ></td><td>".$technolo[6]." niveau ".$reacteur_f."<br><br>Coût: ";
$n=($reacteur_f-1); $a=ceil(pow(2,$n)*3000); $b=ceil(pow(2,$n)*2100); $c=ceil(pow(2,$n)*750);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*3300) - ((pow(2,$labo)*3300)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==7) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=7\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 6 && $energie_t >=5 && $reacteur_f >= 4) {
echo "<tr><td><img src=images/".$technolo[7].".jpg ></td><td>".$technolo[7]." niveau ".$reacteur_ff."<br><br>Coût: ";
$n=($reacteur_ff-1); $a=ceil(pow(2,$n)*5000); $b=ceil(pow(2,$n)*4000); $c=ceil(pow(2,$n)*1500);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*4800) - ((pow(2,$labo)*4800)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==8) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=8\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 1) {
echo "<tr><td><img src=images/".$technolo[8].".jpg ></td><td>".$technolo[8]." niveau ".$medecine."<br><br>Coût: ";
$n=($medecine-1); $a=ceil(pow(2,$n)*800); $b=ceil(pow(2,$n)*1000);
ressources($metal, $cristal, $hydrogene, $a, $b,0);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*720) - ((pow(2,$labo)*720)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==9) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=9\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(9, $metal, $cristal, $hydrogene, $a, $b, 0);
}
echo"</td></tr>";
}
if ($labo >= 3) {
echo "<tr><td><img src=images/".$technolo[9].".jpg ></td><td>".$technolo[9]." niveau ".$tactique."<br><br>Coût: ";
$n=($tactique-1); $a=ceil(pow(2,$n)*2600); $b=ceil(pow(2,$n)*2600);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*22800) - ((pow(2,$labo)*2280)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==10) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=10\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0);
}
echo"</td></tr>";
}
if ($labo >= 8 && $mine_m >= 18 && $mine_c >= 15 && $informatique >= 8) {
echo "<tr><td><img src=images/".$technolo[10].".jpg ></td><td>".$technolo[10]." niveau ".$developpement."<br><br>Coût: ";
$n=($developpement-1); $a=ceil(pow(2,$n)*10000); $b=ceil(pow(2,$n)*10000); $c=ceil(pow(2,$n)*5000);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*8220) - ((pow(2,$labo)*8220)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==11) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=11\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8) {
echo "<tr><td><img src=images/".$technolo[11].".jpg ></td><td>".$technolo[11]." niveau ".$spartan."<br><br>Coût: ";
$n=($spartan-1); $a=ceil(pow(3,$n)*5200); $b=ceil(pow(3,$n)*4250); $c=ceil(pow(3,$n)*850);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>Temps : ";
sec(ceil((pow(2,$labo)*10000) - ((pow(3,$labo)*10000)*0.07*$labo)));
echo"<td>";
if ($temps_tec > 0) {
if ($tec==13) {
$tr=$temps_tec-time();
echo '<span id="axion"></span><br>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=13\">Annuler</a>";
}
}
else {
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
else verification_des_ress(13, $metal, $cristal, $hydrogene, $a, $b, $c);
}
echo"</td></tr>";
}
}
else echo "</tr></table><center><table><tr><td>Vous devez d'abord construire un centre de recherche !</td></tr></table></center>";
?>
</body>
</html>

View file

@ -0,0 +1,26 @@
<?php
$id=$_SESSION['id'];
require_once('bdd.php');
require('../connectBDD.php');
if ((time()) >= $temps_tec && !empty($temps_tec)) {
switch ($tec) {
case 1: $informatique++; mysql_query("UPDATE user SET informatique='".$informatique."' WHERE id='".$id."'") or die ("erreur sql ".mysql_error()); break;
case 2: $detection++; mysql_query("UPDATE user SET detection='".$detection."' WHERE id='".$id."'"); break;
case 3: $armement++; mysql_query("UPDATE user SET armement='".$armement."' WHERE id='".$id."'"); break;
case 5: $energie_t++; mysql_query("UPDATE user SET energie_t='".$energie_t."' WHERE id='".$id."'"); break;
case 6: $reacteur++; mysql_query("UPDATE user SET reacteur='".$reacteur."' WHERE id='".$id."'"); break;
case 7: $reacteur_f++; mysql_query("UPDATE user SET reacteur_f='".$reacteur_f."' WHERE id='".$id."'"); break;
case 8: $reacteur_ff++; mysql_query("UPDATE user SET reacteur_ff='".$reacteur_ff."' WHERE id='".$id."'"); break;
case 9: $medecine++; mysql_query("UPDATE user SET medecine='".$medecine."' WHERE id='".$id."'"); break;
case 10: $tactique++; mysql_query("UPDATE user SET tactique='".$tactique."' WHERE id='".$id."'"); break;
case 11: $developpement++; mysql_query("UPDATE user SET developement='".$developpement."' WHERE id='".$id."'"); break;
case 12: $blindage++; mysql_query("UPDATE user SET blindage='".$blindage."' WHERE id='".$id."'"); break;
//case 13: $spartan++; mysql_query("UPDATE user SET tech_spartan='".$spartan."' WHERE id='".$id."'"); break;
}
mysql_query("UPDATE user SET temps_t='0', tec='0' WHERE id='$id'") or die ("erreur sql ".mysql_error());
}
?>

61
pages/lire_message.php Normal file
View file

@ -0,0 +1,61 @@
<?php session_start(); ?>
<HTML>
<HEAD>
<TITLE>Halo Battle</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="descriptions/diz/base.css">
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
require('../connectBDD.php');
$x = mysql_query("SELECT temps FROM mail");
$di = mysql_fetch_array($x);
$tamps = $di['temps'] - time();
mysql_query("DELETE FROM mail WHERE $tamps >='259200'");
function convert_ts_fr($tstamp) {
echo date ('d/m/Y H:i:s' , $tstamp);
}
?>
</head>
<body>
<?
$nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='$pseudo'");
$nbre_non = mysql_fetch_assoc($nbr);
if ($nbre_non['nbre'] > 25) $t = 25; else $t = $nbre_non['nbre'];
echo "<center><a href=envoyer_message.php>Ecrire un message</a><br><br>";
if ($nbre_non['nbre'] >0) {
echo "<form method=post action=suppr_msg.php><table><tr><td colspan=4 align=center><input type=submit value='Supprimer le message' class=bouton></td></tr>
<tr><td>Action</td><td>Date</td><td>Expéditeur</td><td>Objet</td></tr>";
for ($i=0;$i<$t;$i++) {
$x = mysql_query("SELECT id, vu, expediteur, sujet, temps, contenu FROM mail WHERE destinataire='$pseudo' ORDER BY id DESC LIMIT $i,25") or die ("erreur sql ".mysql_error());
$donnees = mysql_fetch_array($x);
mysql_query("UPDATE mail SET vu='0' WHERE id='".$donnees['id']."'") or die(mysql_error());
echo "
<tr><td><label><input type=radio name=msg_sup value=".$donnees['id']." /></td>
<td>"; convert_ts_fr($donnees['temps']); echo"</td>
<td>".$donnees['expediteur']."<a href=envoyer_message.php?pseudo=".$donnees['expediteur']."> <img src=descriptions/diz/m.gif></a></td>
<td>".$donnees['sujet']."</td></tr>
<tr><td colspan=4 align=center width=400>".$donnees['contenu']."</td></tr>";
}
echo "<tr><td colspan=4 align=center><input type=submit value='Supprimer le message' class=bouton></td></tr></table></form></center>"; }
else echo '<table align="center"><tr><td>Aucun message</td></tr></table>';
?>
</body>
</html>

View file

@ -9,5 +9,5 @@ unset($_SESSION);
// On détruit la session // On détruit la session
session_destroy(); session_destroy();
@header("Location: index.html"); @header("Location: ../index.php");
?> ?>

View file

@ -1,8 +1,9 @@
<? <?php
session_start(); session_start();
$race = $_SESSION['race']; $race = $_SESSION['race'];
echo '<html> echo '<!DOCTYPE HTML SYSTEM>
<html>
<head> <head>
<title>Space battleship</title> <title>Space battleship</title>
@ -15,14 +16,9 @@ echo '<html>
<body> <body>
<div> <div><a href="version.php" target="changement" class=link>Version 0.1</a></div>'; ?>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="version.html"
</SCRIPT>
<A HREF="version.html" target="changement" class=link>Version 0.1</A>
</div>'; ?>
<script language="javascript"> <script type="text/javascript">
function dateTempsReel ( ) { function dateTempsReel ( ) {
var days = new Array('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam'); var days = new Array('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam');
var months = new Array('jan', 'fév', 'mar', 'avr', 'mai', 'juin', 'juil', 'aoû', 'sep', 'oct', 'nov', 'déc'); var months = new Array('jan', 'fév', 'mar', 'avr', 'mai', 'juin', 'juil', 'aoû', 'sep', 'oct', 'nov', 'déc');
@ -44,155 +40,54 @@ function dateTempsReel ( ) {
} }
setTimeout('dateTempsReel()', 999) setTimeout('dateTempsReel()', 999)
} </script> } </script>
<? echo '<div id="datetime"></div><script language="javascript">dateTempsReel();</script> <? echo '<div id="datetime"></div><script type="text/javascript">dateTempsReel();</script>
<div> <div><A HREF="depart.php" target="changement" >Accueil</A></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="depart.php"
</SCRIPT>
<A HREF="depart.php" target="changement" >Accueil</A>
</div>
<div> <div><a href="batiment.php" target="changement">Bâtiments</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="batiment_'.$race.'.php"
</SCRIPT>
<a href="batiment_'.$race.'.php" target="changement">Bâtiments</a>
</div>
<div> <div><a href="caserne.php" target="changement">Caserne</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="caserne_'.$race.'.php"
</SCRIPT>
<a href="caserne_'.$race.'.php" target="changement">Caserne</a>
</div>
<div> <div><a href="chantier_spatial.php" target="changement">Chantier spatial</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="fabrique_'.$race.'.php"
</SCRIPT>
<a href="fabrique_'.$race.'.php" target="changement">Fabrique d\'armes</a>
</div>
<div> <div><a href="chantier_terrestre.php" target="changement">Chantier terrestre</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="chantier_spatial_'.$race.'.php"
</SCRIPT>
<a href="chantier_spatial_'.$race.'.php" target="changement">Chantier spatial</a>
</div>
<div> <div><a href="defense.php" target="changement">Défenses</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="laboratoire_'.$race.'.php"
</SCRIPT>
<a href="laboratoire_'.$race.'.php" target="changement">Laboratoire</a>
</div>
<div> <div><a href="laboratoire.php" target="changement">Laboratoire</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="arbre_bat_'.$race.'.php"
</SCRIPT>
<a href="arbre_bat_'.$race.'.php" target="changement">Arbre technologique</a>
</div>
<div><a href="arbre_bat_'.$race.'.php" target="changement">Arbre technologique</a></div>
<div class=blanc> <div class=blanc></div>
</div>
<div> <div><a href="ressources.php" target="changement">Ressources</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="ressources.php"
</SCRIPT>
<a href="ressources.php" target="changement">Ressources</a>
</div>
<div> <div><a href="gestion.php" target="changement">Gestion</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="gestion.php"
</SCRIPT>
<a href="gestion.php" target="changement">Gestion</a>
</div>
<div> <div><a href="flotte.php" target="changement">Flotte</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="flotte_'.$race.'.php"</SCRIPT>
<a href="flotte_'.$race.'.php" target="changement">Flotte</a>
</div>
<div> <div><a href="armee_'.$race.'.php" target="changement">Armée</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="armee_'.$race.'.php"
</SCRIPT>
<a href="armee_'.$race.'.php" target="changement">Armée</a>
</div>
<div> <div><a href="carte.php" target="changement">Carte spatiale</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="carte.php"
</SCRIPT>
<a href="carte.php" target="changement">Carte spatiale</a>
</div>
<div> <div><a href="options.php" target="changement">Options</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="options.php"
</SCRIPT>
<a href="options.php" target="changement">Options</a>
</div>
<div class=blanc></div>
<div class=blanc> <div><a href="lire_message.php" target="changement">Messages</a></div>
</div>
<div> <div><a href="alliance_choix.php" target="changement">Guilde</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="messages.php"
</SCRIPT>
<a href="messages.php" target="changement">Messages</a>
</div>
<div> <div><a href="voir_classement.php" target="changement">Classement</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="alliance_choix.php"
</SCRIPT>
<a href="alliance_choix.php" target="changement">Guilde</a>
</div>
<div> <div><a href="javascript:top.location.href=http://www.halo-battle.s-fr.com/forum/index.php">Forum</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="#"
</SCRIPT>
<a href="javascript:top.location.href=http://www.halo-battle.s-fr.com/forum/index.php">Forum</a>
</div>
<div> <div><a href="rapport_bug.php" target="changement">Rapport de bugs</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="rapport_bug.php"
</SCRIPT>
<a href="rapport_bug.php" target="changement">Rapport de bugs</a>
</div>
<div> <div><a href="faq.php" target="changement">F.A.Q.</a></div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="faq.php"
</SCRIPT>
<a href="faq.php" target="changement">F.A.Q.</a>
</div>
<div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="logout.php"
</SCRIPT>
<a href="javascript:top.location.href=\'logout.php\'">Déconnexion</a>
</div>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="depart.php"
</SCRIPT>
<div><a href="javascript:top.location.href=\'logout.php\'">Déconnexion</a></div>
</body> </body>
</html>'; </html>';

34
pages/message.php Normal file
View file

@ -0,0 +1,34 @@
<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('../connectBDD.php');
$x = mysql_query("SELECT * FROM user WHERE id='$id'");
$donnees = mysql_fetch_array($x);
$race = $donnees['race'];
$pseudodes = $donnees['pseudo'];
$temps = time();
if (isset($_POST['message_destinataire']) && $_POST['message_destinataire'] !='') {
$resultat = mysql_query("SELECT pseudo FROM user WHERE pseudo='".$_POST['message_destinataire']."'"); // on vérifie l'existance
if(mysql_num_rows($resultat)>=1) { // si c'est bon on passe a la suite
if (isset($_POST['sujet_message']) && $_POST['sujet_message'] !='' ) {
$message_destinataire = htmlspecialchars($_POST['message_destinataire']);
$sujet_message = htmlspecialchars($_POST['sujet_message']);
$message = htmlspecialchars($_POST['message']);
mysql_query("INSERT INTO mail VALUES('', '1', '$message_destinataire', '$pseudodes', '$sujet_message', '$message', '$temps')") or die ("erreur sql ".mysql_error());
}
else echo "Précisez le nom du sujet";
}
else echo "Précisez le nom du destinataire";
}
else "Ce joueur n'existe pas";
mysql_close();
@header("Location: envoyer_message.php?ok=1");
?>

25
pages/ndepart.php Normal file
View file

@ -0,0 +1,25 @@
<?php
session_start();
require_once('../connectBDD.php');
$Pid = $_POST['Pid'];
$id = $_SESSION['id'];
$galaxy = $_SESSION['galaxy'];
$ss = $_SESSION['ss'];
$pos = $_SESSION['pos'];
$race = $_SESSION['race'];
$y = mysql_query("SELECT * FROM planete WHERE id='$Pid'");
$donnees = mysql_fetch_array($y);
if ($donnees['id_user'] == $id) {
$_SESSION['galaxy'] = $donnees['galaxie'];
$_SESSION['ss'] = $donnees['ss'];
$_SESSION['pos'] = $donnees['position'];
header('Location: depart.php');
}
else header('Location: depart.php');
mysql_close();
?>

17
pages/nom.php Normal file
View file

@ -0,0 +1,17 @@
<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require('../connectBDD.php');
if (isset($_POST['nouveaunom']) && $_POST['nouveaunom']!='') {
mysql_query("UPDATE planete SET nom_planete='".$_POST['nouveaunom']."' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'") or die ("erreur sql ".mysql_error());
header("Location: depart.php");
}
else header("Location: depart.php");
mysql_close();
?>

30
pages/noms.php Normal file
View file

@ -0,0 +1,30 @@
<?php
if (!isset($race)) $race = $_SESSION['race'];
if ($race == 'covenant') {
$casernen = array('Grunt','Jackal','Drone','Elite','Sniper','Hunter','Médecin','Ingénieur','Brute');
$casernea = array('grunts','jackals','drones','élites','snipers','hunters','médecins','ingénieurs','brutes');
$batimend = array('purificateur_m','purificateur_c','ionisateur','centrale_s','centrale_fusion','oeil','recherches','chantier_terrestre','???','caserne','silo');
$batimeni = array('purificateur_m.png','purificateur_c.png','ionisateur.png','centrale_s.JPG','centrale_fusion.jpg','oeil.png','recherches.jpg','chantier_terrestre.png','???','caserne.jpg','silo.jpg');
$batiment = array('Purificateur de métal','Purificateur de cristal','Ionisateur','Centrale solaire','Centrale de fusion','Oeil des prophètes','Centre de recherches','Chantier terrestre','Chantier spatial','Caserne','Entrepôt');
$technolo = array('Informatique','Detection','Armement','Bouclier','Maitrise de l\'énergie','Réacteur à antigravité','Réacteur à fusion niveau','Réacteur a fusion de type Forerunneur','Médecine','Commandement militaire','Sous-espace','Spartan');
$nomvaisn = array('Transporteur','Grand transporteur','Vaisseau de colonisation','Sonde d\'espionnage','Recycleur','Seraph','Frégate','Croiseur de classe CCS','Croiseur de classe Reverence','Porte vaisseaux','Station orbitale covenant');
$nomvaisa = array('transporteurs','grands transporteurs','vaisseaux de colo','sondes','recycleurs','seraphs','frégates','croiseurs de classe CCS','croiseurs de classe Reverence','porte vaisseaux','stations orbitale');
$nomterra = array('banshees','spirits','phantom','boarding craft','ghosts','shadow','spectres','appartitions','shade','strong shade','tourelles à barreau de combustible','tourelles à plasma','lanceurs de torpilles plasma');
$nomterrn = array('Banshees','Spirit','Phantom','Boarding craft','Ghost','Shadow','Spectre','Appartition','Shade','Strong shade','Tourelle à barreau de combustible','Tourelle à plasma','Lanceur de torpilles plasma');
}
else {
$casernen = array('Marine','Fusiller','Grenadier','T.C.A.O.','Sniper','Spartan','Médecin','Ingénieur','Soldat exo squellette');
$casernea = array('marines','fusillers','grenadiers','T.C.A.O.','snipers','spartans','médecins','ingénieurs','soldats exo squellette');
$batiment = array('Usine de métallurgie','Usine de cristal','Synchronisateur d\'hydrogène','Centrale solaire','Centrale énergétique','Base radar','Centre de recherches','Chantier terrestre','Chantier spatial','Ecole militaire','Silo de stockage');
$batimend = array('mine_m','mine_c','!!','centrale_s','centrale_f','radar','recherches','chantier_terrestre','???','ecole_militaire','silo');
$batimeni = array('mine_m.png','mine_c.png','!!','centrale_s.JPG','centrale_f.png','radar.jpg','recherches.jpg','chantier_terrestre.jpg','???','ecole_militaire.jpg','silo.jpg');
$technolo = array('IA','Radar','Armement','Blindage','Maitrise de l\'énergie','Réacteur à combustion','Réacteur à fusion niveau','Réacteur a fusion de type II','Médecine','Tactiques de combats','Développement','Spartan');
$nomvaisn = array('Cargos de classe Parabola','Cargos de classe Laden','Vaisseaux de colonisation de classe Odyssey','Drones despionnage de classe Clarion','Recycleurs de classe Minotaur','C709 Longsword Interceptor','Croiseurs de classe Halcyon','Croiseurs de classe Marathon','Porte vaisseaux','Station orbitale');
$nomvaisa = array('cargos de classe Parabola','cargos de classe Laden','vaisseaux de colonisation de classe Odyssey','drones d\'espionnage de classe Clarion','recycleurs de classe Minotaur','C709 Longsword Interceptor','croiseurs de classe Halcyon','croiseurs de classe Marathon','porte vaisseaux','stations orbitale');
$nomvaisi = array('cargosParabola','cargosLaden','vcolo','sonde','recycleurMinotaur','C709','croiseurHalcyon','croiseurMarathon','portevaisseaux','stationorbitale');
$nomterra = array('sparrowhawk','077-TC Pelican','C703 Shortsword Bomber','SHD Albatros','M12 LRV Warthogs','M12G1 LAAV Warthogs','M12A1 LAAV Warthogs','M808B Scorpions MBT','mitrailleuses automatique M247 GP','canons Gauss','DCA légères','DCA lourdes','lanceurs de missiles');
$nomterrn = array('Sparrowhawk','077-TC Pelican','C703 Shortsword Bomber','SHD Albatros','M12 LRV Warthogs','M12G1 LAAV Warthogs','M12A1 LAAV Warthogs','M808B Scorpions MBT','Mitrailleuse automatique M247 GP','Canon Gauss','DCA légère','DCA lourde','Lanceur de missiles');
}
?>

View file

@ -1,4 +1,4 @@
<? <?php
session_start(); session_start();
$id=$_SESSION['id']; $id=$_SESSION['id'];
@ -45,4 +45,5 @@ echo"</head>
</table> </table>
</body> </body>
</html>"; ?> </html>";
?>

View file

@ -1,9 +1,8 @@
<? <?php
session_start(); session_start();
$id = $_SESSION['id']; $id = $_SESSION['id'];
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."'"); $x = mysql_query("SELECT * FROM user WHERE id='".$id."'");
$donnees = mysql_fetch_array($x); $donnees = mysql_fetch_array($x);

View file

@ -1,4 +1,6 @@
<? session_start(); ?> <?php
session_start();
?>
<HTML> <HTML>
<HEAD> <HEAD>
<TITLE>Halo battle</TITLE> <TITLE>Halo battle</TITLE>
@ -6,17 +8,16 @@
<meta http-equiv=pragma content=no-cache > <meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 > <meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico > <link rel=shortcut icon type=image/x-icon href=favicon.ico >
<? <?php
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
function convert_ts_fr($tstamp) { function convert_ts_fr($tstamp) {
echo date ( 'd/m/Y H:i:s' , $tstamp ); }; echo date ('d/m/Y H:i:s' , $tstamp );
}
?> ?>
</head> </head>
<body> <body>
<? <?php
$retour = mysql_query("SELECT COUNT(*) AS nbre_entrees FROM bug"); $retour = mysql_query("SELECT COUNT(*) AS nbre_entrees FROM bug");
$donnees = mysql_fetch_array($retour); $donnees = mysql_fetch_array($retour);
$bug = $donnees['nbre_entrees']; $bug = $donnees['nbre_entrees'];

48
pages/rename.php Normal file
View file

@ -0,0 +1,48 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
?>
</head>
<body>
<?php echo"<center>
<table>
<tr>
<td colspan=3>Votre planète
</td>
</tr>
<tr>
<td>Position
</td>
<td>Nom
</td>
<td>Actions
</td>
</tr>
<tr>
<td>".$galaxy.":".$ss.":".$pos."
</td>
<td>".$nomplanete."
</td>"; if ($nb >= 2) { echo "
<td> <form action=\"abandon_confirm.php\" method=\"post\" ><input type=\"submit\" value=\"abandonner\" class=bouton ></form>
</td>"; } else { echo "<td></td>"; }
echo "</tr><form action=\"nom.php\" method=\"post\">
<tr>
<td>Rennomer
</td>
<td><input type=\"text\" name=\"nouveaunom\" size=\"20\" class=zone_texte >
</td>
<td><input type=\"submit\" value=\"renommer\" class=bouton >
</td>
</tr></form>
</table>
</center>"; ?>
</body>
</html>

View file

@ -1,13 +1,12 @@
<? <?php
$id=$_SESSION['id']; $id=$_SESSION['id'];
$g=$_SESSION['galaxy']; $g=$_SESSION['galaxy'];
$s=$_SESSION['ss']; $s=$_SESSION['ss'];
$p=$_SESSION['pos']; $p=$_SESSION['pos'];
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
$appel = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$g."' AND ss='".$s."'AND pos='".$p."' "); $appel = mysql_query("SELECT * FROM planete WHERE id_user='$id' AND galaxie='$g' AND ss='$s'AND position='$p' ");
$ressource=mysql_fetch_array($appel); $ressource=mysql_fetch_array($appel);
$mine_m = $ressource['mine_m']; $mine_m = $ressource['mine_m'];
@ -30,76 +29,68 @@ $hydrogene = $ressource['hydrogene'];
//---------------Productions-------- //---------------Productions--------
if ($mine_m > 0) { $energie_m = ceil((exp($mine_m*0.28)*10)); } else { $energie_m=0;} if ($mine_m > 0) $energie_m = ceil((exp($mine_m*0.28)*10)); else $energie_m=0;
if ($mine_c > 0) { $energie_c = ceil((exp($mine_c*0.28)*10)); } else { $energie_c=0;} if ($mine_c > 0) $energie_c = ceil((exp($mine_c*0.28)*10)); else $energie_c=0;
if ($mine_h > 0) { $energie_h = ceil((exp($mine_h*0.31)*10)); } else { $energie_h=0;} if ($mine_h > 0) $energie_h = ceil((exp($mine_h*0.31)*10)); else $energie_h=0;
if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11)))); } else { $energie_f =0;} if ($centrale_f > 0 ) $energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11)))); else $energie_f =0;
if ($centrale_s > 0 ) {$energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10)))); } else { $energie_s =0;} if ($centrale_s > 0 ) $energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10)))); else $energie_s =0;
$t = $energie_s + $energie_f; $t = $energie_s + $energie_f;
$nrj= $t + (-$energie_m-$energie_c-$energie_h); $nrj= $t + (-$energie_m-$energie_c-$energie_h);
$coeff = 1 + (($nrj)*($energie_s + $energie_f)); $coeff = 1 + (($nrj)*($energie_s + $energie_f));
if ( $coeff < 0 ) { $coeff = 0; } if ( $coeff < 0 ) $coeff = 0;
if ( $coeff > 1 ) { $coeff = 1; } if ( $coeff > 1 ) $coeff = 1;
if ($metal >= $cap) { if ($metal >= $cap) $prod_met=0;
$prod_met=0;}
else { else {
if ( $mine_m < 0) { if ($mine_m < 0) $prod_met = 0.011*$temps_ecoule;
$prod_met = 0.011*$temps_ecoule; } else $prod_met = (((floor(((25*pow(1.3,$mine_m))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.011*$temps_ecoule)*3;
}
if ($cristal >= $cap) $prod_cri=0;
else { else {
$prod_met = ((floor(((25*pow(1.3,$mine_m))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.011*$temps_ecoule; } } if ( $mine_c < 0 ) $prod_cri = 0.0055*$temps_ecoule;
else $prod_cri = (((floor(((19*pow(1.3,$mine_c))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.0055*$temps_ecoule)*3;
}
if ($hydrogene >= $cap) $prod_hy=0;
if ($cristal >= $cap) {
$prod_cri=0;}
else { else {
if ( $mine_c < 0 ) { if ($centrale_f > 0) $conso_h = ((ceil((($centrale_f*5+(exp($centrale_f*0.3)*10))*$coeff)/0.36)/10000)*$temps_ecoule)*20;
$prod_cri = 0.0055*$temps_ecoule; } else $conso_h = 0;
else {
$prod_cri = ((floor(((19*pow(1.3,$mine_c))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.0055*$temps_ecoule; } }
$prod_hy = ((ceil(((13*pow(1.26,$mine_m))*$coeff)/0.36)/10000)*$temps_ecoule - $conso_h)*3;
if ($hydrogene >= $cap) { if ($mine_h == 0) $prod_hy=0;
$prod_hy=0;} if ($prod_hy < 0) $prod_hy = 0;
else { }
if ($centrale_f > 0) {
$conso_h = ((ceil((($centrale_f*5+(exp($centrale_f*0.3)*10))*$coeff)/0.36)/10000)*$temps_ecoule)*20; } else { $conso_h = 0;}
$prod_hy = (ceil(((13*pow(1.26,$mine_m))*$coeff)/0.36)/10000)*$temps_ecoule - $conso_h;
if ($mine_h == 0) { $prod_hy=0;}
if ($prod_hy < 0) { $prod_hy = 0; } }
$a=$metal+$prod_met; $a=$metal+$prod_met;
$b=$cristal+$prod_cri; $b=$cristal+$prod_cri;
$c=$hydrogene+$prod_hy; $c=$hydrogene+$prod_hy;
//---------------M.A.J-------------- //---------------M.A.J--------------
mysql_query("UPDATE planete SET timestamp='".$temps_actuel."', metal='".$a."', cristal='".$b."', hydrogene='".$c."', coeff='".$coeff."', energie='".$t."' WHERE id='".$id."' AND galaxy='".$g."' AND ss='".$s."'AND pos='".$p."'"); mysql_query("UPDATE planete SET timestamp='$temps_actuel', metal='$a', cristal='$b', hydrogene='$c', coeff='$coeff', energie='$t' WHERE id_user='$id' AND galaxie='$g' AND ss='$s'AND position='$p'");
$pseudo = $ressource['pseudo']; $pseudo = $ressource['pseudo'];
$planetes = mysql_query("SELECT COUNT(*) AS nb FROM planete WHERE pseudo='".$pseudo."'"); $planetes = mysql_query("SELECT COUNT(*) AS nb FROM planete WHERE id_user='$id'");
$nbre = mysql_fetch_assoc($planetes); $nbre = mysql_fetch_assoc($planetes);
$pla = $nbre['nb']; $pla = $nbre['nb'];
echo "<center> echo '<center>
<table id=ressource> <table id="ressource">
<tr>"; if ($pla > 0 ) { <tr>'; if ($pla > 0 ) {
echo "<td rowspan=2 class=xyz><img src=descriptions/diz/planete/".$image.".jpg height=50 width=50></td> echo '<td rowspan="2" class="xyz"><img src="descriptions/diz/planete/'.$image.'.jpg" height="50" width="50"></td>
<td rowspan=2 class=xyz> <td rowspan="2" class="xyz">
<form action='change_planete.php'> <form action="ndepart.php" method="post" id="change_planete">
<select size=1 onSubmit='parent.frames[changement].window.location=depart.php' name=planete>"; <select size="1" onchange="document.getElementById(\'change_planete\').submit();" onSubmit="parent.frames[changement].window.location=depart.php" name="Pid">';
for ($i=0; $i < $pla; $i++) { for ($i=0; $i < $pla; $i++) {
$x = mysql_query("SELECT nb, galaxy, ss, pos, nomplanete FROM planete WHERE pseudo='".$pseudo."' ORDER BY nb LIMIT $i,8"); $x = mysql_query("SELECT id, galaxie, ss, position, nom_planete FROM planete WHERE id_user='$id' ORDER BY id LIMIT $i,8");
$d = mysql_fetch_array($x); $d = mysql_fetch_array($x);
echo "<option value=".$d['nb']; if ($d['nb']==$nb_colo) { echo "selected=selected"; } echo ">".$d['nomplanete']." [".$d['galaxy'].":".$d['ss'].":".$d['pos']."]</option>"; } echo "<option value=".$d['id']; if ($d['galaxie'] == $_SESSION['galaxy'] && $d['ss'] == $_SESSION['ss'] && $d['position'] == $_SESSION['pos']) echo ' selected'; echo ">".$d['nom_planete']." [".$d['galaxie'].":".$d['ss'].":".$d['position']."]</option>"; }
echo "</select></form></td>"; } echo "</select></form></td>"; }
echo "<td class=xyz>Métal</td><td class=xyz>Cristal</td><td class=xyz>Hydrogène</td><td class=xyz>Energie</td></tr> echo "<td class=xyz>Métal</td><td class=xyz>Cristal</td><td class=xyz>Hydrogène</td><td class=xyz>Energie</td></tr>
@ -109,5 +100,3 @@ echo "<td class=xyz>M
mysql_close(); mysql_close();
?> ?>

137
pages/ressources.php Normal file
View file

@ -0,0 +1,137 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
require_once('noms.php');
$cap = (pow(2,$silo)*100000);
$prod_metal = (ceil((($mine_m*40+(exp($mine_m*0.33)*10))*$coeff)))*3;
$prod_cristal = (ceil((($mine_c*20+(exp($mine_c*0.325)*10))*$coeff)))*3;
if ($centrale_f > 0) $conso_hy = ceil(($centrale_f*5+(exp($mine_m*0.3)*10))*$coeff); else $conso_hy=0;
if ($mine_h >0 ) $prod_hydrogene = (ceil(($mine_h*12+(exp($mine_h*0.32)*10))*$coeff))*3; else $prod_hydrogene=0;
if ($mine_h == 0) $w=0;
if (($prod_hydrogene-$conso_hy) < 0) $w= 0;
if ($mine_m > 0) $energie_m = ceil((exp($mine_m*0.28)*10))*$coeff; else $energie_m=0;
if ($mine_c > 0) $energie_c = ceil((exp($mine_c*0.28)*10))*$coeff; else $energie_c=0;
if ($mine_h > 0) $energie_h = ceil((exp($mine_h*0.31)*10))*$coeff; else $energie_h=0;
if ($centrale_s > 0) $energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10))*$coeff)); else $energie_s =0;
if ($centrale_f > 0) $energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); else $energie_f =0;
$w = $prod_hydrogene - $conso_hy;
$u= ($energie_s+$energie_f) - ($energie_m+$energie_c+$energie_h);
echo"<style TYPE=text/css>
TH {
background-color: #00024A;
border: 1px solid #02058A;
}
</style>
</head>
<body>";
echo "<center>
<table>
<tbody><tr>
<td>
Facteur de production : "; if ($coeff < 1) echo "<font color=red>".$coeff."</font>"; else echo $coeff;
echo"<form action=resource2.php method=post>
<table width=550>
<tbody><tr>
<td colspan=6 align=left>
Production sur ".$nom_planete."
</td>
</tr>
<tr>
<th colspan=2>
</th>
<th>
Métal
</th>
<th>
Cristal
</th>
<th>
Hydrogène
</th>
<th>
Energie
</th>
</tr>
<tr>";
echo "<tr><th colspan=2>".$batiment[0]." (".$mine_m.")</th>";
echo "<th><font color=lime>".$prod_metal."</font></th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th><font color=red>".-$energie_m."</font></th></tr>";
echo "<tr><th colspan=2>".$batiment[1]." (".$mine_c.")</th>";
echo "<th>&nbsp;</th>
<th><font color=lime>".$prod_cristal."</font></th>
<th>&nbsp;</th>
<th><font color=red>".-$energie_c."</font></th></tr>
</tr>";
if ($mine_h > 0) {
echo "<tr><th colspan=2>".$batiment[2]." (".$mine_h.")</th>";
echo "<th>&nbsp;</th>
<th>&nbsp;</th>
<th><font color=lime>".$prod_hydrogene."</font></th>
<th><font color=red>".-$energie_h."</th></font></tr>
</tr></tr>";
}
if ($centrale_s > 0) {
echo "<tr>
<th colspan=2>".$batiment[3]." (".$centrale_s.")</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th><font color=lime>".$energie_s."</font></th></tr>
</tr>"; }
if ($centrale_f > 0) {
echo "<tr>
<th colspan=2>".$batiment[4]." (".$centrale_f.")</th>
<th>&nbsp;</th>
<th>&nbsp;</th>
<th><font color=red>".-$conso_hy."</font></th>
<th><font color=lime>".$energie_f."</font></th></tr>
</tr>"; }
echo "<tr>
</tr><tr>
<th colspan=2>Capacité des dépôts</th>
<td><font color=lime>".$cap."</font></td>
<td><font color=lime>".$cap."</font></td>
<td><font color=lime>".$cap."</font></td>
<td><font color=lime>-</font></td></tr>
<tr>
<th colspan=2>Total</th>
<td><font color=lime>".$prod_metal."</font></td>
<td><font color=lime>".$prod_cristal."</font></td>
<td><font color=lime>".$w."</font></td>
<td><font color=lime>".$u."</font></td></tr>
</tbody>
</table>
</form>
</center>"; ?>
</body>
</html>

25
pages/suppr_msg.php Normal file
View file

@ -0,0 +1,25 @@
<html>
<head>
<title>Halo</title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?php
require('../connectBDD.php');
?>
</head>
<body>
<?php if (isset($_POST['msg_sup']) && $_POST['msg_sup'] != '') {
mysql_query("DELETE FROM mail WHERE id='{$_POST['msg_sup']}'");
@header("Location: lire_message.php");
?><SCRIPT language="javascript">
parent.frames["changement"].window.location="lire_message.php"
</SCRIPT><?php
}
else { @header("Location: lire_message.php");
?><SCRIPT language="javascript">
parent.frames["changement"].window.location="lire_message.php"
</SCRIPT><?php }
?>
</body>
</html>

View file

@ -3,6 +3,9 @@ function reste(zetime) {
var heures = Math.floor(zetime / 3600); var heures = Math.floor(zetime / 3600);
var minutes = Math.floor(((zetime / 3600) - Math.floor(zetime / 3600)) * 60); var minutes = Math.floor(((zetime / 3600) - Math.floor(zetime / 3600)) * 60);
var secondes = zetime - ((Math.floor(zetime / 60)) * 60); var secondes = zetime - ((Math.floor(zetime / 60)) * 60);
if (heures < 10) heures = "0" + heures;
if (minutes < 10) minutes = "0" + minutes;
if (secondes < 10) secondes = "0" + secondes;
document.getElementById("axion").innerHTML = heures + ":" + minutes + ":" + secondes; document.getElementById("axion").innerHTML = heures + ":" + minutes + ":" + secondes;
var restant = zetime - 1; var restant = zetime - 1;
setTimeout("reste(" + restant + ")", 1000); setTimeout("reste(" + restant + ")", 1000);

View file

@ -1,9 +1,8 @@
<? <?php
session_start(); session_start();
$id = $_SESSION['id']; $id = $_SESSION['id'];
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
$x = mysql_query("SELECT pseudo FROM user WHERE id='".$id."'"); $x = mysql_query("SELECT pseudo FROM user WHERE id='".$id."'");
$donnees = mysql_fetch_array($x); $donnees = mysql_fetch_array($x);
@ -11,18 +10,15 @@ $pseudo = $donnees['pseudo'];
if (isset($_POST['description']) && $_POST['description'] !='' ) { if (isset($_POST['description']) && $_POST['description'] !='' ) {
if (isset($_POST['page']) && $_POST['page'] !='' ) { if (isset($_POST['page']) && $_POST['page'] !='' ) {
$temps = time(); $temps = time();
mysql_query("INSERT INTO bug VALUES('', '$pseudo', '$temps', '".htmlspecialchars($_POST['page'])."', '".nl2br(htmlspecialchars($_POST['description']))."')");
mysql_query("INSERT INTO bug VALUES('', '$pseudo', '$temps', '".htmlspecialchars($_POST['page'])."', '".htmlspecialchars($_POST['description'])."')");
mysql_close(); mysql_close();
@header("Location: rapport_bug.php?ok=1"); @header("Location: rapport_bug.php?ok=1");
} }
else { echo "Précisez la page concernée"; } else echo "Précisez la page concernée";
} }
else { echo "La description n'est pas valide"; } else echo "La description n'est pas valide";
mysql_close(); mysql_close();
@header("Location: rapport_bug.php"); @header("Location: rapport_bug.php");
?> ?>

113
pages/validation_def.php Normal file
View file

@ -0,0 +1,113 @@
<?php
session_start();
if (isset($_POST['cons_def_1']) || isset($_POST['cons_def_2']) || isset($_POST['cons_def_3']) || isset($_POST['cons_def_4']) || isset($_POST['cons_def_5'])) {
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$race=$_SESSION['race'];
require_once('bdd.php');
require('../connectBDD.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$sa=0;
if (isset($_POST['cons_def_1'])) $sa = floor($_POST['cons_def_1']);
if (isset($_POST['cons_def_2'])) $sa = floor($_POST['cons_def_2']);
if (isset($_POST['cons_def_3'])) $sa = floor($_POST['cons_def_3']);
if (isset($_POST['cons_def_4'])) $sa = floor($_POST['cons_def_4']);
if (isset($_POST['cons_def_5'])) $sa = floor($_POST['cons_def_5']);
if ($sa < 0) $sa=0;
if (isset($_POST['cons_def_1']) && $sa > 0) {
if ($metal - ($sa*500) >= 0) {
if ($cristal - ($sa*200) >= 0) {
$temps_caserne = time() + $sa*ceil(480/pow(1.25,$chantier_terrestre));
$unit = 9;
$metal -= ($sa*500);
$cristal -= ($sa*200);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
header("Location: defense.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_def_2']) && $sa > 0) {
if ($metal - ($sa*4000) >= 0) {
if ($cristal - ($sa*2000) >= 0) {
$temps_caserne = time() + $sa*ceil(1560/pow(1.25,$chantier_terrestre));
$unit = 10;
$metal -= ($sa*4000);
$cristal -= ($sa*2000);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: defense.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_def_3']) && $sa > 0) {
if ($metal - ($sa*4500) >= 0) {
if ($cristal - ($sa*8000) >= 0) {
if($hydrogene - ($sa*600) >= 0) {
$temps_caserne = time() + $sa*ceil(1800/pow(1.25,$chantier_terrestre));
$unit = 11;
$metal -= ($sa*4500);
$cristal -= ($sa*8000);
$hydrogene -= ($sa*600);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: defense.php");
}
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_def_4']) && $sa > 0) {
if ($metal - ($sa*12000) >= 0) {
if ($cristal - ($sa*10000) >= 0) {
if($hydrogene - ($sa*1000) >= 0) {
$temps_caserne = time() + $sa*ceil(6720/pow(1.25,$chantier_terrestre));
$unit = 12;
$metal -= ($sa*12000);
$cristal -= ($sa*10000);
$hydrogene -= ($sa*1000);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: defense.php");
}
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_def_5']) && $sa > 0) {
if ($metal - ($sa*15000) >= 0) {
if ($cristal - ($sa*9500) >= 0) {
if($hydrogene - ($sa*1500) >= 0) {
$temps_caserne = time() + $sa*ceil(12960/pow(1.25,$chantier_terrestre));
$unit = 13;
$metal -= ($sa*15000);
$cristal -= ($sa*9500);
$hydrogene -= ($sa*1500);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: defense.php");
}
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
else header("Location: defense.php");
}
mysql_close();
?>

162
pages/validation_soldat.php Normal file
View file

@ -0,0 +1,162 @@
<?php
session_start();
if (isset($_POST['cons_soldat1']) || isset($_POST['cons_soldat2']) || isset($_POST['cons_soldat3']) || isset($_POST['cons_soldat4']) || isset($_POST['cons_sniper']) || isset($_POST['cons_spartan']) || isset($_POST['cons_medecin']) || isset($_POST['cons_ingenieur']) || isset($_POST['cons_soldat_lourd'])) {
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require('../connectBDD.php');
$sa=0;
if (isset($_POST['cons_soldat1'])) $sa = floor($_POST['cons_soldat1']);
if (isset($_POST['cons_soldat2'])) $sa = floor($_POST['cons_soldat2']);
if (isset($_POST['cons_soldat3'])) $sa = floor($_POST['cons_soldat3']);
if (isset($_POST['cons_soldat4'])) $sa = floor($_POST['cons_soldat4']);
if (isset($_POST['cons_sniper'])) $sa = floor($_POST['cons_sniper']);
if (isset($_POST['cons_spartan'])) $sa = floor($_POST['cons_spartan']);
if (isset($_POST['cons_medecin'])) $sa = floor($_POST['cons_medecin']);
if (isset($_POST['cons_ingenieur'])) $sa = floor($_POST['cons_ingenieur']);
if (isset($_POST['cons_soldat_lourd'])) $sa = floor($_POST['cons_soldat_lourd']);
if ($sa < 0) $sa=0;
if (isset($_POST['cons_soldat1']) && $sa > 0) {
if ($metal - ($sa*80) >= 0) {
if ($cristal - ($sa*45) >= 0) {
$temps_caserne = time() + $sa*ceil(60/pow(1.25,$caserne));
$unit = 1;
$metal -= ($sa*80);
$cristal -= ($sa*45);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'") or die ("erreur sql ".mysql_error());
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_soldat2']) && $sa > 0) {
if ($metal - ($sa*110) >= 0) {
if ($cristal - ($sa*90) >= 0) {
$temps_caserne = time() + $sa*ceil(240/pow(1.25,$caserne));
$unit = 2;
$metal -= ($sa*110);
$cristal -= ($sa*90);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_soldat3']) && $sa > 0) {
if ($metal - ($sa*150) >= 0) {
if ($cristal - ($sa*105) >= 0) {
$temps_caserne = time() + $sa*ceil(240/pow(1.25,$caserne));
$unit = 3;
$metal -= ($sa*150);
$cristal -= ($sa*105);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_soldat4']) && $sa > 0) {
if ($metal - ($sa*220) >= 0) {
if ($cristal - ($sa*150) >= 0) {
$temps_caserne = time() + $sa*ceil(720/pow(1.25,$caserne));
$unit = 4;
$metal -= ($sa*220);
$cristal -= ($sa*150);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_sniper']) && $sa > 0) {
if ($metal - ($sa*180) >= 0) {
if ($cristal - ($sa*100) >= 0) {
$temps_caserne = time() + $sa*ceil(300/pow(1.25,$caserne));
$unit = 5;
$metal -= ($sa*180);
$cristal -= ($sa*100);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_spartan']) && $sa > 0) {
if ($metal - ($sa*25000) >= 0) {
if ($cristal - ($sa*10000) >= 0) {
$temps_caserne = time() + $sa*ceil(29700/pow(1.25,$caserne));
$unit = 6;
$metal -= ($sa*25000);
$cristal -= ($sa*10000);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_medecin']) && $sa > 0) {
if ($metal - ($sa*100) >= 0) {
if ($cristal - ($sa*100) >= 0) {
$temps_caserne = time() + $sa*ceil(90/pow(1.25,$caserne));
$unit = 7;
$metal -= ($sa*100);
$cristal -= ($sa*100);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_ingenieur']) && $sa > 0) {
if ($metal - ($sa*90) >= 0) {
if ($cristal - ($sa*105) >= 0) {
$temps_caserne = time() + $sa*ceil(90/pow(1.25,$caserne));
$unit = 8;
$metal -= ($sa*90);
$cristal -= ($sa*105);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_soldat_lourd']) && $sa > 0) {
if ($metal - ($sa*300) >= 0) {
if ($cristal - ($sa*250) >= 0) {
$temps_caserne = time() + $sa*ceil(900/pow(1.25,$caserne));
$unit = 9;
$metal -= ($sa*300);
$cristal -= ($sa*250);
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
header("Location: caserne.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
else header("Location: caserne.php");
mysql_close();
}

View file

@ -0,0 +1,154 @@
<?php
session_start();
if (isset($_POST['cons_vaisseau_att']) || isset($_POST['cons_vaisseau_1']) || isset($_POST['cons_vaisseau_2']) || isset($_POST['cons_vaisseau_3']) || isset($_POST['cons_vcl_1']) || isset($_POST['cons_vcl_2']) || isset($_POST['cons_vcl_3']) || isset($_POST['cons_vcl_4'])) {
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$race=$_SESSION['race'];
require_once('bdd.php');
require('../connectBDD.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$sa=0;
if (isset($_POST['cons_vaisseau_att'])) $sa = floor($_POST['cons_vaisseau_att']);
if (isset($_POST['cons_vaisseau_1'])) $sa = floor($_POST['cons_vaisseau_1']);
if (isset($_POST['cons_vaisseau_2'])) $sa = floor($_POST['cons_vaisseau_2']);
if (isset($_POST['cons_vaisseau_3'])) $sa = floor($_POST['cons_vaisseau_3']);
if (isset($_POST['cons_vcl_1'])) $sa = floor($_POST['cons_vcl_1']);
if (isset($_POST['cons_vcl_2'])) $sa = floor($_POST['cons_vcl_2']);
if (isset($_POST['cons_vcl_3'])) $sa = floor($_POST['cons_vcl_3']);
if (isset($_POST['cons_vcl_4'])) $sa = floor($_POST['cons_vcl_4']);
if ($sa < 0) $sa=0;
if (isset($_POST['cons_vaisseau_att']) && $sa > 0) {
if ($metal - ($sa*500) >= 0) {
if ($cristal - ($sa*300) >= 0) {
$temps_caserne = time() + $sa*ceil(720/pow(1.25,$chantier_terrestre));
$unit = 1;
$metal -= ($sa*500);
$cristal -= ($sa*300);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vaisseau_1']) && $sa > 0) {
if ($metal - ($sa*680) >= 0) {
if ($cristal - ($sa*420) >= 0) {
$temps_caserne = time() + $sa*ceil(2040/pow(1.25,$chantier_terrestre));
$unit = 2;
$metal -= ($sa*680);
$cristal -= ($sa*420);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vaisseau_2']) && $sa > 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*600) >= 0) {
$temps_caserne = time() + $sa*ceil(2700/pow(1.25,$chantier_terrestre));
$unit = 3;
$metal -= ($sa*1000);
$cristal -= ($sa*600);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vaisseau_3']) && $sa > 0) {
if ($metal - ($sa*1400) >= 0) {
if ($cristal - ($sa*950) >= 0) {
$temps_caserne = time() + $sa*ceil(3960/pow(1.25,$chantier_terrestre));
$unit = 4;
$metal -= ($sa*1400);
$cristal -= ($sa*950);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vcl_1']) && $sa > 0) {
if ($metal - ($sa*400) >= 0) {
if ($cristal - ($sa*240) >= 0) {
$temps_caserne = time() + $sa*ceil(600/pow(1.25,$chantier_terrestre));
$unit = 5;
$metal -= ($sa*400);
$cristal -= ($sa*240);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vcl_2']) && $sa > 0) {
if ($metal - ($sa*480) >= 0) {
if ($cristal - ($sa*260) >= 0) {
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,$chantier_terrestre));
$unit = 6;
$metal -= ($sa*480);
$cristal -= ($sa*260);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vcl_3']) && $sa > 0) {
if ($metal - ($sa*600) >= 0) {
if ($cristal - ($sa*420) >= 0) {
$temps_caserne = time() + $sa*ceil(2160/pow(1.25,$chantier_terrestre));
$unit = 7;
$metal -= ($sa*600);
$cristal -= ($sa*420);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vcl_4']) && $sa > 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*500) >= 0) {
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,$chantier_terrestre));
$unit = 8;
$metal -= ($sa*1000);
$cristal -= ($sa*500);
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
header("Location: chantier_terrestre.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
else header("Location: chantier_terrestre.php");
}
mysql_close();
?>

View file

@ -0,0 +1,216 @@
<?php
session_start();
if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['cons_vcolo']) || isset($_POST['cons_transporteur']) || isset($_POST['cons_gtransporteur']) || isset($_POST['cons_chasseur']) || isset($_POST['cons_fregate']) || isset($_POST['cons_croiseur2']) || isset($_POST['cons_croiseur'])) {
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$race=$_SESSION['race'];
require_once('bdd.php');
require('../connectBDD.php');
$sa=0;
if (isset($_POST['cons_transporteur'])) $sa = floor($_POST['cons_transporteur']);
if (isset($_POST['cons_vcolo'])) $sa = floor($_POST['cons_vcolo']);
if (isset($_POST['cons_sonde'])) $sa = floor($_POST['cons_sonde']);
if (isset($_POST['cons_chasseur'])) $sa = floor($_POST['cons_chasseur']);
if (isset($_POST['cons_croiseur'])) $sa = floor($_POST['cons_croiseur']);
if (isset($_POST['cons_croiseur2'])) $sa = floor($_POST['cons_croiseur2']);
if (isset($_POST['cons_fregate'])) $sa = floor($_POST['cons_fregate']);
if (isset($_POST['cons_gtransporteur'])) $sa = floor($_POST['cons_gtransporteur']);
if (isset($_POST['cons_sto'])) $sa = floor($_POST['cons_sto']);
if ($sa < 0) $sa=0;
if (isset($_POST['cons_transporteur']) && $sa != 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*800) >= 0) {
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,$chantier_spatial));
$unit = 1;
$metal -= ($sa*1000);
$cristal -= ($sa*800);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_close();
@header("Location: chantier_spatial.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
if ($metal - ($sa*4000) >= 0) {
if ($cristal - ($sa*3000) >= 0) {
$temps_caserne = time() + $sa*ceil(6300/pow(1.25,$chantier_spatial));
$unit = 2;
$metal -= ($sa*4000);
$cristal -= ($sa*3000);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_close();
@header("Location: chantier_spatial.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_vcolo']) && $sa != 0) {
if ($metal - ($sa*9000) >= 0) {
if ($cristal - ($sa*9000) >= 0) {
if($hydrogene - ($sa*1000) >= 0) {
$temps_caserne = time() + $sa*ceil(8280/pow(1.25,$chantier_spatial));
$unit = 3;
$metal -= ($sa*9000);
$cristal -= ($sa*9000);
$hydrogene -= ($sa*1000);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
if ($metal - ($sa*15000) >= 0) {
if ($cristal - ($sa*9000) >= 0) {
if($hydrogene - ($sa*1000) >= 0) {
$temps_caserne = time() + $sa*ceil(7380/pow(1.25,$chantier_spatial));
$unit = 5;
$metal -= ($sa*15000);
$cristal -= ($sa*9000);
$hydrogene -= ($sa*1000);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_chasseur']) && $sa != 0) {
if ($metal - ($sa*1700) >= 0) {
if ($cristal - ($sa*1220) >= 0) {
$temps_caserne = time() + $sa*ceil(1200/pow(1.25,$chantier_spatial));
$unit = 6;
$metal -= ($sa*1700);
$cristal -= ($sa*1220);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_fregate']) && $sa != 0) {
if ($metal - ($sa*5800) >= 0) {
if ($cristal - ($sa*1400) >= 0) {
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,$chantier_spatial));
$unit = 7;
$metal -= ($sa*5800);
$cristal -= ($sa*1400);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
mysql_close();
@header("Location: chantier_spatial.php");
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_croiseur']) && $sa != 0) {
if ($metal - ($sa*20000) >= 0) {
if ($cristal - ($sa*16000) >= 0) {
if($hydrogene - ($sa*1600) >= 0) {
$temps_caserne = time() + $sa*ceil(16800/pow(1.25,$chantier_spatial));
$unit = 8;
$metal -= ($sa*20000);
$cristal -= ($sa*16000);
$hydrogene -= ($sa*1600);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_croiseur2']) && $sa != 0) {
if ($metal - ($sa*26000) >= 0) {
if ($cristal - ($sa*16400) >= 0) {
if($hydrogene - ($sa*1600) >= 0) {
$temps_caserne = time() + $sa*ceil(18060/pow(1.25,$chantier_spatial));
$unit = 9;
$metal -= ($sa*26000);
$cristal -= ($sa*16400);
$hydrogene -= ($sa*1600);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_sonde']) && $sa != 0) {
if ($metal - ($sa*1000) >= 0) {
if ($cristal - ($sa*1200) >= 0) {
if($hydrogene - ($sa*100) >= 0) {
$temps_caserne = time() + $sa*ceil(1440/pow(1.25,$chantier_spatial));
$unit = 4;
$metal -= ($sa*1000);
$cristal -= ($sa*1200);
$hydrogene -= ($sa*100);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
elseif (isset($_POST['cons_sto']) && $sa != 0) {
if ($metal - ($sa*500000) >= 0) {
if ($cristal - ($sa*400000) >= 0) {
if($hydrogene - ($sa*250000) >= 0) {
$temps_caserne = time() + $sa*ceil(117000/pow(1.25,$chantier_spatial));
$unit = 11;
$metal -= ($sa*500000);
$cristal -= ($sa*400000);
$hydrogene -= ($sa*250000);
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
@header("Location: chantier_spatial.php");
}
else echo "Pas assez d'hydrogène !";
}
else echo "Pas assez de cristal !";
}
else echo "Pas assez de métal !";
}
else @header("Location: chantier_spatial.php");
mysql_close();
}
?>

65
pages/version.php Normal file
View file

@ -0,0 +1,65 @@
<HTML>
<HEAD>
<TITLE>Halo Battle</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="descriptions/diz/base.css">
<style type='text/css'>
table {
margin-top: 40px;
}
TD.z {
background-color: black;
border: 1px solid #7093DB;
font-weight: bold;
}
TH {
border: 1px solid
}
div {
margin: 0px;
border: 0px;
}
</style>
</head>
</html>
<table width="530" align=center>
<tbody>
<tr>
<td class="z" colspan="2">Mises à jours</td>
</tr>
<tr>
<th>version : 0.0</th>
<th width="80%">
<div align="left">
Commencement du projet Halo Battle.
</div></th>
</tr>
<tr>
<th>version : 0.1</th>
<th width="80%">
<div align="left">
Modifications :<br>
- Ajout de milliers de choses utiles.<br>
<br>
Corrections :<br>
- Correction de plein de bugs.
</div></th>
</tr>
</tbody>
</table>
</body>
</html>

22
pages/version.php2 Normal file
View file

@ -0,0 +1,22 @@
<?php
session_start();
define('DESIGN', 'descriptions/diz/base.css');
require('../header.php');
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
require_once('bdd.php');
require_once('ressource.php');
require('noms.php');
print '<center><table><tr><td><font size="+1">
<b>Halo-Battle</b><br><br>
Version 0.1 Béta<br>
Du samedi 27 octobre 2007<br>
</font></td></tr></table></center>';
?>
</body>
</html>

View file

@ -1,16 +1,27 @@
<? echo"<html> <?php
echo"<html>
<head> <head>
<title>Halo battle</title> <title>Halo battle</title>
<link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css > <link rel=stylesheet media=screen type=text/css title=design href=descriptions/diz/base.css >
<meta http-equiv=pragma content=no-cache > <meta http-equiv=pragma content=no-cache >
<meta http-equiv=content-type content=text/html;charset=iso-8869-1 > <meta http-equiv=content-type content=text/html;charset=iso-8869-1 >
<link rel=shortcut icon type=image/x-icon href=favicon.ico > <link rel=shortcut icon type=image/x-icon href=favicon.ico >
<style TYPE=text/css>
table {
margin-top: 25px;
}
TD.z {
min-width: 15px;
}
</style>
</head>
<body>"; <body>";
mysql_connect("localhost", "root", ""); require('../connectBDD.php');
mysql_select_db("wars");
echo "<table align=center><tr><td>Place</td><td>Race</td><td>Pseudo</td><td>Points</td><td>Flotte</td><td>Recherches</td></tr>"; echo "<table align=center><tr><td>Place</td><td>Race</td><td>Pseudo</td><td class=z>Points</td><td class=z>Flotte</td><td class=z>Recherches</td></tr>";
$ee = mysql_query("SELECT * FROM classement ORDER BY points DESC"); $ee = mysql_query("SELECT * FROM classement ORDER BY points DESC");
$i=1; $i=1;
while ( $data = mysql_fetch_array($ee) ){ while ( $data = mysql_fetch_array($ee) ){

208
table.sql
View file

@ -1,208 +0,0 @@
-- phpMyAdmin SQL Dump
-- version 2.6.1
-- http://www.phpmyadmin.net
--
-- Serveur: localhost
-- Généré le : Mercredi 03 Octobre 2007 à 14:22
-- Version du serveur: 4.1.9
-- Version de PHP: 4.3.10
--
-- Base de données: `wars`
--
-- --------------------------------------------------------
--
-- Structure de la table `bug`
--
CREATE TABLE `bug` (
`id` mediumint(9) NOT NULL default '0',
`pseudo` text NOT NULL,
`temps` bigint(20) NOT NULL default '0',
`page` text NOT NULL,
`description` text NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `bug`
--
-- --------------------------------------------------------
--
-- Structure de la table `classement`
--
CREATE TABLE `classement` (
`pseudo` text NOT NULL,
`race` text NOT NULL,
`points` bigint(20) NOT NULL default '0',
`flottes` bigint(20) NOT NULL default '0',
`terrestres` bigint(20) NOT NULL default '0',
`recherches` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `classement`
--
-- --------------------------------------------------------
--
-- Structure de la table `mail`
--
CREATE TABLE `mail` (
`id` mediumint(9) NOT NULL default '0',
`vu` char(1) NOT NULL default '',
`destinataire` text NOT NULL,
`expediteur` text NOT NULL,
`sujet` text NOT NULL,
`temps` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `mail`
--
-- --------------------------------------------------------
--
-- Structure de la table `planete`
--
CREATE TABLE `planete` (
`id` mediumint(9) NOT NULL default '0',
`galaxie` char(1) NOT NULL default '',
`ss` char(3) NOT NULL default '',
`position` char(2) NOT NULL default '',
`pseudo` text NOT NULL,
`nom_planete` text NOT NULL,
`image` tinyint(4) NOT NULL default '0',
`cases` char(3) NOT NULL default '',
`debris_met` bigint(20) NOT NULL default '0',
`debris_cri` bigint(20) NOT NULL default '0',
`metal` varchar(20) NOT NULL default '',
`cristal` varchar(20) NOT NULL default '',
`hydrogene` varchar(20) NOT NULL default '',
`timestamp` bigint(20) NOT NULL default '0',
`coeff` varchar(5) NOT NULL default '',
`energie` bigint(20) NOT NULL default '0',
`temps_b` bigint(20) NOT NULL default '0',
`bat` tinyint(4) NOT NULL default '0',
`mine_m` char(3) NOT NULL default '',
`mine_c` char(3) NOT NULL default '',
`mine_h` char(3) NOT NULL default '',
`centrale_s` char(3) NOT NULL default '',
`centrale_f` char(3) NOT NULL default '',
`radar` char(3) NOT NULL default '',
`labo` char(3) NOT NULL default '',
`chantier_terestre` char(3) NOT NULL default '',
`chantier_spatial` char(3) NOT NULL default '',
`caserne` char(3) NOT NULL default '',
`silo` char(3) NOT NULL default '',
`temps_t` bigint(20) NOT NULL default '0',
`tec` tinyint(4) NOT NULL default '0',
`informatique` char(3) NOT NULL default '',
`detection` char(3) NOT NULL default '',
`armement` char(3) NOT NULL default '',
`energie_t` char(3) NOT NULL default '',
`reacteur` char(3) NOT NULL default '',
`reacteur_f` char(3) NOT NULL default '',
`reacteur_ff` char(3) NOT NULL default '',
`medecine` char(3) NOT NULL default '',
`tactique` char(3) NOT NULL default '',
`developement` char(3) NOT NULL default '',
`blindage` char(3) NOT NULL default '',
`transporteur` bigint(20) NOT NULL default '0',
`gtransporteur` bigint(20) NOT NULL default '0',
`vcolo` bigint(20) NOT NULL default '0',
`sonde` bigint(20) NOT NULL default '0',
`recycleur` bigint(20) NOT NULL default '0',
`chasseur` bigint(20) NOT NULL default '0',
`fregate` bigint(20) NOT NULL default '0',
`croiseur1` bigint(20) NOT NULL default '0',
`croiseur2` bigint(20) NOT NULL default '0',
`pv` bigint(20) NOT NULL default '0',
`sto` bigint(20) NOT NULL default '0',
`soldat1` bigint(20) NOT NULL default '0',
`soldat2` bigint(20) NOT NULL default '0',
`soldat3` bigint(20) NOT NULL default '0',
`soldat4` bigint(20) NOT NULL default '0',
`sniper` bigint(20) NOT NULL default '0',
`spartam` bigint(20) NOT NULL default '0',
`medecin` bigint(20) NOT NULL default '0',
`ingenieur` bigint(20) NOT NULL default '0',
`soldat_lourd` bigint(20) NOT NULL default '0',
`vaisseau_att` bigint(20) NOT NULL default '0',
`vaisseau_1` bigint(20) NOT NULL default '0',
`vaisseau_2` bigint(20) NOT NULL default '0',
`vaisseau_3` bigint(20) NOT NULL default '0',
`vcl_1` bigint(20) NOT NULL default '0',
`vcl_2` bigint(20) NOT NULL default '0',
`vcl_3` bigint(20) NOT NULL default '0',
`vcl_4` bigint(20) NOT NULL default '0',
`def_1` bigint(20) NOT NULL default '0',
`def_2` bigint(20) NOT NULL default '0',
`def_3` bigint(20) NOT NULL default '0',
`def_4` bigint(20) NOT NULL default '0',
`def_5` bigint(20) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `planete`
--
-- --------------------------------------------------------
--
-- Structure de la table `records`
--
CREATE TABLE `records` (
`type` text NOT NULL,
`pseudo` text NOT NULL,
`lvl` mediumint(9) NOT NULL default '0'
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
--
-- Contenu de la table `records`
--
-- --------------------------------------------------------
--
-- Structure de la table `user`
--
CREATE TABLE `user` (
`id` mediumint(9) NOT NULL auto_increment,
`pseudo` text NOT NULL,
`mdp` text NOT NULL,
`race` text NOT NULL,
`mail` text NOT NULL,
`ip` text NOT NULL,
`mv` tinyint(4) NOT NULL default '0',
`last_visite` bigint(20) NOT NULL default '0',
`points` bigint(20) NOT NULL default '0',
`place_points` smallint(6) NOT NULL default '0',
`recherches` bigint(20) NOT NULL default '0',
`place_recherches` smallint(6) NOT NULL default '0',
`flotte` bigint(20) NOT NULL default '0',
`place_flotte` smallint(6) NOT NULL default '0',
`terrestre` bigint(20) NOT NULL default '0',
`place_terrestre` smallint(6) NOT NULL default '0',
KEY `id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
--
-- Contenu de la table `user`
--

View file

@ -1,49 +0,0 @@
<?php
session_start();
$loginOK = false;
mysql_connect("localhost", "root", "");
mysql_select_db("wars");
if ( isset($_POST) && (!empty($_POST['login'])) && (!empty($_POST['password'])) ) {
extract($_POST);
$login = addslashes($_POST['login']);
$sql = "SELECT * FROM user WHERE pseudo = '".$login."'";
$req = mysql_query($sql) or die('Erreur SQL : <br />'.$sql);
if (mysql_num_rows($req) > 0) {
$data = mysql_fetch_assoc($req);
$password = $_POST['password'];
if ($password == $data['mdp']) {
$loginOK = true;
}
}
}
if ($loginOK) {
$_SESSION['id'] = $data['id'];
$z = mysql_query("SELECT galaxy, ss, pos FROM planete WHERE id='".$data['id']."' AND nb=1");
$donnees = mysql_fetch_array($z);
$_SESSION['galaxy'] = $donnees['galaxy'];
$_SESSION['ss'] = $donnees['ss'];
$_SESSION['pos'] = $donnees['pos'];
$w = mysql_query("SELECT race FROM user WHERE id='".$data['id']."' AND pseudo = '".$login."'");
$donnees = mysql_fetch_array($w);
$_SESSION['race'] = $donnees['race'];
@header("Location: b_index.php");
}
else {
echo 'Mauvais pseudo ou mot de passe, veuillez réessayer !<br><br><a href=index.html>Login</a>';
}
?>