forked from halo-battle/game
First code received by Master Leon
This commit is contained in:
commit
4230eb6922
330 changed files with 15543 additions and 0 deletions
182
page/chantier_terrestre.php
Normal file
182
page/chantier_terrestre.php
Normal file
|
|
@ -0,0 +1,182 @@
|
|||
<? session_start(); ?>
|
||||
<html>
|
||||
<head>
|
||||
<title>Space battleship</title>
|
||||
|
||||
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
|
||||
<?php
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
include 'ressource.php';
|
||||
include 'bdd.php';
|
||||
include 'ajout_terrestre.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 - (0.1*$chantier_terrestre*720)));
|
||||
$g = ceil((2040 - (0.1*$chantier_terrestre*2040)));
|
||||
$h = ceil((2700 - (0.1*$chantier_terrestre*2700)));
|
||||
$i = ceil((3960 - (0.1*$chantier_terrestre*3960)));
|
||||
$j = ceil((600 - (0.1*$chantier_terrestre*600)));
|
||||
$k = ceil((1080 - (0.1*$chantier_terrestre*1080)));
|
||||
$l = ceil((2160 - (0.1*$chantier_terrestre*2160)));
|
||||
$m = ceil((4680 - (0.1*$chantier_terrestre*4680)));
|
||||
|
||||
|
||||
|
||||
if ($temps_terrestre>0) {
|
||||
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;
|
||||
}}
|
||||
?>
|
||||
<script language="javascript" src="time.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<? if ($chantier_terrestre > 0) {
|
||||
if ($temps_terrestre >0) {
|
||||
echo "<table align=center><tr><td>
|
||||
Construction terminé dans : ";
|
||||
$tr=$temps_terrestre-time();
|
||||
echo '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "</td></tr><tr><td>Entrainement de : ".$cons_terrestre." ".$unit."</td></tr>
|
||||
</table>";} else {}
|
||||
|
||||
echo"<table align=center>
|
||||
<tr><td width=150>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
|
||||
|
||||
|
||||
if ($chantier_terrestre >= 1) {
|
||||
echo "<form method=post action=validation_vaisseau_att.php>
|
||||
<tr>
|
||||
<td><img src=images/sparowawk.jpg ></td>
|
||||
<td align=left>Sparrowhawk ( ".$vaisseau_att." vaisseaux )<br>Métal : 500<br>Cristal : 300<br>Temps : "; sec($f); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 3 && $armement >= 1) {
|
||||
echo "<form method=post action=validation_vaisseau_1.php>
|
||||
<tr>
|
||||
<td><img src=images/pelican.jpg ></td>
|
||||
<td align=left>077-TC Pelican ( ".$vaisseau_1." vaisseaux )<br>Métal : 680<br>Cristal : 420<br>Temps : "; sec($g); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 4 && $reacteur >= 1) {
|
||||
echo "<form method=post action=validation_vaisseau_2.php>
|
||||
<tr>
|
||||
<td><img src=images/phantom.jpg ></td>
|
||||
<td align=left>C703 Shortsword Bomber ( ".$vaisseau_2." vaisseaux )<br>Métal : 1000<br>Cristal : 600<br>Temps : "; sec($h); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 6 && $reacteur >= 3) {
|
||||
echo "<form method=post action=validation_vaisseau_3.php>
|
||||
<tr>
|
||||
<td><img src=images/albatross.jpg ></td>
|
||||
<td align=left>SHD Albatros ( ".$vaisseau_3." vaisseaux )<br>Métal : 1400<br>Cristal : 950<br>Temps : "; sec($i); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 1) {
|
||||
echo "<form method=post action=validation_vcl_1.php>
|
||||
<tr>
|
||||
<td><img src=images/warthog1.jpg ></td>
|
||||
<td align=left>M12 LRV Warthog ( ".$vcl_1." véhicules )<br>Métal : 400<br>Cristal : 240<br>Temps : "; sec($j); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 2) {
|
||||
echo "<form method=post action=validation_vcl_2.php>
|
||||
<tr>
|
||||
<td><img src=images/warthog2.jpg ></td>
|
||||
<td align=left>M12G1 LAAV Warthog ( ".$vcl_2." véhicules )<br>Métal : 480<br>Cristal : 260<br>Temps : "; sec($k); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 3 && $armement >= 1) {
|
||||
echo "<form method=post action=validation_vcl_3.php>
|
||||
<tr>
|
||||
<td><img src=images/warthog3.jpg ></td>
|
||||
<td align=left>M12A1 LAAV Warthog ( ".$vcl_3." véhicules )<br>Métal : 600<br>Cristal : 420<br>Temps : "; sec($l); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
if ($chantier_terrestre >= 5 && $blindage >=2 && $armement >=2) {
|
||||
echo "<form method=post action=validation_vcl_4.php>
|
||||
<tr>
|
||||
<td><img src=images/scorpion.jpg ></td>
|
||||
<td align=left>M808B Scorpion MBT ( ".$vcl_4." véhicules )<br>Métal : 1000<br>Cristal : 500<br>Temps : "; sec($m); echo"<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=bouttom>"; } 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 {}
|
||||
|
||||
|
||||
} else { ?><SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="sans_terrestre.php"
|
||||
</SCRIPT> <?
|
||||
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
|
||||
echo "</table>"; ?>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
Add table
Add a link
Reference in a new issue