First code received by Master Leon

This commit is contained in:
nemunaire 2007-03-31 12:00:00 +02:00
commit 4230eb6922
330 changed files with 15543 additions and 0 deletions

5
page/abandnon.php Normal file
View file

@ -0,0 +1,5 @@
<?
header("Location: depart.php");
?>

22
page/abandon.php Normal file
View file

@ -0,0 +1,22 @@
<?php
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT nb FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$nb = $donnees['nb'];
if ($nb >= 2) {
mysql_query("DELETE * FROM flotte WHERE nb='".$nb."' AND id='".$id."'AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
header("Location: depart.php");
}
else { header("Location: depart.php"); }
mysql_close();
?>

23
page/abandon_confirm.php Normal file
View file

@ -0,0 +1,23 @@
<? session_start(); ?>
<html>
<head>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'bdd.php';
?>
</head>
<body>
<? echo"<center>
<tr><td colsapan=2 >Confirmer l'abandon de ".$nomplanete." en ".$galaxy.":".$ss.":".$pos."</td></tr>
<tr><td><form action=abandon.php method=post><input type=submit value=Oui></form></td>
<td><form action=abandnon.php method=post><input type=submit value=Non></form></td></tr>";
?>
</body>
</html>

83
page/ajout_niveau.php Normal file
View file

@ -0,0 +1,83 @@
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$temps = $donnees['temps'];
$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['recherches'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$silo = $donnees['silo'];
if ((time())>=$temps) {
switch ($bat) {
case 1:
$mine_m++;
mysql_query("UPDATE user 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 user 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 user 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 user 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 user SET centrale_f='".$centrale_f."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 6:
$radar++;
mysql_query("UPDATE user SET radar='".$radar."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 7:
$labo++;
mysql_query("UPDATE user SET recherches='".$labo."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 8:
$chantier_terrestre++;
mysql_query("UPDATE user 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 user SET chantier_spatial='".$chantier_spatial."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 10:
$caserne++;
mysql_query("UPDATE user SET caserne='".$caserne."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 11:
$silo++;
mysql_query("UPDATE user 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 user SET temps='0', bat='0', energie='".$energie."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
@header("Location: batiment.php");
}
?>

84
page/ajout_niveau_t.php Normal file
View file

@ -0,0 +1,84 @@
<?
$id=$_SESSION['id'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."'");
$donnees = mysql_fetch_array($x);
$temps_t = $donnees['temps_t'];
$tec = $donnees['tec'];
$informatique = $donnees['informatique'];
$detection = $donnees['detection'];
$armement = $donnees['armement'];
$bouclier = $donnees['bouclier'];
$energie_t = $donnees['energie_t'];
$reacteur = $donnees['reacteur'];
$reacteur_f = $donnees['reacteur_f'];
$reacteur_ff = $donnees['reacteur_ff'];
$medecine = $donnees['medecine'];
$tactique = $donnees['tactique'];
$developpement = $donnees['developpement'];
$blindage = $donnees['blindage'];
$spartan = $donnees['spartan'];
if ((time())>=$temps_t) {
switch ($tec) {
case 1:
$informatique++;
mysql_query("UPDATE user SET informatique='".$informatique."' WHERE id='".$id."'");
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 reacteur_f='".$tactique."' WHERE id='".$id."'");
break;
case 11:
$developpement++;
mysql_query("UPDATE user SET tactique='".$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 spartan='".$spartan."' WHERE id='".$id."'");
break;
}
mysql_query("UPDATE user SET temps_t='0', tec='0' WHERE id='".$id."'");
@header("Location: labo.php");
}
?>

91
page/ajout_terrestre.php Normal file
View file

@ -0,0 +1,91 @@
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$temps_terrestre = $donnees['temps_terrestre'];
$cons_terrestre = $donnees['cons_terrestre'];
$unit_t = $donnees['unit_t'];
$vaisseau_att = $donnees['vaisseau_att'];
$vaisseau_1 = $donnees['vaisseau_1'];
$vaisseau_2 = $donnees['vaisseau_2'];
$vaisseau_3 = $donnees['vaisseau_3'];
$vcl_1 = $donnees['vcl_1'];
$vcl_2 = $donnees['vcl_2'];
$vcl_3 = $donnees['vcl_3'];
$vcl_4 = $donnees['vcl_4'];
$def_1 = $donnees['def_1'];
$def_2 = $donnees['def_2'];
$def_3 = $donnees['def_3'];
$def_4 = $donnees['def_4'];
$def_5 = $donnees['def_5'];
if ((time())>=$temps_terrestre) {
switch ($unit_t) {
case 1:
$vaisseau_att += $cons_terrestre;
mysql_query("UPDATE user SET vaisseau_att='".$vaisseau_att."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 2:
$vaisseau_1 += $cons_terrestre;
mysql_query("UPDATE user SET vaisseau_1='".$vaisseau_1."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 3:
$vaisseau_2 += $cons_terrestre;
mysql_query("UPDATE user SET vaisseau_2='".$vaisseau_2."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 4:
$vaisseau_3 += $cons_terrestre;
mysql_query("UPDATE user SET vaisseau_3='".$vaisseau_3."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 5:
$vcl_1 += $cons_terrestre;
mysql_query("UPDATE user SET vcl_1='".$vcl_1."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 6:
$vcl_2 += $cons_terrestre;
mysql_query("UPDATE user SET vcl_2='".$vcl_2."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 7:
$vcl_3 += $cons_terrestre;
mysql_query("UPDATE user SET vcl_3='".$vcl_3."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 8:
$vcl_4 += $cons_terrestre;
mysql_query("UPDATE user SET vcl_4='".$vcl_4."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 9:
$def_1 += $cons_terrestre;
mysql_query("UPDATE user SET def_1='".$def_1."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 10:
$def_2 += $cons_terrestre;
mysql_query("UPDATE user SET def_2='".$def_2."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 11:
$def_3 += $cons_terrestre;
mysql_query("UPDATE user SET def_3='".$def_3."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 12:
$def_4 += $cons_terrestre;
mysql_query("UPDATE user SET def_4 ='".$def_4 ."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 13:
$def_5 += $cons_terrestre;
mysql_query("UPDATE user SET def_5='".$def_5."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
}
mysql_query("UPDATE user SET temps_terrestre='0', unit_t='0', cons_terrestre='0' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
if ($unit_t <9 && $unit_t>0) {@header("Location: chantier_terrestre.php"); } else if ($unit_t >= 9) {@header("Location: defense.php"); }
}
?>

71
page/ajout_troupes.php Normal file
View file

@ -0,0 +1,71 @@
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$temps_caserne = $donnees['temps_caserne'];
$cons_caserne = $donnees['cons_caserne'];
$unit = $donnees['unit'];
$soldat1 = $donnees['soldat1'];
$soldat2 = $donnees['soldat2'];
$soldat3 = $donnees['soldat3'];
$soldat4 = $donnees['soldat4'];
$sniper = $donnees['sniper'];
$spartam = $donnees['spartam'];
$medecin = $donnees['medecin'];
$ingenieur = $donnees['ingenieur'];
$soldat_lourd = $donnees['soldat_lourd'];
if ((time())>=$temps_caserne) {
switch ($unit) {
case 1:
$soldat1 += $cons_caserne;
mysql_query("UPDATE user SET soldat1='".$soldat1."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 2:
$soldat2 += $cons_caserne;
mysql_query("UPDATE user SET soldat2='".$soldat2."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 3:
$soldat3 += $cons_caserne;
mysql_query("UPDATE user SET soldat3='".$soldat3."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 4:
$soldat4 += $cons_caserne;
mysql_query("UPDATE user SET soldat4='".$soldat4."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 5:
$sniper += $cons_caserne;
mysql_query("UPDATE user SET sniper='".$sniper."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 6:
$spartam += $cons_caserne;
mysql_query("UPDATE user SET spartam='".$spartam."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 7:
$medecin += $cons_caserne;
mysql_query("UPDATE user SET medecin='".$medecin."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 8:
$ingenieur += $cons_caserne;
mysql_query("UPDATE user SET ingenieur='".$ingenieur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 9:
$soldat_lourd += $cons_caserne;
mysql_query("UPDATE user SET soldat_lourd='".$soldat_lourd."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
}
mysql_query("UPDATE user SET temps_caserne='0', unit='0', cons_caserne='0' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
@header("Location: troupes.php");
}
?>

80
page/ajout_vaisseaux.php Normal file
View file

@ -0,0 +1,80 @@
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$temps_spatial = $donnees['temps_spatial'];
$cons_spatial = $donnees['cons_spatial'];
$unit_s = $donnees['unit_s'];
$transporteur = $donnees['transporteur'];
$gtransporteur = $donnees['gtransporteur'];
$vcolo = $donnees['vcolo'];
$sonde = $donnees['sonde'];
$recycleur = $donnees['recycleur'];
$chasseur = $donnees['chasseur'];
$fregate = $donnees['fregate'];
$croiseur = $donnees['croiseur1'];
$croiseur2 = $donnees['croiseur2'];
$pv = $donnees['porte_vaisseau'];
$sto = $donnees['station_orbitale'];
if ((time())>=$temps_spatial) {
switch ($unit_s) {
case 1:
$transporteur += $cons_spatial;
mysql_query("UPDATE user SET transporteur='".$transporteur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 2:
$gtransporteur += $cons_spatial;
mysql_query("UPDATE user SET gtransporteur='".$gtransporteur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 3:
$vcolo += $cons_spatial;
mysql_query("UPDATE user SET vcolo='".$vcolo."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 4:
$sonde += $cons_spatial;
mysql_query("UPDATE user SET sonde='".$sonde."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 5:
$recycleur += $cons_spatial;
mysql_query("UPDATE user SET recycleur='".$recycleur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 6:
$chasseur += $cons_spatial;
mysql_query("UPDATE user SET chasseur='".$chasseur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 7:
$fregate += $cons_spatial;
mysql_query("UPDATE user SET fregate='".$fregate."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 8:
$croiseur += $cons_spatial;
mysql_query("UPDATE user SET croiseur1='".$croiseur."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 9:
$croiseur2 += $cons_spatial;
mysql_query("UPDATE user SET croiseur2='".$croiseur2."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 10:
$pv += $cons_spatial;
mysql_query("UPDATE user SET pv='".$pv."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
case 11:
$sto += $cons_spatial;
mysql_query("UPDATE user SET sto='".$sto."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
break;
}
mysql_query("UPDATE user SET temps_spatial='0', unit_s='0', cons_spatial='0' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
@header("Location: chantier_spatial.php");
}
?>

136
page/anul_bat.php Normal file
View file

@ -0,0 +1,136 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$temps = $donnees['temps'];
$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['recherches'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$silo = $donnees['silo'];
if ( $_GET['bat'] == 1)
{
$metal += ceil(exp(($mine_m*0.400))*200);
$cristal += ceil(exp(($mine_m*0.400))*100);;
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 2)
{
$metal += ceil(exp(($mine_c*0.430))*210);
$cristal += ceil(exp(($mine_c*0.430))*120);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 3)
{
$metal += ceil(exp(($mine_h*0.445))*250);
$cristal += ceil(exp(($mine_h*0.445))*170);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 4)
{ $n=($centrale_s-1);
$metal += ceil(pow(2,$n)*300);
$cristal += ceil(pow(2,$n)*230);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 5)
{ $n=($centrale_f-1);
$metal += ceil(pow(2,$n)*165);
$cristal += ceil(pow(2,$n)*99);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 6)
{ $n=($radar-1);
$metal += ceil(pow(2,$n)*750);
$cristal += ceil(pow(2,$n)*500);
$hydrogene += ceil(pow(2,$n)*50);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 7)
{
$n=($labo-1);
$metal += ceil(pow(2,$n)*200);
$cristal += ceil(pow(2,$n)*150);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 8 )
{ $n=($chantier_terrestre-1);
$metal += ceil(pow(2,$n)*520);
$cristal += ceil(pow(2,$n)*380);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 9)
{ $n=($chantier_spatial-1);
$metal += ceil(pow(2,$n)*600);
$cristal += ceil(pow(2,$n)*450);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 10)
{ $n=($caserne-1);
$metal += ceil(pow(2,$n)*200);
$cristal += ceil(pow(2,$n)*100);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 11)
{ $n=($silo-1);
$metal += ceil(pow(2,$n)*400);
$cristal += ceil(pow(2,$n)*260);
$temps = 0;
$bat = 0;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
mysql_close();
@header("Location: batiment.php");
?>

149
page/anul_tec.php Normal file
View file

@ -0,0 +1,149 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$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'];
$developpement = $donnees['developpement'];
$blindage = $donnees['blindage'];
$spartan = $donnees['spartan'];
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 user SET metal ='".$metal."', cristal='".$cristal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 user SET metal ='".$metal."', cristal='".$cristal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 user SET metal ='".$metal."', cristal='".$cristal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 user SET metal ='".$metal."', cristal='".$cristal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 user SET metal ='".$metal."', 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 user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_t='".$temps_t."', tec='".$tec."' WHERE id='".$id."'");
}
mysql_close();
@header("Location: labo.php");
?>

View file

@ -0,0 +1,63 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/designtechno.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress."</font>";
}
}
?>
</head>
<body>
<center><table><tr><td class="a"><a href="arbre_techno_caserne.php">Caserne</a> |
<a href="arbre_techno_technologie.php">Technologies</a> |
<a href="arbre_techno_batiments_p.php">Batiments</a>
</td></tr></table><br><br></center>
<TABLE>
<tr><td>Image</td><td>Nom</td><td>Techno</td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href=ferme.php>Champ d'algues</a></td>
<td><font color=#00CC99 >Débloqué</font></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href=recup.php>Recuperation de métaux</a></td>
<td><font color=#00CC99 >Débloqué</font></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href=minec.php>Mine de calcium</a></td>
<td><font color=#00CC99 >Débloqué</font></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Centre d'entrainement</td>
<td><font color=#00CC99 >Débloqué</font></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Laboratoire</td>
<td><font color=#00CC99 >Débloqué</font></td></tr>
<tr><td class="a"><img src="" width="100" height="80" ></td>
<td class="a">Base radar</td>
<td class="a"><? @techno(Espionnage,$espionnage, 3) ?></td></tr>
</TABLE>
</body>
</html>

View file

@ -0,0 +1,87 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/designtechno.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress."</font>";
}
}
?>
</head>
<body>
<center><table><tr><td class="a"><a href="arbre_techno_caserne.php">Caserne</a> |
<a href="arbre_techno_technologie.php">Technologies</a> |
<a href="arbre_techno_batiments_p.php">Batiments</a>
</td></tr></table><br><br></center>
<TABLE>
<tr><td>Image</td><td>Nom</td><td>Techno</td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Soldat bigorneau</td>
<td><? @techno(Caserne,$caserne, 1) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Soldat bigorneau blindé</td>
<td><? @techno(Caserne,$caserne, 2) ?><br><? @techno(Blindage,$blindage, 2) ?><br><? @techno(Spécialisation,$specialisation, 3) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Général</td>
<td><? @techno(Caserne,$caserne, 5) ?><br><? @techno(Spécialisation,$specialisation, 6) ?></td></tr>
<tr><td><img src="descriptions/images/heros.html" width="100" height="80" ></td>
<td>Kamikaze</td>
<td><? @techno(Caserne,$caserne, 3) ?><br><? @techno(Spécialisation,$specialisation, 5) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Espion</td>
<td><? @techno(Caserne,$caserne, 3) ?><br><? @techno(Spécialisation,$specialisation, 4) ?><br><? @techno(Espionnage,$espionnage, 4) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Tank crabe</td>
<td><? @techno(Caserne,$caserne, 6) ?><br><? @techno(Spécialisation,$specialisation, 7) ?><br><? @techno(Blindage,$blindage, 5) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Poisson</td>
<td><? @techno(Caserne,$caserne, 4) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Jean-louis</td>
<td><? @techno(Caserne,$caserne, 7) ?><br><? @techno(Spécialisation,$specialisation, 9) ?><br><? @techno(Mjolinor,$mjolinor, 1) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Spartan bigorneau</td>
<td><? @techno(Caserne,$caserne, 10) ?><br><? @techno(Spécialisation,$specialisation, 10) ?><br><? @techno(Blindage,$blindage, 7) ?><br><? @techno(Mjolinor,$mjolinor, 2) ?></td></tr>
<tr><td></td>
<td>Défenses</td>
<td></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td>Barrière de corail</td>
<td><? @techno(Caserne,$caserne, 1) ?><br><? @techno(Blindage,$blindage, 6) ?></td></tr>
<tr><td class="a"><img src="" width="100" height="80" ></td>
<td class="a">Mine</td>
<td class="a"><? @techno(Caserne,$caserne, 6) ?></td></tr>
</TABLE>
</body>
</html>

View file

@ -0,0 +1,68 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/designtechno.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
function techno($nom, $niveau, $niveau_ress)
{
if ($niveau < $niveau_ress)
{
echo "<font color=red >".$nom." ".$niveau_ress."</font>";
}
else
{
echo "<font color=#00CC99 >".$nom." ".$niveau_ress."</font>";
}
}
?>
</head>
<body>
<center><table><tr><td class="a"><a href="arbre_techno_caserne.php">Caserne</a> |
<a href="arbre_techno_technologie.php">Technologies</a> |
<a href="arbre_techno_batiments_p.php">Batiments</a>
</td></tr></table><br><br></center>
<TABLE>
<tr><td>Image</td><td>Nom</td><td>Techno</td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Specialisation</td>
<td><? @techno(Laboratoire,$labo, 2) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Blindage</td>
<td><? @techno(Laboratoire,$labo, 2) ?><br><? @techno("Recupértateur de métaux",$recup_metaux, 5) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Elevage</td>
<td><? @techno(Laboratoire,$labo, 1) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Concombre de mer</td>
<td><? @techno(Laboratoire,$labo, 4) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Vitesse</td>
<td><? @techno(Laboratoire,$labo, 3) ?></td></tr>
<tr><td><img src="" width="100" height="80" ></td>
<td><a href="">Mjolinor</td>
<td><? @techno(Laboratoire,$labo, 7) ?><br><? @techno(Blindage,$blindage, 5) ?></td></tr>
<tr><td class="a"><img src="" width="100" height="80" ></td>
<td class="a">Espionnage</td>
<td class="a"><? @techno(Laboratoire,$labo, 3) ?></td></tr>
</TABLE>
</body>
</html>

353
page/batiment.php Normal file
View file

@ -0,0 +1,353 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
include 'ajout_niveau.php';
$case = $cases - ($mine_m +$mine_c +$mine_h +$centrale_s +$centrale_f +$radar+$labo+$chantier_terrestre +$chantier_spatial+$caserne +$silo );
function verification_des_ress($numbat,
$metal, $cristal, $hydrogene,
$ress_ness_metal, $ress_ness_cristal, $ress_ness_hydrogene)
{
if ($metal >= $ress_ness_metal && $cristal >= $ress_ness_cristal && $hydrogene >= $ress_ness_hydrogene)
{
echo "<font color=teal><a href=\"constructiion.php?bat=".$numbat."\">Construire</a></font>";
}
else
{
echo "<font color=red>Construire</font>";
}
}
function ressources($metal, $cristal, $hydrogene,
$ress_ness_metal, $ress_ness_cristal, $ress_ness_hydrogene)
{
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 ($cristal <= $ress_ness_cristal)
{
$z=floor($cristal)-$ress_ness_cristal;
echo "<font color=red >cristal : <ACRONYM title=".$z.">".$ress_ness_cristal."</ACRONYM></font>";
}
else {echo "<font color=teal >cristal : ".$ress_ness_cristal." </font>";}
if ($hydrogene <= $ress_ness_hydrogene)
{
$z=floor($hydrogene)-$ress_ness_hydrogene;
echo "<font color=red >hydrogene : <ACRONYM title=".$z.">".$ress_ness_hydrogene."</ACRONYM></font>";
}
else {echo "<font color=teal >hydrogene : ".$ress_ness_hydrogene." </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;
}
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<table>
<tr>
<?
echo "<tr><td><img src=images/mine_m.png height=120 width=120></td>
<td width=600><a href=mine_m.php>Usine de méttalurgie</a> niveau ".$mine_m."<br>
<br>
Coût: ";
$a=ceil(exp(($mine_m*0.400))*200);
$b=ceil(exp(($mine_m*0.400))*100);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(1.7,$mine_m)*120) - (0.005*$ingenieur*ceil(pow(1.7,($mine_m-1))*120))));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==1) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=1\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else { verification_des_ress(1, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>";
echo "<tr><td><img src=images/mine_c.png height=120 width=120></td>
<td width=600><a href=mine_c.php>Usine de cristal</a> niveau ".$mine_c."<br>
<br>
Coût: ";
$a=ceil(exp(($mine_c*0.430))*210);
$b=ceil(exp(($mine_c*0.430))*120);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(1.72,$mine_c)*160)) - (0.005*$ingenieur*ceil(pow(1.72,($mine_c-1))*160)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==2) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=2\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(2, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>";
echo "<tr><td><img src=images/mine_h.png height=120 width=120></td>
<td width=600><a href=mine_h.php>Synchronisateur d'hydrogène</a> niveau ".$mine_h."<br>
<br>
Coût: ";
$a=ceil(exp(($mine_h*0.445))*250);
$b=ceil(exp(($mine_h*0.445))*170);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(1.75,$mine_h)*180)) - (0.005*$ingenieur*ceil(pow(1.75,($mine_h-1))*180)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==3) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=3\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(3, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>";
echo "<tr><td><img src=images/centrale_f.jpg height=120 width=120></td>
<td width=600><a href=central_s.php>Centrale solaire</a> niveau ".$centrale_s."<br>
<br>
Coût: "; $n=($centrale_s-1);
$a=ceil(pow(2,$n)*300);
$b=ceil(pow(2,$n)*230);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(1.68,$centrale_s)*190)) - (0.005*$ingenieur*ceil(pow(1.68,($centrale_s-1))*190)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==4) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=4\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(4, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>";
if ($centrale_s >= 12 && $energie_t >=5) {
echo "<tr><td><img src=images/centrale_f.png height=120 width=120></td>
<td width=600><a href=central_f.php>Centrale énergétique</a> niveau ".$centrale_f."<br>
<br>
Coût: ";
$n=($centrale_f-1);
$a=ceil(pow(2,$n)*165);
$b=ceil(pow(2,$n)*99);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(1.8,$centrale_f)*300)) - (0.005*$ingenieur*ceil(pow(1.8,($centrale_f-1))*300)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==5) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=5\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(5, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>"; } else {}
if ($detection >= 1) {
echo "<tr><td><img src=images/radar.jpg height=120 width=120></td>
<td width=600>Base radar niveau ".$radar."<br>
<br>
Coût: ";
$n=($radar-1);
$a=ceil(pow(2,$n)*750);
$b=ceil(pow(2,$n)*500);
$c=ceil(pow(2,$n)*50);
ressources($metal, $cristal, $hydrogene, $a, $b, $c);
echo"<br>
Temps : ";
sec((ceil(pow(2,$radar)*720) - (0.005*$ingenieur*ceil(pow(2,($radar-1))*720))));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==6) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=6\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(6, $metal, $cristal, $hydrogene, $a, $b, $c); } }
echo"</td></tr>"; } else {}
echo "<tr><td><img src=images/labo.jpg height=120 width=120></td>
<td width=600>Centre de recherches niveau ".$labo."<br>
<br>
Coût: ";
$n=($labo-1);
$a=ceil(pow(2,$n)*200);
$b=ceil(pow(2,$n)*150);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(2,$labo)*720)) - (0.005*$ingenieur*ceil(pow(2,($labo-1))*720)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==7) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=7\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {if($tec > 0) {echo "<font color=red>Recherche en cours dans le </font><a href=labo.php>laboratoire</a>"; } else {verification_des_ress(7, $metal, $cristal, $hydrogene, $a, $b, 0);} } }
echo"</td></tr>";
echo "<tr><td><img src=images/chantier_terrestre.jpg height=120 width=120></td>
<td width=600>Chantier terrestre niveau ".$chantier_terrestre."<br>
<br>
Coût: ";
$n=($chantier_terrestre-1);
$a=ceil(pow(2,$n)*520);
$b=ceil(pow(2,$n)*380);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(2,$chantier_terrestre)*420)) - (0.005*$ingenieur*ceil(pow(2,($chantier_terrestre-1))*420)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==8) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=8\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {if($unit_t > 0) {echo "<font color=red>Construction en cours dans le </font>"; if ($unit_t<9 && $unit_s >0) {echo "<a href=chantier_terrestre.php>chantier terrestre</a>";} else if ( $unit_t>=9) {echo "<a href=defense.php>centre de défenses</a>";} }
else {verification_des_ress(8, $metal, $cristal, $hydrogene, $a, $b, 0); } } }
echo"</td></tr>";
if ($chantier_terrestre >= 2) {
echo "<tr><td><img src= height=120 width=120></td>
<td width=600>Chantier spatial niveau ".$chantier_spatial."<br>
<br>
Coût: ";
$n=($chantier_spatial-1);
$a=ceil(pow(2,$n)*600);
$b=ceil(pow(2,$n)*450);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(2,$chantier_spatial)*600)) - (0.005*$ingenieur*ceil(pow(2,($chantier_spatial-1))*600)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==9) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=9\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {if($unit_s > 0) {echo "<font color=red>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"</td></tr>"; } else {}
echo "<tr><td><img src=images/ecole_militaire.jpg height=120 width=120></td>
<td width=600>Ecole militaire niveau ".$caserne."<br>
<br>
Coût: ";
$n=($caserne-1);
$a=ceil(pow(2,$n)*200);
$b=ceil(pow(2,$n)*100);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(2,$caserne)*300)) - (0.005*$ingenieur*ceil(pow(2,($caserne-1))*300)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==10) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=10\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {if($unit > 0) {echo "<font color=red>Entrainement en cours dans la </font><a href=troupes.php>caserne</a>"; } else {verification_des_ress(10, $metal, $cristal, $hydrogene, $a, $b, 0); }} }
echo"</td></tr>";
echo "<tr><td><img src=images/silo.jpg height=120 width=120></td>
<td width=600>Silo de stockage niveau ".$silo."<br>
<br>
Coût: ";
$n=($silo-1);
$a=ceil(pow(2,$n)*400);
$b=ceil(pow(2,$n)*260);
ressources($metal, $cristal, $hydrogene, $a, $b, 0);
echo"<br>
Temps : ";
sec((ceil(pow(2,$silo)*1200)) - (0.005*$ingenieur*ceil(pow(2,($silo-1))*1200)));
echo"<td width=200>";
if ($temps > 0) {
if ($bat==11) {
$tr=$temps-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_bat.php?bat=11\">Annuler</a>";
}
else {}
}
else { if ($case <= 0) { echo "Planète pleine"; } else {verification_des_ress(11, $metal, $cristal, $hydrogene, $a, $b, 0); } }
echo"</td></tr>";
?>
</body>
</html>

120
page/bdd.php Normal file
View file

@ -0,0 +1,120 @@
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
if ($id == 0) { @header("Location: index.html"); }
$race = $donnees['race'];
$pseudo = $donnees['pseudo'];
$pseudo2 = '['.$race.'] '.$pseudo;
$mdp = $donnees['mdp'];
$mail = $donnees['mail'];
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$timestamp = $donnees['timestamp'];
$coeff = $donnees['coeff'];
$nb = $donnees['nb'];
$galaxy = $donnees['galaxy'];
$ss = $donnees['ss'];
$pos = $donnees['pos'];
$nomplanete = $donnees['nomplanete'];
$image = $donnees['image'];
$cases = $donnees['cases'];
$debris_met = $donnees['debris_met'];
$debris_cri = $donnees['debris_cri'];
$temps = $donnees['temps'];
$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['recherches'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$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'];
$developpement = $donnees['developpement'];
$blindage = $donnees['blindage'];
$spartan = $donnees['spartan'];
$temps_spatial = $donnees['temps_spatial'];
$cons_spatial = $donnees['cons_spatial'];
$unit_s = $donnees['unit_s'];
$transporteur = $donnees['transporteur'];
$gtransporteur = $donnees['gtransporteur'];
$vcolo = $donnees['vcolo'];
$sonde = $donnees['sonde'];
$recycleur = $donnees['recycleur'];
$chasseur = $donnees['chasseur'];
$fregate = $donnees['fregate'];
$croiseur = $donnees['croiseur1'];
$croiseur2 = $donnees['croiseur2'];
$pv = $donnees['porte_vaisseau'];
$sto = $donnees['station_orbitale'];
$temps_caserne = $donnees['temps_caserne'];
$cons_caserne = $donnees['cons_caserne'];
$unit = $donnees['unit'];
$soldat1 = $donnees['soldat1'];
$soldat2 = $donnees['soldat2'];
$soldat3 = $donnees['soldat3'];
$soldat4 = $donnees['soldat4'];
$sniper = $donnees['sniper'];
$spartam = $donnees['spartam'];
$medecin = $donnees['medecin'];
$ingenieur = $donnees['ingenieur'];
$soldat_lourd = $donnees['soldat_lourd'];
$temps_terrestre = $donnees['temps_terrestre'];
$cons_terrestre = $donnees['cons_terrestre'];
$unit_t = $donnees['unit_t'];
$vaisseau_att = $donnees['vaisseau_att'];
$vaisseau_1 = $donnees['vaisseau_1'];
$vaisseau_2 = $donnees['vaisseau_2'];
$vaisseau_3 = $donnees['vaisseau_3'];
$vcl_1 = $donnees['vcl_1'];
$vcl_2 = $donnees['vcl_2'];
$vcl_3 = $donnees['vcl_3'];
$vcl_4 = $donnees['vcl_4'];
$def_1 = $donnees['def_1'];
$def_2 = $donnees['def_2'];
$def_3 = $donnees['def_3'];
$def_4 = $donnees['def_4'];
$def_5 = $donnees['def_5'];
//$ = $donnees[''];
mysql_close();
?>

68
page/carte.php Normal file
View file

@ -0,0 +1,68 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
if (isset($_GET['galaxy'])) { $g=$_GET['galaxy'];} else { $g=$_SESSION['galaxy']; }
if (isset($_GET['ss'])) { $s=$_GET['ss'];} else { $s=$_SESSION['ss']; }
?>
</head>
<body>
<?
echo "<form action=change_carte.php method=post>
<table border=0 align=center>
<tbody>
<tr><td>
<table>
<tbody>
<tr><td class=z colspan=3>Galaxie</td></tr>
<tr><td><input name=change_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><input name=change_system 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=bouttom></td></tr>
</tbody></table>
</form>
<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 pseudo FROM user WHERE galaxy='".$g."' AND ss='".$s."' AND pos='".$i."' ");
if(mysql_num_rows($resultat)>=1){
$x = mysql_query("SELECT * FROM user WHERE galaxy='".$g."' AND ss='".$s."'AND pos='".$i."' ");
$d = mysql_fetch_array($x);
if ($d['race'] == 'covenant') { $ra='(c)'; } else { $ra='(h)'; }
echo "<tr><td height=20>".$i."</td><td>".$d['nomplanete']."</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=images/msg.jpg></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>

37
page/central_f.php Normal file
View file

@ -0,0 +1,37 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<table align=center>
<tr><td><img src=images/centrale_f.jpg height=120 width=120></td>
<td width=200>Centrale énergétique niveau ".$centrale_f."<br><br>";
$a=$mine_m+5;
$c=$mine_m-2;
echo '<table><tr><td>Niveau</td><td>Production d énergie par heure</td><td>Consommation d hydrogene</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil((($c*80+(exp($c*0.38)*11))));
$h=ceil((($c*80+(exp($c*0.38)*11)))) - ceil(((($c-1)*80+(exp(($c-1)*0.38)*11))));
$p=ceil(($c*5+(exp($c*0.3)*10)));
$g=ceil(($c*5+(exp($c*0.3)*10))) - ceil((($c-1)*5+(exp(($-1)*0.3)*10)));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
}
?>
</body>
</html>

38
page/central_s.php Normal file
View file

@ -0,0 +1,38 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<table align=center>
<tr><td><img src=images/centrale.JPG height=120 width=120></td>
<td width=200>Centrale solaire niveau ".$centrale_s."<br><br>";
$a=$centrale_s+5;
$c=$centrale_s-2;
echo '<table><tr><td>Niveau</td><td>Production d énergie par heure</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil((($c*20+(exp($c*0.3)*10))));
$h=ceil((($c*20+(exp($c*0.3)*10)))) - ceil(((($c-1)*20+(exp(($c-1)*0.3)*10))));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td></tr>';
}
echo"</table></td></tr>";
?>
</body>
</html>

13
page/change_carte.php Normal file
View file

@ -0,0 +1,13 @@
<?
session_start();
if ($_POST['change_galaxy'] != '') { $y=$_POST['change_galaxy']; } else { $y=$_SESSION['galaxy']; }
if ($y >= 6) { $y = 5; }
if ($_POST['change_system'] != '') { $t=$_POST['change_system']; } else { $t=$_SESSION['ss']; }
if ($t >= 151) { $t = 150; }
@header("Location: carte.php?galaxy=".$y."&ss=".$t."");
?>

22
page/change_planete.php Normal file
View file

@ -0,0 +1,22 @@
<?
session_start();
$id=$_SESSION['id'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$appel = mysql_query("SELECT galaxy, ss, pos FROM user WHERE id='".$id."' AND nb='".$_POST['planete']."'");
$data=mysql_fetch_assoc($appel);
$_SESSION['galaxy'] = $data['galaxy'];
$_SESSION['ss'] = $data['ss'];
$_SESSION['pos'] = $data['pos'];
@header("Location: depart.php");
?>

196
page/chantier_spatial.php Normal file
View file

@ -0,0 +1,196 @@
<? session_start(); ?>
<html>
<head>
<title>Space battleship</title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
include 'ajout_vaisseaux.php';
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil((1080 - (0.1*$chantier_spatial*1080)));
$g = ceil((6300 - (0.1*$chantier_spatial*6300)));
$h = ceil((8280 - (0.1*$chantier_spatial*8280)));
$i = ceil((1440 - (0.1*$chantier_spatial*1440)));
$j = ceil((7380 - (0.1*$chantier_spatial*7380)));
$k = ceil((1200 - (0.1*$chantier_spatial*1200)));
$l = ceil((4680 - (0.1*$chantier_spatial*4680)));
$m = ceil((16800 - (0.1*$chantier_spatial*16800)));
$n = ceil((18060 - (0.1*$chantier_spatial*18060)));
$p = ceil((32400 - (0.1*$chantier_spatial*32400)));
$q = ceil((117000 - (0.1*$chantier_spatial*117000)));
if ($temps_spatial>0) {
switch ($unit_s) {
case 1:
$unit= "cargos de classe Parabola"; break;
case 2:
$unit= "cargos de classe Laden"; break;
case 3:
$unit= "vaisseaux de colonisation de classe Odyssey"; break;
case 4:
$unit= "drones despionnage 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>
<? if ($chantier_spatial > 0) {
if ($temps_spatial >0) {
echo "<table align=center><tr><td>
Construction terminé dans : ";
$tr=$temps_spatial-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Construction de : ".$cons_spatial." ".$unit."</td></tr>
</table>";} else {}
echo"<table align=center>
<tr><td width=150>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($chantier_spatial >= 1 && $reacteur >= 4) {
echo "<form method=post action=validation_transporteur.php>
<tr>
<td><img src=images/ ></td>
<td align=left>Cargos de classe Parabola ( ".$transporteur." vaisseaux )<br>Métal : 1000<br>Cristal : 800<br>Temps : "; sec($f); echo"<br></td>
<td>"; if ( $bat == 9 ) { echo "Chantier spatial en construction"; } else { if ($temps_spatial < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_transporteur /><br><input type=submit value=Envoyer class=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_f >= 2) {
echo "<form method=post action=validation_gtransporteur.php>
<tr>
<td><img src= ></td>
<td align=left>Cargos de classe Laden ( ".$gtransporteur." vaisseaux )<br>Métal : 4000<br>Cristal : 3000<br>Temps : "; sec($g); echo"<br></td>
<td>"; if ( $bat == 9 ) { echo "Chantier spatial en construction"; } else { if ($temps_spatial < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_gtransporteur /><br><input type=submit value=Envoyer class=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_ff >= 1) {
echo "<form method=post action=validation_vcolo.php>
<tr>
<td><img src=images/vcolo.jpg ></td>
<td align=left>Vaisseaux de colonisation de classe Odyssey ( ".$vcolo." vaisseaux )<br>Mé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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 3 && $reacteur >= 5 && $detection >=2) {
echo "<form method=post action=validation_sonde.php>
<tr>
<td><img src=images/sonde.jpg ></td>
<td align=left>Drones despionnage de classe Clarion ( ".$sonde." vaisseaux )<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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 5 && $reacteur_f >= 4 && $blindage >= 5) {
echo "<form method=post action=validation_recycleur.php>
<tr>
<td><img src= ></td>
<td align=left>Recycleurs de classe Minotaur ( ".$recycleur." vaisseaux )<br>Mé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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 1 && $reacteur >= 4) {
echo "<form method=post action=validation_chasseur.php>
<tr>
<td><img src=images/longsword.jpg ></td>
<td align=left>C709 Longsword Interceptor ( ".$chasseur." vaisseaux )<br>Métal : 1700<br>Cristal : 1220<br>Temps : "; sec($k); echo"<br></td>
<td>"; if ( $bat == 9 ) { echo "Chantier spatial en construction"; } else { if ($temps_spatial < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_chasseur /><br><input type=submit value=Envoyer class=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 3 && $reacteur_f >= 3 && $armement >=1) {
echo "<form method=post action=validation_fregate.php>
<tr>
<td><img src=images/fregate.jpg ></td>
<td align=left>Frégate ( ".$fregate." vaisseaux )<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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 6 && $reacteur_ff >= 2 && $armement >=3 && $blindage >= 4) {
echo "<form method=post action=validation_croiseur.php>
<tr>
<td><img src=images/croiseur1.jpg ></td>
<td align=left>Croiseurs de classe Halcyon ( ".$croiseur." vaisseaux )<br>Mé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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 6 && $reacteur_ff >= 3 && $armement >=4 && $blindage >= 4) {
echo "<form method=post action=validation_croiseur2.php>
<tr>
<td><img src=images/croiseur2.jpg ></td>
<td align=left>Croiseurs de classe Marathon ( ".$croiseur2." vaisseaux )<br>Mé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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 8 && $reacteur_ff >= 5 && $armement >=6 && $blindage >= 6) {
echo "<form method=post action=validation_pv.php>
<tr>
<td><img src= ></td>
<td align=left>Porte vaisseaux ( ".$pv." vaisseaux )<br>Mé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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
if ($chantier_spatial >= 12 && $reacteur_ff >= 10 && $armement >=12 && $blindage >= 12) {
echo "<form method=post action=validation_sto.php>
<tr>
<td><img src=images/sto.jpg ></td>
<td align=left>Station orbitale ( ".$sto." vaisseaux )<br>Cette station reste en orbite autour de la planè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=bouttom>"; } else {} }
echo"
</td></tr></form>"; } else {}
} else { ?><SCRIPT language="javascript">
parent.frames["changement"].window.location="sans_spatial.php"
</SCRIPT> <?
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
echo "</table>"; ?>
</body>
</html>

182
page/chantier_terrestre.php Normal file
View file

@ -0,0 +1,182 @@
<? session_start(); ?>
<html>
<head>
<title>Space battleship</title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
include 'ajout_terrestre.php';
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil((720 - (0.1*$chantier_terrestre*720)));
$g = ceil((2040 - (0.1*$chantier_terrestre*2040)));
$h = ceil((2700 - (0.1*$chantier_terrestre*2700)));
$i = ceil((3960 - (0.1*$chantier_terrestre*3960)));
$j = ceil((600 - (0.1*$chantier_terrestre*600)));
$k = ceil((1080 - (0.1*$chantier_terrestre*1080)));
$l = ceil((2160 - (0.1*$chantier_terrestre*2160)));
$m = ceil((4680 - (0.1*$chantier_terrestre*4680)));
if ($temps_terrestre>0) {
switch ($unit_t) {
case 1:
$unit= "sparrowhawk"; break;
case 2:
$unit= "077-TC Pelican"; break;
case 3:
$unit= "C703 Shortsword Bomber "; break;
case 4:
$unit= "SHD Albatros"; break;
case 5:
$unit= "M12 LRV Warthogs"; break;
case 6:
$unit= "M12G1 LAAV Warthogs"; break;
case 7:
$unit= "M12A1 LAAV Warthogs"; break;
case 8:
$unit= "M808B Scorpions MBT"; break;
case 9:
$unit= "mitrailleuses automatique M247 GP"; break;
case 10:
$unit= "canons Gauss"; break;
case 11:
$unit= "DCA légères"; break;
case 12:
$unit= "DCA lourdes"; break;
case 13:
$unit= "lanceurs de missiles"; break;
}}
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<? if ($chantier_terrestre > 0) {
if ($temps_terrestre >0) {
echo "<table align=center><tr><td>
Construction terminé dans : ";
$tr=$temps_terrestre-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Entrainement de : ".$cons_terrestre." ".$unit."</td></tr>
</table>";} else {}
echo"<table align=center>
<tr><td width=150>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($chantier_terrestre >= 1) {
echo "<form method=post action=validation_vaisseau_att.php>
<tr>
<td><img src=images/sparowawk.jpg ></td>
<td align=left>Sparrowhawk ( ".$vaisseau_att." vaisseaux )<br>Métal : 500<br>Cristal : 300<br>Temps : "; sec($f); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vaisseau_att /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo "<form method=post action=validation_vaisseau_1.php>
<tr>
<td><img src=images/pelican.jpg ></td>
<td align=left>077-TC Pelican ( ".$vaisseau_1." vaisseaux )<br>Métal : 680<br>Cristal : 420<br>Temps : "; sec($g); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vaisseau_1 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 4 && $reacteur >= 1) {
echo "<form method=post action=validation_vaisseau_2.php>
<tr>
<td><img src=images/phantom.jpg ></td>
<td align=left>C703 Shortsword Bomber ( ".$vaisseau_2." vaisseaux )<br>Métal : 1000<br>Cristal : 600<br>Temps : "; sec($h); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vaisseau_2 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 6 && $reacteur >= 3) {
echo "<form method=post action=validation_vaisseau_3.php>
<tr>
<td><img src=images/albatross.jpg ></td>
<td align=left>SHD Albatros ( ".$vaisseau_3." vaisseaux )<br>Métal : 1400<br>Cristal : 950<br>Temps : "; sec($i); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vaisseau_3 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 1) {
echo "<form method=post action=validation_vcl_1.php>
<tr>
<td><img src=images/warthog1.jpg ></td>
<td align=left>M12 LRV Warthog ( ".$vcl_1." véhicules )<br>Métal : 400<br>Cristal : 240<br>Temps : "; sec($j); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vcl_1 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 2) {
echo "<form method=post action=validation_vcl_2.php>
<tr>
<td><img src=images/warthog2.jpg ></td>
<td align=left>M12G1 LAAV Warthog ( ".$vcl_2." véhicules )<br>Métal : 480<br>Cristal : 260<br>Temps : "; sec($k); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vcl_2 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 3 && $armement >= 1) {
echo "<form method=post action=validation_vcl_3.php>
<tr>
<td><img src=images/warthog3.jpg ></td>
<td align=left>M12A1 LAAV Warthog ( ".$vcl_3." véhicules )<br>Métal : 600<br>Cristal : 420<br>Temps : "; sec($l); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vcl_3 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
if ($chantier_terrestre >= 5 && $blindage >=2 && $armement >=2) {
echo "<form method=post action=validation_vcl_4.php>
<tr>
<td><img src=images/scorpion.jpg ></td>
<td align=left>M808B Scorpion MBT ( ".$vcl_4." véhicules )<br>Métal : 1000<br>Cristal : 500<br>Temps : "; sec($m); echo"<br></td>
<td>"; if ( $bat == 8 ) { echo "Chantier terrestre en construction"; } else { if ($temps_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_vcl_4 /><br><input type=submit value=Envoyer class=bouttom>"; } else { if ($unit_t>=9)
{echo "<font color=red>Construction en cours dans le </font><a href=defense.php>centre de défenses</a>";} } }
echo "
</td></tr></form>"; } else {}
} else { ?><SCRIPT language="javascript">
parent.frames["changement"].window.location="sans_terrestre.php"
</SCRIPT> <?
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
echo "</table>"; ?>
</body>
</html>

136
page/constructiion.php Normal file
View file

@ -0,0 +1,136 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$ingenieur = $donnees['ingenieur'];
$temps = $donnees['temps'];
$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['recherches'];
$chantier_terrestre = $donnees['chantier_terrestre'];
$chantier_spatial = $donnees['chantier_spatial'];
$caserne = $donnees['caserne'];
$silo = $donnees['silo'];
if ( $_GET['bat'] == 1)
{
$metal -= ceil(exp(($mine_m*0.400))*200);
$cristal -= ceil(exp(($mine_m*0.400))*100);
$temps = time() + (ceil(pow(1.7,$mine_m)*120) - (0.005*$ingenieur*ceil(pow(1.7,($mine_m-1))*120)));
$bat = 1;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 2)
{
$metal -= ceil(exp(($mine_c*0.430))*210);
$cristal -= ceil(exp(($mine_c*0.430))*120);
$temps = time() + (ceil(pow(1.72,$mine_c)*160)) - (0.005*$ingenieur*ceil(pow(1.72,($mine_c-1))*160));
$bat = 2;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 3)
{
$metal -= ceil(exp(($mine_h*0.445))*250);
$cristal -= ceil(exp(($mine_h*0.445))*170);
$temps = time() + (ceil(pow(1.75,$mine_h)*180)) - (0.005*$ingenieur*ceil(pow(1.75,($mine_h-1))*180));
$bat = 3;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 4)
{ $n=($centrale_s-1);
$metal -= ceil(pow(2,$n)*300);
$cristal -= ceil(pow(2,$n)*230);
$temps = time() + (ceil(pow(1.68,$centrale_s)*190)) - (0.005*$ingenieur*ceil(pow(1.68,($centrale_s-1))*190));
$bat = 4;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 5)
{ $n=($centrale_f-1);
$metal -= ceil(pow(2,$n)*165);
$cristal -= ceil(pow(2,$n)*99);
$temps = time() + (ceil(pow(1.8,$centrale_f)*300)) - (0.005*$ingenieur*ceil(pow(1.8,($centrale_f-1))*300));
$bat = 5;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 6)
{ $n=($radar-1);
$metal -= ceil(pow(2,$n)*750);
$cristal -= ceil(pow(2,$n)*500);
$hydrogene -= ceil(pow(2,$n)*50);
$temps = time() + (ceil(pow(2,$radar)*720) - (0.005*$ingenieur*ceil(pow(2,($radar-1))*720)));
$bat = 6;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 7)
{
$n=($labo-1);
$metal -= ceil(pow(2,$n)*200);
$cristal -= ceil(pow(2,$n)*150);
$temps = time() + (ceil(pow(2,$labo)*720)) - (0.005*$ingenieur*ceil(pow(2,($labo-1))*720));
$bat = 7;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 8 )
{ $n=($chantier_terrestre-1);
$metal -= ceil(pow(2,$n)*520);
$cristal -= ceil(pow(2,$n)*380);
$temps = time() + (ceil(pow(2,$chantier_terrestre)*420)) - (0.005*$ingenieur*ceil(pow(2,($chantier_terrestre-1))*420));
$bat = 8;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 9)
{ $n=($chantier_spatial-1);
$metal -= ceil(pow(2,$n)*600);
$cristal -= ceil(pow(2,$n)*450);
$temps = time() + (ceil(pow(2,$chantier_spatial)*600)) - (0.005*$ingenieur*ceil(pow(2,($chantier_spatial-1))*600));
$bat = 9;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 10)
{ $n=($caserne-1);
$metal -= ceil(pow(2,$n)*200);
$cristal -= ceil(pow(2,$n)*100);
$temps = time() + (ceil(pow(2,$caserne)*300)) - (0.005*$ingenieur*ceil(pow(2,($caserne-1))*300));
$bat = 10;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
elseif ( $_GET['bat'] == 11)
{ $n=($silo-1);
$metal -= ceil(pow(2,$n)*400);
$cristal -= ceil(pow(2,$n)*260);
$temps = time() + (ceil(pow(2,$silo)*1200)) - (0.005*$ingenieur*ceil(pow(2,($silo-1))*1200));
$bat = 11;
mysql_query("UPDATE user SET metal='".$metal."', cristal='".$cristal."', temps='".$temps."', bat='".$bat."' WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
}
mysql_close();
@header("Location: batiment.php");
?>

11
page/construction.html Normal file
View file

@ -0,0 +1,11 @@
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
</head>
<body>
<br><br><br><br><br>
<table><tr><td><font color=red><font size=14>Non disponible pour le moment</font></font></td></tr></table>
</body>
</html>

149
page/construction.php Normal file
View file

@ -0,0 +1,149 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$metal = $donnees['metal'];
$cristal = $donnees['cristal'];
$hydrogene = $donnees['hydrogene'];
$labo = $donnees['recherches'];
$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'];
$developpement = $donnees['developpement'];
$blindage = $donnees['blindage'];
$spartan = $donnees['spartan'];
if ( $_GET['tec'] == 1)
{ $n=($informatique-1);
$metal -= ceil(pow(2,$n)*500);
$cristal -= ceil(pow(2,$n)*150);
$temps_t = time() + (ceil((pow(2,$labo)*840) - ((pow(2,$labo)*840)*0.07*$labo)));
$tec = 1;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', 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 = time() + (ceil((pow(2,$labo)*1200) - ((pow(2,$labo)*1200)*0.07*$labo)));
$tec = 2;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 = time() + (ceil((pow(2,$labo)*3000) - ((pow(2,$labo)*3000)*0.07*$labo)));
$tec = 3;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', 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 = time() + (ceil((pow(2,$labo)*1800) - ((pow(2,$labo)*1800)*0.07*$labo)));
$tec = 5;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 = time() + (ceil((pow(2,$labo)*1020) - ((pow(2,$labo)*1020)*0.07*$labo)));
$tec = 6;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', 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 = time() + (ceil((pow(2,$labo)*3300) - ((pow(2,$labo)*3300)*0.07*$labo)));
$tec = 7;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 = time() + (ceil((pow(2,$labo)*4800) - ((pow(2,$labo)*4800)*0.07*$labo)));
$tec = 8;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 = time() + (ceil((pow(2,$labo)*720) - ((pow(2,$labo)*720)*0.07*$labo)));
$tec = 9;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', 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 = time() + (ceil((pow(2,$labo)*22800) - ((pow(2,$labo)*2280)*0.07*$labo)));
$tec = 10;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', 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 = time() + (ceil((pow(2,$labo)*8220) - ((pow(2,$labo)*8220)*0.07*$labo)));
$tec = 11;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', 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 = time() + (ceil((pow(2,$labo)*3420) - ((pow(2,$labo)*3420)*0.07*$labo)));
$tec = 12;
mysql_query("UPDATE user SET metal ='".$metal."', 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 = time() + (ceil((pow(2,$labo)*10000) - ((pow(3,$labo)*10000)*0.07*$labo)));
$tec = 13;
mysql_query("UPDATE user SET metal ='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."', temps_t='".$temps_t."', tec='".$tec."' WHERE id='".$id."'");
}
mysql_close();
@header("Location: labo.php");
?>

144
page/defense.php Normal file
View file

@ -0,0 +1,144 @@
<? session_start(); ?>
<html>
<head>
<title>Space battleship</title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?php
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
include 'ajout_terrestre.php';
function sec ($time) {
$output = '';
$tab = array ('jour' => '86400', 'heure' => '3600', 'minute' => '60', 'seconde' => '1');
foreach ($tab as $key => $value) {
$compteur = 0;
while ($time > ($value-1)) {
$time = $time - $value;
$compteur++;
}
if ($compteur != 0) {
$output .= $compteur.' '.$key;
if ($compteur > 1) $output .= 's';
if ($value != 1) $output .= ' ';
}
}
echo $output;
}
$f = ceil((480 - (0.1*$chantier_terrestre*480)));
$g = ceil((1560 - (0.1*$chantier_terrestre*1560)));
$h = ceil((1800 - (0.1*$chantier_terrestre*1800)));
$i = ceil((6720 - (0.1*$chantier_terrestre*6720)));
$j = ceil((12960 - (0.1*$chantier_terrestre*12960)));
if ($temps_terrestre>0) {
switch ($unit_t) {
case 1:
$unit= "sparrowhawk"; break;
case 2:
$unit= "077-TC Pelican"; break;
case 3:
$unit= "C703 Shortsword Bomber "; break;
case 4:
$unit= "SHD Albatros"; break;
case 5:
$unit= "M12 LRV Warthogs"; break;
case 6:
$unit= "M12G1 LAAV Warthogs"; break;
case 7:
$unit= "M12A1 LAAV Warthogs"; break;
case 8:
$unit= "M808B Scorpions MBT"; break;
case 9:
$unit= "mitrailleuses automatique M247 GP"; break;
case 10:
$unit= "canons Gauss"; break;
case 11:
$unit= "DCA légères"; break;
case 12:
$unit= "DCA lourdes"; break;
case 13:
$unit= "lanceurs de missiles"; break;
}}
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<? if ($chantier_terrestre > 0) {
if ($temps_terrestre >0) {
echo "<table align=center><tr><td>
Construction terminé dans : ";
$tr=$temps_terrestre-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "</td></tr><tr><td>Construction de : ".$cons_terrestre." ".$unit."</td></tr>
</table>";} else {}
echo"<table align=center>
<tr><td width=150>lmages</td><td width=350>Description</td><td width=120>Nombre</td></tr>";
if ($chantier_terrestre >= 1) {
echo "<form method=post action=validation_def_1.php>
<tr>
<td><img src=images/def1.jpg ></td>
<td align=left>Mitrailleuses automatique M247 GP ( ".$def_1." unités )<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_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_1 /><br><input type=submit value=Envoyer class=bouttom>"; } 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 {}
if ($chantier_terrestre >= 3 && $energie_t >=2) {
echo "<form method=post action=validation_def_2.php>
<tr>
<td><img src=images/def2.jpg ></td>
<td align=left>Canons Gauss ( ".$def_2." unités )<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_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_2 /><br><input type=submit value=Envoyer class=bouttom>"; } 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 {}
if ($chantier_terrestre >= 4 && $armement >= 1) {
echo "<form method=post action=validation_def_3.php>
<tr>
<td><img src=images/ ></td>
<td align=left>DCA légères ( ".$def_3." unités )<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_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_3 /><br><input type=submit value=Envoyer class=bouttom>"; } 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 {}
if ($chantier_terrestre >= 6 && $armement >=3 && $enerigie_t >= 4) {
echo "<form method=post action=validation_def_4.php>
<tr>
<td><img src=images/lance_torpille.jpg ></td>
<td align=left>DCA lourdes ( ".$def_4." unités )<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_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_4 /><br><input type=submit value=Envoyer class=bouttom>"; } 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 {}
if ($chantier_terrestre >= 8 && $armement >=5 && $informatique >= 3) {
echo "<form method=post action=validation_def_5.php>
<tr>
<td><img src=images/canon_plasma.jpg ></td>
<td align=left>Lanceurs de missiles ( ".$def_5." unités )<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_terrestre < time() ) { echo "<input type=text class=zone_texte size=4 maxlength=4 name=cons_def_5 /><br><input type=submit value=Envoyer class=bouttom>"; } 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 {}
} else { ?><SCRIPT language="javascript">
parent.frames["changement"].window.location="sans_terrestre.php"
</SCRIPT> <?
echo "<center><table><tr><td>Vous devez d'abord construire un chantier spatial !</td></tr></table></center>"; }
echo "</table>"; ?>
</body>
</html>

108
page/depart.php Normal file
View file

@ -0,0 +1,108 @@
<? session_start(); ?>
<html>
<head>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
$case = $cases - ($mine_m +$mine_c +$mine_h +$centrale_s +$centrale_f +$radar+$labo+$chantier_terrestre +$chantier_spatial+$caserne +$silo );
$diametre = $cases * 92;
function convert_ts_fr($tstamp) {
echo date ( 'H:i:s d/m/Y' , $tstamp ); }
switch ($image) {
case 1 :
$image = "images/p1.jpg";
break;
case 2 :
$image = "images/p2.jpg";
break;
case 3 :
$image = "images/p3.jpg";
break;
case 4 :
$image = "images/p4.jpg";
break;
case 5 :
$image = "images/p5.jpg";
break;
case 6 :
$image = "images/p6.jpg";
break;
case 7 :
$image = "images/p7.jpg";
break;
case 8 :
$image = "images/p8.jpg";
break;
case 9 :
$image = "images/p9.jpg";
break;
case 10 :
$image = "images/p10.jpg";
break;
case 11 :
$image = "images/p11.jpg";
break;
case 12 :
$image = "images/p12.jpg";
break;
}
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$nbr = mysql_query("SELECT COUNT(*) AS nbre FROM mail WHERE destinataire='".$pseudo."' AND vu='1'");
$nbre_non = mysql_fetch_assoc($nbr);
?>
</head>
<body>
<?
echo "
<table width=519 align=center>
<tbody><tr>
<td colspan=4 align=left class=z>
<a href=rename.php>".$nomplanete."</a> (".$pseudo.")
</td>
</tr>
<tr>
<td>
Heure du serveur </td>
<td colspan=3>"; convert_ts_fr(time()); echo"</td>
</tr>";
if ($nbre_non['nbre'] > 0) { echo "<tr><td colspan=4><a href=lire_message.php>Vous avez ".$nbre_non['nbre']." nouveaux messages</a></td></tr>"; }
echo" <tr>
<td colspan=4 align=left class=z>
Evènements </td>
</tr>
<tr>
<td colspan=4 align=center>
<img src=".$image." height=200 width=200>
</td>
</tr><tr>
<td class=z>
Diamètre</td> <td colspan=3>".$diametre." km ( ".$case." / ".$cases." cases ) </td>
</tr>
<tr>
<tr>
<td class=z>
Position</td><td colspan=3><a href=carte.php?galaxy=".$galaxy."&ss=".$ss.">[".$galaxy.":".$ss.":".$pos."]</a></td></tr>
<tr><td class=z>
Race</td><td colspan=3>".$race."</td></tr>
<tr><td class=z>";
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$ee = mysql_query("SELECT points FROM classement WHERE pseudo='".$pseudo."'");
$data = mysql_fetch_array($ee);
echo "Classement</td><td colspan=3><a href=voir_classement.php >".$data['points']." points</a></td></tr>
</tbody></table>"; ?>
</body></html>

BIN
page/design/bleu.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

112
page/design/design.css Normal file
View file

@ -0,0 +1,112 @@
body {
background-image: url('screen119.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: right;
background-color: black;
color: #CCCCFF;
font-size: 12px;
font-family: verdana, serif;
scrollbar-face-color: black;
scrollbar-shadow-color: rgb(98,98,98);
scrollbar-highlight-color: rgb(72,72,72);
scrollbar-3dlight-color: rgb(136,136,136);
scrollbar-darkshadow-color: rgb(81,81,81);
scrollbar-track-color: rgb(72,72,72);
scrollbar-arrow-color: #A8A8A8;
}
table {
color: #999999;
font-size: 12px;
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 0px;
}
TD {
background-color: #330066;
border: 1px solid transparent;
}
.bouttom {
color: white;
font-family: verdana, serif;
BORDER-STYLE: outset;
background-color: #330066;
BORDER-LEFT-COLOR: white;
BORDER-BOTTOM-COLOR: #330066;
BORDER-TOP-COLOR: white;
BACKGROUND-COLOR: #330066;
BORDER-RIGHT-COLOR:#330066;
}
.bouttom:hover {
BORDER-STYLE: inset;
color: red;
}
.zone_texte {
background-color: #9999FF;
color: #000099;
border: 1px solid black;
font-family: verdana, serif;
}
.zone_texte:focus {
background-color: #9999FF;
color: #000099;
border: 1px solid black;
font-family: verdana, serif;
}
a {
color: #CCCCCC;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
a:hover {
color: #CCCCCC;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: pointer;
}
a:active, a:focus {
color: #CCCCCC;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: wait;
}
a:visited {
color: #CCCCCC;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
cursor: pointer;
}
img {
border: 0;
}
#datetime {
color: #7093DB;
font-weight: bold;
}
TD.a {
border: 0;
text-align: center;
}
.z {
background-color:#330099;
}

110
page/design/design1.css Normal file
View file

@ -0,0 +1,110 @@
body {
background-image: url('bleu.jpg');
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
scrollbar-face-color: black;
scrollbar-shadow-color: rgb(98,98,98);
scrollbar-highlight-color: rgb(72,72,72);
scrollbar-3dlight-color: rgb(136,136,136);
scrollbar-darkshadow-color: rgb(81,81,81);
scrollbar-track-color: rgb(72,72,72);
scrollbar-arrow-color: #A8A8A8;
}
table {
background-color: black;
color: #7093DB;
font-size: 12px;
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 1px solid black;
}
.bouttom {
color: #afbdff;
font-family: verdana, serif;
BORDER-STYLE: outset;
background-color: navy;
BORDER-LEFT-COLOR: white;
BORDER-BOTTOM-COLOR: navy;
BORDER-TOP-COLOR: white;
BACKGROUND-COLOR: navy;
BORDER-RIGHT-COLOR: navy;
}
.bouttom:hover {
BORDER-STYLE: inset;
color: red;
}
.zone_texte {
background-color: #111e40;
color: #afbdff;
border: 1px solid #2458b5;
font-family: verdana, serif;
}
.zone_texte:focus {
background-color: #111e75;
color: #afbdff;
border: 1px solid #2458b5;
font-family: verdana, serif;
}
a {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
a:hover {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: pointer;
}
a:active, a:focus {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: wait;
}
a:visited {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
cursor: pointer;
}
img {
border: 0;
}
#datetime {
color: #7093DB;
font-weight: bold;
}
TD.a {
border: 0;
text-align: center;
}
/*QPushButton {
border-radius: 2px;
border: 1px solid #8f8f91;
background-color: qlineargradient(x1: 1, y1: 0, x2: 0, y2: 1, stop: 0 #f6f7fa, stop: 1 #7093DB);
}
QPushButton:pressed {
background-color: qlineargradient(x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #dadbde, stop: 1 #f6f7fa);
}*/

View file

@ -0,0 +1,71 @@
body {
background-image: url('screen119.jpg');
background-attachment: fixed;
background-repeat: no-repeat;
background-position: right;
background-color: black;
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
scrollbar-face-color: black;
scrollbar-shadow-color: rgb(98,98,98);
scrollbar-highlight-color: rgb(72,72,72);
scrollbar-3dlight-color: rgb(136,136,136);
scrollbar-darkshadow-color: rgb(81,81,81);
scrollbar-track-color: rgb(72,72,72);
scrollbar-arrow-color: #A8A8A8;
}
table {
background-color: black;
color: #7093DB;
font-size: 12px;
border-collapse: separate;
empty-cells: show;
text-align: center;
border: 1px solid black;
}
TD.a {
border-bottom: 0;
}
TD {
border-bottom: 1px #0099FF solid;
}
a {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
border: none;
}
a:hover {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: pointer;
}
a:active, a:focus {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: none;
cursor: wait;
}
a:visited {
color: #7093DB;
font-size: 12px;
font-family: verdana, serif;
text-decoration: underline;
cursor: pointer;
}
img {
border: 0;
}

BIN
page/design/screen119.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 72 KiB

25
page/envoyer_message.php Normal file
View file

@ -0,0 +1,25 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
if (isset($_GET['pseudo'])) { $p=$_GET['pseudo'];} else { $p=''; }
if (isset($_GET['ok'])) { $_GET['ok']=1; } else { $_GET['ok']=0; }
?>
</head>
<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="10" maxlength="20" name="message_destinataire" <? echo "value=".$p;?> ></td></tr>
<tr><td>Sujet</td><td><input type="text" class="zone_texte" size="10" 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="bouttom"></td></tr>
</TABLE>
</form>
</body>
</html>

33
page/ferme.php Normal file
View file

@ -0,0 +1,33 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<tr><td><img src= height=120 width=120></td>
<td width=600>Champ d'algues Niveau ".$ferme."<br><br>
Important pour creer de nouveaux bigorneaux et la nourriture quotidienne de vos troupes.<br><br>";
$a=$ferme+5;
$c=$ferme-2;
echo '<table><tr><td>Niveau</td><td>Production par heure</td></td=r><br>';
for ($c;$c<$a;$c++) {
$b=ceil($c * exp(0.6 * $c) + 100);
$h=ceil($c * exp(0.6 * $c) + 100) - ceil(($c-1) * exp(0.6 * ($c-1)) + 100);
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td></tr>';
}
echo"</table></td></tr>";
?>
</body>
</html>

261
page/flotte.js Normal file
View file

@ -0,0 +1,261 @@
function vitesse() {
var vi;
vi = document.getElementsByName("vitesse")[0].value;
vi = vi / 10;
return(vi);
}
function target() {
var galaxie;
var systeme;
var planete;
galaxie = document.getElementsByName("galaxie_arr")[0].value;
systeme = document.getElementsByName("systeme_arr")[0].value;
planete = document.getElementsByName("planete_arr")[0].value;
return("["+galaxie+":"+systeme+":"+planete+"]");
}
function setTarget(galaxie, ss, planete) {
document.getElementsByName('galaxie_arr')[0].value = galaxie;
document.getElementsByName('systeme_arr')[0].value = ss;
document.getElementsByName('planete_arr')[0].value = planete;
}
function setMission(mission) {
document.getElementsByName('ordre')[0].selectedIndex = mission;
return;
}
function setUnion(unionid) {
document.getElementsByName('union2')[0].selectedIndex = unionid;
}
function setTargetLong(galaxie, ss, planete, categorie, mission, cnt) {
setTarget(galaxie, ss, planete, categorie);
setMission(mission);
setUnions(cnt);
}
function min(a, b) {
a = a * 1;
b = b * 1;
if (a > b) {
return b;
} else {
return a;
}
}
function maxvitesse() {
var msp = 1000000000;
for (i = 1; i<=14; i++) {
if (document.getElementsByName("vaisseau" + i)[0]) {
if ((document.getElementsByName("vitesse" + i)[0].value * 1) >= 1
&& (document.getElementsByName("vaisseau" + i)[0].value * 1) >= 1) {
msp = min(msp, document.getElementsByName("vitesse" + i)[0].value);
}
}
}
return(msp);
}
function distance() {
var galaxie_dep;
var systeme_dep;
var planete_dep;
var galaxie_arr;
var systeme_arr;
var planete_arr;
var dist;
galaxie_dep = document.getElementsByName("galaxie_dep")[0].value;
systeme_dep = document.getElementsByName("systeme_dep")[0].value;
planete_dep = document.getElementsByName("planete_dep")[0].value;
galaxie_arr = document.getElementsByName("galaxie_arr")[0].value;
systeme_arr = document.getElementsByName("systeme_arr")[0].value;
planete_arr = document.getElementsByName("planete_arr")[0].value;
dist = 0;
if ((galaxie_arr - galaxie_dep) != 0) {
dist = Math.abs(galaxie_arr - galaxie_dep) * 20000;
} else if ((systeme_arr - systeme_dep) != 0) {
dist = Math.abs(systeme_arr - systeme_dep) * 95 + 2700;
} else if ((planete_arr - planete_dep) != 0) {
dist = Math.abs(planete_arr - planete_dep) * 5 + 1000;
} else {
dist = 5;
}
return(dist);
}
function duree() {
var coef_vit;
coef_vit = document.getElementsByName("facteurvitesse")[0].value;
mvit = maxvitesse();
vit = vitesse();
dist = distance();
return Math.ceil(((35000 / vit * Math.sqrt(dist * 10 / mvit) + 10) / coef_vit));
}
function conso() {
var conso = 0;
var conso_base = 0;
var valeurs;
var i;
coef_vit = document.getElementsByName("facteurvitesse")[0].value;
dist = distance();
dur = duree();
for (i = 1; i <= 14; i++) {
if (document.getElementsByName("vaisseau" + i)[0]) {
vitv = document.getElementsByName("vitesse" + i)[0].value;
vite = 35000 / (dur * coef_vit - 10) * Math.sqrt(dist * 10 / vitv);
conso_base = document.getElementsByName("conso" + i)[0].value
* document.getElementsByName("vaisseau" + i)[0].value;
conso += conso_base * dist / 35000 * ((vite / 10) + 1) * ((vite / 10) + 1);
}
}
conso = Math.round(conso) + 1;
return(conso);
}
function stockage() {
var stockage = 0;
for (i=1; i<=14; i++) {
if (document.getElementsByName("vaisseau" + i)[0]) {
if ((document.getElementsByName("vaisseau" + i)[0].value * 1) >= 1) {
stockage
+= document.getElementsByName("vaisseau" + i)[0].value
* document.getElementsByName("capacite" + i)[0].value
}
}
}
stockage -= conso();
return(stockage);
}
function Infov() {
document.getElementById("distance").innerHTML = distance();
var secondes = duree();
document.forms["flotte"].elements["temps"].value = secondes;
var heures = Math.floor(secondes / 3600);
secondes -= heures * 3600;
var minutes = Math.floor(secondes / 60);
secondes -= minutes * 60;
if (minutes < 10) minutes = "0" + minutes;
if (secondes < 10) secondes = "0" + secondes;
document.getElementById("duree").innerHTML = heures + ":" + minutes + ":" + secondes + " h";
var stor = stockage();
var cons = conso();
document.getElementById("maxvitesse").innerHTML = maxvitesse();
if (stor >= 0) {
document.getElementById("conso").innerHTML = '<font color="lime">'+cons+'</font>';
document.getElementById("stockage").innerHTML = '<font color="lime">'+stor+'</font>';
} else {
document.getElementById("conso").innerHTML = '<font color="red">'+cons+'</font>';
document.getElementById("stockage").innerHTML = '<font color="red">'+stor+'</font>';
}
}
function setRessource(id, val) {
if (document.getElementsByName(id)[0]) {
document.getElementsByName("ressource" + id + "_aff")[0].value = val;
}
}
function maxRessource(id) {
var ressource = document.getElementsByName("ressource" + id)[0].value;
var ressourcechoisie = document.getElementsByName("ressource" + id + "_aff")[0].value;
var stockCap = stockage();
var r1Transport = document.getElementsByName("ressource1_aff")[0].value;
var r2Transport = document.getElementsByName("ressource2_aff")[0].value;
var r3Transport = document.getElementsByName("ressource3_aff")[0].value;
var freeCapacity = Math.min(Math.max(stockCap - r1Transport - r2Transport - r3Transport + ressourcechoisie*1, 0), ressource);
if (document.getElementsByName("ressource" + id + "_aff")[0]) {
document.getElementsByName("ressource" + id + "_aff")[0].value = freeCapacity;
}
calculateTransportCapacity();
}
function maxTritium() {
var stockCap = stockage(); // Capacitée de stoquage
var r1toTransport = document.getElementsByName("ressource1_aff")[0].value; // valeur inscrite dans le titane a envoyé pas le titane qu'on a quai
var r2toTransport = document.getElementsByName("ressource2_aff")[0].value; //pareille pour le carbone
var r3Transport = document.getElementsByName("ressource3")[0].value - (conso()+1); //tritium a quai - conso
var freeCapacity = stockCap - r1toTransport - r2toTransport; // capacitée de stoquage moins le titane/carbonne deja "a envoyer"
// si on a plus de place pour foutre du tritium ça reste a 0
if (freeCapacity < 0) {
document.getElementsByName("ressource3_aff")[0].value = "0";
}
// si on a encore de la place
if (freeCapacity > 0) {
// si on a plus de place que de tritium a quai
if (freeCapacity >= r3Transport){
document.getElementsByName("ressource3_aff")[0].value = r3Transport;
// si on a moins de place que de tritium a quai on calcule pour tritium 1000 avec une place de 500
}
if (freeCapacity < r3Transport){
document.getElementsByName("ressource3_aff")[0].value = freeCapacity;
}
}
calculateTransportCapacity();
}
function maxRessources() {
var id;
var stockCap = stockage();
var r1Transport = document.getElementsByName("ressource1")[0].value;
var r2Transport = document.getElementsByName("ressource2")[0].value;
var r3Transport = document.getElementsByName("ressource3")[0].value - (conso()+1);
var freeCapacity = stockCap - r1Transport - r2Transport - r3Transport;
if (freeCapacity < 0) {
r1Transport = Math.min(r1Transport, stockCap);
r2Transport = Math.min(r2Transport, stockCap - r1Transport);
r3Transport = Math.min(r3Transport, stockCap - r1Transport - r2Transport);
}
document.getElementsByName("ressource1_aff")[0].value = Math.max(r1Transport, 0);
document.getElementsByName("ressource2_aff")[0].value = Math.max(r2Transport, 0);
document.getElementsByName("ressource3_aff")[0].value = Math.max(r3Transport, 0);
calculateTransportCapacity();
}
function calculateTransportCapacity() {
var r1= Math.abs(document.getElementsByName("ressource1_aff")[0].value);
var r2= Math.abs(document.getElementsByName("ressource2_aff")[0].value);
var r3= Math.abs(document.getElementsByName("ressource3_aff")[0].value);
tc = stockage() - r1 - r2 - r3;
if (tc < 0) {
document.getElementById("reste_ressources").innerHTML="<font color=red>"+tc+"</font>";
} else {
document.getElementById("reste_ressources").innerHTML="<font color=lime>"+tc+"</font>";
}
return tc;
}

182
page/flotte.php Normal file
View file

@ -0,0 +1,182 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$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;
?>
<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>
</HEAD>
<body>
<form name="flotte">
</form>
<form method="post" action="construction.html">
<table align=center>
<TR><td width="60">Images</td><TD width="200">Vaisseaux</TD><TD width="150">Nombre disponible</TD><TD width="50">Max</TD><TD width="100">A envoyer<br><? echo "Flottes : ".$nbr."/".$trez."</TD></TR>"; ?>
<?php
if( $transporteur > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Cargos de classe Parabola</td>
<td ><? echo $transporteur; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau1');">max</a></td>
<td><input name="maxvaisseau1" value="<? echo $transporteur; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau1" /></td>
</tr><? } else {} ?>
<?if( $gtransporteur > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Cargos de classe Laden</td>
<td><? echo $gtransporteur; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau2');">max</a></td>
<td><input name="maxvaisseau2" value="<? echo $gtransporteur; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau2" /></td>
</tr><? } else {} ?>
<?if( $vcolo > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Vaisseaux de colonisation de classe Odyssey</td>
<td><? echo $vcolo; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau3');">max</a></td>
<td><input name="maxvaisseau3" value="<? echo $vcolo; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau3" /></td>
</tr><? } else {} ?>
<?if( $sonde > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Drones despionnage de classe Clarion</td>
<td><? echo $sonde; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau4');">max</a></td>
<td><input name="maxvaisseau4" value="<? echo $sonde; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau4" /></td>
</tr><? } else {} ?>
<?if( $recycleur > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Recycleurs de classe Minotaur </td>
<td><? echo $recycleur; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau5');">max</a></td>
<td><input name="maxvaisseau5" value="<? echo $recycleur; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau5" /></td>
</tr><? } else {} ?>
<?if( $chasseur > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>C709 Longsword Interceptor</td>
<td><? echo $chasseur; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau6');">max</a></td>
<td><input name="maxvaisseau6" value="<? echo $chasseur; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau6" /></td>
</tr><? } else {} ?>
<?if( $fregate > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Frégate</td>
<td><? echo $fregate; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau7');">max</a></td>
<td><input name="maxvaisseau7" value="<? echo $fregate; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau7" /></td>
</tr><? } else {} ?>
<?if( $croiseur > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Croiseurs de classe Halcyon</td>
<td><? echo $croiseur; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau8');">max</a></td>
<td><input name="maxvaisseau8" value="<? echo $croiseur; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau8" /></td>
</tr><? } else {} ?>
<?if( $croiseur2 > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Croiseurs de classe Marathon</td>
<td><? echo $croiseur2; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau9');">max</a></td>
<td><input name="maxvaisseau9" value="<? echo $croiseur2; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau9" /></td>
</tr><? } else {} ?>
<?if( $pv > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Portes vaisseaux</td>
<td><? echo $pv; ?></a></td>
<td width="70" ><a href="javascript:maxvaisseau('vaisseau10');">max</a></td>
<td><input name="maxvaisseau10" value="<? echo $pv; ?>" type="hidden">
<input type="text" class="zone_texte" size="8" maxlength="10" name="vaisseau10" /></td>
</tr><? } else {} ?>
<?if( $sto > 0){ ?>
<tr><td><img src="images/." width="50" height="40" ></td>
<td>Stations orbitales</td>
<td><? echo $sto; ?></a></td>
<td width="70" ></td>
<td></td>
</tr><? } else {} ?>
<?
?>
<TR><TD colspan="3"><a href="javascript:maxvaisseaux();">Tous les vaisseaux</a></td><TD colspan="2">
<a href="javascript:aucunvaisseaux();">Aucun vaisseau</a></TD></TR>
<TR><TD colspan="5"><? if ($nbr < ($trez)) { echo "<input type=submit value=Envoyer class=bouttom>"; } else { echo "Nombre de flotte total atteint"; } ?></TD></TR>
</table>
</form>
</BODY>
</HTML>

269
page/flotte2.php Normal file
View file

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

103
page/flotte3.php Normal file
View file

@ -0,0 +1,103 @@
<?
session_start();
$id=$_SESSION['id'];
$dep_galaxy=$_SESSION['galaxy'];
$dep_ss=$_SESSION['ss'];
$dep_pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'");
$donnees = mysql_fetch_array($x);
$metal = pow($donnees['metal']);
$cristal = pow($donnees['cristal']);
$hydrogene = pow($donnees['hydrogene']);
if ( $_POST['galaxie_arr'] != $galaxie_dep && $_POST['systeme_arr'] != $ss_dep && $_POST['planete_arr'] != $pos_dep) {
if ( $_POST['galaxie_arr'] < 6) {
if ( $_POST['systeme_arr'] < 151) {
if ( $_POST['planete_arr'] < 13) {
// COORDONNEES
$_POST['galaxie_arr'] = $arr_galaxy;
$_POST['systeme_arr'] = $arr_ss
$_POST['planete_arr'] = $arr_pos;
// TEMPS
$temps1 = time();
$temps_arr = time() + $_POST['temps'];
$temps_retour = time() + (2*$_POST['temps']);
// RESSOURCES
if (isset($_POST['ressource1_aff'])) { $met = $_POST['ressource1_aff']; } else { $_POST['ressource1_aff']=0; }
if ($_POST['ressource1_aff'] > $metal) { $met=$metal; }
else { $met=$_POST['ressource1_aff']; }
if ($met < 0) { $met = 0; } else { $met = $_POST['ressource1_aff']; }
$metal -= $met;
if (isset($_POST['ressource2_aff'])) { $cri = $_POST['ressource2_aff']; } else { $_POST['ressource2_aff']=0; }
if ($_POST['ressource2_aff'] > $cristal) { $cri=$cristal; }
else { $cri=$_POST['ressource2_aff']; }
if ($cri < 0) { $cri = 0; } else { $cri = $_POST['ressource2_aff']; }
$cristal -= $cri;
if (isset($_POST['ressource3_aff'])) { $hy = $_POST['ressource3_aff']; } else { $_POST['ressource3_aff']=0; }
if ($_POST['ressource3_aff'] > $hydrogene) { $hy=$hydrogene; }
else { $hy=$_POST['ressource3_aff']; }
if ($hy < 0) { $hy = 0; } else { $hy = $_POST['ressource3_aff']; }
$hydrogene -= $hy;
// NOMBRE DE FLOTTE
$retour = mysql_query("SELECT COUNT (*) AS nbre FROM flotte WHERE pseudo='".$pseudo."'");
$d = mysql_fetch_array($retour);
$nbr = $d['nbre']+1;
// MISSION
if ($_POST['ordre'] == 'transport') {
$mission = 1; }
else if ($_POST['ordre'] == 'stationner') {
$mission = 2; }
else if ($_POST['ordre'] == 'attaquer') {
$mission = 3; }
else if ($_POST['ordre'] == 'espionner') {
$mission = 4; }
else if ($_POST['ordre'] == 'recycler') {
$mission = 5; }
else if ($_POST['ordre'] == 'coloniser') {
$mission = 6; }
else { $mission = 0; }
// VAISSEAUX ENVOYES
if (isset($_POST['vaisseau1'])) { $t = $_POST['vaisseau1']; } else { $_POST['vaisseau1']=0; }
if ($_POST['vaisseau1'] > $transporteur) { $t=$transporteur; }
else { $t=pow($_POST['vaisseau1']); }
$transporteur -= $t;
if (isset($_POST['vaisseau2'])) { $gt = $_POST['vaisseau2']; } else { $_POST['vaisseau2']=0; }
if ($_POST['vaisseau2'] > $gtransporteur) { $gt=$gtransporteur; }
else { $gt=pow($_POST['vaisseau2']); }
$gtransporteur -= $gt;
if (isset($_POST['vaisseau3'])) { $mt = $_POST['vaisseau3']; } else { $_POST['vaisseau3']=0; }
if ($_POST['vaisseau3'] > $m_transporteur) { $mt=$m_transporteur; }
else { $mt=pow($_POST['vaisseau3']); }
$m_transporteur -= $mt;
// MAJ
mysql_query("INSERT INTO flotte VALUES('$nbr', '$pseudo', '$race', '$dep_galaxy', '$dep_ss', '$dep_pos',
'$arr_galaxy', '$arr_ss', '$arr_pos', '$mission', '$temps', '$temps_arr', '$temps_retour', '$met',
'$cri', '$hy', '$t', '$gt', '$vc', '$s', '$re', '$ch', '$fr', '$cr', '$crr', '$pv')");
mysql_query("UPDATE user SET transporteur='".$transporteur."', g_transporteur='".$g_transporteur."', metal='".$metal."', cristal='".$cristal."', hydrogene='".$hydrogene."'WHERE ID='".$id."'");
} else { echo "Mauvaises coordonnées, les planètes s'arretent à 12"; }
} else { echo "Mauvaises coordonnées, les systèmes solaires s'arretent à 150"; }
} else { echo "Mauvaises coordonnées, les galaxies s'arretent à 5"; }
} else { echo "Mauvaises coordonnées"; }
?>

BIN
page/images/albatross.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
page/images/armement.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 47 KiB

BIN
page/images/blindage.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

BIN
page/images/centrale_f.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 32 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 33 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
page/images/croiseur1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

BIN
page/images/croiseur2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 23 KiB

BIN
page/images/def1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
page/images/def2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
page/images/energie_t.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 50 KiB

BIN
page/images/fregate.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

BIN
page/images/fusillier.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
page/images/grenadier.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
page/images/ingenieur.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
page/images/longsword.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
page/images/marine.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
page/images/medecin.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

BIN
page/images/medecine.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

BIN
page/images/mine_c.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
page/images/mine_m.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
page/images/msg.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1,019 B

BIN
page/images/ordinateur.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

BIN
page/images/p1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
page/images/p10.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

BIN
page/images/p11.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 62 KiB

BIN
page/images/p12.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 68 KiB

BIN
page/images/p2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

BIN
page/images/p3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
page/images/p4.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
page/images/p5.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 67 KiB

BIN
page/images/p6.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

BIN
page/images/p7.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
page/images/p8.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
page/images/p9.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 KiB

BIN
page/images/pelican.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6 KiB

BIN
page/images/radar.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 60 KiB

BIN
page/images/reacteur.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 44 KiB

BIN
page/images/reacteur_f.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

BIN
page/images/reacteur_ff.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

BIN
page/images/scorpion.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

BIN
page/images/silo.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

BIN
page/images/sniper.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 46 KiB

BIN
page/images/sonde.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

BIN
page/images/sparowawk.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

BIN
page/images/spartan.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

BIN
page/images/sto.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.7 KiB

BIN
page/images/tactique.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 45 KiB

BIN
page/images/tcao.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 49 KiB

BIN
page/images/warthog1.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.8 KiB

BIN
page/images/warthog2.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 KiB

BIN
page/images/warthog3.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.6 KiB

391
page/labo.php Normal file
View file

@ -0,0 +1,391 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
include 'ajout_niveau_t.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 ($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 ($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 ($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;
}
?>
<script language="javascript" src="time.js"></script>
</head>
<body>
<table>
<tr>
<?
if ($labo > 0) {
if ($labo >= 1) {
echo "<tr><td><img src=images/ordinateur.jpg height=120 width=120></td>
<td width=600>IA 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 width=200>";
if ($temps_t > 0) {
if ($tec==1) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=1\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 2 && $informatique >=2) {
echo "<tr><td><img src=images/radar_techno.jpg height=120 width=120></td>
<td width=600>Radar 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 width=200>";
if ($temps_t > 0) {
if ($tec==2) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=2\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 5) {
echo "<tr><td><img src=images/armement.jpg height=120 width=120></td>
<td width=600>Armement 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 width=200>";
if ($temps_t > 0) {
if ($tec==3) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=3\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 4) {
echo "<tr><td><img src=images/blindage.jpg height=120 width=120></td>
<td width=600>Blindage 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 width=200>";
if ($temps_t > 0) {
if ($tec==12) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=12\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 2) {
echo "<tr><td><img src=images/energie_t.jpg height=120 width=120></td>
<td width=600>Maitrise de l'énergie 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 width=200>";
if ($temps_t > 0) {
if ($tec==5) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=5\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 2) {
echo "<tr><td><img src=images/reacteur.jpg height=120 width=120></td>
<td width=600>Réacteur à combustion 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 width=200>";
if ($temps_t > 0) {
if ($tec==6) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=6\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 4 && $energie_t >=2 && $reacteur >= 4) {
echo "<tr><td><img src=images/reacteur_f.jpg height=120 width=120></td>
<td width=600>Réacteur à fusion 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 width=200>";
if ($temps_t > 0) {
if ($tec==7) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=7\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 6 && $energie_t >=5 && $reacteur_f >= 4) {
echo "<tr><td><img src=images/reacteur_ff.jpg height=120 width=120></td>
<td width=600>Réacteur a fusion de type II 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 width=200>";
if ($temps_t > 0) {
if ($tec==8) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=8\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 1) {
echo "<tr><td><img src=images/medecine.jpg height=120 width=120></td>
<td width=600>Médecine 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 width=200>";
if ($temps_t > 0) {
if ($tec==9) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=9\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 3) {
echo "<tr><td><img src=images/tactique.jpg height=120 width=120></td>
<td width=600>Tactiques de combats 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 width=200>";
if ($temps_t > 0) {
if ($tec==10) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=10\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 8 && $mine_m >= 18 && $mine_c >= 15 && $informatique >= 8) {
echo "<tr><td><img src=images/citydevlopment.jpg height=120 width=120></td>
<td width=600>Développement 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 width=200>";
if ($temps_t > 0) {
if ($tec==11) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=11\">Annuler</a>";
}
else {}
}
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>"; } else {}
if ($labo >= 8 && $medecine >= 5 && $informatique >= 8) {
echo "<tr><td><img src=images/spartan_techno.jpg height=120 width=120></td>
<td width=600>Spartan 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 width=200>";
if ($temps_t > 0) {
if ($tec==13) {
$tr=$temps_t-time();
echo '<div id="axion"></div>';
echo '<script language="JavaScript">reste('.$tr.');</script>';
echo "<a href=\"anul_tec.php?tec=13\">Annuler</a>";
}
else {}
}
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 {}
}
else { ?><SCRIPT language="javascript">
parent.frames["changement"].window.location="sans_labo.php"
</SCRIPT> <?
echo "Vous devez construire un laboratoire pour y avoir accès"; }
?>
</body>
</html>

60
page/lire_message.php Normal file
View file

@ -0,0 +1,60 @@
<? session_start(); ?>
<HTML>
<HEAD>
<TITLE>Space Battleship</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$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=bouttom></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, sujet, expediteur, temps, message FROM mail WHERE destinataire='".$pseudo."' ORDER BY id DESC LIMIT $i,25");
$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=images/msg.jpg></a></td>
<td>".$donnees['sujet']."</td></tr>
<tr><td colspan=4 align=center>".$donnees['message']."</td></tr>
<tr><td colspan=4 width=20></td></tr>";
}
echo "<tr><td colspan=4 align=center><input type=submit value='Supprimer le message' class=bouttom></td></tr></table></form></center>"; }
else { echo"<table><tr><td>Aucuns messages</td></tr></table>"; }
?>
</body>
</html>

33
page/message.php Normal file
View file

@ -0,0 +1,33 @@
<?
session_start();
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
mysql_connect("leon.redby.fr", "leon0", "7268032");
mysql_select_db("leon0");
$x = mysql_query("SELECT * FROM user WHERE id='".$id."'");
$donnees = mysql_fetch_array($x);
$race = $donnees['race'];
$pseudo = $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'] !='' ) {
mysql_query("INSERT INTO mail VALUES('', '1', '".htmlspecialchars($_POST['message_destinataire'])."', '".$pseudo."', '".htmlspecialchars($_POST['sujet_message'])."', '".htmlspecialchars($_POST['message'])."', '".$temps."')");
}
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");
?>

36
page/mine_c.php Normal file
View file

@ -0,0 +1,36 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<table align=center>
<tr><td><img src=images/mine_c.png height=120 width=120></td>
<td width=200>Usine de cristal niveau ".$mine_c."<br><br>";
$a=$mine_c+5;
$c=$mine_c-2;
echo '<table><tr><td>Niveau</td><td>Production par heure</td><td>Consommation énergie</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil((($c*20+(exp(($c)*0.325)*10))));
$h=ceil((($c*20+(exp(($c)*0.325)*10)))) - ceil(((($c-1)*20+(exp(($c-1)*0.325)*10))));
$p=ceil((exp($c*0.28)*10));
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
}
echo"</table></td></tr>";
?>
</body>
</html>

39
page/mine_h.php Normal file
View file

@ -0,0 +1,39 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<table align=center>
<tr><td><img src=images/mine_h.png height=120 width=120></td>
<td width=200>Synchronisateur d'hydrogène niveau ".$mine_h."<br><br>";
$a=$mine_h+5;
$c=$mine_h-2;
echo '<table><tr><td>Niveau</td><td>Production par heure</td><td>Consommation énergie</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil(($c*12+(exp($c*0.32)*10)));
$h=ceil(($c*12+(exp($c*0.32)*10))) - ceil((($c-1)*12+(exp(($c-1)*0.32)*10)));
$p=ceil((exp($c*0.31)*10));
$g=ceil((exp($c*0.31)*10)) - ceil((exp(($c-1)*0.31)*10));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
}
echo"</table></td></tr>";
?>
</body>
</html>

39
page/mine_m.php Normal file
View file

@ -0,0 +1,39 @@
<? session_start(); ?>
<html>
<head>
<title></title>
<link rel="stylesheet" media="screen" name="design" href="design/design.css">
<?
$id=$_SESSION['id'];
$galaxy=$_SESSION['galaxy'];
$ss=$_SESSION['ss'];
$pos=$_SESSION['pos'];
include 'ressource.php';
include 'bdd.php';
?>
</head>
<body>
<table>
<tr>
<? echo "<table align=center>
<tr><td><img src=images/mine_m.png height=120 width=120></td>
<td width=200>Usine de méttalurgie niveau ".$mine_m."<br><br>";
$a=$mine_m+5;
$c=$mine_m-2;
echo '<table><tr><td>Niveau</td><td>Production par heure</td><td>Consommation énergie</td></tr><br>';
for ($c;$c<$a;$c++) {
$b=ceil((($c*40+(exp($c*0.33)*10))));
$h=ceil((($c*40+(exp($c*0.33)*10)))) - ceil(((($c-1)*40+(exp(($c-1)*0.33)*10))));
$p=ceil((exp($c*0.28)*10));
$g=ceil((exp($c*0.28)*10)) - ceil((exp(($c-1)*0.28)*10));
echo '<tr><td>'.$c.'</td><td>'.$b.' (+ '.$h.')</td><td>'.$p.' (+ '.$g.')</td></tr>';
}
echo"</table></td></tr>";
?>
</body>
</html>

BIN
page/mine_m.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

Some files were not shown because too many files have changed in this diff Show more