Version 2007-10-27
30
pages/ajout_terrestre.php
Normal 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
|
|
@ -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");
|
||||
?>
|
||||
|
|
@ -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
|
|
@ -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>'; ?>
|
||||
157
pages/arbre_techno_covenant.php
Normal 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>'; ?>
|
||||
157
pages/arbre_techno_humain.php
Normal 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>'; ?>
|
||||
140
pages/arbre_unitees_covenant.php
Normal 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>'; ?>
|
||||
140
pages/arbre_unitees_humain.php
Normal 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>'; ?>
|
||||
154
pages/arbre_vaisseaux_covenant.php
Normal 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>'; ?>
|
||||
154
pages/arbre_vaisseaux_humain.php
Normal 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 d’espionnage 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>'; ?>
|
||||
161
pages/arbre_vehicules_covenant.php
Normal 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>'; ?>
|
||||
161
pages/arbre_vehicules_humain.php
Normal 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>'; ?>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
|
|
@ -8,17 +8,26 @@ $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>";
|
||||
|
||||
function sec($time) {
|
||||
require_once 'bdd.php';
|
||||
require_once 'ressource.php';
|
||||
require_once 'batiment_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) {
|
||||
|
|
@ -49,409 +58,355 @@ 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)
|
||||
{
|
||||
$z=floor($fer)-$need_fer;
|
||||
echo '<font color=red >Fer : <ACRONYM title="'.$z.'">'.$need_fer.'</ACRONYM></font> ';
|
||||
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 "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 "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>";}}
|
||||
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>
|
||||
$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.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 '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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="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 '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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="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 '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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="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 : ";
|
||||
$a=ceil(pow(2,$centrale_s)*300);
|
||||
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 '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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">';
|
||||
|
||||
|
||||
<br class=a>
|
||||
|
||||
|
||||
<div class=a>
|
||||
<img src=descriptions/diz/batiment>
|
||||
</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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
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?bat='.$batimend[4].'">'.$batiment[4].'</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">';
|
||||
}
|
||||
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>
|
||||
</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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
echo '<div class=a>
|
||||
<img src="images/batiments/'.$batimeni[5].'" alt="">
|
||||
</div>
|
||||
<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 : ';
|
||||
$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">';
|
||||
}
|
||||
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>
|
||||
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 : ";
|
||||
$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>";
|
||||
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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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="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 : ";
|
||||
$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>";
|
||||
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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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 ($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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
echo '<div class="a">
|
||||
<img src="images/batiments/'.$batimeni[8].'">
|
||||
</div>
|
||||
<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 : ';
|
||||
$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_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">';
|
||||
}
|
||||
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 "<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 : ";
|
||||
$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>";
|
||||
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 '<div id="axion"></div>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
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 : ";
|
||||
$a=ceil(pow(2,$silo)*400);
|
||||
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 '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"batiment_anul.php?bat=1\">Annuler</a>";
|
||||
$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>
|
||||
|
||||
|
||||
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>';
|
||||
?>
|
||||
|
|
@ -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,64 +24,29 @@ $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 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;
|
||||
}
|
||||
|
||||
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;
|
||||
if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); } else { $energie_f =0;}
|
||||
|
||||
if ($centrale_s > 0 ) {$energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10))*$coeff)); } else { $energie_s =0;}
|
||||
|
||||
$energie = $energie_s + $energie_f;
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); } else { $energie_f =0;}
|
||||
|
||||
if ($centrale_s > 0 ) {$energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10))*$coeff)); } else { $energie_s =0;}
|
||||
|
||||
$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();
|
||||
|
||||
@header("Location: batiment_".$race.".php");
|
||||
}
|
||||
?>
|
||||
|
|
@ -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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 2)
|
||||
{
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 3)
|
||||
{
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 4)
|
||||
{
|
||||
$metal += ceil(pow(2,$centrale_s)*300);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
|
||||
elseif ( $_GET['bat'] == 5)
|
||||
{
|
||||
$metal += ceil(pow(2,$centrale_f)*165);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 6)
|
||||
{
|
||||
$metal += ceil(pow(2,$radar)*750);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 7)
|
||||
{
|
||||
$metal += ceil(pow(2,$labo)*200);
|
||||
$cristal += ceil(pow(2,$labo)*150);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 8 )
|
||||
{
|
||||
$metal += ceil(pow(2,$chantier_terrestre)*520);
|
||||
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 ) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 9)
|
||||
{
|
||||
$metal += ceil(pow(2,$chantier_spatial)*600);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 10)
|
||||
{
|
||||
$metal += ceil(pow(2,$caserne)*200);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
|
||||
elseif ( $_GET['bat'] == 11)
|
||||
{
|
||||
$metal += ceil(pow(2,$silo)*400);
|
||||
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) {
|
||||
$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");
|
||||
?>
|
||||
|
|
@ -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>"; ?>
|
||||
|
|
@ -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>"; ?>
|
||||
|
|
@ -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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 2)
|
||||
{
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 3)
|
||||
{
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 4)
|
||||
{
|
||||
$metal -= ceil(pow(2,$centrale_s)*300);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
|
||||
elseif ( $_GET['bat'] == 5)
|
||||
{
|
||||
$metal -= ceil(pow(2,$centrale_f)*165);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 6)
|
||||
{
|
||||
$metal -= ceil(pow(2,$radar)*750);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 7)
|
||||
{
|
||||
$metal -= ceil(pow(2,$labo)*200);
|
||||
$cristal -= ceil(pow(2,$labo)*150);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 8 )
|
||||
{
|
||||
$metal -= ceil(pow(2,$chantier_terrestre)*520);
|
||||
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 ) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 9)
|
||||
{
|
||||
$metal -= ceil(pow(2,$chantier_spatial)*600);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
elseif ( $_GET['bat'] == 10)
|
||||
{
|
||||
$metal -= ceil(pow(2,$caserne)*200);
|
||||
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) {
|
||||
$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."'");
|
||||
}
|
||||
|
||||
|
||||
elseif ( $_GET['bat'] == 11)
|
||||
{
|
||||
$metal -= ceil(pow(2,$silo)*400);
|
||||
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) {
|
||||
$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");
|
||||
?>
|
||||
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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
|
|
@ -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>
|
||||
28
pages/chantier_spacial_ajout.php
Normal 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
|
|
@ -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 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é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>
|
||||
195
pages/chantier_terrestre.php
Normal 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>
|
||||
30
pages/chantier_terrestre_ajout.php
Normal 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
|
|
@ -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
|
|
@ -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é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é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é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è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
|
|
@ -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>
|
||||
|
|
@ -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); }
|
||||
|
|
@ -53,7 +52,7 @@ function convert_ts_fr($tstamp) { echo date('H:i:s d/m/Y', $tstamp); }
|
|||
echo"</head>
|
||||
|
||||
|
||||
<body>
|
||||
<body>
|
||||
|
||||
<table width=500 align=center>
|
||||
<tr><td colspan=2 align=left class=c>Evènements</td></tr>
|
||||
|
|
@ -65,13 +64,13 @@ 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>
|
||||
|
||||
<tr><td witdh=50 class=d>Diamètre</td>
|
||||
<td>".$diametre." km ( ".$case." / ".$cases." cases )</td></tr>
|
||||
|
||||
<td>".$diametre." km ( ".$case." / ".$cases." cases )</td></tr>
|
||||
|
||||
<tr><td witdh=50 class=d>Race</td>
|
||||
<td>".$race."</td></tr>
|
||||
|
||||
|
|
@ -79,7 +78,7 @@ echo "<tr><td colspan=2 align=left class=c><a href=rename.php>".$nom_planete."</
|
|||
<td><a href=carte.php?galaxy=".$galaxy."&ss=".$ss.">[".$galaxy.":".$ss.":".$pos."]</a></td></tr>
|
||||
|
||||
<tr><td witdh=50 class=d>Classement</td>
|
||||
<td><a href=voir_classement.php >".$data['points']." points (".$data['place_points'].")</a></td></tr>
|
||||
<td><a href=voir_classement.php >".$data['points']." points (".$data['place_points'].")</a></td></tr>
|
||||
</table>
|
||||
|
||||
</body></html>"; ?>
|
||||
|
|
@ -35,6 +35,10 @@ text-decoration: underline;
|
|||
border: none;
|
||||
}
|
||||
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
|
||||
a:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
|
|
|
|||
BIN
pages/descriptions/diz/fond/Thumbs.db
Normal file
BIN
pages/descriptions/diz/techno/Thumbs.db
Normal file
BIN
pages/descriptions/diz/unit/marine.jpg
Normal file
|
After Width: | Height: | Size: 16 KiB |
33
pages/envoyer_message.php
Normal 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
|
|
@ -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 d’espionnage 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>
|
||||
BIN
pages/images/batiments/Thumbs.db
Normal file
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 15 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 25 KiB After Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 26 KiB After Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
|
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 20 KiB |
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 13 KiB |
|
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 19 KiB |
317
pages/laboratoire.php
Normal 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: ";
|
||||
$n=($tactique-1); $a=ceil(pow(2,$n)*2600); $b=ceil(pow(2,$n)*2600);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
echo"<br>Temps : ";
|
||||
sec(ceil((pow(2,$labo)*22800) - ((pow(2,$labo)*2280)*0.07*$labo)));
|
||||
echo"<td>";
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==10) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=10\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0);
|
||||
}
|
||||
echo"</td></tr>";
|
||||
}
|
||||
if ($labo >= 8 && $mine_m >= 18 && $mine_c >= 15 && $informatique >= 8) {
|
||||
echo "<tr><td><img src=images/".$technolo[10].".jpg ></td><td>".$technolo[10]." niveau ".$developpement."<br><br>Coût: ";
|
||||
$n=($developpement-1); $a=ceil(pow(2,$n)*10000); $b=ceil(pow(2,$n)*10000); $c=ceil(pow(2,$n)*5000);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
echo"<br>Temps : ";
|
||||
sec(ceil((pow(2,$labo)*8220) - ((pow(2,$labo)*8220)*0.07*$labo)));
|
||||
echo"<td>";
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==11) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=11\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo"</td></tr>";
|
||||
}
|
||||
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8) {
|
||||
echo "<tr><td><img src=images/".$technolo[11].".jpg ></td><td>".$technolo[11]." niveau ".$spartan."<br><br>Coût: ";
|
||||
$n=($spartan-1); $a=ceil(pow(3,$n)*5200); $b=ceil(pow(3,$n)*4250); $c=ceil(pow(3,$n)*850);
|
||||
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
echo"<br>Temps : ";
|
||||
sec(ceil((pow(2,$labo)*10000) - ((pow(3,$labo)*10000)*0.07*$labo)));
|
||||
echo"<td>";
|
||||
if ($temps_tec > 0) {
|
||||
if ($tec==13) {
|
||||
$tr=$temps_tec-time();
|
||||
echo '<span id="axion"></span><br>';
|
||||
echo '<script language="JavaScript">reste('.$tr.');</script>';
|
||||
echo "<a href=\"anul_tec.php?tec=13\">Annuler</a>";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if($bat == 7) echo "Le laboratoire est en cours d'évolution";
|
||||
else verification_des_ress(13, $metal, $cristal, $hydrogene, $a, $b, $c);
|
||||
}
|
||||
echo"</td></tr>";
|
||||
}
|
||||
}
|
||||
else echo "</tr></table><center><table><tr><td>Vous devez d'abord construire un centre de recherche !</td></tr></table></center>";
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
26
pages/laboratoire_ajout.php
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
<?php
|
||||
$id=$_SESSION['id'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
|
||||
if ((time()) >= $temps_tec && !empty($temps_tec)) {
|
||||
|
||||
switch ($tec) {
|
||||
case 1: $informatique++; mysql_query("UPDATE user SET informatique='".$informatique."' WHERE id='".$id."'") or die ("erreur sql ".mysql_error()); break;
|
||||
case 2: $detection++; mysql_query("UPDATE user SET detection='".$detection."' WHERE id='".$id."'"); break;
|
||||
case 3: $armement++; mysql_query("UPDATE user SET armement='".$armement."' WHERE id='".$id."'"); break;
|
||||
case 5: $energie_t++; mysql_query("UPDATE user SET energie_t='".$energie_t."' WHERE id='".$id."'"); break;
|
||||
case 6: $reacteur++; mysql_query("UPDATE user SET reacteur='".$reacteur."' WHERE id='".$id."'"); break;
|
||||
case 7: $reacteur_f++; mysql_query("UPDATE user SET reacteur_f='".$reacteur_f."' WHERE id='".$id."'"); break;
|
||||
case 8: $reacteur_ff++; mysql_query("UPDATE user SET reacteur_ff='".$reacteur_ff."' WHERE id='".$id."'"); break;
|
||||
case 9: $medecine++; mysql_query("UPDATE user SET medecine='".$medecine."' WHERE id='".$id."'"); break;
|
||||
case 10: $tactique++; mysql_query("UPDATE user SET tactique='".$tactique."' WHERE id='".$id."'"); break;
|
||||
case 11: $developpement++; mysql_query("UPDATE user SET developement='".$developpement."' WHERE id='".$id."'"); break;
|
||||
case 12: $blindage++; mysql_query("UPDATE user SET blindage='".$blindage."' WHERE id='".$id."'"); break;
|
||||
//case 13: $spartan++; mysql_query("UPDATE user SET tech_spartan='".$spartan."' WHERE id='".$id."'"); break;
|
||||
}
|
||||
|
||||
mysql_query("UPDATE user SET temps_t='0', tec='0' WHERE id='$id'") or die ("erreur sql ".mysql_error());
|
||||
}
|
||||
?>
|
||||
61
pages/lire_message.php
Normal file
|
|
@ -0,0 +1,61 @@
|
|||
<?php session_start(); ?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Halo Battle</TITLE>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" media="screen" name="design" href="descriptions/diz/base.css">
|
||||
<?php
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require_once('ressource.php');
|
||||
|
||||
|
||||
require('../connectBDD.php');
|
||||
|
||||
$x = mysql_query("SELECT temps FROM mail");
|
||||
$di = mysql_fetch_array($x);
|
||||
|
||||
$tamps = $di['temps'] - time();
|
||||
|
||||
mysql_query("DELETE FROM mail WHERE $tamps >='259200'");
|
||||
|
||||
function convert_ts_fr($tstamp) {
|
||||
echo date ('d/m/Y H:i:s' , $tstamp);
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<?
|
||||
$nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='$pseudo'");
|
||||
$nbre_non = mysql_fetch_assoc($nbr);
|
||||
|
||||
if ($nbre_non['nbre'] > 25) $t = 25; else $t = $nbre_non['nbre'];
|
||||
|
||||
echo "<center><a href=envoyer_message.php>Ecrire un message</a><br><br>";
|
||||
if ($nbre_non['nbre'] >0) {
|
||||
echo "<form method=post action=suppr_msg.php><table><tr><td colspan=4 align=center><input type=submit value='Supprimer le message' class=bouton></td></tr>
|
||||
<tr><td>Action</td><td>Date</td><td>Expéditeur</td><td>Objet</td></tr>";
|
||||
for ($i=0;$i<$t;$i++) {
|
||||
|
||||
$x = mysql_query("SELECT id, vu, expediteur, sujet, temps, contenu FROM mail WHERE destinataire='$pseudo' ORDER BY id DESC LIMIT $i,25") or die ("erreur sql ".mysql_error());
|
||||
$donnees = mysql_fetch_array($x);
|
||||
|
||||
mysql_query("UPDATE mail SET vu='0' WHERE id='".$donnees['id']."'") or die(mysql_error());
|
||||
|
||||
echo "
|
||||
<tr><td><label><input type=radio name=msg_sup value=".$donnees['id']." /></td>
|
||||
<td>"; convert_ts_fr($donnees['temps']); echo"</td>
|
||||
<td>".$donnees['expediteur']."<a href=envoyer_message.php?pseudo=".$donnees['expediteur']."> <img src=descriptions/diz/m.gif></a></td>
|
||||
<td>".$donnees['sujet']."</td></tr>
|
||||
<tr><td colspan=4 align=center width=400>".$donnees['contenu']."</td></tr>";
|
||||
}
|
||||
echo "<tr><td colspan=4 align=center><input type=submit value='Supprimer le message' class=bouton></td></tr></table></form></center>"; }
|
||||
else echo '<table align="center"><tr><td>Aucun message</td></tr></table>';
|
||||
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -9,5 +9,5 @@ unset($_SESSION);
|
|||
// On détruit la session
|
||||
session_destroy();
|
||||
|
||||
@header("Location: index.html");
|
||||
@header("Location: ../index.php");
|
||||
?>
|
||||
165
pages/menu.php
|
|
@ -1,8 +1,9 @@
|
|||
<?
|
||||
<?php
|
||||
session_start();
|
||||
$race = $_SESSION['race'];
|
||||
|
||||
echo '<html>
|
||||
echo '<!DOCTYPE HTML SYSTEM>
|
||||
<html>
|
||||
<head>
|
||||
<title>Space battleship</title>
|
||||
|
||||
|
|
@ -15,14 +16,9 @@ echo '<html>
|
|||
|
||||
<body>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="version.html"
|
||||
</SCRIPT>
|
||||
<A HREF="version.html" target="changement" class=link>Version 0.1</A>
|
||||
</div>'; ?>
|
||||
<div><a href="version.php" target="changement" class=link>Version 0.1</a></div>'; ?>
|
||||
|
||||
<script language="javascript">
|
||||
<script type="text/javascript">
|
||||
function dateTempsReel ( ) {
|
||||
var days = new Array('Dim', 'Lun', 'Mar', 'Mer', 'Jeu', 'Ven', 'Sam');
|
||||
var months = new Array('jan', 'fév', 'mar', 'avr', 'mai', 'juin', 'juil', 'aoû', 'sep', 'oct', 'nov', 'déc');
|
||||
|
|
@ -44,156 +40,55 @@ function dateTempsReel ( ) {
|
|||
}
|
||||
setTimeout('dateTempsReel()', 999)
|
||||
} </script>
|
||||
<? echo '<div id="datetime"></div><script language="javascript">dateTempsReel();</script>
|
||||
<? echo '<div id="datetime"></div><script type="text/javascript">dateTempsReel();</script>
|
||||
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="depart.php"
|
||||
</SCRIPT>
|
||||
<A HREF="depart.php" target="changement" >Accueil</A>
|
||||
</div>
|
||||
<div><A HREF="depart.php" target="changement" >Accueil</A></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="batiment_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="batiment_'.$race.'.php" target="changement">Bâtiments</a>
|
||||
</div>
|
||||
<div><a href="batiment.php" target="changement">Bâtiments</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="caserne_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="caserne_'.$race.'.php" target="changement">Caserne</a>
|
||||
</div>
|
||||
<div><a href="caserne.php" target="changement">Caserne</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="fabrique_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="fabrique_'.$race.'.php" target="changement">Fabrique d\'armes</a>
|
||||
</div>
|
||||
<div><a href="chantier_spatial.php" target="changement">Chantier spatial</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="chantier_spatial_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="chantier_spatial_'.$race.'.php" target="changement">Chantier spatial</a>
|
||||
</div>
|
||||
<div><a href="chantier_terrestre.php" target="changement">Chantier terrestre</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="laboratoire_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="laboratoire_'.$race.'.php" target="changement">Laboratoire</a>
|
||||
</div>
|
||||
<div><a href="defense.php" target="changement">Défenses</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="arbre_bat_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="arbre_bat_'.$race.'.php" target="changement">Arbre technologique</a>
|
||||
</div>
|
||||
<div><a href="laboratoire.php" target="changement">Laboratoire</a></div>
|
||||
|
||||
<div><a href="arbre_bat_'.$race.'.php" target="changement">Arbre technologique</a></div>
|
||||
|
||||
<div class=blanc>
|
||||
</div>
|
||||
<div class=blanc></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="ressources.php"
|
||||
</SCRIPT>
|
||||
<a href="ressources.php" target="changement">Ressources</a>
|
||||
</div>
|
||||
<div><a href="ressources.php" target="changement">Ressources</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="gestion.php"
|
||||
</SCRIPT>
|
||||
<a href="gestion.php" target="changement">Gestion</a>
|
||||
</div>
|
||||
<div><a href="gestion.php" target="changement">Gestion</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="flotte_'.$race.'.php"</SCRIPT>
|
||||
<a href="flotte_'.$race.'.php" target="changement">Flotte</a>
|
||||
</div>
|
||||
<div><a href="flotte.php" target="changement">Flotte</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="armee_'.$race.'.php"
|
||||
</SCRIPT>
|
||||
<a href="armee_'.$race.'.php" target="changement">Armée</a>
|
||||
</div>
|
||||
<div><a href="armee_'.$race.'.php" target="changement">Armée</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="carte.php"
|
||||
</SCRIPT>
|
||||
<a href="carte.php" target="changement">Carte spatiale</a>
|
||||
</div>
|
||||
<div><a href="carte.php" target="changement">Carte spatiale</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="options.php"
|
||||
</SCRIPT>
|
||||
<a href="options.php" target="changement">Options</a>
|
||||
</div>
|
||||
<div><a href="options.php" target="changement">Options</a></div>
|
||||
|
||||
<div class=blanc></div>
|
||||
|
||||
<div class=blanc>
|
||||
</div>
|
||||
<div><a href="lire_message.php" target="changement">Messages</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="messages.php"
|
||||
</SCRIPT>
|
||||
<a href="messages.php" target="changement">Messages</a>
|
||||
</div>
|
||||
<div><a href="alliance_choix.php" target="changement">Guilde</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="alliance_choix.php"
|
||||
</SCRIPT>
|
||||
<a href="alliance_choix.php" target="changement">Guilde</a>
|
||||
</div>
|
||||
<div><a href="voir_classement.php" target="changement">Classement</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="#"
|
||||
</SCRIPT>
|
||||
<a href="javascript:top.location.href=http://www.halo-battle.s-fr.com/forum/index.php">Forum</a>
|
||||
</div>
|
||||
<div><a href="javascript:top.location.href=http://www.halo-battle.s-fr.com/forum/index.php">Forum</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="rapport_bug.php"
|
||||
</SCRIPT>
|
||||
<a href="rapport_bug.php" target="changement">Rapport de bugs</a>
|
||||
</div>
|
||||
<div><a href="rapport_bug.php" target="changement">Rapport de bugs</a></div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="faq.php"
|
||||
</SCRIPT>
|
||||
<a href="faq.php" target="changement">F.A.Q.</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="logout.php"
|
||||
</SCRIPT>
|
||||
<a href="javascript:top.location.href=\'logout.php\'">Déconnexion</a>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
<SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="depart.php"
|
||||
</SCRIPT>
|
||||
<div><a href="faq.php" target="changement">F.A.Q.</a></div>
|
||||
|
||||
<div><a href="javascript:top.location.href=\'logout.php\'">Déconnexion</a></div>
|
||||
|
||||
</body>
|
||||
</html>';
|
||||
</html>';
|
||||
?>
|
||||
34
pages/message.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
require_once('../connectBDD.php');
|
||||
|
||||
$x = mysql_query("SELECT * FROM user WHERE id='$id'");
|
||||
$donnees = mysql_fetch_array($x);
|
||||
|
||||
$race = $donnees['race'];
|
||||
$pseudodes = $donnees['pseudo'];
|
||||
$temps = time();
|
||||
|
||||
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'] !='' ) {
|
||||
$message_destinataire = htmlspecialchars($_POST['message_destinataire']);
|
||||
$sujet_message = htmlspecialchars($_POST['sujet_message']);
|
||||
$message = htmlspecialchars($_POST['message']);
|
||||
mysql_query("INSERT INTO mail VALUES('', '1', '$message_destinataire', '$pseudodes', '$sujet_message', '$message', '$temps')") or die ("erreur sql ".mysql_error());
|
||||
}
|
||||
else echo "Précisez le nom du sujet";
|
||||
}
|
||||
else echo "Précisez le nom du destinataire";
|
||||
}
|
||||
else "Ce joueur n'existe pas";
|
||||
mysql_close();
|
||||
@header("Location: envoyer_message.php?ok=1");
|
||||
?>
|
||||
25
pages/ndepart.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<?php
|
||||
session_start();
|
||||
require_once('../connectBDD.php');
|
||||
|
||||
$Pid = $_POST['Pid'];
|
||||
|
||||
$id = $_SESSION['id'];
|
||||
$galaxy = $_SESSION['galaxy'];
|
||||
$ss = $_SESSION['ss'];
|
||||
$pos = $_SESSION['pos'];
|
||||
$race = $_SESSION['race'];
|
||||
|
||||
$y = mysql_query("SELECT * FROM planete WHERE id='$Pid'");
|
||||
$donnees = mysql_fetch_array($y);
|
||||
|
||||
|
||||
if ($donnees['id_user'] == $id) {
|
||||
$_SESSION['galaxy'] = $donnees['galaxie'];
|
||||
$_SESSION['ss'] = $donnees['ss'];
|
||||
$_SESSION['pos'] = $donnees['position'];
|
||||
header('Location: depart.php');
|
||||
}
|
||||
else header('Location: depart.php');
|
||||
mysql_close();
|
||||
?>
|
||||
17
pages/nom.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
session_start();
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
require('../connectBDD.php');
|
||||
|
||||
if (isset($_POST['nouveaunom']) && $_POST['nouveaunom']!='') {
|
||||
mysql_query("UPDATE planete SET nom_planete='".$_POST['nouveaunom']."' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'") or die ("erreur sql ".mysql_error());
|
||||
header("Location: depart.php");
|
||||
}
|
||||
else header("Location: depart.php");
|
||||
|
||||
mysql_close();
|
||||
?>
|
||||
30
pages/noms.php
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
<?php
|
||||
if (!isset($race)) $race = $_SESSION['race'];
|
||||
|
||||
if ($race == 'covenant') {
|
||||
$casernen = array('Grunt','Jackal','Drone','Elite','Sniper','Hunter','Médecin','Ingénieur','Brute');
|
||||
$casernea = array('grunts','jackals','drones','élites','snipers','hunters','médecins','ingénieurs','brutes');
|
||||
$batimend = array('purificateur_m','purificateur_c','ionisateur','centrale_s','centrale_fusion','oeil','recherches','chantier_terrestre','???','caserne','silo');
|
||||
$batimeni = array('purificateur_m.png','purificateur_c.png','ionisateur.png','centrale_s.JPG','centrale_fusion.jpg','oeil.png','recherches.jpg','chantier_terrestre.png','???','caserne.jpg','silo.jpg');
|
||||
$batiment = array('Purificateur de métal','Purificateur de cristal','Ionisateur','Centrale solaire','Centrale de fusion','Oeil des prophètes','Centre de recherches','Chantier terrestre','Chantier spatial','Caserne','Entrepôt');
|
||||
$technolo = array('Informatique','Detection','Armement','Bouclier','Maitrise de l\'énergie','Réacteur à antigravité','Réacteur à fusion niveau','Réacteur a fusion de type Forerunneur','Médecine','Commandement militaire','Sous-espace','Spartan');
|
||||
$nomvaisn = array('Transporteur','Grand transporteur','Vaisseau de colonisation','Sonde d\'espionnage','Recycleur','Seraph','Frégate','Croiseur de classe CCS','Croiseur de classe Reverence','Porte vaisseaux','Station orbitale covenant');
|
||||
$nomvaisa = array('transporteurs','grands transporteurs','vaisseaux de colo','sondes','recycleurs','seraphs','frégates','croiseurs de classe CCS','croiseurs de classe Reverence','porte vaisseaux','stations orbitale');
|
||||
$nomterra = array('banshees','spirits','phantom','boarding craft','ghosts','shadow','spectres','appartitions','shade','strong shade','tourelles à barreau de combustible','tourelles à plasma','lanceurs de torpilles plasma');
|
||||
$nomterrn = array('Banshees','Spirit','Phantom','Boarding craft','Ghost','Shadow','Spectre','Appartition','Shade','Strong shade','Tourelle à barreau de combustible','Tourelle à plasma','Lanceur de torpilles plasma');
|
||||
}
|
||||
else {
|
||||
$casernen = array('Marine','Fusiller','Grenadier','T.C.A.O.','Sniper','Spartan','Médecin','Ingénieur','Soldat exo squellette');
|
||||
$casernea = array('marines','fusillers','grenadiers','T.C.A.O.','snipers','spartans','médecins','ingénieurs','soldats exo squellette');
|
||||
$batiment = array('Usine de métallurgie','Usine de cristal','Synchronisateur d\'hydrogène','Centrale solaire','Centrale énergétique','Base radar','Centre de recherches','Chantier terrestre','Chantier spatial','Ecole militaire','Silo de stockage');
|
||||
$batimend = array('mine_m','mine_c','!!','centrale_s','centrale_f','radar','recherches','chantier_terrestre','???','ecole_militaire','silo');
|
||||
$batimeni = array('mine_m.png','mine_c.png','!!','centrale_s.JPG','centrale_f.png','radar.jpg','recherches.jpg','chantier_terrestre.jpg','???','ecole_militaire.jpg','silo.jpg');
|
||||
$technolo = array('IA','Radar','Armement','Blindage','Maitrise de l\'énergie','Réacteur à combustion','Réacteur à fusion niveau','Réacteur a fusion de type II','Médecine','Tactiques de combats','Développement','Spartan');
|
||||
$nomvaisn = array('Cargos de classe Parabola','Cargos de classe Laden','Vaisseaux de colonisation de classe Odyssey','Drones d’espionnage de classe Clarion','Recycleurs de classe Minotaur','C709 Longsword Interceptor','Croiseurs de classe Halcyon','Croiseurs de classe Marathon','Porte vaisseaux','Station orbitale');
|
||||
$nomvaisa = array('cargos de classe Parabola','cargos de classe Laden','vaisseaux de colonisation de classe Odyssey','drones d\'espionnage de classe Clarion','recycleurs de classe Minotaur','C709 Longsword Interceptor','croiseurs de classe Halcyon','croiseurs de classe Marathon','porte vaisseaux','stations orbitale');
|
||||
$nomvaisi = array('cargosParabola','cargosLaden','vcolo','sonde','recycleurMinotaur','C709','croiseurHalcyon','croiseurMarathon','portevaisseaux','stationorbitale');
|
||||
$nomterra = array('sparrowhawk','077-TC Pelican','C703 Shortsword Bomber','SHD Albatros','M12 LRV Warthogs','M12G1 LAAV Warthogs','M12A1 LAAV Warthogs','M808B Scorpions MBT','mitrailleuses automatique M247 GP','canons Gauss','DCA légères','DCA lourdes','lanceurs de missiles');
|
||||
$nomterrn = array('Sparrowhawk','077-TC Pelican','C703 Shortsword Bomber','SHD Albatros','M12 LRV Warthogs','M12G1 LAAV Warthogs','M12A1 LAAV Warthogs','M808B Scorpions MBT','Mitrailleuse automatique M247 GP','Canon Gauss','DCA légère','DCA lourde','Lanceur de missiles');
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
<?
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
|
|
@ -45,4 +45,5 @@ echo"</head>
|
|||
</table>
|
||||
|
||||
</body>
|
||||
</html>"; ?>
|
||||
</html>";
|
||||
?>
|
||||
|
|
@ -1,9 +1,8 @@
|
|||
<?
|
||||
session_start();
|
||||
<?php
|
||||
session_start();
|
||||
|
||||
$id = $_SESSION['id'];
|
||||
mysql_connect("localhost", "root", "");
|
||||
mysql_select_db("leon0");
|
||||
require('../connectBDD.php');
|
||||
$x = mysql_query("SELECT * FROM user WHERE id='".$id."'");
|
||||
$donnees = mysql_fetch_array($x);
|
||||
|
||||
|
|
@ -15,14 +14,14 @@ $mdp = $donnees['mdp'];
|
|||
if (isset($_POST['nouveau_pseudo']) && $_POST['nouveau_pseudo']!='') {
|
||||
|
||||
$result = mysql_query("SELECT pseudo FROM user WHERE pseudo='".$_POST['nouveau_pseudo']."'");
|
||||
if(mysql_num_rows($result)>=1)
|
||||
if(mysql_num_rows($result)>=1)
|
||||
{
|
||||
echo "Ce pseudo est déja utilisé<br><br><br>";
|
||||
echo "Ce pseudo est déja utilisé<br><br><br>";
|
||||
}
|
||||
else {
|
||||
$pseudo=htmlspecialchars($_POST['nouveau_pseudo']);
|
||||
mysql_query("UPDATE `user` SET pseudo='".$pseudo."' WHERE ID='".$id."'");
|
||||
}
|
||||
mysql_query("UPDATE `user` SET pseudo='".$pseudo."' WHERE ID='".$id."'");
|
||||
}
|
||||
} else {}
|
||||
|
||||
if (isset($_POST['ancien_mdp']) && isset($_POST['nouveau_mdp']) && isset($_POST['nouveau_mdp2']) && $_POST['nouveau_mdp']!="" && $_POST['nouveau_mdp2']!="" && $_POST['ancien_mdp'] !='' ) {
|
||||
|
|
@ -36,18 +35,18 @@ if (isset($_POST['ancien_mdp']) && isset($_POST['nouveau_mdp']) && isset($_POST[
|
|||
else { echo "Ancien mot de passe faux"; }
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
if (isset($_POST['nouveau_mail']) && $_POST['nouveau_mail']!='')
|
||||
{
|
||||
if (preg_match("#^[a-z0-9._-]+@[a-z0-9._-]{2,}\.[a-z]{2,4}$#", $_POST['nouveau_mail']))
|
||||
{
|
||||
|
||||
|
||||
$result = mysql_query("SELECT mail FROM user WHERE mail='".$_POST["nouveau_mail"]."'");
|
||||
if(mysql_num_rows($result)>=1)
|
||||
{echo "Cette adresse mail est déja utilisé";
|
||||
if(mysql_num_rows($result)>=1)
|
||||
{echo "Cette adresse mail est déja utilisé";
|
||||
}
|
||||
else
|
||||
else
|
||||
{ $mail=htmlspecialchars($_POST['nouveau_mail']);
|
||||
mysql_query("UPDATE `user` SET mail='".$mail."' WHERE ID='".$id."'"); }
|
||||
}
|
||||
|
|
@ -57,6 +56,6 @@ if (isset($_POST['nouveau_mail']) && $_POST['nouveau_mail']!='')
|
|||
|
||||
|
||||
mysql_close();
|
||||
@header("Location:options.php");
|
||||
@header("Location:options.php");
|
||||
|
||||
?>
|
||||
|
|
@ -1,4 +1,6 @@
|
|||
<? session_start(); ?>
|
||||
<?php
|
||||
session_start();
|
||||
?>
|
||||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Halo battle</TITLE>
|
||||
|
|
@ -6,17 +8,16 @@
|
|||
<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 >
|
||||
<?
|
||||
mysql_connect("localhost", "root", "");
|
||||
mysql_select_db("wars");
|
||||
|
||||
<?php
|
||||
require('../connectBDD.php');
|
||||
|
||||
function convert_ts_fr($tstamp) {
|
||||
echo date ( 'd/m/Y H:i:s' , $tstamp ); };
|
||||
echo date ('d/m/Y H:i:s' , $tstamp );
|
||||
}
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<?
|
||||
<?php
|
||||
$retour = mysql_query("SELECT COUNT(*) AS nbre_entrees FROM bug");
|
||||
$donnees = mysql_fetch_array($retour);
|
||||
$bug = $donnees['nbre_entrees'];
|
||||
|
|
@ -25,18 +26,18 @@ $bug = $donnees['nbre_entrees'];
|
|||
if (isset($_GET['ok']) == 1) { echo "<br><talbe align=center><tr><td><font color=lime>Bug envoyé</font></td></tr></table>"; }
|
||||
|
||||
|
||||
if ( $bug > 0)
|
||||
if ( $bug > 0)
|
||||
{
|
||||
echo "<table align=center>";
|
||||
$result = mysql_query("SELECT * FROM bug");
|
||||
$result = mysql_query("SELECT * FROM bug");
|
||||
while ($data = mysql_fetch_array($result) )
|
||||
{
|
||||
|
||||
echo "<tr><td>Expéditeur : ".$data['pseudo']."</td></tr><tr><td>Le : "; convert_ts_fr($data['temps']);
|
||||
echo "<tr><td>Expéditeur : ".$data['pseudo']."</td></tr><tr><td>Le : "; convert_ts_fr($data['temps']);
|
||||
echo"</td></tr><tr><td>Page concernée : ".$data['page']."</td></tr><tr><td>Description du bug : ".$data['description']."</td></tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
}
|
||||
}
|
||||
else { echo "<br><br><table align=center><tr><td><font color=red>Aucun bug trouvé</font></td></tr></table>"; }
|
||||
|
||||
|
||||
|
|
|
|||
48
pages/rename.php
Normal file
|
|
@ -0,0 +1,48 @@
|
|||
<?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');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
<?php echo"<center>
|
||||
<table>
|
||||
<tr>
|
||||
<td colspan=3>Votre planète
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Position
|
||||
</td>
|
||||
<td>Nom
|
||||
</td>
|
||||
<td>Actions
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>".$galaxy.":".$ss.":".$pos."
|
||||
</td>
|
||||
<td>".$nomplanete."
|
||||
</td>"; if ($nb >= 2) { echo "
|
||||
<td> <form action=\"abandon_confirm.php\" method=\"post\" ><input type=\"submit\" value=\"abandonner\" class=bouton ></form>
|
||||
</td>"; } else { echo "<td></td>"; }
|
||||
echo "</tr><form action=\"nom.php\" method=\"post\">
|
||||
<tr>
|
||||
<td>Rennomer
|
||||
</td>
|
||||
<td><input type=\"text\" name=\"nouveaunom\" size=\"20\" class=zone_texte >
|
||||
</td>
|
||||
<td><input type=\"submit\" value=\"renommer\" class=bouton >
|
||||
</td>
|
||||
</tr></form>
|
||||
</table>
|
||||
</center>"; ?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,13 +1,12 @@
|
|||
<?
|
||||
<?php
|
||||
$id=$_SESSION['id'];
|
||||
$g=$_SESSION['galaxy'];
|
||||
$s=$_SESSION['ss'];
|
||||
$p=$_SESSION['pos'];
|
||||
|
||||
mysql_connect("localhost", "root", "");
|
||||
mysql_select_db("wars");
|
||||
require('../connectBDD.php');
|
||||
|
||||
$appel = mysql_query("SELECT * FROM planete WHERE id='".$id."' AND galaxy='".$g."' AND ss='".$s."'AND pos='".$p."' ");
|
||||
$appel = mysql_query("SELECT * FROM planete WHERE id_user='$id' AND galaxie='$g' AND ss='$s'AND position='$p' ");
|
||||
$ressource=mysql_fetch_array($appel);
|
||||
|
||||
$mine_m = $ressource['mine_m'];
|
||||
|
|
@ -30,76 +29,68 @@ $hydrogene = $ressource['hydrogene'];
|
|||
|
||||
//---------------Productions--------
|
||||
|
||||
if ($mine_m > 0) { $energie_m = ceil((exp($mine_m*0.28)*10)); } else { $energie_m=0;}
|
||||
if ($mine_c > 0) { $energie_c = ceil((exp($mine_c*0.28)*10)); } else { $energie_c=0;}
|
||||
if ($mine_h > 0) { $energie_h = ceil((exp($mine_h*0.31)*10)); } else { $energie_h=0;}
|
||||
if ($centrale_f > 0 ) {$energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11)))); } else { $energie_f =0;}
|
||||
if ($centrale_s > 0 ) {$energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10)))); } else { $energie_s =0;}
|
||||
if ($mine_m > 0) $energie_m = ceil((exp($mine_m*0.28)*10)); else $energie_m=0;
|
||||
if ($mine_c > 0) $energie_c = ceil((exp($mine_c*0.28)*10)); else $energie_c=0;
|
||||
if ($mine_h > 0) $energie_h = ceil((exp($mine_h*0.31)*10)); else $energie_h=0;
|
||||
if ($centrale_f > 0 ) $energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11)))); else $energie_f =0;
|
||||
if ($centrale_s > 0 ) $energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10)))); else $energie_s =0;
|
||||
$t = $energie_s + $energie_f;
|
||||
$nrj= $t + (-$energie_m-$energie_c-$energie_h);
|
||||
|
||||
$coeff = 1 + (($nrj)*($energie_s + $energie_f));
|
||||
if ( $coeff < 0 ) { $coeff = 0; }
|
||||
if ( $coeff > 1 ) { $coeff = 1; }
|
||||
if ( $coeff < 0 ) $coeff = 0;
|
||||
if ( $coeff > 1 ) $coeff = 1;
|
||||
|
||||
|
||||
if ($metal >= $cap) {
|
||||
$prod_met=0;}
|
||||
else {
|
||||
if ( $mine_m < 0) {
|
||||
$prod_met = 0.011*$temps_ecoule; }
|
||||
else {
|
||||
$prod_met = ((floor(((25*pow(1.3,$mine_m))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.011*$temps_ecoule; } }
|
||||
|
||||
|
||||
if ($cristal >= $cap) {
|
||||
$prod_cri=0;}
|
||||
else {
|
||||
if ( $mine_c < 0 ) {
|
||||
$prod_cri = 0.0055*$temps_ecoule; }
|
||||
else {
|
||||
$prod_cri = ((floor(((19*pow(1.3,$mine_c))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.0055*$temps_ecoule; } }
|
||||
|
||||
|
||||
if ($hydrogene >= $cap) {
|
||||
$prod_hy=0;}
|
||||
if ($metal >= $cap) $prod_met=0;
|
||||
else {
|
||||
if ($centrale_f > 0) {
|
||||
$conso_h = ((ceil((($centrale_f*5+(exp($centrale_f*0.3)*10))*$coeff)/0.36)/10000)*$temps_ecoule)*20; } else { $conso_h = 0;}
|
||||
if ($mine_m < 0) $prod_met = 0.011*$temps_ecoule;
|
||||
else $prod_met = (((floor(((25*pow(1.3,$mine_m))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.011*$temps_ecoule)*3;
|
||||
}
|
||||
|
||||
$prod_hy = (ceil(((13*pow(1.26,$mine_m))*$coeff)/0.36)/10000)*$temps_ecoule - $conso_h;
|
||||
if ($mine_h == 0) { $prod_hy=0;}
|
||||
if ($prod_hy < 0) { $prod_hy = 0; } }
|
||||
if ($cristal >= $cap) $prod_cri=0;
|
||||
else {
|
||||
if ( $mine_c < 0 ) $prod_cri = 0.0055*$temps_ecoule;
|
||||
else $prod_cri = (((floor(((19*pow(1.3,$mine_c))*$coeff)/0.36)))*$temps_ecoule/10000 + 0.0055*$temps_ecoule)*3;
|
||||
}
|
||||
|
||||
if ($hydrogene >= $cap) $prod_hy=0;
|
||||
else {
|
||||
if ($centrale_f > 0) $conso_h = ((ceil((($centrale_f*5+(exp($centrale_f*0.3)*10))*$coeff)/0.36)/10000)*$temps_ecoule)*20;
|
||||
else $conso_h = 0;
|
||||
|
||||
$prod_hy = ((ceil(((13*pow(1.26,$mine_m))*$coeff)/0.36)/10000)*$temps_ecoule - $conso_h)*3;
|
||||
if ($mine_h == 0) $prod_hy=0;
|
||||
if ($prod_hy < 0) $prod_hy = 0;
|
||||
}
|
||||
|
||||
|
||||
$a=$metal+$prod_met;
|
||||
$b=$cristal+$prod_cri;
|
||||
$c=$hydrogene+$prod_hy;
|
||||
|
||||
|
||||
|
||||
//---------------M.A.J--------------
|
||||
mysql_query("UPDATE planete SET timestamp='".$temps_actuel."', metal='".$a."', cristal='".$b."', hydrogene='".$c."', coeff='".$coeff."', energie='".$t."' WHERE id='".$id."' AND galaxy='".$g."' AND ss='".$s."'AND pos='".$p."'");
|
||||
mysql_query("UPDATE planete SET timestamp='$temps_actuel', metal='$a', cristal='$b', hydrogene='$c', coeff='$coeff', energie='$t' WHERE id_user='$id' AND galaxie='$g' AND ss='$s'AND position='$p'");
|
||||
|
||||
$pseudo = $ressource['pseudo'];
|
||||
|
||||
$planetes = mysql_query("SELECT COUNT(*) AS nb FROM planete WHERE pseudo='".$pseudo."'");
|
||||
$planetes = mysql_query("SELECT COUNT(*) AS nb FROM planete WHERE id_user='$id'");
|
||||
$nbre = mysql_fetch_assoc($planetes);
|
||||
$pla = $nbre['nb'];
|
||||
|
||||
echo "<center>
|
||||
<table id=ressource>
|
||||
<tr>"; if ($pla > 0 ) {
|
||||
echo "<td rowspan=2 class=xyz><img src=descriptions/diz/planete/".$image.".jpg height=50 width=50></td>
|
||||
<td rowspan=2 class=xyz>
|
||||
<form action='change_planete.php'>
|
||||
<select size=1 onSubmit='parent.frames[changement].window.location=depart.php' name=planete>";
|
||||
echo '<center>
|
||||
<table id="ressource">
|
||||
<tr>'; if ($pla > 0 ) {
|
||||
echo '<td rowspan="2" class="xyz"><img src="descriptions/diz/planete/'.$image.'.jpg" height="50" width="50"></td>
|
||||
<td rowspan="2" class="xyz">
|
||||
<form action="ndepart.php" method="post" id="change_planete">
|
||||
<select size="1" onchange="document.getElementById(\'change_planete\').submit();" onSubmit="parent.frames[changement].window.location=depart.php" name="Pid">';
|
||||
for ($i=0; $i < $pla; $i++) {
|
||||
|
||||
$x = mysql_query("SELECT nb, galaxy, ss, pos, nomplanete FROM planete WHERE pseudo='".$pseudo."' ORDER BY nb LIMIT $i,8");
|
||||
$x = mysql_query("SELECT id, galaxie, ss, position, nom_planete FROM planete WHERE id_user='$id' ORDER BY id LIMIT $i,8");
|
||||
$d = mysql_fetch_array($x);
|
||||
|
||||
echo "<option value=".$d['nb']; if ($d['nb']==$nb_colo) { echo "selected=selected"; } echo ">".$d['nomplanete']." [".$d['galaxy'].":".$d['ss'].":".$d['pos']."]</option>"; }
|
||||
echo "<option value=".$d['id']; if ($d['galaxie'] == $_SESSION['galaxy'] && $d['ss'] == $_SESSION['ss'] && $d['position'] == $_SESSION['pos']) echo ' selected'; echo ">".$d['nom_planete']." [".$d['galaxie'].":".$d['ss'].":".$d['position']."]</option>"; }
|
||||
echo "</select></form></td>"; }
|
||||
|
||||
echo "<td class=xyz>Métal</td><td class=xyz>Cristal</td><td class=xyz>Hydrogène</td><td class=xyz>Energie</td></tr>
|
||||
|
|
@ -108,6 +99,4 @@ echo "<td class=xyz>M
|
|||
</center>";
|
||||
|
||||
mysql_close();
|
||||
?>
|
||||
|
||||
|
||||
?>
|
||||
137
pages/ressources.php
Normal file
|
|
@ -0,0 +1,137 @@
|
|||
<?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_once('noms.php');
|
||||
|
||||
$cap = (pow(2,$silo)*100000);
|
||||
|
||||
$prod_metal = (ceil((($mine_m*40+(exp($mine_m*0.33)*10))*$coeff)))*3;
|
||||
|
||||
$prod_cristal = (ceil((($mine_c*20+(exp($mine_c*0.325)*10))*$coeff)))*3;
|
||||
|
||||
if ($centrale_f > 0) $conso_hy = ceil(($centrale_f*5+(exp($mine_m*0.3)*10))*$coeff); else $conso_hy=0;
|
||||
if ($mine_h >0 ) $prod_hydrogene = (ceil(($mine_h*12+(exp($mine_h*0.32)*10))*$coeff))*3; else $prod_hydrogene=0;
|
||||
if ($mine_h == 0) $w=0;
|
||||
if (($prod_hydrogene-$conso_hy) < 0) $w= 0;
|
||||
|
||||
if ($mine_m > 0) $energie_m = ceil((exp($mine_m*0.28)*10))*$coeff; else $energie_m=0;
|
||||
if ($mine_c > 0) $energie_c = ceil((exp($mine_c*0.28)*10))*$coeff; else $energie_c=0;
|
||||
if ($mine_h > 0) $energie_h = ceil((exp($mine_h*0.31)*10))*$coeff; else $energie_h=0;
|
||||
if ($centrale_s > 0) $energie_s = ceil((($centrale_s*20+(exp($centrale_s*0.3)*10))*$coeff)); else $energie_s =0;
|
||||
if ($centrale_f > 0) $energie_f = ceil((($centrale_f*80+(exp($centrale_f*0.38)*11))*$coeff)); else $energie_f =0;
|
||||
$w = $prod_hydrogene - $conso_hy;
|
||||
$u= ($energie_s+$energie_f) - ($energie_m+$energie_c+$energie_h);
|
||||
|
||||
echo"<style TYPE=text/css>
|
||||
TH {
|
||||
background-color: #00024A;
|
||||
border: 1px solid #02058A;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>";
|
||||
|
||||
|
||||
echo "<center>
|
||||
<table>
|
||||
<tbody><tr>
|
||||
<td>
|
||||
Facteur de production : "; if ($coeff < 1) echo "<font color=red>".$coeff."</font>"; else echo $coeff;
|
||||
|
||||
echo"<form action=resource2.php method=post>
|
||||
<table width=550>
|
||||
<tbody><tr>
|
||||
<td colspan=6 align=left>
|
||||
Production sur ".$nom_planete."
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th colspan=2>
|
||||
</th>
|
||||
<th>
|
||||
Métal
|
||||
</th>
|
||||
<th>
|
||||
Cristal
|
||||
</th>
|
||||
<th>
|
||||
Hydrogène
|
||||
</th>
|
||||
<th>
|
||||
Energie
|
||||
</th>
|
||||
</tr>
|
||||
<tr>";
|
||||
|
||||
echo "<tr><th colspan=2>".$batiment[0]." (".$mine_m.")</th>";
|
||||
echo "<th><font color=lime>".$prod_metal."</font></th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><font color=red>".-$energie_m."</font></th></tr>";
|
||||
|
||||
|
||||
echo "<tr><th colspan=2>".$batiment[1]." (".$mine_c.")</th>";
|
||||
echo "<th> </th>
|
||||
<th><font color=lime>".$prod_cristal."</font></th>
|
||||
<th> </th>
|
||||
<th><font color=red>".-$energie_c."</font></th></tr>
|
||||
</tr>";
|
||||
|
||||
if ($mine_h > 0) {
|
||||
echo "<tr><th colspan=2>".$batiment[2]." (".$mine_h.")</th>";
|
||||
echo "<th> </th>
|
||||
<th> </th>
|
||||
<th><font color=lime>".$prod_hydrogene."</font></th>
|
||||
<th><font color=red>".-$energie_h."</th></font></tr>
|
||||
</tr></tr>";
|
||||
}
|
||||
|
||||
if ($centrale_s > 0) {
|
||||
echo "<tr>
|
||||
<th colspan=2>".$batiment[3]." (".$centrale_s.")</th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><font color=lime>".$energie_s."</font></th></tr>
|
||||
</tr>"; }
|
||||
|
||||
if ($centrale_f > 0) {
|
||||
echo "<tr>
|
||||
<th colspan=2>".$batiment[4]." (".$centrale_f.")</th>
|
||||
<th> </th>
|
||||
<th> </th>
|
||||
<th><font color=red>".-$conso_hy."</font></th>
|
||||
<th><font color=lime>".$energie_f."</font></th></tr>
|
||||
</tr>"; }
|
||||
|
||||
|
||||
echo "<tr>
|
||||
</tr><tr>
|
||||
<th colspan=2>Capacité des dépôts</th>
|
||||
<td><font color=lime>".$cap."</font></td>
|
||||
<td><font color=lime>".$cap."</font></td>
|
||||
<td><font color=lime>".$cap."</font></td>
|
||||
<td><font color=lime>-</font></td></tr>
|
||||
|
||||
|
||||
<tr>
|
||||
<th colspan=2>Total</th>
|
||||
<td><font color=lime>".$prod_metal."</font></td>
|
||||
<td><font color=lime>".$prod_cristal."</font></td>
|
||||
<td><font color=lime>".$w."</font></td>
|
||||
<td><font color=lime>".$u."</font></td></tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</form>
|
||||
</center>"; ?>
|
||||
</body>
|
||||
</html>
|
||||
25
pages/suppr_msg.php
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Halo</title>
|
||||
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
|
||||
<?php
|
||||
require('../connectBDD.php');
|
||||
?>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php if (isset($_POST['msg_sup']) && $_POST['msg_sup'] != '') {
|
||||
|
||||
mysql_query("DELETE FROM mail WHERE id='{$_POST['msg_sup']}'");
|
||||
@header("Location: lire_message.php");
|
||||
?><SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="lire_message.php"
|
||||
</SCRIPT><?php
|
||||
}
|
||||
else { @header("Location: lire_message.php");
|
||||
?><SCRIPT language="javascript">
|
||||
parent.frames["changement"].window.location="lire_message.php"
|
||||
</SCRIPT><?php }
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -3,6 +3,9 @@ function reste(zetime) {
|
|||
var heures = Math.floor(zetime / 3600);
|
||||
var minutes = Math.floor(((zetime / 3600) - Math.floor(zetime / 3600)) * 60);
|
||||
var secondes = 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("axion").innerHTML = heures + ":" + minutes + ":" + secondes;
|
||||
var restant = zetime - 1;
|
||||
setTimeout("reste(" + restant + ")", 1000);
|
||||
|
|
|
|||
|
|
@ -1,28 +1,24 @@
|
|||
<?
|
||||
session_start();
|
||||
|
||||
<?php
|
||||
session_start();
|
||||
$id = $_SESSION['id'];
|
||||
mysql_connect("localhost", "root", "");
|
||||
mysql_select_db("wars");
|
||||
require('../connectBDD.php');
|
||||
|
||||
$x = mysql_query("SELECT pseudo FROM user WHERE id='".$id."'");
|
||||
$donnees = mysql_fetch_array($x);
|
||||
|
||||
$pseudo = $donnees['pseudo'];
|
||||
|
||||
if (isset($_POST['description']) && $_POST['description'] !='' ) {
|
||||
if (isset($_POST['page']) && $_POST['page'] !='' ) {
|
||||
|
||||
$temps = time();
|
||||
|
||||
mysql_query("INSERT INTO bug VALUES('', '$pseudo', '$temps', '".htmlspecialchars($_POST['page'])."', '".htmlspecialchars($_POST['description'])."')");
|
||||
mysql_close();
|
||||
@header("Location: rapport_bug.php?ok=1");
|
||||
if (isset($_POST['page']) && $_POST['page'] !='' ) {
|
||||
$temps = time();
|
||||
mysql_query("INSERT INTO bug VALUES('', '$pseudo', '$temps', '".htmlspecialchars($_POST['page'])."', '".nl2br(htmlspecialchars($_POST['description']))."')");
|
||||
mysql_close();
|
||||
@header("Location: rapport_bug.php?ok=1");
|
||||
}
|
||||
else echo "Précisez la page concernée";
|
||||
}
|
||||
else { echo "Précisez la page concernée"; }
|
||||
}
|
||||
else { echo "La description n'est pas valide"; }
|
||||
else echo "La description n'est pas valide";
|
||||
|
||||
mysql_close();
|
||||
@header("Location: rapport_bug.php");
|
||||
|
||||
@header("Location: rapport_bug.php");
|
||||
?>
|
||||
113
pages/validation_def.php
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_POST['cons_def_1']) || isset($_POST['cons_def_2']) || isset($_POST['cons_def_3']) || isset($_POST['cons_def_4']) || isset($_POST['cons_def_5'])) {
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
$race=$_SESSION['race'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
$sa=0;
|
||||
if (isset($_POST['cons_def_1'])) $sa = floor($_POST['cons_def_1']);
|
||||
if (isset($_POST['cons_def_2'])) $sa = floor($_POST['cons_def_2']);
|
||||
if (isset($_POST['cons_def_3'])) $sa = floor($_POST['cons_def_3']);
|
||||
if (isset($_POST['cons_def_4'])) $sa = floor($_POST['cons_def_4']);
|
||||
if (isset($_POST['cons_def_5'])) $sa = floor($_POST['cons_def_5']);
|
||||
if ($sa < 0) $sa=0;
|
||||
|
||||
if (isset($_POST['cons_def_1']) && $sa > 0) {
|
||||
if ($metal - ($sa*500) >= 0) {
|
||||
if ($cristal - ($sa*200) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(480/pow(1.25,$chantier_terrestre));
|
||||
$unit = 9;
|
||||
$metal -= ($sa*500);
|
||||
$cristal -= ($sa*200);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
|
||||
header("Location: defense.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_def_2']) && $sa > 0) {
|
||||
if ($metal - ($sa*4000) >= 0) {
|
||||
if ($cristal - ($sa*2000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1560/pow(1.25,$chantier_terrestre));
|
||||
$unit = 10;
|
||||
$metal -= ($sa*4000);
|
||||
$cristal -= ($sa*2000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: defense.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_def_3']) && $sa > 0) {
|
||||
if ($metal - ($sa*4500) >= 0) {
|
||||
if ($cristal - ($sa*8000) >= 0) {
|
||||
if($hydrogene - ($sa*600) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1800/pow(1.25,$chantier_terrestre));
|
||||
$unit = 11;
|
||||
$metal -= ($sa*4500);
|
||||
$cristal -= ($sa*8000);
|
||||
$hydrogene -= ($sa*600);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: defense.php");
|
||||
}
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_def_4']) && $sa > 0) {
|
||||
if ($metal - ($sa*12000) >= 0) {
|
||||
if ($cristal - ($sa*10000) >= 0) {
|
||||
if($hydrogene - ($sa*1000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(6720/pow(1.25,$chantier_terrestre));
|
||||
$unit = 12;
|
||||
$metal -= ($sa*12000);
|
||||
$cristal -= ($sa*10000);
|
||||
$hydrogene -= ($sa*1000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: defense.php");
|
||||
}
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_def_5']) && $sa > 0) {
|
||||
if ($metal - ($sa*15000) >= 0) {
|
||||
if ($cristal - ($sa*9500) >= 0) {
|
||||
if($hydrogene - ($sa*1500) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(12960/pow(1.25,$chantier_terrestre));
|
||||
$unit = 13;
|
||||
$metal -= ($sa*15000);
|
||||
$cristal -= ($sa*9500);
|
||||
$hydrogene -= ($sa*1500);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: defense.php");
|
||||
}
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
else header("Location: defense.php");
|
||||
}
|
||||
mysql_close();
|
||||
?>
|
||||
162
pages/validation_soldat.php
Normal file
|
|
@ -0,0 +1,162 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_POST['cons_soldat1']) || isset($_POST['cons_soldat2']) || isset($_POST['cons_soldat3']) || isset($_POST['cons_soldat4']) || isset($_POST['cons_sniper']) || isset($_POST['cons_spartan']) || isset($_POST['cons_medecin']) || isset($_POST['cons_ingenieur']) || isset($_POST['cons_soldat_lourd'])) {
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
|
||||
$sa=0;
|
||||
if (isset($_POST['cons_soldat1'])) $sa = floor($_POST['cons_soldat1']);
|
||||
if (isset($_POST['cons_soldat2'])) $sa = floor($_POST['cons_soldat2']);
|
||||
if (isset($_POST['cons_soldat3'])) $sa = floor($_POST['cons_soldat3']);
|
||||
if (isset($_POST['cons_soldat4'])) $sa = floor($_POST['cons_soldat4']);
|
||||
if (isset($_POST['cons_sniper'])) $sa = floor($_POST['cons_sniper']);
|
||||
if (isset($_POST['cons_spartan'])) $sa = floor($_POST['cons_spartan']);
|
||||
if (isset($_POST['cons_medecin'])) $sa = floor($_POST['cons_medecin']);
|
||||
if (isset($_POST['cons_ingenieur'])) $sa = floor($_POST['cons_ingenieur']);
|
||||
if (isset($_POST['cons_soldat_lourd'])) $sa = floor($_POST['cons_soldat_lourd']);
|
||||
|
||||
if ($sa < 0) $sa=0;
|
||||
if (isset($_POST['cons_soldat1']) && $sa > 0) {
|
||||
if ($metal - ($sa*80) >= 0) {
|
||||
if ($cristal - ($sa*45) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(60/pow(1.25,$caserne));
|
||||
$unit = 1;
|
||||
$metal -= ($sa*80);
|
||||
$cristal -= ($sa*45);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'") or die ("erreur sql ".mysql_error());
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_soldat2']) && $sa > 0) {
|
||||
if ($metal - ($sa*110) >= 0) {
|
||||
if ($cristal - ($sa*90) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(240/pow(1.25,$caserne));
|
||||
$unit = 2;
|
||||
$metal -= ($sa*110);
|
||||
$cristal -= ($sa*90);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_soldat3']) && $sa > 0) {
|
||||
if ($metal - ($sa*150) >= 0) {
|
||||
if ($cristal - ($sa*105) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(240/pow(1.25,$caserne));
|
||||
$unit = 3;
|
||||
$metal -= ($sa*150);
|
||||
$cristal -= ($sa*105);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_soldat4']) && $sa > 0) {
|
||||
if ($metal - ($sa*220) >= 0) {
|
||||
if ($cristal - ($sa*150) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(720/pow(1.25,$caserne));
|
||||
$unit = 4;
|
||||
$metal -= ($sa*220);
|
||||
$cristal -= ($sa*150);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_sniper']) && $sa > 0) {
|
||||
if ($metal - ($sa*180) >= 0) {
|
||||
if ($cristal - ($sa*100) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(300/pow(1.25,$caserne));
|
||||
$unit = 5;
|
||||
$metal -= ($sa*180);
|
||||
$cristal -= ($sa*100);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_spartan']) && $sa > 0) {
|
||||
if ($metal - ($sa*25000) >= 0) {
|
||||
if ($cristal - ($sa*10000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(29700/pow(1.25,$caserne));
|
||||
$unit = 6;
|
||||
$metal -= ($sa*25000);
|
||||
$cristal -= ($sa*10000);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_medecin']) && $sa > 0) {
|
||||
if ($metal - ($sa*100) >= 0) {
|
||||
if ($cristal - ($sa*100) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(90/pow(1.25,$caserne));
|
||||
$unit = 7;
|
||||
$metal -= ($sa*100);
|
||||
$cristal -= ($sa*100);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_ingenieur']) && $sa > 0) {
|
||||
if ($metal - ($sa*90) >= 0) {
|
||||
if ($cristal - ($sa*105) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(90/pow(1.25,$caserne));
|
||||
$unit = 8;
|
||||
$metal -= ($sa*90);
|
||||
$cristal -= ($sa*105);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_soldat_lourd']) && $sa > 0) {
|
||||
if ($metal - ($sa*300) >= 0) {
|
||||
if ($cristal - ($sa*250) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(900/pow(1.25,$caserne));
|
||||
$unit = 9;
|
||||
$metal -= ($sa*300);
|
||||
$cristal -= ($sa*250);
|
||||
|
||||
mysql_query("UPDATE planete SET cas_contruct_nb='$sa', cas_contruct='$unit', cas_contruct_time='$temps_caserne', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND position='$pos' AND ss='$ss'");
|
||||
header("Location: caserne.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
else header("Location: caserne.php");
|
||||
mysql_close();
|
||||
}
|
||||
154
pages/validation_terrestre.php
Normal file
|
|
@ -0,0 +1,154 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_POST['cons_vaisseau_att']) || isset($_POST['cons_vaisseau_1']) || isset($_POST['cons_vaisseau_2']) || isset($_POST['cons_vaisseau_3']) || isset($_POST['cons_vcl_1']) || isset($_POST['cons_vcl_2']) || isset($_POST['cons_vcl_3']) || isset($_POST['cons_vcl_4'])) {
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
$race=$_SESSION['race'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
|
||||
$sa=0;
|
||||
if (isset($_POST['cons_vaisseau_att'])) $sa = floor($_POST['cons_vaisseau_att']);
|
||||
if (isset($_POST['cons_vaisseau_1'])) $sa = floor($_POST['cons_vaisseau_1']);
|
||||
if (isset($_POST['cons_vaisseau_2'])) $sa = floor($_POST['cons_vaisseau_2']);
|
||||
if (isset($_POST['cons_vaisseau_3'])) $sa = floor($_POST['cons_vaisseau_3']);
|
||||
if (isset($_POST['cons_vcl_1'])) $sa = floor($_POST['cons_vcl_1']);
|
||||
if (isset($_POST['cons_vcl_2'])) $sa = floor($_POST['cons_vcl_2']);
|
||||
if (isset($_POST['cons_vcl_3'])) $sa = floor($_POST['cons_vcl_3']);
|
||||
if (isset($_POST['cons_vcl_4'])) $sa = floor($_POST['cons_vcl_4']);
|
||||
|
||||
if ($sa < 0) $sa=0;
|
||||
if (isset($_POST['cons_vaisseau_att']) && $sa > 0) {
|
||||
if ($metal - ($sa*500) >= 0) {
|
||||
if ($cristal - ($sa*300) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(720/pow(1.25,$chantier_terrestre));
|
||||
$unit = 1;
|
||||
$metal -= ($sa*500);
|
||||
$cristal -= ($sa*300);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vaisseau_1']) && $sa > 0) {
|
||||
if ($metal - ($sa*680) >= 0) {
|
||||
if ($cristal - ($sa*420) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(2040/pow(1.25,$chantier_terrestre));
|
||||
$unit = 2;
|
||||
$metal -= ($sa*680);
|
||||
$cristal -= ($sa*420);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vaisseau_2']) && $sa > 0) {
|
||||
if ($metal - ($sa*1000) >= 0) {
|
||||
if ($cristal - ($sa*600) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(2700/pow(1.25,$chantier_terrestre));
|
||||
$unit = 3;
|
||||
$metal -= ($sa*1000);
|
||||
$cristal -= ($sa*600);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vaisseau_3']) && $sa > 0) {
|
||||
if ($metal - ($sa*1400) >= 0) {
|
||||
if ($cristal - ($sa*950) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(3960/pow(1.25,$chantier_terrestre));
|
||||
$unit = 4;
|
||||
$metal -= ($sa*1400);
|
||||
$cristal -= ($sa*950);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vcl_1']) && $sa > 0) {
|
||||
if ($metal - ($sa*400) >= 0) {
|
||||
if ($cristal - ($sa*240) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(600/pow(1.25,$chantier_terrestre));
|
||||
$unit = 5;
|
||||
$metal -= ($sa*400);
|
||||
$cristal -= ($sa*240);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vcl_2']) && $sa > 0) {
|
||||
if ($metal - ($sa*480) >= 0) {
|
||||
if ($cristal - ($sa*260) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,$chantier_terrestre));
|
||||
$unit = 6;
|
||||
$metal -= ($sa*480);
|
||||
$cristal -= ($sa*260);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vcl_3']) && $sa > 0) {
|
||||
if ($metal - ($sa*600) >= 0) {
|
||||
if ($cristal - ($sa*420) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(2160/pow(1.25,$chantier_terrestre));
|
||||
$unit = 7;
|
||||
$metal -= ($sa*600);
|
||||
$cristal -= ($sa*420);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vcl_4']) && $sa > 0) {
|
||||
if ($metal - ($sa*1000) >= 0) {
|
||||
if ($cristal - ($sa*500) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,$chantier_terrestre));
|
||||
$unit = 8;
|
||||
$metal -= ($sa*1000);
|
||||
$cristal -= ($sa*500);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_t='$unit', temps_t='$temps_caserne', metal='$metal', cristal='$cristal', hydrogene='$hydrogene', cons_terrestre='$sa' WHERE galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
header("Location: chantier_terrestre.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
else header("Location: chantier_terrestre.php");
|
||||
}
|
||||
mysql_close();
|
||||
?>
|
||||
216
pages/validation_vaisseaux.php
Normal file
|
|
@ -0,0 +1,216 @@
|
|||
<?php
|
||||
session_start();
|
||||
|
||||
if (isset($_POST['cons_sto']) || isset($_POST['cons_sonde']) || isset($_POST['cons_vcolo']) || isset($_POST['cons_transporteur']) || isset($_POST['cons_gtransporteur']) || isset($_POST['cons_chasseur']) || isset($_POST['cons_fregate']) || isset($_POST['cons_croiseur2']) || isset($_POST['cons_croiseur'])) {
|
||||
$id=$_SESSION['id'];
|
||||
$galaxy=$_SESSION['galaxy'];
|
||||
$ss=$_SESSION['ss'];
|
||||
$pos=$_SESSION['pos'];
|
||||
$race=$_SESSION['race'];
|
||||
|
||||
require_once('bdd.php');
|
||||
require('../connectBDD.php');
|
||||
|
||||
$sa=0;
|
||||
if (isset($_POST['cons_transporteur'])) $sa = floor($_POST['cons_transporteur']);
|
||||
if (isset($_POST['cons_vcolo'])) $sa = floor($_POST['cons_vcolo']);
|
||||
if (isset($_POST['cons_sonde'])) $sa = floor($_POST['cons_sonde']);
|
||||
if (isset($_POST['cons_chasseur'])) $sa = floor($_POST['cons_chasseur']);
|
||||
if (isset($_POST['cons_croiseur'])) $sa = floor($_POST['cons_croiseur']);
|
||||
if (isset($_POST['cons_croiseur2'])) $sa = floor($_POST['cons_croiseur2']);
|
||||
if (isset($_POST['cons_fregate'])) $sa = floor($_POST['cons_fregate']);
|
||||
if (isset($_POST['cons_gtransporteur'])) $sa = floor($_POST['cons_gtransporteur']);
|
||||
if (isset($_POST['cons_sto'])) $sa = floor($_POST['cons_sto']);
|
||||
|
||||
if ($sa < 0) $sa=0;
|
||||
if (isset($_POST['cons_transporteur']) && $sa != 0) {
|
||||
if ($metal - ($sa*1000) >= 0) {
|
||||
if ($cristal - ($sa*800) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1080/pow(1.25,$chantier_spatial));
|
||||
$unit = 1;
|
||||
$metal -= ($sa*1000);
|
||||
$cristal -= ($sa*800);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_close();
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
|
||||
if ($metal - ($sa*4000) >= 0) {
|
||||
if ($cristal - ($sa*3000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(6300/pow(1.25,$chantier_spatial));
|
||||
$unit = 2;
|
||||
$metal -= ($sa*4000);
|
||||
$cristal -= ($sa*3000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_close();
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_vcolo']) && $sa != 0) {
|
||||
if ($metal - ($sa*9000) >= 0) {
|
||||
if ($cristal - ($sa*9000) >= 0) {
|
||||
if($hydrogene - ($sa*1000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(8280/pow(1.25,$chantier_spatial));
|
||||
$unit = 3;
|
||||
$metal -= ($sa*9000);
|
||||
$cristal -= ($sa*9000);
|
||||
$hydrogene -= ($sa*1000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_gtransporteur']) && $sa != 0) {
|
||||
if ($metal - ($sa*15000) >= 0) {
|
||||
if ($cristal - ($sa*9000) >= 0) {
|
||||
if($hydrogene - ($sa*1000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(7380/pow(1.25,$chantier_spatial));
|
||||
$unit = 5;
|
||||
$metal -= ($sa*15000);
|
||||
$cristal -= ($sa*9000);
|
||||
$hydrogene -= ($sa*1000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_chasseur']) && $sa != 0) {
|
||||
if ($metal - ($sa*1700) >= 0) {
|
||||
if ($cristal - ($sa*1220) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1200/pow(1.25,$chantier_spatial));
|
||||
$unit = 6;
|
||||
$metal -= ($sa*1700);
|
||||
$cristal -= ($sa*1220);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_fregate']) && $sa != 0) {
|
||||
if ($metal - ($sa*5800) >= 0) {
|
||||
if ($cristal - ($sa*1400) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(4680/pow(1.25,$chantier_spatial));
|
||||
$unit = 7;
|
||||
$metal -= ($sa*5800);
|
||||
$cristal -= ($sa*1400);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'") or die ("erreur sql ".mysql_error());
|
||||
mysql_close();
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_croiseur']) && $sa != 0) {
|
||||
if ($metal - ($sa*20000) >= 0) {
|
||||
if ($cristal - ($sa*16000) >= 0) {
|
||||
if($hydrogene - ($sa*1600) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(16800/pow(1.25,$chantier_spatial));
|
||||
$unit = 8;
|
||||
$metal -= ($sa*20000);
|
||||
$cristal -= ($sa*16000);
|
||||
$hydrogene -= ($sa*1600);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_croiseur2']) && $sa != 0) {
|
||||
if ($metal - ($sa*26000) >= 0) {
|
||||
if ($cristal - ($sa*16400) >= 0) {
|
||||
if($hydrogene - ($sa*1600) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(18060/pow(1.25,$chantier_spatial));
|
||||
$unit = 9;
|
||||
$metal -= ($sa*26000);
|
||||
$cristal -= ($sa*16400);
|
||||
$hydrogene -= ($sa*1600);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_sonde']) && $sa != 0) {
|
||||
if ($metal - ($sa*1000) >= 0) {
|
||||
if ($cristal - ($sa*1200) >= 0) {
|
||||
if($hydrogene - ($sa*100) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(1440/pow(1.25,$chantier_spatial));
|
||||
$unit = 4;
|
||||
$metal -= ($sa*1000);
|
||||
$cristal -= ($sa*1200);
|
||||
$hydrogene -= ($sa*100);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
elseif (isset($_POST['cons_sto']) && $sa != 0) {
|
||||
if ($metal - ($sa*500000) >= 0) {
|
||||
if ($cristal - ($sa*400000) >= 0) {
|
||||
if($hydrogene - ($sa*250000) >= 0) {
|
||||
$temps_caserne = time() + $sa*ceil(117000/pow(1.25,$chantier_spatial));
|
||||
$unit = 11;
|
||||
$metal -= ($sa*500000);
|
||||
$cristal -= ($sa*400000);
|
||||
$hydrogene -= ($sa*250000);
|
||||
|
||||
mysql_query("UPDATE planete SET unit_s='$unit', metal='$metal', cristal='$cristal', hydrogene='$hydrogene' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
mysql_query("UPDATE planete SET cons_spatial='$sa', temps_spatial='$temps_caserne' WHERE id_user='$id' AND galaxie='$galaxy' AND ss='$ss' AND position='$pos'");
|
||||
@header("Location: chantier_spatial.php");
|
||||
}
|
||||
else echo "Pas assez d'hydrogène !";
|
||||
}
|
||||
else echo "Pas assez de cristal !";
|
||||
}
|
||||
else echo "Pas assez de métal !";
|
||||
}
|
||||
else @header("Location: chantier_spatial.php");
|
||||
mysql_close();
|
||||
}
|
||||
?>
|
||||
65
pages/version.php
Normal file
|
|
@ -0,0 +1,65 @@
|
|||
<HTML>
|
||||
<HEAD>
|
||||
<TITLE>Halo Battle</TITLE>
|
||||
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
|
||||
<link rel="stylesheet" media="screen" name="design" href="descriptions/diz/base.css">
|
||||
<style type='text/css'>
|
||||
table {
|
||||
margin-top: 40px;
|
||||
}
|
||||
|
||||
TD.z {
|
||||
background-color: black;
|
||||
border: 1px solid #7093DB;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
TH {
|
||||
border: 1px solid
|
||||
}
|
||||
|
||||
div {
|
||||
margin: 0px;
|
||||
border: 0px;
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
</head>
|
||||
|
||||
</html>
|
||||
<table width="530" align=center>
|
||||
<tbody>
|
||||
|
||||
<tr>
|
||||
<td class="z" colspan="2">Mises à jours</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>version : 0.0</th>
|
||||
<th width="80%">
|
||||
<div align="left">
|
||||
Commencement du projet Halo Battle.
|
||||
</div></th>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<th>version : 0.1</th>
|
||||
<th width="80%">
|
||||
<div align="left">
|
||||
Modifications :<br>
|
||||
- Ajout de milliers de choses utiles.<br>
|
||||
<br>
|
||||
Corrections :<br>
|
||||
- Correction de plein de bugs.
|
||||
</div></th>
|
||||
</tr>
|
||||
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
|
||||
</body>
|
||||
</html>
|
||||
22
pages/version.php2
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
<?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');
|
||||
|
||||
print '<center><table><tr><td><font size="+1">
|
||||
<b>Halo-Battle</b><br><br>
|
||||
Version 0.1 Béta<br>
|
||||
Du samedi 27 octobre 2007<br>
|
||||
</font></td></tr></table></center>';
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
|
|
@ -1,16 +1,27 @@
|
|||
<? echo"<html>
|
||||
<?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 >
|
||||
|
||||
<style TYPE=text/css>
|
||||
table {
|
||||
margin-top: 25px;
|
||||
}
|
||||
TD.z {
|
||||
min-width: 15px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>";
|
||||
|
||||
mysql_connect("localhost", "root", "");
|
||||
mysql_select_db("wars");
|
||||
require('../connectBDD.php');
|
||||
|
||||
echo "<table align=center><tr><td>Place</td><td>Race</td><td>Pseudo</td><td>Points</td><td>Flotte</td><td>Recherches</td></tr>";
|
||||
echo "<table align=center><tr><td>Place</td><td>Race</td><td>Pseudo</td><td class=z>Points</td><td class=z>Flotte</td><td class=z>Recherches</td></tr>";
|
||||
$ee = mysql_query("SELECT * FROM classement ORDER BY points DESC");
|
||||
$i=1;
|
||||
while ( $data = mysql_fetch_array($ee) ){
|
||||
|
|
|
|||