<?php
include ('logue.php');
include ('entete2.php');
include ('ressource.php');
include ('siege.php');
include 'destruction3.php';
include ('entete.php');

if ($row2[techenergie_evolution] == "0000-00-00 00:00:00" OR $row2[techlaser_evolution] == "0000-00-00 00:00:00" OR $row2[techions_evolution] == "0000-00-00 00:00:00" OR $row2[techplasma_evolution] == "0000-00-00 00:00:00" OR $row2[techordi_evolution] == "0000-00-00 00:00:00" OR $row2[techcombustion_evolution] == "0000-00-00 00:00:00" OR $row2[techAsgaards_evolution] == "0000-00-00 00:00:00" OR $row2[techhyperespace_evolution] == "0000-00-00 00:00:00" OR $row2[techespio1_evolution] == "0000-00-00 00:00:00" OR $row2[techespio2_evolution] == "0000-00-00 00:00:00" OR $row2[techArmement_evolution] == "0000-00-00 00:00:00" OR $row2[techBouclier_evolution] == "0000-00-00 00:00:00" OR $row2[techcoque_evolution] == "0000-00-00 00:00:00" OR $row2[techinfra_evolution] == "0000-00-00 00:00:00" OR $row2[technaqua_evolution] == "0000-00-00 00:00:00" OR $row2[techanti_evolution] == "0000-00-00 00:00:00" OR $row2[techproAsgaard_evolution] == "0000-00-00 00:00:00" OR $row2[techproAncien_evolution] == "0000-00-00 00:00:00" OR $row2[techinfra_evolution] == "0000-00-00 00:00:00" OR $row2[technaqua_evolution] == "0000-00-00 00:00:00")
{
	$sql2 = "UPDATE matgraph_users SET labo_util = 0 WHERE id=$idlogin ";
	$res2 = db_mysql_Query($sql2)or die('erreur sql<br>'.$sql2.'<br>'.mysql_error());
	$row[labo_util] = "0";
}


$New_fer_lvl = $row[fer_lvl] + 1;
$New_or_lvl = $row[or_lvl] + 1;
$New_exfer_lvl = $row[exfer_lvl] + 1;
$New_exor_lvl = $row[exor_lvl] + 1;
$New_ada_lvl = $row[ada_lvl] + 1;
$New_ura_lvl = $row[ura_lvl] + 1;
$New_central_lvl = $row[central_lvl] + 1;
$New_labo_lvl = $row[labo_lvl] + 1;
$New_robo_lvl = $row[robo_lvl] + 1;
$New_siege_lvl = $row[siege_lvl] + 1;
$New_chantier_lvl = $row[chantier_lvl] + 1;
$New_hangarfer_lvl = $row[hangarfer_lvl] + 1;
$New_hangaror_lvl = $row[hangaror_lvl] + 1;
$New_hangarada_lvl = $row[hangarada_lvl] + 1;
$New_hangarura_lvl = $row[hangarura_lvl] + 1;
$New_silo_lvl = $row[silo_lvl] + 1;
$New_defense_lvl = $row[defense_lvl] + 1;
$New_mili_lvl = $row[mili_lvl] + 1;
$New_fission_lvl = $row[fission_lvl] + 1;
$New_terri_lvl = $row[terri_lvl] + 1;

$pts = floor(($row[pts] / 1000)) ;

// fer
if ($row[fer_lvl] =="0") {
$fer_lvl = "0";
}
else {
$fer_lvl = $row[fer_lvl];
}
// or
if ($row[or_lvl] =="0") {
$or_lvl = "0";
}
else {
$or_lvl = $row[or_lvl];
}
// exfer
if ($row[exfer_lvl] =="0") {
$exfer_lvl = "0";
}
else {
$exfer_lvl = $row[exfer_lvl];
}
// exor
if ($row[exor_lvl] =="0") {
$exor_lvl = "0";
}
else {
$exor_lvl = $row[exor_lvl];
}
// ada
if ($row[ada_lvl] =="0") {
$ada_lvl = "0";
}
else {
$ada_lvl = $row[ada_lvl];
}
// ura
if ($row[ura_lvl] =="0") {
$ura_lvl = "0";
}
else {
$ura_lvl = $row[ura_lvl];
}
// central
if ($row[central_lvl] =="0") {
$central_lvl = "0";
}
else {
$central_lvl = $row[central_lvl];
}
// fission
if ($row[fission_lvl] =="0") {
$fission_lvl = "0";
}
else {
$fission_lvl = $row[fission_lvl];
}
// labo
if ($row[labo_lvl] =="0") {
$labo_lvl = "0";
}
else {
$labo_lvl = $row[labo_lvl];
}
// robo
if ($row[robo_lvl] =="0") {
$robo_lvl = "0";
}
else {
$robo_lvl = $row[robo_lvl];
}
// siege
if ($row[siege_lvl] =="0") {
$siege_lvl = "0";
}
else {
$siege_lvl = $row[siege_lvl];
}
// chantier
if ($row[chantier_lvl] =="0") {
$chantier_lvl = "0";
}
else {
$chantier_lvl = $row[chantier_lvl];
}
// hangarfer
if ($row[hangarfer_lvl] =="0") {
$hangarfer_lvl = "0";
}
else {
$hangarfer_lvl = $row[hangarfer_lvl];
}
// hangaror
if ($row[hangaror_lvl] =="0") {
$hangaror_lvl = "0";
}
else {
$hangaror_lvl = $row[hangaror_lvl];
}
// hangarada
if ($row[hangarada_lvl] =="0") {
$hangarada_lvl = "0";
}
else {
$hangarada_lvl = $row[hangarada_lvl];
}
// hangarura
if ($row[hangarura_lvl] =="0") {
$hangarura_lvl = "0";
}
else {
$hangarura_lvl = $row[hangarura_lvl];
}
// silo
if ($row[silo_lvl] =="0") {
$silo_lvl = "0";
}
else {
$silo_lvl = $row[silo_lvl];
}
// defense
if ($row[defense_lvl] =="0") {
$defense_lvl = "0";
}
else {
$defense_lvl = $row[defense_lvl];
}
// mili
if ($row[mili_lvl] =="0") {
$mili_lvl = "0";
}
else {
$mili_lvl = $row[mili_lvl];
}
// terri
if ($row[terri_lvl] =="0") {
$terri_lvl = "0";
}
else {
$terri_lvl = $row[terri_lvl];
}

if ($row[fer_lvl] == "0") {
$besoin_fer_energie2 = "-30" ; }
else {
$besoin_fer_energie2 = round((-30 * (bcpow(1.18, $row[fer_lvl],3))),0);
}
$besoin_fer_energie = -1 * $besoin_fer_energie2 ;

if ($row[or_lvl] == "0") {
$besoin_or_energie2 = "-26" ;}
else {
$besoin_or_energie2 = round((-26 * (bcpow(1.14, $row[or_lvl],3))),0);
}
$besoin_or_energie = -1 * $besoin_or_energie2 ;
//

if ($row[exfer_lvl] == "0") {
$besoin_exfer_energie2 = "-200" ;}
else {
$besoin_exfer_energie2 = round((-200 * (bcpow(1.2, $row[exfer_lvl],3))),0);
}
$besoin_exfer_energie = -1 * $besoin_exfer_energie2 ;

if ($row[exor_lvl] == "0") {
$besoin_exor_energie2 = "-150" ; }
else {
$besoin_exor_energie2 = round((-150 * (bcpow(1.16, $row[exor_lvl],3))),0);
}
$besoin_exor_energie = -1 * $besoin_exor_energie2 ;
//

if ($row[ada_lvl] == "0") {
$besoin_ada_energie2 = "-40" ; }
else {
$besoin_ada_energie2 = round((-40 * (bcpow(1.12, $row[ada_lvl],3))),0);
}
$besoin_ada_energie = -1 * $besoin_ada_energie2 ;

if ($row[ura_lvl] == "0") {
$besoin_ura_energie2 = "-68" ;}
else {
$besoin_ura_energie2 = round((-68 * (bcpow(1.1, $row[ura_lvl],3))),0);
}
$besoin_ura_energie = -1 * $besoin_ura_energie2 ;

if ($row[fission_lvl] == "0") {
$coutfission = "0" ;
}
else {
$coutfission = (20 * ( bcpow( 1.3, $row[fission_lvl],3))) ;
}

// cout
if ($row[fer_lvl] =="0") {
$besoin_fer_fer = number_format(60, 0, ',', ' ');
$besoin_fer_or = number_format(15, 0, ',', ' ');
$besoin2_fer_fer = 60;
$besoin2_fer_or = 15;
}
else {
$besoin_fer_fer = number_format(round((60 * ( bcpow( 1.45, ($row[fer_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_fer_or = number_format(round((15 * ( bcpow( 1.45, ($row[fer_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_fer_fer = round((60 * ( bcpow( 1.45, ($row[fer_lvl] + 1),3))),0);
$besoin2_fer_or = round((15 * ( bcpow( 1.45, ($row[fer_lvl] + 1),3))),0);
}

if ($row[or_lvl] =="0") {
$besoin_or_fer = number_format(50, 0, ',', ' ');
$besoin_or_or = number_format(25, 0, ',', ' ');
$besoin2_or_fer = 50;
$besoin2_or_or = 25;
}
else {
$besoin_or_fer = number_format(round((50 * ( bcpow( 1.5, ($row[or_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_or_or = number_format(round((25 * ( bcpow( 1.5, ($row[or_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_or_fer = round((50 * ( bcpow( 1.5, ($row[or_lvl] + 1),3))),0);
$besoin2_or_or = round((25 * ( bcpow( 1.5, ($row[or_lvl] + 1),3))),0);
}
//
if ($row[exfer_lvl] =="0") {
$besoin_exfer_fer = number_format(35000, 0, ',', ' ');
$besoin_exfer_or = number_format(15000, 0, ',', ' ');
$besoin_exfer_ada = number_format(1000, 0, ',', ' ');
$besoin2_exfer_fer = 35000;
$besoin2_exfer_or = 15000;
$besoin2_exfer_ada = 1000;
}
else {
$besoin_exfer_fer = number_format(round((30000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_exfer_or = number_format(round((20000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1)))),0), 0, ',', ' ');
$besoin_exfer_ada = number_format(round((1000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1)))),0), 0, ',', ' ');
$besoin2_exfer_fer = round((30000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1),3))),0);
$besoin2_exfer_or = round((20000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1)))),0);
$besoin2_exfer_ada = round((1000 * ( bcpow( 1.2, ($row[exfer_lvl] + 1)))),0);
}

if ($row[exor_lvl] =="0") {
$besoin_exor_fer = number_format(32000, 0, ',', ' ');
$besoin_exor_or = number_format(20000, 0, ',', ' ');
$besoin_exor_ada = number_format(1500, 0, ',', ' ');
$besoin2_exor_fer = 32000;
$besoin2_exor_or = 20000;
$besoin2_exor_ada = 1500;
}
else {
$besoin_exor_fer = number_format(round((32000 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_exor_or = number_format(round((20000 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_exor_ada = number_format(round((1500 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_exor_fer = round((32000 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0);
$besoin2_exor_or = round((20000 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0);
$besoin2_exor_ada = round((1500 * ( bcpow( 1.3, ($row[exor_lvl] + 1),3))),0);
}
//

if ($row[ada_lvl] =="0") {
$besoin_ada_fer = number_format(500, 0, ',', ' ');
$besoin_ada_or = number_format(160, 0, ',', ' ');
$besoin2_ada_fer = 500;
$besoin2_ada_or = 160;
}
else {
$besoin_ada_fer = number_format(round((500 * ( bcpow( 1.45, ($row[ada_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_ada_or = number_format(round((160 * ( bcpow( 1.45, ($row[ada_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_ada_fer = round((500 * ( bcpow( 1.45, ($row[ada_lvl] + 1),3))),0);
$besoin2_ada_or = round((160 * ( bcpow( 1.45, ($row[ada_lvl] + 1),3))),0);
}

if ($row[ura_lvl] =="0") {
$besoin_ura_fer = number_format(500, 0, ',', ' ');
$besoin_ura_or = number_format(300, 0, ',', ' ');
$besoin_ura_ada = number_format(100, 0, ',', ' ');
$besoin2_ura_fer = 500;
$besoin2_ura_or = 300;
$besoin2_ura_ada = 100;
}
else {
$besoin_ura_fer = number_format(round((500 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_ura_or = number_format(round((300 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_ura_ada = number_format(round((100 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_ura_fer = round((500 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0);
$besoin2_ura_or = round((300 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0);
$besoin2_ura_ada = round((100 * ( bcpow( 1.4, ($row[ura_lvl] + 1),3))),0);
}

if ($row[central_lvl] =="0") {
$besoin_central_fer = number_format(52, 0, ',', ' ');
$besoin_central_or = number_format(30, 0, ',', ' ');
$besoin2_central_fer = 52;
$besoin2_central_or = 30;
}
else {
$besoin_central_fer = number_format(round((52 * ( bcpow( 1.6, ($row[central_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_central_or = number_format(round((30 * ( bcpow( 1.6, ($row[central_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_central_fer = round((52 * ( bcpow( 1.6, ($row[central_lvl] + 1),3))),0);
$besoin2_central_or = round((30 * ( bcpow( 1.6, ($row[central_lvl] + 1),3))),0);
}

if ($row[fission_lvl] =="0") {
$besoin_fission_fer = number_format(5200, 0, ',', ' ');
$besoin_fission_or = number_format(3000, 0, ',', ' ');
$besoin_fission_ada = number_format(750, 0, ',', ' ');
$besoin2_fission_fer = 5200;
$besoin2_fission_or = 3000;
$besoin2_fission_ada = 75;
}
else {
$besoin_fission_fer = number_format(round((5200 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_fission_or = number_format(round((3000 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_fission_ada = number_format(round((750 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_fission_fer = round((5200 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0);
$besoin2_fission_or = round((3000 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0);
$besoin2_fission_ada =round((750 * ( bcpow( 1.6, ($row[fission_lvl] + 1),3))),0);
}

if ($row[labo_lvl] =="0") {
$besoin_labo_fer = number_format(200, 0, ',', ' ');
$besoin_labo_or = number_format(400, 0, ',', ' ');
$besoin_labo_ada = number_format(200, 0, ',', ' ');
$besoin2_labo_fer = 200;
$besoin2_labo_or = 400;
$besoin2_labo_ada = 200;
}
else {
$besoin_labo_fer = number_format(round((200 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_labo_or = number_format(round((400 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_labo_ada = number_format(round((200 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_labo_fer = round((200 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0);
$besoin2_labo_or = round((400 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0);
$besoin2_labo_ada = round((200 * ( bcpow( 1.75, ($row[labo_lvl] + 1),3))),0);
}

if ($row[robo_lvl] =="0") {
$besoin_robo_fer = number_format(100, 0, ',', ' ');
$besoin_robo_or = number_format(200, 0, ',', ' ');
$besoin_robo_ada = number_format(100, 0, ',', ' ');
$besoin2_robo_fer = 100;
$besoin2_robo_or = 200;
$besoin2_robo_ada = 100;
}
else {
$besoin_robo_fer = number_format(round((100 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_robo_or = number_format(round((200 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_robo_ada = number_format(round((100 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_robo_fer = round((100 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0);
$besoin2_robo_or = round((200 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0);
$besoin2_robo_ada = round((100 * ( bcpow( 1.9, ($row[robo_lvl] + 1),3))),0);
}

if ($row[siege_lvl] =="0") {
$besoin_siege_fer = number_format(900000, 0, ',', ' ');
$besoin_siege_or = number_format(900000, 0, ',', ' ');
$besoin_siege_ada = number_format(500000, 0, ',', ' ');
$besoin_siege_ura = number_format(10000, 0, ',', ' ');
$besoin2_siege_fer = 900000;
$besoin2_siege_or = 900000;
$besoin2_siege_ada = 500000;
$besoin2_siege_ura = 10000;
}
else {
$besoin_siege_fer = number_format(round((450000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_siege_or = number_format(round((450000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_siege_ada = number_format(round((250000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_siege_ura = number_format(round((5000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_siege_fer = round((450000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0);
$besoin2_siege_or = round((450000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0);
$besoin2_siege_ada = round((250000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0);
$besoin2_siege_ura = round((5000 * ( bcpow( 2, ($row[siege_lvl] + 1),3))),0);
}

if ($row[chantier_lvl] =="0") {
$besoin_chantier_fer = number_format(100, 0, ',', ' ');
$besoin_chantier_or = number_format(200, 0, ',', ' ');
$besoin_chantier_ada = number_format(100, 0, ',', ' ');
$besoin2_chantier_fer = 100;
$besoin2_chantier_or = 200;
$besoin2_chantier_ada = 100;
}
else {
$besoin_chantier_fer = number_format(round((100 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_chantier_or = number_format(round((200 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_chantier_ada = number_format(round((100 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_chantier_fer = round((100 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0);
$besoin2_chantier_or = round((200 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0);
$besoin2_chantier_ada = round((100 * ( bcpow( 1.9, ($row[chantier_lvl] + 1),3))),0);
}

if ($row[hangarfer_lvl] =="0") {
$besoin_hangarfer_fer = number_format(2000, 0, ',', ' ');
$besoin2_hangarfer_fer = 2000;
}
else {
$besoin_hangarfer_fer = number_format(round((1000 * ( bcpow( 2, ($row[hangarfer_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_hangarfer_fer = round((1000 * ( bcpow( 2, ($row[hangarfer_lvl] + 1),3))),0);
}

if ($row[hangaror_lvl] =="0") {
$besoin_hangaror_fer = number_format(2000, 0, ',', ' ');
$besoin_hangaror_or = number_format(1000, 0, ',', ' ');
$besoin2_hangaror_fer = 2000;
$besoin2_hangaror_or = 1000;
}
else {
$besoin_hangaror_fer = number_format(round((1000 * ( bcpow( 2, ($row[hangaror_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_hangaror_or = number_format(round((500 * ( bcpow( 2, ($row[hangaror_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_hangaror_fer = round((1000 * ( bcpow( 2, ($row[hangaror_lvl] + 1),3))),0);
$besoin2_hangaror_or = round((500 * ( bcpow( 2, ($row[hangaror_lvl] + 1),3))),0);
}

if ($row[hangarada_lvl] =="0") {
$besoin_hangarada_fer = number_format(2000, 0, ',', ' ');
$besoin_hangarada_or = number_format(2000, 0, ',', ' ');
$besoin2_hangarada_fer = 2000;
$besoin2_hangarada_or = 2000;
}
else {
$besoin_hangarada_fer = number_format(round((1000 * ( bcpow( 2, ($row[hangarada_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_hangarada_or = number_format(round((1000 * ( bcpow( 2, ($row[hangarada_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_hangarada_fer = round((1000 * ( bcpow( 2, ($row[hangarada_lvl] + 1),3))),0);
$besoin2_hangarada_or = round((1000 * ( bcpow( 2, ($row[hangarada_lvl] + 1),3))),0);
}

if ($row[hangarura_lvl] =="0") {
$besoin_hangarura_fer = number_format(2000, 0, ',', ' ');
$besoin_hangarura_or = number_format(1000, 0, ',', ' ');
$besoin_hangarura_ada = number_format(1000, 0, ',', ' ');
$besoin2_hangarura_fer = 2000;
$besoin2_hangarura_or = 1000;
$besoin2_hangarura_ada = 1000;
}
else {
$besoin_hangarura_fer = number_format(round((1000 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_hangarura_or = number_format(round((500 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_hangarura_ada = number_format(round((500 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_hangarura_fer = round((1000 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0);
$besoin2_hangarura_or = round((500 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0);
$besoin2_hangarura_ada = round((500 * ( bcpow( 2, ($row[hangarura_lvl] + 1),3))),0);
}

if ($row[silo_lvl] =="0") {
$besoin_silo_fer = number_format(20000, 0, ',', ' ');
$besoin_silo_or = number_format(20000, 0, ',', ' ');
$besoin_silo_ada = number_format(1000, 0, ',', ' ');
$besoin2_silo_fer = 20000;
$besoin2_silo_or = 20000;
$besoin2_silo_ada = 1000;
}
else {
$besoin_silo_fer = number_format(round((20000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_silo_or = number_format(round((20000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_silo_ada = number_format(round((1000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_silo_fer = round((20000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0);
$besoin2_silo_or = round((20000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0);
$besoin2_silo_ada = round((1000 * ( bcpow( 1.9, ($row[silo_lvl] + 1),3))),0);
}
if ($row[defense_lvl] =="0") {
$besoin_defense_fer = number_format(75, 0, ',', ' ');
$besoin_defense_or = number_format(150, 0, ',', ' ');
$besoin_defense_ada = number_format(75, 0, ',', ' ');
$besoin2_defense_fer = 75;
$besoin2_defense_or = 150;
$besoin2_defense_ada = 75;
}
else {
$besoin_defense_fer = number_format(round((75 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_defense_or = number_format(round((150 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_defense_ada = number_format(round((75 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_defense_fer = round((75 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0);
$besoin2_defense_or = round((150 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0);
$besoin2_defense_ada = round((75 * ( bcpow( 1.9, ($row[defense_lvl] + 1),3))),0);
}
if ($row[mili_lvl] =="0") {
$besoin_mili_fer = number_format(500, 0, ',', ' ');
$besoin_mili_or = number_format(500, 0, ',', ' ');
$besoin2_mili_fer = 500;
$besoin2_mili_or = 500;
}
else {
$besoin_mili_fer = number_format(round((250 * ( bcpow( 2, ($row[mili_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_mili_or = number_format(round((250 * ( bcpow( 2, ($row[mili_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_mili_fer = round((250 * ( bcpow( 2, ($row[mili_lvl] + 1),3))),0);
$besoin2_mili_or = round((250 * ( bcpow( 2, ($row[mili_lvl] + 1),3))),0);
}
if ($row[terri_lvl] =="0") {
$besoin_terri_fer = number_format(500000, 0, ',', ' ');
$besoin_terri_or = number_format(500000, 0, ',', ' ');
$besoin2_terri_fer = 500000;
$besoin2_terri_or = 500000;
}
else {
$besoin_terri_fer = number_format(round((250000 * ( bcpow( 2, ($row[terri_lvl] + 1),3))),0), 0, ',', ' ');
$besoin_terri_or = number_format(round((250000 * ( bcpow( 2, ($row[terri_lvl] + 1),3))),0), 0, ',', ' ');
$besoin2_terri_fer = round((250000 * ( bcpow( 2, ($row[terri_lvl] + 1),3))),0);
$besoin2_terri_or = round((250000 * ( bcpow( 2, ($row[terri_lvl] + 1),3))),0);
}


// temps evolution
if ($row[fer_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsfer2 ; $construction = "fer" ; }
if ($row[or_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsor2 ; $construction = "or" ; }
if ($row[exfer_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsexfer2 ; $construction = "exfer" ; }
if ($row[exor_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsexor2 ; $construction = "exor" ; }
if ($row[ada_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsada2 ; $construction = "ada" ; }
if ($row[ura_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsura2 ; $construction = "ura" ; }
if ($row[central_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempscentral2 ; $construction = "central" ; }
if ($row[labo_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempslabo2 ; $construction = "labo" ; }
if ($row[robo_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsrobo2 ; $construction = "robo" ;  }
if ($row[siege_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempssiege2 ; $construction = "siege" ;  }
if ($row[chantier_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempschantier2 ; $construction = "chantier" ; }
if ($row[hangarfer_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempshangarfer2 ; $construction = "hangarfer" ; }
if ($row[hangaror_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempshangaror2 ; $construction = "hangaror" ; }
if ($row[hangarada_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempshangarada2 ; $construction = "hangarada" ; }
if ($row[hangarura_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempshangarura2 ; $construction = "hangarura" ; }
if ($row[silo_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempssilo2 ; $construction = "silo" ; }
if ($row[defense_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdefense2 ; $construction = "defense" ; }
if ($row[mili_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsmili2 ; $construction = "mili" ; }
if ($row[fission_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsfission2 ; $construction = "fission" ; }
if ($row[terri_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsterri2 ; $construction = "terri" ; }


if ($row[fer_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionfer2 ; $construction = "fer" ; }
if ($row[or_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionor2 ; $construction = "or" ; }
if ($row[exfer_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionexfer2 ; $construction = "exfer" ; }
if ($row[exor_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionexor2 ; $construction = "exor" ; }
if ($row[ada_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionada2 ; $construction = "ada" ; }
if ($row[ura_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionura2 ; $construction = "ura" ; }
if ($row[labo_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionlabo2 ; $construction = "labo" ; }
if ($row[robo_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionrobo2 ; $construction = "robo" ;  }
if ($row[siege_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionsiege2 ; $construction = "siege" ;  }
if ($row[chantier_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionchantier2 ; $construction = "chantier" ; }
if ($row[hangarfer_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionhangarfer2 ; $construction = "hangarfer" ; }
if ($row[hangaror_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionhangaror2 ; $construction = "hangaror" ; }
if ($row[hangarada_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionhangarada2 ; $construction = "hangarada" ; }
if ($row[hangarura_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionhangarura2 ; $construction = "hangarura" ; }
if ($row[silo_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionsilo2 ; $construction = "silo" ; }
if ($row[defense_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructiondefense2 ; $construction = "defense" ; }
if ($row[mili_destruction] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempsdestructionmili2 ; $construction = "mili" ; }

$tempsevolution = $tempsevo;
$eminevo = $tempsevolution / 60;

if ( floor($eminevo) != $eminevo )
  $esecevo = floor( ($eminevo - floor( $eminevo )) * 60);

  if ( $eminevo > 60 ) {

    $ehourevo = floor( $eminevo / 60 );
    $eminevo = $eminevo - ( 60 * $ehourevo );

    if ( $ehourevo > 24 ) {
      $edayevo = floor( $ehourevo / 24);
      $ehourevo = $ehourevo - ( 24 * $edayevo );
    }

  }

$tempsevolution ="";

if (empty($edayevo) )
  $edayevo = 0;

if (empty($ehourevo) )
  $ehourevo = 0;

if (empty($esecevo) )
  $esecevo = 0;

$emin2evo = floor($eminevo) ;
$nom="evo";
$tempsevolution = "<body onLoad=chrono($edayevo,$ehourevo,$emin2evo,$esecevo,'$nom')>
<span id=\"ligne_$nom\">$edayevo:$ehourevo:$emin2evo:$esecevo</span>";
/////////////// TEMPS //////////////
//FER
$temps1fer = (108 * $siege_temps_evolution * (bcpow(1.5, $New_fer_lvl,3)));
if ($robo_lvl == "0") {
$stimefer = (round($temps1fer));
}
else {
$stimefer = (round($temps1fer*(bcpow(0.9, $robo_lvl,3))));
}
$etimefer = $stimefer;
$eminfer = $etimefer / 60;

if ( floor($eminfer) != $eminfer )
  $esecfer = floor( ($eminfer - floor( $eminfer )) * 60);

  if ( $eminfer > 60 ) {

    $ehourfer = floor( $eminfer / 60 );
    $eminfer = $eminfer - ( 60 * $ehourfer );

    if ( $ehourfer > 24 ) {
      $edayfer = floor( $ehourfer / 24);
      $ehourfer = $ehourfer - ( 24 * $edayfer );
    }

  }

$etimefer ="";

if (!empty($edayfer) )
  $etimefer.=$edayfer."j";

if (!empty($ehourfer) )
  $etimefer.=$ehourfer."h";

if ($eminfer != 0)
  $etimefer.= floor($eminfer)."min";

if (!empty($esecfer) && edayfer < 0)
  $etimefer.=$esecfer."s";

//or
$temps1or = (103 * $siege_temps_evolution * (bcpow(1.5, $New_or_lvl,3)));
if ($robo_lvl == "0") {
$stimeor = (round($temps1or));
}
else {
$stimeor = (round($temps1or*(bcpow(0.9, $robo_lvl,3))));
}
$etimeor = $stimeor;
$eminor = $etimeor / 60;

if ( floor($eminor) != $eminor )
  $esecor = floor( ($eminor - floor( $eminor )) * 60);

  if ( $eminor > 60 ) {

    $ehouror = floor( $eminor / 60 );
    $eminor = $eminor - ( 60 * $ehouror );

    if ( $ehouror > 24 ) {
      $edayor = floor( $ehouror / 24);
      $ehouror = $ehouror - ( 24 * $edayor );
    }

  }

$etimeor ="";

if (!empty($edayor) )
  $etimeor.=$edayor."j";

if (!empty($ehouror) )
  $etimeor.=$ehouror."h";

if ($eminor != 0)
  $etimeor.= floor($eminor)."min";

if (!empty($esecor) && edayor < 0)
  $etimeor.=$esecor."s";


//exfer

$temps1exfer = (43200 * $siege_temps_evolution * (bcpow(1.7, $New_exfer_lvl,3)));
if ($robo_lvl == "0") {
$stimeexfer = (round($temps1exfer));
}
else {
$stimeexfer = (round($temps1exfer*(bcpow(0.9, $robo_lvl,3))));
}
$etimeexfer = $stimeexfer;
$eminexfer = $etimeexfer / 60;

if ( floor($eminexfer) != $eminexfer )
  $esecexfer = floor( ($eminexfer - floor( $eminexfer )) * 60);

  if ( $eminexfer > 60 ) {

    $ehourexfer = floor( $eminexfer / 60 );
    $eminexfer = $eminexfer - ( 60 * $ehourexfer );

    if ( $ehourexfer > 24 ) {
      $edayexfer = floor( $ehourexfer / 24);
      $ehourexfer = $ehourexfer - ( 24 * $edayexfer );
    }

  }

$etimeexfer ="";

if (!empty($edayexfer) )
  $etimeexfer.=$edayexfer."j";

if (!empty($ehourexfer) )
  $etimeexfer.=$ehourexfer."h";

if ($eminexfer != 0)
  $etimeexfer.= floor($eminexfer)."min";

if (!empty($esecexfer) && edayexfer < 0)
  $etimeexfer.=$esecexfer."s";


//exor
$temps1exor = (43200 * $siege_temps_evolution * (bcpow(1.35, $New_exor_lvl,3)));
if ($robo_lvl == "0") {
$stimeexor = (round($temps1exor));
}
else {
$stimeexor = (round($temps1exor*(bcpow(0.9, $robo_lvl,3))));
}
$etimeexor = $stimeexor;
$eminexor = $etimeexor / 60;

if ( floor($eminexor) != $eminexor )
  $esecexor = floor( ($eminexor - floor( $eminexor )) * 60);

  if ( $eminexor > 60 ) {

    $ehourexor = floor( $eminexor / 60 );
    $eminexor = $eminexor - ( 60 * $ehourexor );

    if ( $ehourexor > 24 ) {
      $edayexor = floor( $ehourexor / 24);
      $ehourexor = $ehourexor - ( 24 * $edayexor );
    }

  }

$etimeexor ="";

if (!empty($edayexor) )
  $etimeexor.=$edayexor."j";

if (!empty($ehourexor) )
  $etimeexor.=$ehourexor."h";

if ($eminexor != 0)
  $etimeexor.= floor($eminexor)."min";

if (!empty($esecexor) && edayexor < 0)
  $etimeexor.=$esecexor."s";

//ada
$temps1ada = (432 * $siege_temps_evolution * (bcpow(1.4, $New_ada_lvl,3)));
if ($robo_lvl == "0") {
$stimeada = (round($temps1ada));
}
else {
$stimeada = (round($temps1ada*(bcpow(0.9, $robo_lvl,3))));
}
$etimeada = $stimeada;
$eminada = $etimeada / 60;

if ( floor($eminada) != $eminada )
  $esecada = floor( ($eminada - floor( $eminada )) * 60);

  if ( $eminada > 60 ) {

    $ehourada = floor( $eminada / 60 );
    $eminada = $eminada - ( 60 * $ehourada );

    if ( $ehourada > 24 ) {
      $edayada = floor( $ehourada / 24);
      $ehourada = $ehourada - ( 24 * $edayada );
    }

  }

$etimeada ="";

if (!empty($edayada) )
  $etimeada.=$edayada."j";

if (!empty($ehourada) )
  $etimeada.=$ehourada."h";

if ($eminada != 0)
  $etimeada.= floor($eminada)."min";

if (!empty($esecada) && edayada < 0)
  $etimeada.=$esecada."s";

//ura

$temps1ura = (600 * $siege_temps_evolution * (bcpow(1.4, $New_ura_lvl,3)));
if ($robo_lvl == "0") {
$stimeura = (round($temps1ura));
}
else {
$stimeura = (round($temps1ura*(bcpow(0.9, $robo_lvl,3))));
}
$etimeura = $stimeura;
$eminura = $etimeura / 60;

if ( floor($eminura) != $eminura )
  $esecura = floor( ($eminura - floor( $eminura )) * 60);

  if ( $eminura > 60 ) {

    $ehourura = floor( $eminura / 60 );
    $eminura = $eminura - ( 60 * $ehourura );

    if ( $ehourura > 24 ) {
      $edayura = floor( $ehourura / 24);
      $ehourura = $ehourura - ( 24 * $edayura );
    }

  }

$etimeura ="";

if (!empty($edayura) )
  $etimeura.=$edayura."j";

if (!empty($ehourura) )
  $etimeura.=$ehourura."h";

if ($eminura != 0)
  $etimeura.= floor($eminura)."min";

if (!empty($esecura) && edayura < 0)
  $etimeura.=$esecura."s";

//central
$temps1central = (108 * $siege_temps_evolution * (bcpow(1.35, $New_central_lvl,3)));
if ($robo_lvl == "0") {
$stimecentral = (round($temps1central));
}
else {
$stimecentral = (round($temps1central*(bcpow(0.9, $robo_lvl,3))));
}
$etimecentral = $stimecentral;
$emincentral = $etimecentral / 60;

if ( floor($emincentral) != $emincentral )
  $eseccentral = floor( ($emincentral - floor( $emincentral )) * 60);

  if ( $emincentral > 60 ) {

    $ehourcentral = floor( $emincentral / 60 );
    $emincentral = $emincentral - ( 60 * $ehourcentral );

    if ( $ehourcentral > 24 ) {
      $edaycentral = floor( $ehourcentral / 24);
      $ehourcentral = $ehourcentral - ( 24 * $edaycentral );
    }

  }

$etimecentral ="";

if (!empty($edaycentral) )
  $etimecentral.=$edaycentral."j";

if (!empty($ehourcentral) )
  $etimecentral.=$ehourcentral."h";

if ($emincentral != 0)
  $etimecentral.= floor($emincentral)."min";

if (!empty($eseccentral) && edaycentral < 0)
  $etimecentral.=$eseccentral."s";

//fission
$temps1fission = (650 * $siege_temps_evolution * (bcpow(1.35, ($row[fission_lvl] + 1),3)));
if ($robo_lvl == "0") {
$stimefission = (round($temps1fission));
}
else {
$stimefission = (round($temps1fission*(bcpow(0.9, $robo_lvl,3))));
}
$etimefission = $stimefission;
$eminfission = $etimefission / 60;

if ( floor($eminfission) != $eminfission )
  $esecfission = floor( ($eminfission - floor( $eminfission )) * 60);

  if ( $eminfission > 60 ) {

    $ehourfission = floor( $eminfission / 60 );
    $eminfission = $eminfission - ( 60 * $ehourfission );

    if ( $ehourfission > 24 ) {
      $edayfission = floor( $ehourfission / 24);
      $ehourfission = $ehourfission - ( 24 * $edayfission );
    }

  }

$etimefission ="";

if (!empty($edayfission) )
  $etimefission.=$edayfission."j";

if (!empty($ehourfission) )
  $etimefission.=$ehourfission."h";

if ($eminfission != 0)
  $etimefission.= floor($eminfission)."min";

if (!empty($esecfission) && edayfission < 0)
  $etimefission.=$esecfission."s";


//labo
$temps1labo = (369 * $siege_temps_evolution * (bcpow(1.95, $New_labo_lvl,3)));
if ($robo_lvl == "0") {
$stimelabo = (round($temps1labo));
}
else {
$stimelabo = (round($temps1labo*(bcpow(0.9, $robo_lvl,3))));
}
$etimelabo = $stimelabo;
$eminlabo = $etimelabo / 60;

if ( floor($eminlabo) != $eminlabo )
  $eseclabo = floor( ($eminlabo - floor( $eminlabo )) * 60);

  if ( $eminlabo > 60 ) {

    $ehourlabo = floor( $eminlabo / 60 );
    $eminlabo = $eminlabo - ( 60 * $ehourlabo );

    if ( $ehourlabo > 24 ) {
      $edaylabo = floor( $ehourlabo / 24);
      $ehourlabo = $ehourlabo - ( 24 * $edaylabo );
    }

  }

$etimelabo ="";

if (!empty($edaylabo) )
  $etimelabo.=$edaylabo."j";

if (!empty($ehourlabo) )
  $etimelabo.=$ehourlabo."h";

if ($eminlabo != 0)
  $etimelabo.= floor($eminlabo)."min";

if (!empty($eseclabo) && edaylabo < 0)
  $etimelabo.=$eseclabo."s";

//robo
if ($row[robo_lvl] == "0") {
$stimerobo = (600);
}
else {
$stimerobo = (round(600 * (bcpow(1.8, ($row[robo_lvl]),3))));
}
$etimerobo = $stimerobo;
$eminrobo = $etimerobo / 60;

if ( floor($eminrobo) != $eminrobo )
  $esecrobo = floor( ($eminrobo - floor( $eminrobo )) * 60);

  if ( $eminrobo > 60 ) {

    $ehourrobo = floor( $eminrobo / 60 );
    $eminrobo = $eminrobo - ( 60 * $ehourrobo );

    if ( $ehourrobo > 24 ) {
      $edayrobo = floor( $ehourrobo / 24);
      $ehourrobo = $ehourrobo - ( 24 * $edayrobo );
    }

  }

$etimerobo ="";

if (!empty($edayrobo) )
  $etimerobo.=$edayrobo."j";

if (!empty($ehourrobo) )
  $etimerobo.=$ehourrobo."h";

if ($eminrobo != 0)
  $etimerobo.= floor($eminrobo)."min";

if (!empty($esecrobo) && edayrobo < 0)
  $etimerobo.=$esecrobo."s";

//siege
if ($row[siege_lvl] == "0") {
$stimesiege = (129600);
}
else {
$stimesiege = (round(129600 * (bcpow(2, ($row[siege_lvl]),3))));
}
$etimesiege = $stimesiege;
$eminsiege = $etimesiege / 60;

if ( floor($eminsiege) != $eminsiege )
  $esecsiege = floor( ($eminsiege - floor( $eminsiege )) * 60);

  if ( $eminsiege > 60 ) {

    $ehoursiege = floor( $eminsiege / 60 );
    $eminsiege = $eminsiege - ( 60 * $ehoursiege );

    if ( $ehoursiege > 24 ) {
      $edaysiege = floor( $ehoursiege / 24);
      $ehoursiege = $ehoursiege - ( 24 * $edaysiege );
    }

  }

$etimesiege ="";

if (!empty($edaysiege) )
  $etimesiege.=$edaysiege."j";

if (!empty($ehoursiege) )
  $etimesiege.=$ehoursiege."h";

if ($eminsiege != 0)
  $etimesiege.= floor($eminsiege)."min";

if (!empty($esecsiege) && edaysiege < 0)
  $etimesiege.=$esecsiege."s";


//chantier
$temps1chantier = (864 * $siege_temps_evolution * (bcpow(1.35, $New_chantier_lvl,3)));
if ($robo_lvl == "0") {
$stimechantier = (round($temps1chantier));
}
else {
$stimechantier = (round($temps1chantier*(bcpow(0.9, $robo_lvl,3))));
}
$etimechantier = $stimechantier;
$eminchantier = $etimechantier / 60;

if ( floor($eminchantier) != $eminchantier )
  $esecchantier = floor( ($eminchantier - floor( $eminchantier )) * 60);

  if ( $eminchantier > 60 ) {

    $ehourchantier = floor( $eminchantier / 60 );
    $eminchantier = $eminchantier - ( 60 * $ehourchantier );

    if ( $ehourchantier > 24 ) {
      $edaychantier = floor( $ehourchantier / 24);
      $ehourchantier = $ehourchantier - ( 24 * $edaychantier );
    }

  }

$etimechantier ="";

if (!empty($edaychantier) )
  $etimechantier.=$edaychantier."j";

if (!empty($ehourchantier) )
  $etimechantier.=$ehourchantier."h";

if ($eminchantier != 0)
  $etimechantier.= floor($eminchantier)."min";

if (!empty($esecchantier) && edaychantier < 0)
  $etimechantier.=$esecchantier."s";

//hangarfer
$temps1hangarfer = (1440 * $siege_temps_evolution * (bcpow(1.35, $New_hangarfer_lvl,3)));
if ($robo_lvl == "0") {
$stimehangarfer = (round($temps1hangarfer));
}
else {
$stimehangarfer = (round($temps1hangarfer*(bcpow(0.9, $robo_lvl,3))));
}
$etimehangarfer = $stimehangarfer;
$eminhangarfer = $etimehangarfer / 60;

if ( floor($eminhangarfer) != $eminhangarfer )
  $esechangarfer = floor( ($eminhangarfer - floor( $eminhangarfer )) * 60);

  if ( $eminhangarfer > 60 ) {

    $ehourhangarfer = floor( $eminhangarfer / 60 );
    $eminhangarfer = $eminhangarfer - ( 60 * $ehourhangarfer );

    if ( $ehourhangarfer > 24 ) {
      $edayhangarfer = floor( $ehourhangarfer / 24);
      $ehourhangarfer = $ehourhangarfer - ( 24 * $edayhangarfer );
    }

  }

$etimehangarfer ="";

if (!empty($edayhangarfer) )
  $etimehangarfer.=$edayhangarfer."j";

if (!empty($ehourhangarfer) )
  $etimehangarfer.=$ehourhangarfer."h";

if ($eminhangarfer != 0)
  $etimehangarfer.= floor($eminhangarfer)."min";

if (!empty($esechangarfer) && edayhangarfer < 0)
  $etimehangarfer.=$esechangarfer."s";

//hangaror
$temps1hangaror = (1440 * $siege_temps_evolution * (bcpow(1.35, $New_hangaror_lvl,3)));
if ($robo_lvl == "0") {
$stimehangaror = (round($temps1hangaror));
}
else {
$stimehangaror = (round($temps1hangaror*(bcpow(0.9, $robo_lvl,3))));
}
$etimehangaror = $stimehangaror;
$eminhangaror = $etimehangaror / 60;

if ( floor($eminhangaror) != $eminhangaror )
  $esechangaror = floor( ($eminhangaror - floor( $eminhangaror )) * 60);

  if ( $eminhangaror > 60 ) {

    $ehourhangaror = floor( $eminhangaror / 60 );
    $eminhangaror = $eminhangaror - ( 60 * $ehourhangaror );

    if ( $ehourhangaror > 24 ) {
      $edayhangaror = floor( $ehourhangaror / 24);
      $ehourhangaror = $ehourhangaror - ( 24 * $edayhangaror );
    }

  }

$etimehangaror ="";

if (!empty($edayhangaror) )
  $etimehangaror.=$edayhangaror."j";

if (!empty($ehourhangaror) )
  $etimehangaror.=$ehourhangaror."h";

if ($eminhangaror != 0)
  $etimehangaror.= floor($eminhangaror)."min";

if (!empty($esechangaror) && edayhangaror < 0)
  $etimehangaror.=$esechangaror."s";

//hangarada
$temps1hangarada = (1440 * $siege_temps_evolution * (bcpow(1.35, $New_hangarada_lvl,3)));
if ($robo_lvl == "0") {
$stimehangarada = (round($temps1hangarada));
}
else {
$stimehangarada = (round($temps1hangarada*(bcpow(0.9, $robo_lvl,3))));
}
$etimehangarada = $stimehangarada;
$eminhangarada = $etimehangarada / 60;

if ( floor($eminhangarada) != $eminhangarada )
  $esechangarada = floor( ($eminhangarada - floor( $eminhangarada )) * 60);

  if ( $eminhangarada > 60 ) {

    $ehourhangarada = floor( $eminhangarada / 60 );
    $eminhangarada = $eminhangarada - ( 60 * $ehourhangarada );

    if ( $ehourhangarada > 24 ) {
      $edayhangarada = floor( $ehourhangarada / 24);
      $ehourhangarada = $ehourhangarada - ( 24 * $edayhangarada );
    }

  }

$etimehangarada ="";

if (!empty($edayhangarada) )
  $etimehangarada.=$edayhangarada."j";

if (!empty($ehourhangarada) )
  $etimehangarada.=$ehourhangarada."h";

if ($eminhangarada != 0)
  $etimehangarada.= floor($eminhangarada)."min";

if (!empty($esechangarada) && edayhangarada < 0)
  $etimehangarada.=$esechangarada."s";

//hangarura
$temps1hangarura = (1440 * $siege_temps_evolution * (bcpow(1.35, $New_hangarura_lvl,3)));
if ($robo_lvl == "0") {
$stimehangarura = (round($temps1hangarura));
}
else {
$stimehangarura = (round($temps1hangarura*(bcpow(0.9, $robo_lvl,3))));
}
$etimehangarura = $stimehangarura;
$eminhangarura = $etimehangarura / 60;

if ( floor($eminhangarura) != $eminhangarura )
  $esechangarura = floor( ($eminhangarura - floor( $eminhangarura )) * 60);

  if ( $eminhangarura > 60 ) {

    $ehourhangarura = floor( $eminhangarura / 60 );
    $eminhangarura = $eminhangarura - ( 60 * $ehourhangarura );

    if ( $ehourhangarura > 24 ) {
      $edayhangarura = floor( $ehourhangarura / 24);
      $ehourhangarura = $ehourhangarura - ( 24 * $edayhangarura );
    }

  }

$etimehangarura ="";

if (!empty($edayhangarura) )
  $etimehangarura.=$edayhangarura."j";

if (!empty($ehourhangarura) )
  $etimehangarura.=$ehourhangarura."h";

if ($eminhangarura != 0)
  $etimehangarura.= floor($eminhangarura)."min";

if (!empty($esechangarura) && edayhangarura < 0)
  $etimehangarura.=$esechangarura."s";

//silo
$temps1silo = (43200 * $siege_temps_evolution * (bcpow(1.9, $New_silo_lvl,3)));
if ($robo_lvl == "0") {
$stimesilo = (round($temps1silo));
}
else {
$stimesilo = (round($temps1silo*(bcpow(0.9, $robo_lvl,3))));
}
$etimesilo = $stimesilo;
$eminsilo = $etimesilo / 60;

if ( floor($eminsilo) != $eminsilo )
  $esecsilo = floor( ($eminsilo - floor( $eminsilo )) * 60);

  if ( $eminsilo > 60 ) {

    $ehoursilo = floor( $eminsilo / 60 );
    $eminsilo = $eminsilo - ( 60 * $ehoursilo );

    if ( $ehoursilo > 24 ) {
      $edaysilo = floor( $ehoursilo / 24);
      $ehoursilo = $ehoursilo - ( 24 * $edaysilo );
    }

  }

$etimesilo ="";

if (!empty($edaysilo) )
  $etimesilo.=$edaysilo."j";

if (!empty($ehoursilo) )
  $etimesilo.=$ehoursilo."h";

if ($eminsilo != 0)
  $etimesilo.= floor($eminsilo)."min";

if (!empty($esecsilo) && edaysilo < 0)
  $etimesilo.=$esecsilo."s";

//mili
$temps1mili = (600 * $siege_temps_evolution * (bcpow(2, $New_mili_lvl,3)));
if ($robo_lvl == "0") {
$stimemili = (round($temps1mili));
}
else {
$stimemili = (round($temps1mili*(bcpow(0.9, $robo_lvl,3))));
}
$etimemili = $stimemili;
$eminmili = $etimemili / 60;

if ( floor($eminmili) != $eminmili )
  $esecmili = floor( ($eminmili - floor( $eminmili )) * 60);

  if ( $eminmili > 60 ) {

    $ehourmili = floor( $eminmili / 60 );
    $eminmili = $eminmili - ( 60 * $ehourmili );

    if ( $ehourmili > 24 ) {
      $edaymili = floor( $ehourmili / 24);
      $ehourmili = $ehourmili - ( 24 * $edaymili );
    }

  }

$etimemili ="";

if (!empty($edaymili) )
  $etimemili.=$edaymili."j";

if (!empty($ehourmili) )
  $etimemili.=$ehourmili."h";

if ($eminmili != 0)
  $etimemili.= floor($eminmili)."min";

if (!empty($esecmili) && edaymili < 0)
  $etimemili.=$esecmili."s";

//defense
$temps1defense = (650 * $siege_temps_evolution * (bcpow(1.35, $New_defense_lvl,3)));
if ($robo_lvl == "0") {
$stimedefense = (round($temps1defense));
}
else {
$stimedefense = (round($temps1defense*(bcpow(0.9, $robo_lvl,3))));
}
$etimedefense = $stimedefense;
$emindefense = $etimedefense / 60;

if ( floor($emindefense) != $emindefense )
  $esecdefense = floor( ($emindefense - floor( $emindefense )) * 60);

  if ( $emindefense > 60 ) {

    $ehourdefense = floor( $emindefense / 60 );
    $emindefense = $emindefense - ( 60 * $ehourdefense );

    if ( $ehourdefense > 24 ) {
      $edaydefense = floor( $ehourdefense / 24);
      $ehourdefense = $ehourdefense - ( 24 * $edaydefense );
    }

  }

$etimedefense ="";

if (!empty($edaydefense) )
  $etimedefense.=$edaydefense."j";

if (!empty($ehourdefense) )
  $etimedefense.=$ehourdefense."h";

if ($emindefense != 0)
  $etimedefense.= floor($emindefense)."min";

if (!empty($esecdefense) && edaydefense < 0)
  $etimedefense.=$esecdefense."s";

//terri
$temps1terri = (33200 * $siege_temps_evolution * (bcpow(2, $New_terri_lvl,3)));
if ($robo_lvl == "0") {
$stimeterri = (round($temps1terri));
}
else {
$stimeterri = (round($temps1terri*(bcpow(0.9, $robo_lvl,3))));
}
$etimeterri = $stimeterri;
$eminterri = $etimeterri / 60;

if ( floor($eminterri) != $eminterri )
  $esecterri = floor( ($eminterri - floor( $eminterri )) * 60);

  if ( $eminterri > 60 ) {

    $ehourterri = floor( $eminterri / 60 );
    $eminterri = $eminterri - ( 60 * $ehourterri );

    if ( $ehourterri > 24 ) {
      $edayterri = floor( $ehourterri / 24);
      $ehourterri = $ehourterri - ( 24 * $edayterri );
    }

  }

$etimeterri ="";

if (!empty($edayterri) )
  $etimeterri.=$edayterri."j";

if (!empty($ehourterri) )
  $etimeterri.=$ehourterri."h";

if ($eminterri != 0)
  $etimeterri.= floor($eminterri)."min";

if (!empty($esecterri) && edayterri < 0)
  $etimeterri.=$esecterri."s";
//

echo"
<script language=\"javascript\">

function chrono(jours,heures,minutes,secondes,champs) {

  if (secondes > 0) {
    secondes--;
  }
  else {
    secondes = 59;

    if (minutes > 0) {
      minutes--;
    }
    else {
      minutes = 59;

      if (heures > 0) {
        heures--;
        jours--;
      }
      else {
        heures = 23;
      }
    }
  }

  if( heures < 0 ) {
    window.history.go(0); 
  }
  if( minutes < 0 ) {
    window.history.go(0); 
  }
  if( secondes < 0 ) {
    window.history.go(0); 
  }
  if ( minutes == 59 && secondes == 59 && heures == 23 ) {
    window.history.go(0);
     }
  else {
    seconde = secondes;
    minute = minutes;
    text = '';
    if (jours > 0) {
      text +=jours + 'j ';
    }
    if (heures > 0) {
      text +=heures + 'h ';
    }
    if (minutes < 10) {
      minute = '0' + minutes;
    }
    if (seconde < 10) {
      seconde = '0' + secondes;
    }
      text +=minute + 'm ' + seconde + 's';

  document.getElementById('ligne_' + champs).innerHTML = '<font color=#800000>'+ text +'</font>';
  setTimeout(\"chrono(\" + jours + \",\" + heures + \",\" + minutes + \",\" + secondes + \",'\" + champs + \"')\", 1000);
         }
    }
</script>

<style type=\"text/css\">
<!--
img {
border:0;
}
A {
	COLOR: #9999ff; TEXT-DECORATION: none
}
A:hover {
	COLOR: #ff9900; TEXT-DECORATION: none
}

.objet_name{
	color:#B9C6FF;
	font-size:12px;
	text-align:center;
}
.objet_level{
	color:#FF4F65;
	font-size:12px;
}
.Categorie {
	color: #CCCCCC;
	font-size:14px;
	
}

.Categorie:first-letter /* La première lettre de chaque paragraphe */
{
   font-weight: bold; /* En gras */
   font-size: 15px; /* Ecrit légèrement plus gros que la normale */
   color:#666666; /* En bleu */
}
.objet_construc{
 font-size:14px;
 text-align:center;
}
-->
</style>
<script src=\"Js_module/overlib.js\" type=text/javascript></script>
<style type=text/css>.Style1 {
	COLOR:#FF0000;
}
.Style2 {
	COLOR: #ff0000
}
.Style3 {
	COLOR: #00cc00
}
.Style4 {
	COLOR: #999999
}
.Style5 {
	COLOR: #3399ff
}
.Style6 {
	COLOR: #ffff00
}
A.menulink {
	BORDER-RIGHT: #111111 1px solid; BORDER-TOP: #111111 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #111111 1px solid; WIDTH: 150px; COLOR: #00cc00; BORDER-BOTTOM: #111111 1px solid; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
A.menulink:hover {
	BORDER-RIGHT: #111111 1px solid; BORDER-TOP: #111111 1px solid; BORDER-LEFT: #111111 1px solid; COLOR: #00cc00; BORDER-BOTTOM: #111111 1px solid; BACKGROUND-COLOR: #111111
}
A.menulink2 {
	BORDER-RIGHT: #111111 1px solid; BORDER-TOP: #111111 1px solid; FONT-SIZE: 11px; BORDER-LEFT: #111111 1px solid; WIDTH: 150px; COLOR: #ff3300; BORDER-BOTTOM: #111111 1px solid; FONT-FAMILY: Verdana; TEXT-DECORATION: none
}
A.menulink2:hover {
	BORDER-RIGHT: #111111 1px solid; BORDER-TOP: #111111 1px solid; BORDER-LEFT: #111111 1px solid; BORDER-BOTTOM: #111111 1px solid; BACKGROUND-COLOR: #111111
}
INPUT {
	BORDER-RIGHT: #7e7e7e 1px solid; BORDER-TOP: #7e7e7e 1px solid; BORDER-LEFT: #7e7e7e 1px solid; COLOR: white; BORDER-BOTTOM: #7e7e7e 1px solid; FONT-FAMILY: 'trebuchet ms',sans-serif; BACKGROUND-COLOR: #222222
}
TEXTAREA {
	BORDER-RIGHT: #7e7e7e 1px solid; BORDER-TOP: #7e7e7e 1px solid; BORDER-LEFT: #7e7e7e 1px solid; COLOR: white; BORDER-BOTTOM: #7e7e7e 1px solid; FONT-FAMILY: 'trebuchet ms',sans-serif; BACKGROUND-COLOR: #000000
}
SELECT {
	COLOR: white; BACKGROUND-COLOR: #000000
}
OPTION {
	COLOR: white; BACKGROUND-COLOR: #000000
}
</style>";
echo"
<div id=overDiv style=\"Z-INDEX: 1000; FILTER: Alpha(Opacity=85); VISIBILITY: hidden; POSITION: absolute; opacity: 0.8\"></div>
<div align=\"center\"><form name=\"colo\" method=\"post\" action=\"colonie.php\" target=\"_parent\">
<table align=\"center\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td width=\"100\" rowspan=\"2\" valign=\"middle\">
       <div align=\"center\">
         <input name=\"page\" value=\"" . $PHP_SELF . "\" type=\"hidden\" id=\"page\">
         <select name=\"idcolo\" onchange=submit()>";
include ('colo2.php');

include ('evolutionbats.php');

//img
$central_img = "central";
$fission_img = "fission";
$fer_img = "fer";
$exfer_img = "exfer";
$or_img = "or";
$exor_img = "exor";
$ada_img = "cristal";
$ura_img = "naqua";
$robo_img = "robo";
$labo_img = "labo";
$defense_img = "centredef";
$mili_img = "mili";
$chantier_img = "chantier";
$siege_img = "siege";
$hangarfer_img = "hangarfer";
$hangaror_img = "hangaror";
$hangarada_img = "hangarada";
$hangarura_img = "hangarura";
$silo_img = "dakara";
$terri_img = "terraformeur";

//namepage
$central_namepage = "central";
$fission_namepage = "fission";
$fer_namepage = "fer";
$exfer_namepage = "exfer";
$or_namepage = "or";
$exor_namepage = "exor";
$ada_namepage = "ada";
$ura_namepage = "ura";
$robo_namepage = "robo";
$labo_namepage = "labo";
$defense_namepage = "centredef";
$chantier_namepage = "chantier";
$mili_namepage = "mili";
$siege_namepage = "siege";
$hangarfer_namepage = "hangarfer";
$hangaror_namepage = "hangaror";
$hangarada_namepage = "hangarada";
$hangarura_namepage = "hangarura";
$silo_namepage = "babel";
$terri_namepage = "terri";

//name
$central_name = "Centrale";
$fission_name = "Centrale énergétique au Naquadah";
$fer_name = "Mine de Fer";
$exfer_name = "Centre d\'extraction du fer";
$or_name = "Mine d\'or";
$exor_name = "Centre d\'extraction d\'or";
$ada_name = "Mine de Cristal";
$ura_name = "Mine de Naquadah";
$robo_name = "Usine Robotique";
$labo_name = "Centre de recherches scientifiques";
$defense_name = "Centre Militaire de Defense Interplanétaire";
$mili_name = "Caserne Militaire";
$chantier_name = "Chantier spatial";
$siege_name = "Siége des Anciens";
$hangarfer_name = "Zone de Stockage du fer";
$hangaror_name = "Zone de Stockage de l\’or";
$hangarada_name = "Zone de Stockage du Cristal";
$hangarura_name = "Cuve de Stockage du Naquadah";
$silo_name = "Temple de Dakara";
$terri_name = "Vaisseau Terraformeur";

//description
$central_description = addslashes("Les centrales d'énergie thermique transforment les rayons du soleil en énergie. Presque tous les bâtiments ont besoin d'énergie, plus précisément d'électricité, pour être en service.");
$fission_description = addslashes("Le Naquadah pouvant stocker et, ensuite, restituer de l'energie, il peut être utilisé pour alimenter en électricité une ville.");
$fer_description = addslashes("Le fer est la matière première la plus utilisée : elle sert comme principal composant des infrastructures et dans la construction des coques des vaisseaux.");
$exfer_description = addslashes("Grâce à la recherche, les chercheurs ont trouvé un moyen de récupérer le fer plus profond. Par le même procédé que les 'piles rechargeable' on peu maintenant récupérer du fer en fusion.");
$or_description = addslashes("L'or est la matière principale entrant dans la fabrication des circuits électriques et d'autres installations électromagnétiques.");
$exor_description = addslashes("Grâce à la recherche, les chercheurs ont trouvé un moyen de récupérer l'or plus profond. Par le même procédé que les 'piles rechargeable' on peut maintenant récupérer de l'or en fusion.");
$ada_description = addslashes("Extrait du cristal des mines de la planète. ");
$ura_description = addslashes("Extrait du Naquadah des rares mines de la planète.");
$robo_description = addslashes("L'usine Robotique crée des robots qualifiés pour la main d'oeuvre. Les robots vont donc servir à construire plus rapidement les infrastructures et les vaisseaux.");
$labo_description = addslashes("Le centre de recherches scientifiques permet de développer des technologies de type militaire ou économique.");
$defense_description = addslashes("Ce centre permet de développer, à partir des technologies d'armement, un système de défense contre ce type d'arme. ");
$mili_description = addslashes("La caserne militaire permet de former des hommes aux combats. Ils seront en première ligne lors de combats mais servent, aussi, pour explorer de nouvelles planètes.");
$chantier_description = addslashes("Le chantier spatial permet de construire des vaisseaux commerciaux ou militaires sur la planète.");
$siege_description = addslashes("Le siège des Anciens est un système de contrôle très puissant. Il permet de gérer énormément de chose rien que par la pensée. C'est une évolution sans précédent de l'informatique de base.");
$hangarfer_description = addslashes("La zone de stockage de fer est une immense plateforme qui permet le stockage du fer. ");
$hangaror_description = addslashes("La zone de stockage de l’or est une immense plateforme qui permet le stockage de l’or.");
$hangarada_description = addslashes("La zone de stockage du cristal est une immense plateforme qui permet le stockage du cristal. ");
$hangarura_description = addslashes("La cuve de stockage de l’uranium est un immense silo capable de conserver le Naquadah sans danger avant son utilisation. ");
$silo_description = addslashes("Le temple de Dakara est l’ultime héritage des Anciens d’Atlantis. Ce temple peut envoyer un rayon surpuissant capable de détruire les défenses adverses.");
$terri_description = addslashes("Le vaisseau Terraformeur permet de modifier l'aspect d'une planète et de la remodeler. Il est donc possible de l'utiliser afin d'agrandir la place des planètes.");

function premiertd($name,$lvl,$namepage) {

echo"<td width=\"120px\" style=\"BACKGROUND-COLOR:#4D4D4D\" class=\"objet_name\"><a href=\"des".$namepage.".php\" target=\"_parent\">".stripslashes($name)."</a> (<span class=\"objet_level\">$lvl</span>)</td>";

}

function deuxiemetd($name,$lvl,$img,$description,$etime,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fer,$besoin2_or,$besoin2_ada,$besoin2_ura,$besoin2_energie,$besoin_fer,$besoin_or,$besoin_ada,$besoin_ura,$besoin_energie,$Total_energie_reste,$place,$evolution) {

echo"<td style=\"width:120px\"> <a href=\"#\" onMouseOver=\"return overlib('<table border=\'0\' cellspacing=\'0\' cellpadding=\'0\' width=\'332px\'> <tr> <td class=black background=\'imgs/tip/topleft.png\' width=\'6\' height=\'6\'></td> <td class=black background=\'imgs/tip/top.png\' height=\'6\'></td> <td class=black background=\'imgs/tip/topright.png\' width=\'6\' height=\'6\'></td> </tr> <tr> <td class=black background=\'imgs/tip/left.png\' width=\'6\'></td> <td class=black background=\'imgs/tip/middle.png\' heigh=\'500\'> <table background=\'imgs/tip/middle.png\' border=\'0\' style=\'border-collapse:collapse;font-size: 12px;width:320px\'> <tr> <td class=black background=\'imgs/tip/middle.png\' colspan=\'2\'><strong>$name</strong> (Niveau $lvl) </td> </tr> <tr> <td class=black background=\'imgs/tip/middle.png\'><img src=\'imgs/".$img."_m.gif\' alt=\'$name\' width=\'80\' height=\'80\'></td> <td class=black background=\'imgs/tip/middle.png\'>$description</td> </tr> <tr style=\'text-align:center;\'> <td class=black background=\'imgs/tip/middle.png\'><span style=\'color:#FF0000\'><strong>$etime</strong></span></td> <td class=black background=\'imgs/tip/middle.png\'><strong>"; if(!empty($besoin2_fer)) { echo" <br> Fer : "; if($newwfer_ressource < ($besoin2_fer)){ echo"<span style=\'color:#FF0000\'>$besoin_fer</span>"; } else { echo"$besoin_fer"; }} if(!empty($besoin2_or)) { echo" <br> Or : "; if($newwor_ressource < ($besoin2_or)){ echo"<span style=\'color:#FF0000\'>$besoin_or</span>"; } else { echo"$besoin_or"; }} if(!empty($besoin2_ada)) { echo" <br> Cristal : "; if($newwada_ressource < ($besoin2_ada)){ echo"<span style=\'color:#FF0000\'>$besoin_ada</span>"; } else { echo"$besoin_ada"; }} if(!empty($besoin2_ura)) { echo" <br> Naquadah : "; if($newwura_ressource < ($besoin2_ura)){ echo"<span style=\'color:#FF0000\'>$besoin_ura</span>"; } else { echo"$besoin_ura"; }} if(!empty($besoin2_energie)) { echo" <br> Energie : "; if($Total_energie_reste < ($besoin2_energie)){ echo"<span style=\'color:#FF0000\'>$besoin_energie</span>"; } else { echo"$besoin_energie"; }} echo"</strong> </td> </tr> </table> </td>	<td class=\'black\' background=\'imgs/tip/right.png\' width=\'6\'></td> </tr> <tr> <td class=black background=\'imgs/tip/bottomleft.png\' width=\'6\' height=\'6\'></td> <td class=black background=\'imgs/tip/bottom.png\' height=\'6\'></td> <td class=black background=\'imgs/tip/bottomright.png\' width=\'6\' height=\'6\'></td>	</tr>	</table>')\" onMouseOut=\"return nd()\"> <img src=\"imgs/"; if ($evolution < 0 && $place > 0 && $newwfer_ressource >= ($besoin2_fer) && $newwor_ressource >= ($besoin2_or) && $newwada_ressource >= ($besoin2_ada) && $newwura_ressource >= ($besoin2_ura) && $Total_energie_reste >= ($besoin2_energie)) { echo $img; } else { echo $img."_d"; } echo".gif\" alt=\"$name\" width=\"120\" height=\"120\"></a></td>";

}


function troisiemetd($namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fer,$besoin2_or,$besoin2_ada,$besoin2_ura,$besoin2_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution) {

echo"<td width=\"120px\">"; if ($newwfer_ressource < ($besoin2_fer) || $newwor_ressource < ($besoin2_or) || $newwada_ressource < ($besoin2_ada) || $newwura_ressource < ($besoin2_ura) || $Total_energie_reste < ($besoin2_energie)) { echo"-"; } else { if ($evolution < 0 && $place > 0 && $newwfer_ressource >= ($besoin2_fer) && $newwor_ressource >= ($besoin2_or) && $newwura_ressource >= ($besoin2_ura) && $newwada_ressource >= ($besoin2_ada)  && $Total_energie_reste >= ($besoin2_energie)) { echo"<a href=\"Evolution".$namepage.".php\" target=\"_parent\"  class=\"objet_construc\">Construire</a>"; } if ($place <= 0 ) { echo" Manque de place"; } if ($evolution > 0) { if ($construction == "$namepage"){ echo"<p class=\"objet_construc\">$tempsevolution<br><a href=\"Arret".$namepage.".php\" target=\"_parent\" class=\"objet_construc\">Arreter</a>"; } else { echo"-"; }}} echo"</td>";
								

}

$premierecolonneressource = 1;
if ($row2[techenergie_lvl] >= 4 && $row[ura_lvl] >= 5) { $premierecolonneressource ++; }
if ($row[fer_lvl] >= "20" ) { $premierecolonneressource ++; }
if ( $row[or_lvl] >= "20" ) { $premierecolonneressource ++; }

$deuxiemecolonneressource = 1;
if ($row[robo_lvl] >= "1") { $deuxiemecolonneressource ++; }
if ($row[robo_lvl] >= "2") { $deuxiemecolonneressource ++; }
if ($row[robo_lvl] >= "3") { $deuxiemecolonneressource ++; }



$troisiemecolonneressource = 3;
if ($row2[techordi_lvl] >= 10 && $row2[techproAncien_lvl] >= 5 && $labo_lvl >= 8) { $troisiemecolonneressource ++; }


echo"<table width=\"480px\" border=\"0\" align=\"center\" style=\"border-collapse:collapse;\">

              <tr>
                <td colspan=\"$premierecolonneressource\" style=\"BACKGROUND-COLOR: #222222\" class=\"Categorie\">Batiments économiques</td>
              </tr>
			  <tr>";
			   //central
			   premiertd($central_name,$central_lvl,$central_namepage);
			   //fission
               if ($row2[techenergie_lvl] >= 4 && $row[ura_lvl] >= 5) { premiertd($fission_name,$fission_lvl,$fission_namepage); }
			   //exfer
               if ($row[fer_lvl] >= "20" ) { premiertd($exfer_name,$exfer_lvl,$exfer_namepage);}
			   //exor
			   if ( $row[or_lvl] >= "20" ) { premiertd($exor_name,$exor_lvl,$exor_namepage); }
			   
				echo"</tr>
              <tr style=\"text-align:center\">";
              	//central
                deuxiemetd($central_name,$central_lvl,$central_img,$central_description,$etimecentral,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_central_fer,$besoin2_central_or,$besoin2_central_ada,$besoin2_central_ura,$besoin2_central_energie,$besoin_central_fer,$besoin_central_or,$besoin_central_ada,$besoin_central_ura,$besoin_central_energie,$Total_energie_reste,$place,$evolution);
                //fission
                if ($row2[techenergie_lvl] >= 4 && $row[ura_lvl] >= 5) { deuxiemetd($fission_name,$fission_lvl,$fission_img,$fission_description,$etimefission,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fission_fer,$besoin2_fission_or,$besoin2_fission_ada,$besoin2_fission_ura,$besoin2_fission_energie,$besoin_fission_fer,$besoin_fission_or,$besoin_fission_ada,$besoin_fission_ura,$besoin_fission_energie,$Total_energie_reste,$place,$evolution); }
                //exfer
				if ($row[fer_lvl] >= "20" ) { deuxiemetd($exfer_name,$exfer_lvl,$exfer_img,$exfer_description,$etimeexfer,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_exfer_fer,$besoin2_exfer_or,$besoin2_exfer_ada,$besoin2_exfer_ura,$besoin2_exfer_energie,$besoin_exfer_fer,$besoin_exfer_or,$besoin_exfer_ada,$besoin_exfer_ura,$besoin_exfer_energie,$Total_energie_reste,$place,$evolution); }
				//exor
				if ( $row[or_lvl] >= "20" ) { deuxiemetd($exor_name,$exor_lvl,$exor_img,$exor_description,$etimeexor,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_exor_fer,$besoin2_exor_or,$besoin2_exor_ada,$besoin2_exor_ura,$besoin2_exor_energie,$besoin_exor_fer,$besoin_exor_or,$besoin_exor_ada,$besoin_exor_ura,$besoin_exor_energie,$Total_energie_reste,$place,$evolution); }
				
                
                
                echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
              	//central
                troisiemetd($central_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_central_fer,$besoin2_central_or,$besoin2_central_ada,$besoin2_central_ura,$besoin2_central_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
				//fission
				if ($row2[techenergie_lvl] >= 4 && $row[ura_lvl] >= 5) { troisiemetd($fission_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fission_fer,$besoin2_fission_or,$besoin2_fission_ada,$besoin2_fission_ura,$besoin2_fission_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
                //exfer
				if ($row[fer_lvl] >= "20" ) { troisiemetd($exfer_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_exfer_fer,$besoin2_exfer_or,$besoin2_exfer_ada,$besoin2_exfer_ura,$besoin2_exfer_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
				//exor
				if ( $row[or_lvl] >= "20" ) { troisiemetd($exor_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_exor_fer,$besoin2_exor_or,$besoin2_exor_ada,$besoin2_exor_ura,$besoin2_exor_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }

                echo"
              </tr>
              <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr style=\"text-align:center\">";
              premiertd($fer_name,$fer_lvl,$fer_namepage);
			  premiertd($or_name,$or_lvl,$or_namepage);
			  premiertd($ada_name,$ada_lvl,$ada_namepage);
			  premiertd($ura_name,$ura_lvl,$ura_namepage);

              echo"</tr>
              <tr>";
			  deuxiemetd($fer_name,$fer_lvl,$fer_img,$fer_description,$etimefer,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fer_fer,$besoin2_fer_or,$besoin2_fer_ada,$besoin2_fer_ura,$besoin2_fer_energie,$besoin_fer_fer,$besoin_fer_or,$besoin_fer_ada,$besoin_fer_ura,$besoin_fer_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($or_name,$or_lvl,$or_img,$or_description,$etimeor,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_or_fer,$besoin2_or_or,$besoin2_or_ada,$besoin2_or_ura,$besoin2_or_energie,$besoin_or_fer,$besoin_or_or,$besoin_or_ada,$besoin_or_ura,$besoin_or_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($ada_name,$ada_lvl,$ada_img,$ada_description,$etimeada,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_ada_fer,$besoin2_ada_or,$besoin2_ada_ada,$besoin2_ada_ura,$besoin2_ada_energie,$besoin_ada_fer,$besoin_ada_or,$besoin_ada_ada,$besoin_ada_ura,$besoin_ada_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($ura_name,$ura_lvl,$ura_img,$ura_description,$etimeura,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_ura_fer,$besoin2_ura_or,$besoin2_ura_ada,$besoin2_ura_ura,$besoin2_ura_energie,$besoin_ura_fer,$besoin_ura_or,$besoin_ura_ada,$besoin_ura_ura,$besoin_ura_energie,$Total_energie_reste,$place,$evolution);

 
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  troisiemetd($fer_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_fer_fer,$besoin2_fer_or,$besoin2_fer_ada,$besoin2_fer_ura,$besoin2_fer_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($or_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_or_fer,$besoin2_or_or,$besoin2_or_ada,$besoin2_or_ura,$besoin2_or_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($ada_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_ada_fer,$besoin2_ada_or,$besoin2_ada_ada,$besoin2_ada_ura,$besoin2_ada_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($ura_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_ura_fer,$besoin2_ura_or,$besoin2_ura_ada,$besoin2_ura_ura,$besoin2_ura_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);

                echo"
              </tr>
              <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr style=\"text-align:center\">";
              premiertd($hangarfer_name,$hangarfer_lvl,$hangarfer_namepage);
			  premiertd($hangaror_name,$hangaror_lvl,$hangaror_namepage);
			  premiertd($hangarada_name,$hangarada_lvl,$hangarada_namepage);
			  premiertd($hangarura_name,$hangarura_lvl,$hangarura_namepage);

              echo"</tr>
              <tr style=\"text-align:center\">";
			  deuxiemetd($hangarfer_name,$hangarfer_lvl,$hangarfer_img,$hangarfer_description,$etimehangarfer,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarfer_fer,$besoin2_hangarfer_or,$besoin2_hangarfer_ada,$besoin2_hangarfer_ura,$besoin2_hangarfer_energie,$besoin_hangarfer_fer,$besoin_hangarfer_or,$besoin_hangarfer_ada,$besoin_hangarfer_ura,$besoin_hangarfer_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($hangaror_name,$hangaror_lvl,$hangaror_img,$hangaror_description,$etimehangaror,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangaror_fer,$besoin2_hangaror_or,$besoin2_hangaror_ada,$besoin2_hangaror_ura,$besoin2_hangaror_energie,$besoin_hangaror_fer,$besoin_hangaror_or,$besoin_hangaror_ada,$besoin_hangaror_ura,$besoin_hangaror_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($hangarada_name,$hangarada_lvl,$hangarada_img,$hangarada_description,$etimehangarada,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarada_fer,$besoin2_hangarada_or,$besoin2_hangarada_ada,$besoin2_hangarada_ura,$besoin2_hangarada_energie,$besoin_hangarada_fer,$besoin_hangarada_or,$besoin_hangarada_ada,$besoin_hangarada_ura,$besoin_hangarada_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($hangarura_name,$hangarura_lvl,$hangarura_img,$hangarura_description,$etimehangarura,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarura_fer,$besoin2_hangarura_or,$besoin2_hangarura_ada,$besoin2_hangarura_ura,$besoin2_hangarura_energie,$besoin_hangarura_fer,$besoin_hangarura_or,$besoin_hangarura_ada,$besoin_hangarura_ura,$besoin_hangarura_energie,$Total_energie_reste,$place,$evolution);

              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  troisiemetd($hangarfer_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarfer_fer,$besoin2_hangarfer_or,$besoin2_hangarfer_ada,$besoin2_hangarfer_ura,$besoin2_hangarfer_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($hangaror_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangaror_fer,$besoin2_hangaror_or,$besoin2_hangaror_ada,$besoin2_hangaror_ura,$besoin2_hangaror_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($hangarada_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarada_fer,$besoin2_hangarada_or,$besoin2_hangarada_ada,$besoin2_hangarada_ura,$besoin2_hangarada_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($hangarura_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_hangarura_fer,$besoin2_hangarura_or,$besoin2_hangarura_ada,$besoin2_hangarura_ura,$besoin2_hangarura_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);

              echo"</tr>
			  <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td colspan=\"$deuxiemecolonneressource\" class=\"Categorie\" style=\"BACKGROUND-COLOR: #222222\">Batiments militaires</td>
              </tr>
			  <tr>";
			  
			  if ( $row[robo_lvl] >= "1" ) {premiertd($mili_name,$mili_lvl,$mili_namepage); }
			  if ( $row[robo_lvl] >= "2" ) {premiertd($chantier_name,$chantier_lvl,$chantier_namepage); }
			  if ( $row[robo_lvl] >= "3" ) {premiertd($defense_name,$defense_lvl,$defense_namepage); }
			  premiertd($silo_name,$silo_lvl,$silo_namepage);
			  
              echo"</tr>
              <tr style=\"text-align:center\">";
			  if ( $row[robo_lvl] >= "1" ) {deuxiemetd($mili_name,$mili_lvl,$mili_img,$mili_description,$etimemili,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_mili_fer,$besoin2_mili_or,$besoin2_mili_ada,$besoin2_mili_ura,$besoin2_mili_energie,$besoin_mili_fer,$besoin_mili_or,$besoin_mili_ada,$besoin_mili_ura,$besoin_mili_energie,$Total_energie_reste,$place,$evolution); }
			  if ( $row[robo_lvl] >= "2" ) {deuxiemetd($chantier_name,$chantier_lvl,$chantier_img,$chantier_description,$etimechantier,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_chantier_fer,$besoin2_chantier_or,$besoin2_chantier_ada,$besoin2_chantier_ura,$besoin2_chantier_energie,$besoin_chantier_fer,$besoin_chantier_or,$besoin_chantier_ada,$besoin_chantier_ura,$besoin_chantier_energie,$Total_energie_reste,$place,$evolution); }
			  if ( $row[robo_lvl] >= "3" ) {deuxiemetd($defense_name,$defense_lvl,$defense_img,$defense_description,$etimedefense,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_defense_fer,$besoin2_defense_or,$besoin2_defense_ada,$besoin2_defense_ura,$besoin2_defense_energie,$besoin_defense_fer,$besoin_defense_or,$besoin_defense_ada,$besoin_defense_ura,$besoin_defense_energie,$Total_energie_reste,$place,$evolution); }
			  deuxiemetd($silo_name,$silo_lvl,$silo_img,$silo_description,$etimesilo,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_silo_fer,$besoin2_silo_or,$besoin2_silo_ada,$besoin2_silo_ura,$besoin2_silo_energie,$besoin_silo_fer,$besoin_silo_or,$besoin_silo_ada,$besoin_silo_ura,$besoin_silo_energie,$Total_energie_reste,$place,$evolution);
			  
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
		  	  if ( $row[robo_lvl] >= "1" ) {troisiemetd($mili_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_mili_fer,$besoin2_mili_or,$besoin2_mili_ada,$besoin2_mili_ura,$besoin2_mili_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
			  if ( $row[robo_lvl] >= "2" ) {troisiemetd($chantier_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_chantier_fer,$besoin2_chantier_or,$besoin2_chantier_ada,$besoin2_chantier_ura,$besoin2_chantier_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
			  if ( $row[robo_lvl] >= "3" ) {troisiemetd($defense_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_defense_fer,$besoin2_defense_or,$besoin2_defense_ada,$besoin2_defense_ura,$besoin2_defense_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
			  troisiemetd($silo_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_silo_fer,$besoin2_silo_or,$besoin2_silo_ada,$besoin2_silo_ura,$besoin2_silo_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  
              echo"
              </tr>
              <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>
                <td>&nbsp;</td>

                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>
                <td colspan=\"$troisiemecolonneressource\" style=\"BACKGROUND-COLOR: #222222\" class=\"Categorie\">Batiments scientifiques</td>
              </tr>";
			  
			  premiertd($robo_name,$robo_lvl,$robo_namepage);
			  premiertd($labo_name,$labo_lvl,$labo_namepage);
			  premiertd($terri_name,$terri_lvl,$terri_namepage);
			  if ($row2[techordi_lvl] >= 10 && $row2[techproAncien_lvl] >= 5 && $labo_lvl >= 8) {premiertd($siege_name,$siege_lvl); }
			  
              echo"</tr>
              <tr style=\"text-align:center\">";
			  deuxiemetd($robo_name,$robo_lvl,$robo_img,$robo_description,$etimerobo,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_robo_fer,$besoin2_robo_or,$besoin2_robo_ada,$besoin2_robo_ura,$besoin2_robo_energie,$besoin_robo_fer,$besoin_robo_or,$besoin_robo_ada,$besoin_robo_ura,$besoin_robo_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($labo_name,$labo_lvl,$labo_img,$labo_description,$etimelabo,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_labo_fer,$besoin2_labo_or,$besoin2_labo_ada,$besoin2_labo_ura,$besoin2_labo_energie,$besoin_labo_fer,$besoin_labo_or,$besoin_labo_ada,$besoin_labo_ura,$besoin_labo_energie,$Total_energie_reste,$place,$evolution);
			  deuxiemetd($terri_name,$terri_lvl,$terri_img,$terri_description,$etimeterri,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_terri_fer,$besoin2_terri_or,$besoin2_terri_ada,$besoin2_terri_ura,$besoin2_terri_energie,$besoin_terri_fer,$besoin_terri_or,$besoin_terri_ada,$besoin_terri_ura,$besoin_terri_energie,$Total_energie_reste,$place,$evolution);
			  if ($row2[techordi_lvl] >= 10 && $row2[techproAncien_lvl] >= 5 && $labo_lvl >= 8) {deuxiemetd($siege_name,$siege_lvl,$siege_img,$siege_description,$etimesiege,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_siege_fer,$besoin2_siege_or,$besoin2_siege_ada,$besoin2_siege_ura,$besoin2_siege_energie,$besoin_siege_fer,$besoin_siege_or,$besoin_siege_ada,$besoin_siege_ura,$besoin_siege_energie,$Total_energie_reste,$place,$evolution); }
			
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  troisiemetd($robo_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_robo_fer,$besoin2_robo_or,$besoin2_robo_ada,$besoin2_robo_ura,$besoin2_robo_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($labo_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_labo_fer,$besoin2_labo_or,$besoin2_labo_ada,$besoin2_labo_ura,$besoin2_labo_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  troisiemetd($terri_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_terri_fer,$besoin2_terri_or,$besoin2_terri_ada,$besoin2_terri_ura,$besoin2_terri_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution);
			  if ($row2[techordi_lvl] >= 10 && $row2[techproAncien_lvl] >= 5 && $labo_lvl >= 8) {troisiemetd($siege_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$besoin2_siege_fer,$besoin2_siege_or,$besoin2_siege_ada,$besoin2_siege_ura,$besoin2_siege_energie,$Total_energie_reste,$place,$evolution,$construction,$tempsevolution); }
			  
              echo"</tr>
            </table><br><br>";

mysql_close($connect);

echo'<br><br><br>';
//include 'zap.php';
?>