HB/pages/nn/chantier_terrestre.php

242 lines
10 KiB
PHP

<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
$_SESSION['dernPage'] = 'chantier_terrestre.php';
require_once '../securite.php';
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 >";
require_once 'bdd.php';
require_once 'ressource.php';
require_once 'chantier_terrestre_ajout.php';
require_once '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(720/pow(1.25,($chantier_terrestre-1)));
$g = ceil(2040/pow(1.25,($chantier_terrestre-3)));
$h = ceil(7200/pow(1.25,($chantier_terrestre-4)));
$i = ceil(3960/pow(1.25,($chantier_terrestre-6)));
$j = ceil(600/pow(1.25,($chantier_terrestre-1)));
$k = ceil(1080/pow(1.25,($chantier_terrestre-2)));
$l = ceil(2160/pow(1.25,($chantier_terrestre-3)));
$m = ceil(4680/pow(1.25,($chantier_terrestre-5)));
if ($temps_t > 0) $unit = $nomterra[--$unit_t];
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<?php
print '<div class="centre"><table style="margin-left: auto; margin-right: auto; width: 275px; height: 50px"><tr><td><b>Prochainement dans Halo-Battle</b></td></tr></table></div></body></html>';
exit;
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>';
}
if ($chantier_terrestre >= 1) {
echo'<div class=d><a href="arbre_vehicules_'.$race.'.php">Arbre des technologies</a></div><br class="a">
<div class="center"><table style="margin-left: auto; margin-right: auto;"><tr><td style="border:none; background: transparent;">
<div class=a>
<img src="images/terrestre/'.$nomterri[0].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[0].'</a>'; if ($vais_0 > 0) { echo" (".$vais_0." vaisseaux)"; }
echo '<br>'.$nomterde[0].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>500</span> '.$ressourc[1].' : <span class=rc>300</span><br>
Temps de construction : '; sec($f);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 500 && $cristal >= 300) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[1].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[1].'</a>'; if ($vais_1 > 0) { echo" (".$vais_1." vaisseaux)"; }
echo '<br>'.$nomterde[1].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>680</span> '.$ressourc[1].' : <span class=rc>420</span><br>
Temps de construction : '; sec($g);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 680 && $cristal >= 420) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 4 && $reacteur >= 1) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[2].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[2].'</a>'; if ($vais_2 > 0) { echo" (".$vais_2." vaisseaux)"; }
echo '<br>'.$nomterde[2].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>1.000</span> '.$ressourc[1].' : <span class=rc>600</span><br>
Temps de construction : '; sec($h);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 1000 && $cristal >= 600) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 6 && $reacteur >= 3) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[3].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[3].'</a>'; if ($vais_3 > 0) { echo" (".$vais_3." vaisseaux)"; }
echo '<br>'.$nomterde[3].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>1.400</span> '.$ressourc[1].' : <span class=rc>950</span><br>
Temps de construction : '; sec($i);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 1400 && $cristal >= 950) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 1) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[4].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[4].'</a>'; if ($vcl_1 > 0) { echo" (".$vcl_1." véhicules)"; }
echo '<br>'.$nomterde[4].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>400</span> '.$ressourc[1].' : <span class=rc>240</span><br>
Temps de construction : '; sec($j);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 400 && $cristal >= 240) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 2) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[5].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[5].'</a>'; if ($vcl_2 > 0) { echo" (".$vcl_2." véhicules)"; }
echo '<br>'.$nomterde[5].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>480</span> '.$ressourc[1].' : <span class=rc>260</span><br>
Temps de construction : '; sec($k);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 480 && $cristal >= 260) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[6].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[6].'</a>'; if ($vcl_3 > 0) { echo" (".$vcl_3." véhicules)"; }
echo '<br>'.$nomterde[6].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>600</span> '.$ressourc[1].' : <span class=rc>420</span><br>
Temps de construction : '; sec($l);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 600 && $cristal >= 420) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
if ($chantier_terrestre >= 5 && $blindage >=2 && $armement >=2) {
echo'<div class=a>
<img src="images/terrestre/'.$nomterri[7].'" alt="" />
</div>
<div class=b>
<a href=\"descriptions/.php\">'.$nomterrn[7].'</a>'; if ($vcl_4 > 0) { echo" (".$vcl_4." véhicules)"; }
echo '<br>'.$nomterde[7].'<br>Besoin de : '.$ressourc[0].' : <span class=rc>1.000</span> '.$ressourc[1].' : <span class=rc>500</span><br>
Temps de construction : '; sec($m);
echo '</div>
<div class="c">';
echo'<form method="post" action="validation_terrestre.php">';
if ($bat == 8) echo '<br><br><br>Chantier terrestre en construction';
else {
if ($metal >= 1000 && $cristal >= 500) { if ($temps_t < time()) { echo '<br><br><br><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 '<br><font color="red">Construction en cours dans le </font><a href="defense.php">centre de défenses</a>';
}
}
echo '</form></div><br class=a>'; }
}
else { echo '<table align=center><tr><td>Vous devez d\'abord construire un chantier terrestre !</td></tr></table>'; } ?>
</td></tr></table></div>
</body>
</html>