HB/page/flotte2.php

269 lines
9.4 KiB
PHP
Raw Blame History

<? session_start(); ?>
<html>
<head>
<title>Halo</title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<? if (isset($_POST['vaisseau1'])) {} else { $_POST['vaisseau1'] = 0; }
if (isset($_POST['vaisseau2'])) {} else { $_POST['vaisseau2'] = 0; }
if (isset($_POST['vaisseau3'])) {} else { $_POST['vaisseau3'] = 0; }
if (isset($_POST['vaisseau4'])) {} else { $_POST['vaisseau4'] = 0; }
if (isset($_POST['vaisseau5'])) {} else { $_POST['vaisseau5'] = 0; }
if (isset($_POST['vaisseau6'])) {} else { $_POST['vaisseau6'] = 0; }
if (isset($_POST['vaisseau7'])) {} else { $_POST['vaisseau7'] = 0; }
if (isset($_POST['vaisseau8'])) {} else { $_POST['vaisseau8'] = 0; }
if (isset($_POST['vaisseau9'])) {} else { $_POST['vaisseau9'] = 0; }
if (isset($_POST['vaisseau10'])) {} else { $_POST['vaisseau10'] = 0; }
if ($_POST['vaisseau1'] > 0 || $_POST['vaisseau2'] > 0 || $_POST['vaisseau3'] > 0 ||
$_POST['vaisseau4'] > 0 || $_POST['vaisseau5'] > 0 || $_POST['vaisseau6'] > 0 ||
$_POST['vaisseau7'] > 0 || $_POST['vaisseau8'] > 0 || $_POST['vaisseau9'] > 0 ||
$_POST['vaisseau10'] > 0 ) {
echo "<form action=flotte3.php method=post name=flotte>
<table>
<tr>
<td align=center valign=top>
<script language=javascript src=flotte.js></script>
<input value=".$galaxy." name=galaxie_dep type=hidden>
<input value=".$ss." name=systeme_dep type=hidden>
<input value=".$pos." name=planete_dep type=hidden>
<input value=2 name=facteurvitesse type=hidden>
<input name=temps type=hidden>
<input value=".$metal." name=ressource1 type=hidden>
<input value=".$cristal." name=ressource2 type=hidden>
<input value=".$hydrogene." name=ressource3 type=hidden>";
if(isset($_POST['vaisseau1'])) {
echo "<input value=".$_POST['vaisseau1']." name=vaisseau1 type=hidden>
<input value=20 name=conso1 type=hidden>
<input value=10000 name=vitesse1 type=hidden>
<input value=5000 name=capacite1 type=hidden>";
} else {$_POST['vaisseau1']=0;}
if(isset($_POST['vaisseau2'])) {
echo "<input value=".$_POST['vaisseau2']." name=vaisseau2 type=hidden>
<input value=200 name=conso2 type=hidden>
<input value=16000 name=vitesse2 type=hidden>
<input value=50000 name=capacite2 type=hidden>";
} else {$_POST['vaisseau1']=0;}
if(isset($_POST['vaisseau3'])) {
echo "<input value=".$_POST['vaisseau3']." name=vaisseau3 type=hidden>
<input value=500 name=conso3 type=hidden>
<input value=10000 name=vitesse3 type=hidden>
<input value=250000 name=capacite3 type=hidden>";
} else {$_POST['vaisseau3']=0;}
if(isset($_POST['vaisseau4'])) {
echo "<input value=".$_POST['vaisseau4']." name=vaisseau4 type=hidden>
<input value=200 name=conso4 type=hidden>
<input value=3000 name=vitesse4 type=hidden>
<input value=100000 name=capacite4 type=hidden>";
} else {$_POST['vaisseau4']=0;}
if(isset($_POST['vaisseau5'])) {
echo "<input value=".$_POST['vaisseau5']." name=vaisseau5 type=hidden>
<input value=100 name=conso5 type=hidden>
<input value=25000 name=vitesse5 type=hidden>
<input value=250 name=capacite5 type=hidden>";
} else {$_POST['vaisseau5']=0;}
if(isset($_POST['vaisseau6'])) {
echo "<input value=".$_POST['vaisseau6']." name=vaisseau6 type=hidden>
<input value=120 name=conso6 type=hidden>
<input value=30000 name=vitesse6 type=hidden>
<input value=200 name=capacite6 type=hidden>";
} else {$_POST['vaisseau6']=0;}
if(isset($_POST['vaisseau7'])) {
echo "<input value=".$_POST['vaisseau7']." name=vaisseau7 type=hidden>
<input value=700 name=conso7 type=hidden>
<input value=20000 name=vitesse7 type=hidden>
<input value=5000 name=capacite7 type=hidden>";
} else {$_POST['vaisseau7']=0;}
if(isset($_POST['vaisseau8'])) {
echo "<input value=".$_POST['vaisseau8']." name=vaisseau8 type=hidden>
<input value=1000 name=conso8 type=hidden>
<input value=10000 name=vitesse8 type=hidden>
<input value=15000 name=capacite8 type=hidden>";
} else {$_POST['vaisseau8']=0;}
if(isset($_POST['vaisseau9'])) {
echo "<input value=".$_POST['vaisseau9']." name=vaisseau9 type=hidden>
<input value=1000 name=conso9 type=hidden>
<input value=3000 name=vitesse9 type=hidden>
<input value=2000 name=capacite9 type=hidden>";
} else {$_POST['vaisseau9']=0;}
if(isset($_POST['vaisseau10'])) {
echo "<input value=".$_POST['vaisseau10']." name=vaisseau10 type=hidden>
<input value=500 name=conso10 type=hidden>
<input value=10000 name=vitesse10 type=hidden>
<input value=2500 name=capacite10 type=hidden>";
} else {$_POST['vaisseau10']=0;}
?>
<table border="0" cellpadding="0" cellspacing="1" width="519">
<tbody><tr height="20">
<td colspan="2" class="z">Envoyer la flotte</td>
</tr>
<tr height="20">
<th width="50%" class="z">Objectif</th>
<th>
<input name="galaxie_arr" size="3" maxlength="1" onchange="Infov()" onkeyup="Infov()" value="<? echo $galaxy; ?>">
<input name="systeme_arr" size="3" maxlength="3" onchange="Infov()" onkeyup="Infov()" value="<? echo $ss; ?>">
<input name="planete_arr" size="3" maxlength="2" onchange="Infov()" onkeyup="Infov()" value="<? echo $pos; ?>">
</th></tr>
<tr height="20">
<th>Vitesse</th>
<th>
<select name="vitesse" onchange="Infov()" onkeyup="Infov()">
<option value="100">100</option>
<option value="90">90</option>
<option value="80">80</option>
<option value="70">70</option>
<option value="60">60</option>
<option value="50">50</option>
<option value="40">40</option>
<option value="30">30</option>
<option value="20">20</option>
<option value="10">10</option>
</select> %
</th>
</tr>
<tr height="20">
<th class="z">Distance</th><th><div id="distance"></div></th>
</tr>
<tr height="20">
<th class="z">Dur<75>e d'un trajet</th><th><div id="duree"></div></th>
</tr>
<tr height="20">
<th class="z">Consommation d'hydrogene</th><th><div id="conso"></div></th>
</tr>
<tr height="20">
<th class="z">Capacit<69></th><th><div id="stockage"></div></th>
</tr>
<tr height="20">
<th class="z">Vitesse</th><th><div id="maxvitesse"></div></th>
</tr>
</tbody></table>
<br>
<!-- tableau mission -->
<table border="0" cellpadding="0" cellspacing="1" width="519">
<tbody><tr height="20">
<td colspan="2" class="z">Mission</td>
</tr>
<tr height="20">
<th><input name="ordre" value="transport" type="radio">Transporter</th><th><input name="ordre" value="stationnement" type="radio">Stationner</th></tr>
<tr>
<th><input name="ordre" value="attaque" type="radio">Attaquer</th><? if ($_POST['vaisseau4'] > 0) { echo "<th><input name=ordre value=espionnage type=radio>Espionner</th></tr>"; } else { echo "<th>&nbsp;</th></tr>"; } ?>
<? if ($_POST['vaisseau5'] > 0 ) {
echo "<tr><th><input name=ordre value=recyclage type=radio>Recycler</th>";} else { echo "<tr><th>&nbsp;</th>"; }
if ( $_POST['vaisseau3'] > 0 && $_POST['vaisseau1'] == 0 && $_POST['vaisseau2'] == 0 && $_POST['vaisseau10'] == 0
&& $_POST['vaisseau4'] == 0 && $_POST['vaisseau5'] == 0 && $_POST['vaisseau6'] == 0 && $_POST['vaisseau7'] == 0
&& $_POST['vaisseau8'] == 0 && $_POST['vaisseau9'] == 0) {
echo "<th><input name=ordre value=coloniser type=radio>Coloniser</th></tr>";} else { echo "<th>&nbsp;</th></tr>"; }
?>
</tbody></table>
<br>
<!-- tableau ressources <20> transporter. -->
<table border="0" cellpadding="0" cellspacing="1" width="519">
<tbody><tr height="20">
<td colspan="2" class="z">Ressources</td>
</tr>
<tr height="20">
<th>M<>tal </th><th><a href="javascript:maxRessource('1');">(max) </a><input name="ressource1_aff" size="10" onchange="calculateTransportCapacity();" type="text"></th>
</tr><tr>
<th>Cristal </th><th><a href="javascript:maxRessource('2');">(max) </a><input name="ressource2_aff" size="10" onchange="calculateTransportCapacity();" type="text"></th>
</tr>
<tr height="20">
<th>Hydrog<6F>ne </th><th><a href="javascript:maxTritium();">(max) </a><input name="ressource3_aff" size="10" onchange="calculateTransportCapacity();" type="text"></th>
</tr>
<tr height="20">
<th>Restant</th>
<th colspan="2"><div id="reste_ressources">-</div></th>
</tr>
<tr height="20">
<th colspan="3"><a href="javascript:maxRessources()">Toutes les ressources</a></th>
</tr>
</tbody></table>
<br>
<!-- tableau raccourcis colonnies -->
<table border="0" cellpadding="0" cellspacing="1" width="519">
<tbody><tr>
</tr><tr height="20">
<td colspan="3" class="z">Raccourcis</td>
</tr>
<tr height="20">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$nbr_non_vus = mysql_query("SELECT COUNT(*) AS nb FROM user WHERE pseudo='".$pseudo."'");
$nbre = mysql_fetch_assoc($nbr_non_vus);
$pla = $nbre['nb'];
echo "<center>
<tr>";
for ($i=0; $i < $pla; $i++) {
$x = mysql_query("SELECT nb, galaxy, ss, pos, nomplanete FROM user WHERE pseudo='".$pseudo."' ORDER BY nb LIMIT $i,8");
$d = mysql_fetch_array($x);
echo "<th colspan=3><a href='javascript:setTarget(".$d['galaxy'].",".$d['ss'].",".$d['pos']."); Infov()'>".$d['nomplanete']." [".$d['galaxy'].":".$d['ss'].":".$d['pos']."]</a></th>";
}
?>
</tr>
</center>
<tr height="20">
<th colspan="3">
<input value="Continuer" type="submit">
</th>
</tr>
</tbody></table>
<script language="javascript">Infov();</script> </td>
</tr>
</tbody>
</table>
</form>
<? } else { ?>
<SCRIPT language="javascript">
parent.frames["changement"].window.location="flotte.php"
</SCRIPT>
<? } ?>
</body>
</html>