HB/page/chantier_spatial.php

196 lines
9.4 KiB
PHP
Raw Normal View History

2007-03-31 10:00:00 +00:00
<? 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_vaisseaux.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 - (0.1*$chantier_spatial*1080)));
$g = ceil((6300 - (0.1*$chantier_spatial*6300)));
$h = ceil((8280 - (0.1*$chantier_spatial*8280)));
$i = ceil((1440 - (0.1*$chantier_spatial*1440)));
$j = ceil((7380 - (0.1*$chantier_spatial*7380)));
$k = ceil((1200 - (0.1*$chantier_spatial*1200)));
$l = ceil((4680 - (0.1*$chantier_spatial*4680)));
$m = ceil((16800 - (0.1*$chantier_spatial*16800)));
$n = ceil((18060 - (0.1*$chantier_spatial*18060)));
$p = ceil((32400 - (0.1*$chantier_spatial*32400)));
$q = ceil((117000 - (0.1*$chantier_spatial*117000)));
if ($temps_spatial>0) {
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 d<>espionnage de classe Clarion"; break;
case 5:
$unit= "recycleurs de classe Minotaur"; break;
case 6:
$unit= "C709 Longsword Interceptor"; break;
case 7:
$unit= "fr<EFBFBD>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>
<? if ($chantier_spatial > 0) {
if ($temps_spatial >0) {
echo "<table align=center><tr><td>
Construction termin<EFBFBD> dans : ";
$tr=$temps_spatial-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Construction de : ".$cons_spatial." ".$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_spatial >= 1 && $reacteur >= 4) {
echo "<form method=post action=validation_transporteur.php>
<tr>
<td><img src=images/ ></td>
<td align=left>Cargos de classe Parabola ( ".$transporteur." vaisseaux )<br>M<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_f >= 2) {
echo "<form method=post action=validation_gtransporteur.php>
<tr>
<td><img src= ></td>
<td align=left>Cargos de classe Laden ( ".$gtransporteur." vaisseaux )<br>M<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_ff >= 1) {
echo "<form method=post action=validation_vcolo.php>
<tr>
<td><img src=images/vcolo.jpg ></td>
<td align=left>Vaisseaux de colonisation de classe Odyssey ( ".$vcolo." vaisseaux )<br>M<EFBFBD>tal : 9000<br>Cristal : 9000<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 3 && $reacteur >= 5 && $detection >=2) {
echo "<form method=post action=validation_sonde.php>
<tr>
<td><img src=images/sonde.jpg ></td>
<td align=left>Drones d<EFBFBD>espionnage de classe Clarion ( ".$sonde." vaisseaux )<br>M<EFBFBD>tal : 1000<br>Cristal : 1200<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_f >= 4 && $blindage >= 5) {
echo "<form method=post action=validation_recycleur.php>
<tr>
<td><img src= ></td>
<td align=left>Recycleurs de classe Minotaur ( ".$recycleur." vaisseaux )<br>M<EFBFBD>tal : 15000<br>Cristal : 9000<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 1 && $reacteur >= 4) {
echo "<form method=post action=validation_chasseur.php>
<tr>
<td><img src=images/longsword.jpg ></td>
<td align=left>C709 Longsword Interceptor ( ".$chasseur." vaisseaux )<br>M<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 3 && $reacteur_f >= 3 && $armement >=1) {
echo "<form method=post action=validation_fregate.php>
<tr>
<td><img src=images/fregate.jpg ></td>
<td align=left>Fr<EFBFBD>gate ( ".$fregate." vaisseaux )<br>M<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 6 && $reacteur_ff >= 2 && $armement >=3 && $blindage >= 4) {
echo "<form method=post action=validation_croiseur.php>
<tr>
<td><img src=images/croiseur1.jpg ></td>
<td align=left>Croiseurs de classe Halcyon ( ".$croiseur." vaisseaux )<br>M<EFBFBD>tal : 20000<br>Cristal : 16000<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 6 && $reacteur_ff >= 3 && $armement >=4 && $blindage >= 4) {
echo "<form method=post action=validation_croiseur2.php>
<tr>
<td><img src=images/croiseur2.jpg ></td>
<td align=left>Croiseurs de classe Marathon ( ".$croiseur2." vaisseaux )<br>M<EFBFBD>tal : 26000<br>Cristal : 16400<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 8 && $reacteur_ff >= 5 && $armement >=6 && $blindage >= 6) {
echo "<form method=post action=validation_pv.php>
<tr>
<td><img src= ></td>
<td align=left>Porte vaisseaux ( ".$pv." vaisseaux )<br>M<EFBFBD>tal : 60000<br>Cristal : 40000<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >=12 && $blindage >= 12) {
echo "<form method=post action=validation_sto.php>
<tr>
<td><img src=images/sto.jpg ></td>
<td align=left>Station orbitale ( ".$sto." vaisseaux )<br>Cette station reste en orbite autour de la plan<EFBFBD>te et ne peut plus y bouger.<br>M<EFBFBD>tal : 500000<br>Cristal : 400000<br>Hydrog<EFBFBD>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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
} else { ?><SCRIPT language="javascript">
parent.frames["changement"].window.location="sans_spatial.php"
</SCRIPT> <?
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
echo "</table>"; ?>
</body>
</html>