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 @@
<?
echo "<HTML>
<HEAD>
<title>Halo battle</title>
<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>";
<?php
//define('DESIGN', 'pages/design/design1.css');
require('securitebanni.php');
require('header.php');
?>
<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>
<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 >
<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>
<br>
<br>
<br>
<br>
<br>
<center>
<table>
<div class="contenu">
<div class="texte">
<div style="text-align: center;">
<table style="margin-left: auto; margin-right: auto;">
<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>
<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 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 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 class="cellulestxt">Race : </td><td class="cellulestxt"><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">
<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="submit" value="Envoyer" class="bouton">
</td></tr>
</form>
</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>
</html>

View file

@ -16,140 +16,103 @@
<br>
<center>
<?php
// CONNECION SQL
mysql_connect("localhost", "root", "");
mysql_select_db("wars");
//define('DESIGN', 'pages/design/design.css');
//define('TITLE', 'Space battleship');
//require('header.php');
?>
<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'];
$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;
$v3=0;
$v4=0;
$v5=0;
$erreurs = '<table style="width: 75%; margin-left: auto; margin-right: auto;">';
$inscriptOk = true;
// VERIFICATION DU PSEUDO
if ($pseudo =="")
{echo "Vous devez rentrer un pseudo";
?><br><br><?
// Diverses vérification pour savoir si tous les champs sont remplis et s'ils ont tous les données valides
if (addslashes(preg_replace('@[^a-zA-Z0-9_]@i', '', $pseudo)) != $pseudo || $pseudo == '') {
$inscriptOk = false;
$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>';
}
else
{
$result = mysql_query("SELECT pseudo FROM user WHERE pseudo='".$_POST["pseudo"]."'");
if(mysql_num_rows($result)>=1)
{echo "Ce pseudo est déja pris";
?><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><?
else {
$result = mysql_query("SELECT pseudo FROM user WHERE pseudo='$pseudo'");
if(mysql_num_rows($result) >= 1) {
$inscriptOk = false;
$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>';
}
}
// VERIFICATION DE la race
if (isset($_POST['race'])){$race = $_POST['race'];}else{ $race = ''; }
if ($race == '')
{echo "Vous devez choisir une race";
?><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>';
}
else if ($race == "covenant")
{$v5=1;}
else if ($race == "humain")
{$v5=1;}
else
{echo "Vous devez choisir une race";
?><br><br><?
else {
$result = mysql_query("SELECT mail FROM user WHERE mail='$mail'");
if(mysql_num_rows($result) >= 1) {
$inscriptOk = false;
$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>';
}
}
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
if ($v1==1 && $v3==1 && $v4==1 && $v5==1)
{
$temps = time();
$coo=2;
while ($coo > 1) {
$galaxy = mt_rand(2,4);
$planete_trouvee = false;
while ($planete_trouvee != true) {
$galaxie = mt_rand(2,4);
$ss = mt_rand(1,150);
$pos = mt_rand(1,12);
$result = mysql_query("SELECT pseudo FROM planete WHERE galaxy='".$galaxy."' AND ss='".$ss."' AND pos='".$pos."'");
if(mysql_num_rows($result)>=1) { $coo=2; }
else { $coo=1; }
// Test pour savoir si la planète est déjà habitée
$result = mysql_query("SELECT id FROM planete WHERE galaxie='$galaxie' AND ss='$ss' AND position='$pos'");
if(mysql_num_rows($result)>=1) $planete_trouvee = false;
else $planete_trouvee = true;
}
$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."'");
$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>";
echo "<a href='index.php'><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();
?>
</BODY>
</HTML>
</div>
</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'];
$pos=$_SESSION['pos'];
echo"<html>
echo'<html>
<head>
<title>Halo Battle</title>
@ -50,25 +50,25 @@ TD.e {
background-color: #000151;
border: 1px solid #00007D;
}
</style>";
</style>';
function techno($nom, $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
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress."</font>";
echo "<font color=#00CC99 >".$nom." ".$niveau_ress." (".$niveau.")</font>";
}
}
include 'bdd.php';
echo"</head>
echo'</head>
<body>
<table align=center id=tablo>
@ -83,72 +83,72 @@ echo"</head>
<tr>
<td class=c>Bâtiment</td>
<td class=c>Niveau</td>
<td class=e>Technologies nécessaires</td>
<td class=e>Technologies nécessaires (niveau actuel)</td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Centrale de fusion</a></td>
<td class=d>".$centrale_f."</td>
<td class=e><font color=#00CC99>Débloqué</font></td>
<td class=d>'.$centrale_f.'</td>
<td class=e>'; @techno(Energie,$energie_t, 5); echo'<br>'; @techno('Centrale solaire',$centrale_s, 12); echo'</td>
</tr>
<tr>
<td class=c><a href=descriptions/.php>Oeil des prophètes</a></td>
<td class=d>".$radar."</td>
<td class=e>"; @techno(Détection,$detection, 1); echo"</td>
<td class=d>'.$radar.'</td>
<td class=e>'; @techno(Détection,$detection, 1); echo'</td>
</tr>
<tr>
<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>
</tr>
<tr>
<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>
</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>
<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>Caserne</a></td>
<td class=d>".$caserne."</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>Entrepôt</a></td>
<td class=d>".$silo."</td>
<td class=d>'.$silo.'</td>
<td class=e><font color=#00CC99 >Débloqué</font></td>
</tr>
@ -157,4 +157,4 @@ echo"</head>
</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();
$id=$_SESSION['id'];
@ -8,15 +8,24 @@ $pos=$_SESSION['pos'];
echo"<html>
<head>
<title>Space battleship</title>
<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 >";
<link rel=shortcut icon type=image/x-icon href=favicon.ico >
include 'bdd.php';
include 'batiment_ajout.php';
<style TYPE=text/css>
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) {
$output = '';
@ -50,408 +59,354 @@ else
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)
{
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>";}}
else echo "Fer : <span class=rc>".$need_fer." </span>";
}
if ($need_cristal > 0) {
if ($cristal <= $need_cristal)
{
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>";}}
else echo "Cristal : <span class=rc>".$need_cristal." </span>";
}
if ($need_ro > 0) {
if ($ro <= $need_ro)
{
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>";}}
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>
echo '<script language="javascript" src="time.js"></script>
</head>
<body>
<div class=d><a href=arbre_bat.php>Arbre des technologies</a></div>
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment>
<div class=d><a href="arbre_bat_'.$race.'.php">Arbre des technologies</a></div>
<br class="a">
<div class="a">
<img src="images/batiments/'.$batimeni[0].'" alt="" />
</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(exp(($mine_m*0.400))*200);
$b=ceil(exp(($mine_m*0.400))*100);
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>";
<div class="b">
<a href="descriptions.php?bat='.$batimend[0].'">'.$batiment[0].'</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 '<div id="axion"></div>';
echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
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 {
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>
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="images/batiments/'.$batimeni[1].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Purificateur de cristal</a> "; if ($mine_c > 0) { echo "( Niveau ".$mine_c." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[1].'">'.$batiment[1].'</a> '; if ($mine_c > 0) echo '(Niveau '.$mine_c.')'; echo '<br>
Description.<br>
Besoin de : ";
$a=ceil(exp(($mine_c*0.430))*210);
$b=ceil(exp(($mine_c*0.430))*120);
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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>
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="images/batiments/'.$batimeni[2].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Ionisateur</a> "; if ($mine_h > 0) { echo "( Niveau ".$mine_h." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[2].'">'.$batiment[2].'</a> '; if ($mine_h > 0) echo '(Niveau '.$mine_h.')'; echo '<br>
Description.<br>
Besoin de : ";
$a=ceil(exp(($mine_h*0.445))*250);
$b=ceil(exp(($mine_h*0.445))*170);
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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>
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="images/batiments/'.$batimeni[3].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Centrale solaire</a> "; if ($centrale_s > 0) { echo "( Niveau ".$centrale_s." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[3].'">'.$batiment[3].'</a> '; if ($centrale_s > 0) echo '(Niveau '.$centrale_s.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
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">';
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment>
if ($centrale_s >= 12 && $energie_t >= 5) {
echo '<div class="a">
<img src="images/batiments/'.$batimeni[4].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Centrale de fusion</a> "; if ($centrale_f > 0) { echo "( Niveau ".$centrale_f." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[4].'">'.$batiment[4].'</a> '; if ($centrale_f > 0) echo '(Niveau '.$centrale_f.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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 ($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>
echo '<div class=a>
<img src="images/batiments/'.$batimeni[5].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Oeil des prophètes</a> "; if ($radar > 0) { echo "( Niveau ".$radar." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[5].'">'.$batiment[5].'</a> '; if ($radar > 0) echo '(Niveau '.$radar.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
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 {
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>"; }
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>
echo '<div class="a">
<img src="images/batiments/'.$batimeni[6].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Centre de recherches</a> "; if ($labo > 0) { echo "( Niveau ".$labo." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[6].'">'.$batiment[6].'</a> '; if ($labo > 0) echo '(Niveau '.$labo.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align="center"><tr><td><div id="axion"></div></td></tr>';
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 {
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>
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="laboratoire.php">laboratoire</a>';
else verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0);
}
}
echo '</div>
<br class="a">
<div class="a">
<img src="images/batiments/'.$batimeni[7].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Chantier terrestre</a> "; if ($chantier_terrestre > 0) { echo "( Niveau ".$chantier_terrestre." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[7].'">'.$batiment[7].'</a> '; if ($chantier_terrestre > 0) echo '(Niveau '.$chantier_terrestre.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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 ($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>
echo '<div class="a">
<img src="images/batiments/'.$batimeni[8].'">
</div>
<div class=b>
<a href=descriptions/.php>Chantier spatial</a> "; if ($chantier_spatial > 0) { echo "( Niveau ".$chantier_spatial." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[8].'">'.$batiment[8].'</a> '; if ($chantier_spatial > 0) echo '(Niveau '.$chantier_spatial.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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>"; }
if ($case <= 0) echo "<font color=red>Planète pleine</font>";
else {
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);
}
}
echo '</div><br class="a">';
}
echo "<br class=a>
<div class=a>
<img src=descriptions/diz/batiment>
echo '<div class="a">
<img src="images/batiments/'.$batimeni[9].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Caserne</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[9].'">'.$batiment[9].'</a> '; if ($caserne > 0) echo '(Niveau '.$caserne.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
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>
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);
}
}
<br class=a>
<div class=a>
<img src=descriptions/diz/batiment>
echo '</div>
<br class="a">
<div class="a">
<img src="images/batiments/'.$batimeni[10].'" alt="">
</div>
<div class=b>
<a href=descriptions/.php>Entrepôt</a> "; if ($caserne > 0) { echo "( Niveau ".$caserne." )"; } echo "<br>
<div class="b">
<a href="descriptions.php?bat='.$batimend[10].'">'.$batiment[10].'</a> '; if ($silo > 0) echo '(Niveau '.$silo.')'; echo '<br>
Description.<br>
Besoin de : ";
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>";
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 '<div id="axion"></div>';
echo '<table align=center><tr><td><div id="axion"></div></td></tr>';
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 {
if ($case <= 0) { echo "<font color=red>Planète pleine</font>"; }
else { verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo "</div>
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>"; ?>
</html>';
?>

View file

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

View file

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

View file

@ -1,8 +1,7 @@
<?
mysql_connect("localhost", "root", "");
mysql_select_db("wars");
<?php
require('../connectBDD.php');
$z = mysql_query("SELECT * FROM user WHERE id='".$id."' ");
$z = mysql_query("SELECT * FROM user WHERE id='$id' ");
$donnees = mysql_fetch_array($z);
$id = $donnees['id'];
@ -22,12 +21,27 @@ $place_flotte = $donnees['place_flotte'];
$terrestre = $donnees['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);
$galaxy = $donnees['galaxy'];
$galaxy = $donnees['galaxie'];
$ss = $donnees['ss'];
$pos = $donnees['pos'];
$pos = $donnees['position'];
$nb = $donnees['nb'];
$nom_planete = $donnees['nom_planete'];
$image = $donnees['image'];
@ -55,20 +69,6 @@ $chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$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'];
$gtransporteur = $donnees['gtransporteur'];
$vcolo = $donnees['vcolo'];
@ -81,6 +81,9 @@ $croiseur2 = $donnees['croiseur2'];
$pv = $donnees['pv'];
$sto = $donnees['sto'];
$temps_caserne = $donnees['cas_contruct_time'];
$cons_caserne = $donnees['cas_contruct_nb'];
$unit = $donnees['cas_contruct'];
$soldat1 = $donnees['soldat1'];
$soldat2 = $donnees['soldat2'];
$soldat3 = $donnees['soldat3'];
@ -91,10 +94,32 @@ $medecin = $donnees['medecin'];
$ingenieur = $donnees['ingenieur'];
$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_2 = $donnees['vaisseau_2'];
$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_2 = $donnees['vcl_2'];
$vcl_3 = $donnees['vcl_3'];
@ -105,4 +130,10 @@ $def_2 = $donnees['def_2'];
$def_3 = $donnees['def_3'];
$def_4 = $donnees['def_4'];
$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();
$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 );
$diametre = $cases * 92;
mysql_connect("localhost", "root", "");
mysql_select_db("wars");
require('../connectBDD.php');
$nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='".$pseudo."' AND vu='1'");
$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);
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>"; }
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>

View file

@ -35,6 +35,10 @@ text-decoration: underline;
border: none;
}
img {
border: 0;
}
a:hover {
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: ";