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

$New_techinfra_lvl = ($row2[techinfra_lvl] + 1);
$New_techenergie_lvl = ($row2[techenergie_lvl] + 1);
$New_techlaser_lvl = ($row2[techlaser_lvl] + 1);
$New_techions_lvl = ($row2[techions_lvl] + 1);
$New_techplasma_lvl = ($row2[techplasma_lvl] + 1);
$New_techordi_lvl = ($row2[techordi_lvl] + 1);
$New_techcombustion_lvl = ($row2[techcombustion_lvl] + 1);
$New_techAsgaards_lvl = ($row2[techAsgaards_lvl] + 1);
$New_techhyperespace_lvl = ($row2[techhyperespace_lvl] + 1);
$New_techhypernav_lvl = ($row2[techhypernav_lvl] + 1);
$New_techespio1_lvl = ($row2[techespio1_lvl] + 1);
$New_techespio2_lvl = ($row2[techespio2_lvl] + 1);
$New_techArmement_lvl = ($row2[techArmement_lvl] + 1);
$New_techBouclier_lvl = ($row2[techBouclier_lvl] + 1);
$New_techcoque_lvl = ($row2[techcoque_lvl] + 1);
$New_techproAsgaard_lvl = ($row2[techproAsgaard_lvl] + 1);
$New_techproAncien_lvl = ($row2[techproAncien_lvl] + 1);
$New_technaqua_lvl = ($row2[technaqua_lvl] + 1);
$New_techenergie_lvl = ($row2[techenergie_lvl] + 1);
$New_techanti_lvl = ($row2[techanti_lvl] + 1);

// techenergie
if ($row2[techenergie_lvl] == "0") {
	$Depense_techenergie_or = number_format(800, 0, ',', ' ');
	$Depense_techenergie_ada = number_format(400, 0, ',', ' ');
	$Depense2_techenergie_or = 800;
	$Depense2_techenergie_ada = 400;
}else{
	$Depense2_techenergie_or = round((400 * ( bcpow( 2, ($row2[techenergie_lvl] + 1),3))),0);
	$Depense2_techenergie_ada = round((200 * ( bcpow( 2, ($row2[techenergie_lvl] + 1),3))),0);
	$Depense_techenergie_or = number_format(round((400 * ( bcpow( 2, ($row2[techenergie_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techenergie_ada = number_format(round((200 * ( bcpow( 2, ($row2[techenergie_lvl] + 1),3))),0), 0, ',', ' ');
}

// techlaser
if ($row2[techlaser_lvl] == "0") {
	$Depense_techlaser_fer = number_format(400, 0, ',', ' ');
	$Depense_techlaser_or = number_format(100, 0, ',', ' ');
	$Depense2_techlaser_fer = 400;
	$Depense2_techlaser_or = 100;
}else{
	$Depense2_techlaser_fer = round((200 * ( bcpow( 2, ($row2[techlaser_lvl] + 1),3))),0);
	$Depense2_techlaser_or = round((50 * ( bcpow( 2, ($row2[techlaser_lvl] + 1),3))),0);
	$Depense_techlaser_fer = number_format(round((200 * ( bcpow( 2, ($row2[techlaser_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techlaser_or = number_format(round((50 * ( bcpow( 2, ($row2[techlaser_lvl] + 1),3))),0), 0, ',', ' ');
}

//techions
if ($row2[techions_lvl] == "0") {
	$Depense_techions_fer = number_format(3000, 0, ',', ' ');
	$Depense_techions_or = number_format(900, 0, ',', ' ');
	$Depense_techions_ada = number_format(300, 0, ',', ' ');
	$Depense2_techions_fer = 3000;
	$Depense2_techions_or = 900;
	$Depense2_techions_ada = 300;
}else{
	$Depense2_techions_fer = round((1500 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0);
	$Depense2_techions_or = round((450 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0);
	$Depense2_techions_ada = round((150 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0);
	$Depense_techions_fer = number_format(round((1500 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techions_or = number_format(round((450 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techions_ada = number_format(round((150 * ( bcpow( 2, ($row2[techions_lvl] + 1),3))),0), 0, ',', ' ');
}

//techplasma
if ($row2[techplasma_lvl] == "0") {
	$Depense_techplasma_fer = number_format(2000, 0, ',', ' ');
	$Depense_techplasma_or = number_format(4000, 0, ',', ' ');
	$Depense_techplasma_ada = number_format(1000, 0, ',', ' ');
	$Depense2_techplasma_fer = 2000;
	$Depense2_techplasma_or = 4000;
	$Depense2_techplasma_ada = 1000;
}else{
	$Depense2_techplasma_fer = round((1000 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0);
	$Depense2_techplasma_or = round((2000 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0);
	$Depense2_techplasma_ada = round((500 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0);
	$Depense_techplasma_fer = number_format(round((1000 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techplasma_or = number_format(round((2000 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techplasma_ada = number_format(round((500 * ( bcpow( 2, ($row2[techplasma_lvl] + 1),3))),0), 0, ',', ' ');
}

// techordi
if ($row2[techordi_lvl] == "0") {
	$Depense_techordi_or = number_format(400, 0, ',', ' ');
	$Depense_techordi_ada = number_format(600, 0, ',', ' ');
	$Depense2_techordi_or = 400;
	$Depense2_techordi_ada = 600;
}else{
	$Depense2_techordi_or = round((200 * ( bcpow( 2, ($row2[techordi_lvl] + 1),3))),0);
	$Depense2_techordi_ada = round((300 * ( bcpow( 2, ($row2[techordi_lvl] + 1),3))),0);
	$Depense_techordi_or = number_format(round((200 * ( bcpow( 2, ($row2[techordi_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techordi_ada = number_format(round((300 * ( bcpow( 2, ($row2[techordi_lvl] + 1),3))),0), 0, ',', ' ');
}

// techcombustion
if ($row2[techcombustion_lvl] == "0") {
	$Depense_techcombustion_fer = number_format(2400, 0, ',', ' ');
	$Depense_techcombustion_ada = number_format(3600, 0, ',', ' ');
	$Depense2_techcombustion_fer = 2400;
	$Depense2_techcombustion_ada = 3600;
}else{
	$Depense2_techcombustion_fer = round((1200 * ( bcpow( 2, ($row2[techcombustion_lvl] + 1),3))),0);
	$Depense2_techcombustion_ada = round((1800 * ( bcpow( 2, ($row2[techcombustion_lvl] + 1),3))),0);
	$Depense_techcombustion_fer = number_format(round((1200 * ( bcpow( 2, ($row2[techcombustion_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techcombustion_ada = number_format(round((1800 * ( bcpow( 2, ($row2[techcombustion_lvl] + 1),3))),0), 0, ',', ' ');
}

// techAsgaards
if ($row2[techAsgaards_lvl] == "0") {
	$Depense_techAsgaards_fer = number_format(1000, 0, ',', ' ');
	$Depense_techAsgaards_or = number_format(2000, 0, ',', ' ');
	$Depense_techAsgaards_ada = number_format(300, 0, ',', ' ');
	$Depense2_techAsgaards_fer = 1000;
	$Depense2_techAsgaards_or = 2000;
	$Depense2_techAsgaards_ada = 300;
}else{
	$Depense2_techAsgaards_fer = round((500 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0);
	$Depense2_techAsgaards_or = round((1000 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0);
	$Depense2_techAsgaards_ada = round((150 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0);
	$Depense_techAsgaards_fer = number_format(round((500 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techAsgaards_or = number_format(round((1000 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techAsgaards_ada = number_format(round((150 * ( bcpow( 2, ($row2[techAsgaards_lvl] + 1),3))),0), 0, ',', ' ');
}

// techhyperespace
if ($row2[techhyperespace_lvl] == "0") {
	$Depense_techhyperespace_or = number_format(40000, 0, ',', ' ');
	$Depense_techhyperespace_ada = number_format(20000, 0, ',', ' ');
	$Depense2_techhyperespace_or = 40000;
	$Depense2_techhyperespace_ada = 20000;
}else{
	$Depense2_techhyperespace_or = round((20000 * ( bcpow( 2, ($row2[techhyperespace_lvl] + 1),3))),0);
	$Depense2_techhyperespace_ada = round((10000 * ( bcpow( 2, ($row2[techhyperespace_lvl] + 1),3))),0);
	$Depense_techhyperespace_or = number_format(round((20000 * ( bcpow( 2, ($row2[techhyperespace_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techhyperespace_ada = number_format(round((10000 * ( bcpow( 2, ($row2[techhyperespace_lvl] + 1),3))),0), 0, ',', ' ');
}

// techhypernav
if ($row2[techhypernav_lvl] == "0") {
	$Depense_techhypernav_fer = number_format(100000, 0, ',', ' ');
	$Depense_techhypernav_or = number_format(50000, 0, ',', ' ');
	$Depense_techhypernav_ada = number_format(50000, 0, ',', ' ');
	$Depense_techhypernav_ura = number_format(40000, 0, ',', ' ');
	$Depense2_techhypernav_fer = 100000;
	$Depense2_techhypernav_or = 50000;
	$Depense2_techhypernav_ada = 50000;
	$Depense2_techhypernav_ura = 40000;
}else{
	$Depense2_techhypernav_fer = round((50000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0);
	$Depense2_techhypernav_or = round((25000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0);
	$Depense2_techhypernav_ada = round((25000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0);
	$Depense2_techhypernav_ura = round((20000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0);
	$Depense_techhypernav_fer = number_format(round((50000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techhypernav_or = number_format(round((25000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techhypernav_ada = number_format(round((25000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techhypernav_ura = number_format(round((20000 * ( bcpow( 2, ($row2[techhypernav_lvl] + 1),3))),0), 0, ',', ' ');
}

// techespio1
if ($row2[techespio1_lvl] == "0") {
	$Depense_techespio1_fer = number_format(100, 0, ',', ' ');
	$Depense_techespio1_or = number_format(1000, 0, ',', ' ');
	$Depense_techespio1_ada = number_format(200, 0, ',', ' ');
	$Depense2_techespio1_fer = 100;
	$Depense2_techespio1_or = 1000;
	$Depense2_techespio1_ada = 200;
}else{
	$Depense2_techespio1_fer = round((50 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0);
	$Depense2_techespio1_or = round((500 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0);
	$Depense2_techespio1_ada = round((100 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0);
	$Depense_techespio1_fer = number_format(round((50 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techespio1_or = number_format(round((500 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techespio1_ada = number_format(round((100 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0), 0, ',', ' ');
}

// techespio2
if ($row2[techespio2_lvl] == "0") {
	$Depense_techespio2_fer = number_format(400, 0, ',', ' ');
	$Depense_techespio2_or = number_format(2000, 0, ',', ' ');
	$Depense_techespio2_ada = number_format(500, 0, ',', ' ');
	$Depense2_techespio2_fer = 400;
	$Depense2_techespio2_or = 2000;
	$Depense2_techespio2_ada = 500;
}else{
	$Depense2_techespio2_fer = round((200 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0);
	$Depense2_techespio2_or = round((1000 * ( bcpow( 2, ($row2[techespio2_lvl] + 1),3))),0);
	$Depense2_techespio2_ada = round((250 * ( bcpow( 2, ($row2[techespio2_lvl] + 1),3))),0);
	$Depense_techespio2_fer = number_format(round((200 * ( bcpow( 2, ($row2[techespio1_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techespio2_or = number_format(round((1000 * ( bcpow( 2, ($row2[techespio2_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techespio2_ada = number_format(round((250 * ( bcpow( 2, ($row2[techespio2_lvl] + 1),3))),0), 0, ',', ' ');
}

// techArmement
if ($row2[techArmement_lvl] == "0") {
	$Depense_techArmement_fer = number_format(400, 0, ',', ' ');
	$Depense_techArmement_or = number_format(200, 0, ',', ' ');
	$Depense2_techArmement_fer = 400;
	$Depense2_techArmement_or = 200;
}else{
	$Depense2_techArmement_fer = round((200 * ( bcpow( 2, ($row2[techArmement_lvl] + 1),3))),0);
	$Depense2_techArmement_or = round((100 * ( bcpow( 2, ($row2[techArmement_lvl] + 1),3))),0);
	$Depense_techArmement_fer = number_format(round((200 * ( bcpow( 2, ($row2[techArmement_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techArmement_or = number_format(round((100 * ( bcpow( 2, ($row2[techArmement_lvl] + 1),3))),0), 0, ',', ' ');
}

// techBouclier
if ($row2[techBouclier_lvl] == "0") {
	$Depense_techBouclier_fer = number_format(400, 0, ',', ' ');
	$Depense_techBouclier_or = number_format(300, 0, ',', ' ');
	$Depense_techBouclier_ada = number_format(75, 0, ',', ' ');
	$Depense2_techBouclier_fer = 400;
	$Depense2_techBouclier_or = 300;
	$Depense2_techBouclier_ada = 75;
}else{
	$Depense2_techBouclier_fer = round((200 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0);
	$Depense2_techBouclier_or = round((150 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0);
	$Depense2_techBouclier_ada = round((37.5 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0);
	$Depense_techBouclier_fer = number_format(round((200 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techBouclier_or = number_format(round((150 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techBouclier_ada = number_format(round((37.5 * ( bcpow( 2, ($row2[techBouclier_lvl] + 1),3))),0), 0, ',', ' ');
}

// techcoque
if ($row2[techcoque_lvl] == "0") {
	$Depense_techcoque_fer = number_format(800, 0, ',', ' ');
	$Depense2_techcoque_fer = 800;
}else{
	$Depense2_techcoque_fer = round((400 * ( bcpow( 2, ($row2[techcoque_lvl] + 1),3))),0);
	$Depense_techcoque_fer = number_format(round((400 * ( bcpow( 2, ($row2[techcoque_lvl] + 1),3))),0), 0, ',', ' ');
}

// techproAsgaard
if ($row2[techproAsgaard_lvl] == "0") {
	$Depense_techproAsgaard_fer = number_format(200, 0, ',', ' ');
	$Depense_techproAsgaard_or = number_format(200, 0, ',', ' ');
	$Depense_techproAsgaard_ada = number_format(200, 0, ',', ' ');
	$Depense_techproAsgaard_ura = number_format(10, 0, ',', ' ');
	$Depense2_techproAsgaard_fer = 200;
	$Depense2_techproAsgaard_or = 200;
	$Depense2_techproAsgaard_ada = 200;
	$Depense2_techproAsgaard_ura = 10;
}else{
	$Depense2_techproAsgaard_fer = round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0);
	$Depense2_techproAsgaard_or = round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0);
	$Depense2_techproAsgaard_ada = round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0);
	$Depense2_techproAsgaard_ura = round((5 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0);
	$Depense_techproAsgaard_fer = number_format(round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techproAsgaard_or = number_format(round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techproAsgaard_ada = number_format(round((100 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techproAsgaard_ura = number_format(round((5 * ( bcpow( 2, ($row2[techproAsgaard_lvl] + 1),3))),0), 0, ',', ' ');
}

// techproAncien
if ($row2[techproAncien_lvl] == "0") {
	$Depense_techproAncien_fer = number_format(8000, 0, ',', ' ');
	$Depense_techproAncien_ada = number_format(8000, 0, ',', ' ');
	$Depense2_techproAncien_fer = 8000;
	$Depense2_techproAncien_ada = 8000;
}else{
	$Depense2_techproAncien_fer = round((4000 * ( bcpow( 2, ($row2[techproAncien_lvl] + 1),3))),0);
	$Depense2_techproAncien_ada = round((4000 * ( bcpow( 2, ($row2[techproAncien_lvl] + 1),3))),0);
	$Depense_techproAncien_fer = number_format(round((4000 * ( bcpow( 2, ($row2[techproAncien_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techproAncien_ada = number_format(round((4000 * ( bcpow( 2, ($row2[techproAncien_lvl] + 1),3))),0), 0, ',', ' ');
}

// techinfra
if ($row2[techinfra_lvl] == "0") {
	$Depense_techinfra_fer = number_format(560, 0, ',', ' ');
	$Depense_techinfra_or = number_format(225, 0, ',', ' ');
	$Depense_techinfra_ada = number_format(60, 0, ',', ' ');
	$Depense2_techinfra_fer = 560;
	$Depense2_techinfra_or = 225;
	$Depense2_techinfra_ada = 60;
}else{
	$Depense2_techinfra_fer = round((280 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0);
	$Depense2_techinfra_or = round((112.5 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0);
	$Depense2_techinfra_ada = round((30 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0);
	$Depense_techinfra_fer = number_format(round((280 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techinfra_or = number_format(round((112.5 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techinfra_ada = number_format(round((30 * ( bcpow( 2, ($row2[techinfra_lvl] + 1),3))),0), 0, ',', ' ');
}

// technaqua
if ($row2[technaqua_lvl] == "0") {
	$Depense_technaqua_fer = number_format(4000, 0, ',', ' ');
	$Depense_technaqua_ura = number_format(2500, 0, ',', ' ');
	$Depense2_technaqua_fer = 4000;
	$Depense2_technaqua_ura = 2500;
}else{
	$Depense2_technaqua_fer = round((2000 * ( bcpow( 2, ($row2[technaqua_lvl] + 1),3))),0);
	$Depense2_technaqua_ura = round((1250 * ( bcpow( 2, ($row2[technaqua_lvl] + 1),3))),0);
	$Depense_technaqua_fer = number_format(round((2000 * ( bcpow( 2, ($row2[technaqua_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_technaqua_ura = number_format(round((1250 * ( bcpow( 2, ($row2[technaqua_lvl] + 1),3))),0), 0, ',', ' ');
}

// techanti
if ($row2[techanti_lvl] == "0") {
	$Depense_techanti_fer = number_format(1000, 0, ',', ' ');
	$Depense_techanti_ada = number_format(500, 0, ',', ' ');
	$Depense_techanti_ura = number_format(200, 0, ',', ' ');
	$Depense2_techanti_fer = 1000;
	$Depense2_techanti_ada = 500;
	$Depense2_techanti_ura = 200;
}else{
	$Depense2_techanti_fer = round((500 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0);
	$Depense2_techanti_ada = round((250 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0);
	$Depense2_techanti_ura = round((100 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0);
	$Depense_techanti_fer = number_format(round((500 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techanti_ada = number_format(round((250 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0), 0, ',', ' ');
	$Depense_techanti_ura = number_format(round((100 * ( bcpow( 2, ($row2[techanti_lvl] + 1),3))),0), 0, ',', ' ');
}


if ($row2[techinfra_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechinfra2 ; $construction = "techinfra" ; }
if ($row2[techenergie_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechenergie2 ; $construction = "techenergie" ; }
if ($row2[techlaser_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechlaser2 ; $construction = "techlaser" ; }
if ($row2[techions_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechions2 ; $construction = "techions" ; }
if ($row2[techplasma_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechplasma2 ; $construction = "techplasma" ; }
if ($row2[techordi_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechordi2 ; $construction = "techordi" ; }
if ($row2[techcombustion_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcombustion2 ; $construction = "techcombustion" ; }
if ($row2[techAsgaards_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechAsgaards2 ; $construction = "techAsgaards" ; }
if ($row2[techhyperespace_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechhyperespace2 ; $construction = "techhyperespace" ; }
if ($row2[techhypernav_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechhypernav2; $construction = "techhypernav"; }
if ($row2[techespio1_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio12 ; $construction = "techespio1" ; }
if ($row2[techespio2_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio22 ; $construction = "techespio2" ; }
if ($row2[techArmement_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechArmement2 ; $construction = "techArmement" ; }
if ($row2[techBouclier_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechBouclier2 ; $construction = "techBouclier" ; }
if ($row2[techcoque_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcoque2 ; $construction = "techcoque" ; }
if ($row2[techproAsgaard_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechproAsgaard2 ; $construction = "techproAsgaard" ; }
if ($row2[techproAncien_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechproAncien2 ; $construction = "techproAncien" ; }
if ($row2[technaqua_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechnaqua2 ; $construction = "technaqua" ; }
if ($row2[techanti_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechanti2 ; $construction = "techanti" ; }

$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>";
// chantier
if ($row[chantier_lvl] =="0") {
$chantier_lvl = "0";
}
else {
$chantier_lvl = $row[chantier_lvl];
}
// labo
if ($row[labo_lvl] =="0") {
$labo_lvl = "0";
}
else {
$labo_lvl = $row[labo_lvl];
}
// techenergie
if ($row2[techenergie_lvl] =="0") {
$techenergie_lvl = "0";
}
else {
$techenergie_lvl = $row2[techenergie_lvl];
}
// techlaser
if ($row2[techlaser_lvl] =="0") {
$techlaser_lvl = "0";
}
else {
$techlaser_lvl = $row2[techlaser_lvl];
}
// techions
if ($row2[techions_lvl] =="0") {
$techions_lvl = "0";
}
else {
$techions_lvl = $row2[techions_lvl];
}
// techplasma
if ($row2[techplasma_lvl] =="0") {
$techplasma_lvl = "0";
}
else {
$techplasma_lvl = $row2[techplasma_lvl];
}
// techordi
if ($row2[techordi_lvl] =="0") {
$techordi_lvl = "0";
}
else {
$techordi_lvl = $row2[techordi_lvl];
}
// techcombustion
if ($row2[techcombustion_lvl] =="0") {
$techcombustion_lvl = "0";
}
else {
$techcombustion_lvl = $row2[techcombustion_lvl];
}
// techAsgaards
if ($row2[techAsgaards_lvl] =="0") {
$techAsgaards_lvl = "0";
}
else {
$techAsgaards_lvl = $row2[techAsgaards_lvl];
}
// techhyperespace
if ($row2[techhyperespace_lvl] =="0") {
$techhyperespace_lvl = "0";
}
else {
$techhyperespace_lvl = $row2[techhyperespace_lvl];
}
// techhyperespace
if ($row2[techhypernav_lvl] =="0") {
	$techhypernav_lvl = "0";
}else{
	$techhypernav_lvl = $row2[techhypernav_lvl];
}

// techespio1
if ($row2[techespio1_lvl] =="0") {
$techespio1_lvl = "0";
}
else {
$techespio1_lvl = $row2[techespio1_lvl];
}
// techespio2
if ($row2[techespio2_lvl] =="0") {
$techespio2_lvl = "0";
}
else {
$techespio2_lvl = $row2[techespio2_lvl];
}
// techArmement
if ($row2[techArmement_lvl] =="0") {
$techArmement_lvl = "0";
}
else {
$techArmement_lvl = $row2[techArmement_lvl];
}
// techBouclier
if ($row2[techBouclier_lvl] =="0") {
$techBouclier_lvl = "0";
}
else {
$techBouclier_lvl = $row2[techBouclier_lvl];
}
// techcoque
if ($row2[techcoque_lvl] =="0") {
$techcoque_lvl = "0";
}
else {
$techcoque_lvl = $row2[techcoque_lvl];
}
// techproAsgaard
if ($row2[techproAsgaard_lvl] =="0") {
$techproAsgaard_lvl = "0";
}
else {
$techproAsgaard_lvl = $row2[techproAsgaard_lvl];
}
// techproAncien
if ($row2[techproAncien_lvl] =="0") {
$techproAncien_lvl = "0";
}
else {
$techproAncien_lvl = $row2[techproAncien_lvl];
}
// techinfra
if ($row2[techinfra_lvl] =="0") {
$techinfra_lvl = "0";
}
else {
$techinfra_lvl = $row2[techinfra_lvl];
}
// technaqua
if ($row2[technaqua_lvl] =="0") {
$technaqua_lvl = "0";
}
else {
$technaqua_lvl = $row2[technaqua_lvl];
}
// techanti
if ($row2[techanti_lvl] =="0") {
$techanti_lvl = "0";
}
else {
$techanti_lvl = $row2[techanti_lvl];
}

/////////////// TEMPS //////////////
//techenergie
$temps1techenergie = (534 * $siege_temps_evolution * (bcpow(2, $New_techenergie_lvl,3)));
$stimetechenergie = (round($temps1techenergie*(bcpow(0.9, $labo_lvl,3))));

$etimetechenergie = $stimetechenergie;
$emintechenergie = $etimetechenergie / 60;

if ( floor($emintechenergie) != $emintechenergie )
  $esectechenergie = floor( ($emintechenergie - floor( $emintechenergie )) * 60);

  if ( $emintechenergie > 60 ) {

    $ehourtechenergie = floor( $emintechenergie / 60 );
    $emintechenergie = $emintechenergie - ( 60 * $ehourtechenergie );

    if ( $ehourtechenergie > 24 ) {
      $edaytechenergie = floor( $ehourtechenergie / 24);
      $ehourtechenergie = $ehourtechenergie - ( 24 * $edaytechenergie );
    }

  }

$etimetechenergie ="";

if (!empty($edaytechenergie) )
  $etimetechenergie.=$edaytechenergie."j";

if (!empty($ehourtechenergie) )
  $etimetechenergie.=$ehourtechenergie."h";

if ($emintechenergie != 0)
  $etimetechenergie.= floor($emintechenergie)."min";

if (!empty($esectechenergie) )
  $etimetechenergie.=$esectechenergie."s";

//techlaser
$temps1techlaser = (400 * $siege_temps_evolution * (bcpow(2, $New_techlaser_lvl,3)));
$stimetechlaser = (round($temps1techlaser*(bcpow(0.9, $labo_lvl,3))));

$etimetechlaser = $stimetechlaser;
$emintechlaser = $etimetechlaser / 60;

if ( floor($emintechlaser) != $emintechlaser )
  $esectechlaser = floor( ($emintechlaser - floor( $emintechlaser )) * 60);

  if ( $emintechlaser > 60 ) {

    $ehourtechlaser = floor( $emintechlaser / 60 );
    $emintechlaser = $emintechlaser - ( 60 * $ehourtechlaser );

    if ( $ehourtechlaser > 24 ) {
      $edaytechlaser = floor( $ehourtechlaser / 24);
      $ehourtechlaser = $ehourtechlaser - ( 24 * $edaytechlaser );
    }

  }

$etimetechlaser ="";

if (!empty($edaytechlaser) )
  $etimetechlaser.=$edaytechlaser."j";

if (!empty($ehourtechlaser) )
  $etimetechlaser.=$ehourtechlaser."h";

if ($emintechlaser != 0)
  $etimetechlaser.= floor($emintechlaser)."min";

if (!empty($esectechlaser) )
  $etimetechlaser.=$esectechlaser."s";

//techions
$temps1techions = (1334 * $siege_temps_evolution * (bcpow(2, $New_techions_lvl,3)));
$stimetechions = (round($temps1techions *(bcpow(0.9, $labo_lvl,3))));

$etimetechions = $stimetechions;
$emintechions = $etimetechions / 60;

if ( floor($emintechions) != $emintechions )
  $esectechions = floor( ($emintechions - floor( $emintechions )) * 60);

  if ( $emintechions > 60 ) {

    $ehourtechions = floor( $emintechions / 60 );
    $emintechions = $emintechions - ( 60 * $ehourtechions );

    if ( $ehourtechions > 24 ) {
      $edaytechions = floor( $ehourtechions / 24);
      $ehourtechions = $ehourtechions - ( 24 * $edaytechions );
    }

  }

$etimetechions ="";

if (!empty($edaytechions) )
  $etimetechions.=$edaytechions."j";

if (!empty($ehourtechions) )
  $etimetechions.=$ehourtechions."h";

if ($emintechions != 0)
  $etimetechions.= floor($emintechions)."min";

if (!empty($esectechions) )
  $etimetechions.=$esectechions."s";

//techplasma
$temps1techplasma = (8000 * $siege_temps_evolution * (bcpow(2, $New_techplasma_lvl,3)));
$stimetechplasma = (round($temps1techplasma*(bcpow(0.9, $labo_lvl,3))));

$etimetechplasma = $stimetechplasma;
$emintechplasma = $etimetechplasma / 60;

if ( floor($emintechplasma) != $emintechplasma )
  $esectechplasma = floor( ($emintechplasma - floor( $emintechplasma )) * 60);

  if ( $emintechplasma > 60 ) {

    $ehourtechplasma = floor( $emintechplasma / 60 );
    $emintechplasma = $emintechplasma - ( 60 * $ehourtechplasma );

    if ( $ehourtechplasma > 24 ) {
      $edaytechplasma = floor( $ehourtechplasma / 24);
      $ehourtechplasma = $ehourtechplasma - ( 24 * $edaytechplasma );
    }

  }

$etimetechplasma ="";

if (!empty($edaytechplasma) )
  $etimetechplasma.=$edaytechplasma."j";

if (!empty($ehourtechplasma) )
  $etimetechplasma.=$ehourtechplasma."h";

if ($emintechplasma != 0)
  $etimetechplasma.= floor($emintechplasma)."min";

if (!empty($esectechplasma) )
  $etimetechplasma.=$esectechplasma."s";

//techordi
$temps1techordi = (800 * $siege_temps_evolution * (bcpow(2, $New_techordi_lvl,3)));
$stimetechordi = (round($temps1techordi*(bcpow(0.9, $labo_lvl,3))));

$etimetechordi = $stimetechordi;
$emintechordi = $etimetechordi / 60;

if ( floor($emintechordi) != $emintechordi )
  $esectechordi = floor( ($emintechordi - floor( $emintechordi )) * 60);

  if ( $emintechordi > 60 ) {

    $ehourtechordi = floor( $emintechordi / 60 );
    $emintechordi = $emintechordi - ( 60 * $ehourtechordi );

    if ( $ehourtechordi > 24 ) {
      $edaytechordi = floor( $ehourtechordi / 24);
      $ehourtechordi = $ehourtechordi - ( 24 * $edaytechordi );
    }

  }

$etimetechordi ="";

if (!empty($edaytechordi) )
  $etimetechordi.=$edaytechordi."j";

if (!empty($ehourtechordi) )
  $etimetechordi.=$ehourtechordi."h";

if ($emintechordi != 0)
  $etimetechordi.= floor($emintechordi)."min";

if (!empty($esectechordi) )
  $etimetechordi.=$esectechordi."s";

//techcombustion
$temps1techcombustion = (334 * $siege_temps_evolution * (bcpow(2, $New_techcombustion_lvl,3)));
$stimetechcombustion = (round($temps1techcombustion*(bcpow(0.9, $labo_lvl,3))));

$etimetechcombustion = $stimetechcombustion;
$emintechcombustion = $etimetechcombustion / 60;

if ( floor($emintechcombustion) != $emintechcombustion )
  $esectechcombustion = floor( ($emintechcombustion - floor( $emintechcombustion )) * 60);

  if ( $emintechcombustion > 60 ) {

    $ehourtechcombustion = floor( $emintechcombustion / 60 );
    $emintechcombustion = $emintechcombustion - ( 60 * $ehourtechcombustion );

    if ( $ehourtechcombustion > 24 ) {
      $edaytechcombustion = floor( $ehourtechcombustion / 24);
      $ehourtechcombustion = $ehourtechcombustion - ( 24 * $edaytechcombustion );
    }

  }

$etimetechcombustion ="";

if (!empty($edaytechcombustion) )
  $etimetechcombustion.=$edaytechcombustion."j";

if (!empty($ehourtechcombustion) )
  $etimetechcombustion.=$ehourtechcombustion."h";

if ($emintechcombustion != 0)
  $etimetechcombustion.= floor($emintechcombustion)."min";

if (!empty($esectechcombustion) )
  $etimetechcombustion.=$esectechcombustion."s";

//techAsgaards
$temps1techAsgaards = (2000 * $siege_temps_evolution * (bcpow(2, $New_techAsgaards_lvl,3)));
$stimetechAsgaards = (round($temps1techAsgaards*(bcpow(0.9, $labo_lvl,3))));

$etimetechAsgaards = $stimetechAsgaards;
$emintechAsgaards = $etimetechAsgaards / 60;

if ( floor($emintechAsgaards) != $emintechAsgaards )
  $esectechAsgaards = floor( ($emintechAsgaards - floor( $emintechAsgaards )) * 60);

  if ( $emintechAsgaards > 60 ) {

    $ehourtechAsgaards = floor( $emintechAsgaards / 60 );
    $emintechAsgaards = $emintechAsgaards - ( 60 * $ehourtechAsgaards );

    if ( $ehourtechAsgaards > 24 ) {
      $edaytechAsgaards = floor( $ehourtechAsgaards / 24);
      $ehourtechAsgaards = $ehourtechAsgaards - ( 24 * $edaytechAsgaards );
    }

  }

$etimetechAsgaards ="";

if (!empty($edaytechAsgaards) )
  $etimetechAsgaards.=$edaytechAsgaards."j";

if (!empty($ehourtechAsgaards) )
  $etimetechAsgaards.=$ehourtechAsgaards."h";

if ($emintechAsgaards != 0)
  $etimetechAsgaards.= floor($emintechAsgaards)."min";

if (!empty($esectechAsgaards) )
  $etimetechAsgaards.=$esectechAsgaards."s";

//techhyperespace
$temps1techhyperespace = (24000 * $siege_temps_evolution * (bcpow(2, $New_techhyperespace_lvl,3)));
$stimetechhyperespace = (round($temps1techhyperespace*(bcpow(0.9, $labo_lvl,3))));

$etimetechhyperespace = $stimetechhyperespace;
$emintechhyperespace = $etimetechhyperespace / 60;

if ( floor($emintechhyperespace) != $emintechhyperespace )
  $esectechhyperespace = floor( ($emintechhyperespace - floor( $emintechhyperespace )) * 60);

  if ( $emintechhyperespace > 60 ) {

    $ehourtechhyperespace = floor( $emintechhyperespace / 60 );
    $emintechhyperespace = $emintechhyperespace - ( 60 * $ehourtechhyperespace );

    if ( $ehourtechhyperespace > 24 ) {
      $edaytechhyperespace = floor( $ehourtechhyperespace / 24);
      $ehourtechhyperespace = $ehourtechhyperespace - ( 24 * $edaytechhyperespace );
    }

  }

$etimetechhyperespace ="";

if (!empty($edaytechhyperespace) )
  $etimetechhyperespace.=$edaytechhyperespace."j";

if (!empty($ehourtechhyperespace) )
  $etimetechhyperespace.=$ehourtechhyperespace."h";

if ($emintechhyperespace != 0)
  $etimetechhyperespace.= floor($emintechhyperespace)."min";

if (!empty($esectechhyperespace) )
  $etimetechhyperespace.=$esectechhyperespace."s";

//techhypernav
$temps1techhypernav = (24000 * $siege_temps_evolution * (bcpow(2, $New_techhypernav_lvl,3)));
$etimetechhypernav = retour_temps($temps1techhypernav,$labo_lvl);

//techespio1
$temps1techespio1 = (1200 * $siege_temps_evolution * (bcpow(2, $New_techespio1_lvl,3)));
$stimetechespio1 = (round($temps1techespio1*(bcpow(0.9, $labo_lvl,3))));

$etimetechespio1 = $stimetechespio1;
$emintechespio1 = $etimetechespio1 / 60;

if ( floor($emintechespio1) != $emintechespio1 )
  $esectechespio1 = floor( ($emintechespio1 - floor( $emintechespio1 )) * 60);

  if ( $emintechespio1 > 60 ) {

    $ehourtechespio1 = floor( $emintechespio1 / 60 );
    $emintechespio1 = $emintechespio1 - ( 60 * $ehourtechespio1 );

    if ( $ehourtechespio1 > 24 ) {
      $edaytechespio1 = floor( $ehourtechespio1 / 24);
      $ehourtechespio1 = $ehourtechespio1 - ( 24 * $edaytechespio1 );
    }

  }

$etimetechespio1 ="";

if (!empty($edaytechespio1) )
  $etimetechespio1.=$edaytechespio1."j";

if (!empty($ehourtechespio1) )
  $etimetechespio1.=$ehourtechespio1."h";

if ($emintechespio1 != 0)
  $etimetechespio1.= floor($emintechespio1)."min";

if (!empty($esectechespio1) )
  $etimetechespio1.=$esectechespio1."s";

//techespio2
$temps1techespio2 = (1667 * $siege_temps_evolution * (bcpow(2, $New_techespio2_lvl,3)));
$stimetechespio2 = (round($temps1techespio2*(bcpow(0.9, $labo_lvl,3))));

$etimetechespio2 = $stimetechespio2;
$emintechespio2 = $etimetechespio2 / 60;

if ( floor($emintechespio2) != $emintechespio2 )
  $esectechespio2 = floor( ($emintechespio2 - floor( $emintechespio2 )) * 60);

  if ( $emintechespio2 > 60 ) {

    $ehourtechespio2 = floor( $emintechespio2 / 60 );
    $emintechespio2 = $emintechespio2 - ( 60 * $ehourtechespio2 );

    if ( $ehourtechespio2 > 24 ) {
      $edaytechespio2 = floor( $ehourtechespio2 / 24);
      $ehourtechespio2 = $ehourtechespio2 - ( 24 * $edaytechespio2 );
    }

  }

$etimetechespio2 ="";

if (!empty($edaytechespio2) )
  $etimetechespio2.=$edaytechespio2."j";

if (!empty($ehourtechespio2) )
  $etimetechespio2.=$ehourtechespio2."h";

if ($emintechespio2 != 0)
  $etimetechespio2.= floor($emintechespio2)."min";

if (!empty($esectechespio2) )
  $etimetechespio2.=$esectechespio2."s";

//techArmement
$temps1techArmement = (1000 * $siege_temps_evolution * (bcpow(2, $New_techArmement_lvl,3)));
$stimetechArmement = (round($temps1techArmement*(bcpow(0.9, $labo_lvl,3))));

$etimetechArmement = $stimetechArmement;
$emintechArmement = $etimetechArmement / 60;

if ( floor($emintechArmement) != $emintechArmement )
  $esectechArmement = floor( ($emintechArmement - floor( $emintechArmement )) * 60);

  if ( $emintechArmement > 60 ) {

    $ehourtechArmement = floor( $emintechArmement / 60 );
    $emintechArmement = $emintechArmement - ( 60 * $ehourtechArmement );

    if ( $ehourtechArmement > 24 ) {
      $edaytechArmement = floor( $ehourtechArmement / 24);
      $ehourtechArmement = $ehourtechArmement - ( 24 * $edaytechArmement );
    }

  }

$etimetechArmement ="";

if (!empty($edaytechArmement) )
  $etimetechArmement.=$edaytechArmement."j";

if (!empty($ehourtechArmement) )
  $etimetechArmement.=$ehourtechArmement."h";

if ($emintechArmement != 0)
  $etimetechArmement.= floor($emintechArmement)."min";

if (!empty($esectechArmement) )
  $etimetechArmement.=$esectechArmement."s";

//techBouclier
$temps1techBouclier = (1000 * $siege_temps_evolution * (bcpow(2, $New_techBouclier_lvl,3)));
$stimetechBouclier = (round($temps1techBouclier*(bcpow(0.9, $labo_lvl,3))));

$etimetechBouclier = $stimetechBouclier;
$emintechBouclier = $etimetechBouclier / 60;

if ( floor($emintechBouclier) != $emintechBouclier )
  $esectechBouclier = floor( ($emintechBouclier - floor( $emintechBouclier )) * 60);

  if ( $emintechBouclier > 60 ) {

    $ehourtechBouclier = floor( $emintechBouclier / 60 );
    $emintechBouclier = $emintechBouclier - ( 60 * $ehourtechBouclier );

    if ( $ehourtechBouclier > 24 ) {
      $edaytechBouclier = floor( $ehourtechBouclier / 24);
      $ehourtechBouclier = $ehourtechBouclier - ( 24 * $edaytechBouclier );
    }

  }

$etimetechBouclier ="";

if (!empty($edaytechBouclier) )
  $etimetechBouclier.=$edaytechBouclier."j";

if (!empty($ehourtechBouclier) )
  $etimetechBouclier.=$ehourtechBouclier."h";

if ($emintechBouclier != 0)
  $etimetechBouclier.= floor($emintechBouclier)."min";

if (!empty($esectechBouclier) )
  $etimetechBouclier.=$esectechBouclier."s";

//techcoque
$temps1techcoque = (1000 * $siege_temps_evolution * (bcpow(2, $New_techcoque_lvl,3)));
$stimetechcoque = (round($temps1techcoque *(bcpow(0.9, $labo_lvl,3))));

$etimetechcoque = $stimetechcoque;
$emintechcoque = $etimetechcoque / 60;

if ( floor($emintechcoque) != $emintechcoque )
  $esectechcoque = floor( ($emintechcoque - floor( $emintechcoque )) * 60);

  if ( $emintechcoque > 60 ) {

    $ehourtechcoque = floor( $emintechcoque / 60 );
    $emintechcoque = $emintechcoque - ( 60 * $ehourtechcoque );

    if ( $ehourtechcoque > 24 ) {
      $edaytechcoque = floor( $ehourtechcoque / 24);
      $ehourtechcoque = $ehourtechcoque - ( 24 * $edaytechcoque );
    }

  }

$etimetechcoque ="";

if (!empty($edaytechcoque) )
  $etimetechcoque.=$edaytechcoque."j";

if (!empty($ehourtechcoque) )
  $etimetechcoque.=$ehourtechcoque."h";

if ($emintechcoque != 0)
  $etimetechcoque.= floor($emintechcoque)."min";

if (!empty($esectechcoque) )
  $etimetechcoque.=$esectechcoque."s";

//techproAsgaard
$temps1techproAsgaard = (1000 * $siege_temps_evolution * (bcpow(2, $New_techproAsgaard_lvl,3)));
$stimetechproAsgaard = (round($temps1techproAsgaard *(bcpow(0.9, $labo_lvl,3))));

$etimetechproAsgaard = $stimetechproAsgaard;
$emintechproAsgaard = $etimetechproAsgaard / 60;

if ( floor($emintechproAsgaard) != $emintechproAsgaard )
  $esectechproAsgaard = floor( ($emintechproAsgaard - floor( $emintechproAsgaard )) * 60);

  if ( $emintechproAsgaard > 60 ) {

    $ehourtechproAsgaard = floor( $emintechproAsgaard / 60 );
    $emintechproAsgaard = $emintechproAsgaard - ( 60 * $ehourtechproAsgaard );

    if ( $ehourtechproAsgaard > 24 ) {
      $edaytechproAsgaard = floor( $ehourtechproAsgaard / 24);
      $ehourtechproAsgaard = $ehourtechproAsgaard - ( 24 * $edaytechproAsgaard );
    }

  }

$etimetechproAsgaard ="";

if (!empty($edaytechproAsgaard) )
  $etimetechproAsgaard.=$edaytechproAsgaard."j";

if (!empty($ehourtechproAsgaard) )
  $etimetechproAsgaard.=$ehourtechproAsgaard."h";

if ($emintechproAsgaard != 0)
  $etimetechproAsgaard.= floor($emintechproAsgaard)."min";

if (!empty($esectechproAsgaard) )
  $etimetechproAsgaard.=$esectechproAsgaard."s";

//techproAncien
$temps1techproAncien = (2000 * $siege_temps_evolution * (bcpow(2, $New_techproAncien_lvl,3)));
$stimetechproAncien = (round($temps1techproAncien *(bcpow(0.9, $labo_lvl,3))));

$etimetechproAncien = $stimetechproAncien;
$emintechproAncien = $etimetechproAncien / 60;

if ( floor($emintechproAncien) != $emintechproAncien )
  $esectechproAncien = floor( ($emintechproAncien - floor( $emintechproAncien )) * 60);

  if ( $emintechproAncien > 60 ) {

    $ehourtechproAncien = floor( $emintechproAncien / 60 );
    $emintechproAncien = $emintechproAncien - ( 60 * $ehourtechproAncien );

    if ( $ehourtechproAncien > 24 ) {
      $edaytechproAncien = floor( $ehourtechproAncien / 24);
      $ehourtechproAncien = $ehourtechproAncien - ( 24 * $edaytechproAncien );
    }

  }

$etimetechproAncien ="";

if (!empty($edaytechproAncien) )
  $etimetechproAncien.=$edaytechproAncien."j";

if (!empty($ehourtechproAncien) )
  $etimetechproAncien.=$ehourtechproAncien."h";

if ($emintechproAncien != 0)
  $etimetechproAncien.= floor($emintechproAncien)."min";

if (!empty($esectechproAncien) )
  $etimetechproAncien.=$esectechproAncien."s";

//techinfra
$temps1techinfra = (667 * $siege_temps_evolution * (bcpow(2, $New_techinfra_lvl,3)));
$stimetechinfra = (round($temps1techinfra*(bcpow(0.9, $labo_lvl,3))));

$etimetechinfra = $stimetechinfra;
$emintechinfra = $etimetechinfra / 60;

if ( floor($emintechinfra) != $emintechinfra )
  $esectechinfra = floor( ($emintechinfra - floor( $emintechinfra )) * 60);

  if ( $emintechinfra > 60 ) {

    $ehourtechinfra = floor( $emintechinfra / 60 );
    $emintechinfra = $emintechinfra - ( 60 * $ehourtechinfra );

    if ( $ehourtechinfra > 24 ) {
      $edaytechinfra = floor( $ehourtechinfra / 24);
      $ehourtechinfra = $ehourtechinfra - ( 24 * $edaytechinfra );
    }

  }

$etimetechinfra ="";

if (!empty($edaytechinfra) )
  $etimetechinfra.=$edaytechinfra."j";

if (!empty($ehourtechinfra) )
  $etimetechinfra.=$ehourtechinfra."h";

if ($emintechinfra != 0)
  $etimetechinfra.= floor($emintechinfra)."min";

if (!empty($esectechinfra) )
  $etimetechinfra.=$esectechinfra."s";

//technaqua
$temps1technaqua = (86400 * $siege_temps_evolution * (bcpow(2, $New_technaqua_lvl,3)));
$stimetechnaqua = (round($temps1technaqua*(bcpow(0.9, $labo_lvl,3))));

$etimetechnaqua = $stimetechnaqua;
$emintechnaqua = $etimetechnaqua / 60;

if ( floor($emintechnaqua) != $emintechnaqua )
  $esectechnaqua = floor( ($emintechnaqua - floor( $emintechnaqua )) * 60);

  if ( $emintechnaqua > 60 ) {

    $ehourtechnaqua = floor( $emintechnaqua / 60 );
    $emintechnaqua = $emintechnaqua - ( 60 * $ehourtechnaqua );

    if ( $ehourtechnaqua > 24 ) {
      $edaytechnaqua = floor( $ehourtechnaqua / 24);
      $ehourtechnaqua = $ehourtechnaqua - ( 24 * $edaytechnaqua );
    }

  }

$etimetechnaqua ="";

if (!empty($edaytechnaqua) )
  $etimetechnaqua.=$edaytechnaqua."j";

if (!empty($ehourtechnaqua) )
  $etimetechnaqua.=$ehourtechnaqua."h";

if ($emintechnaqua != 0)
  $etimetechnaqua.= floor($emintechnaqua)."min";

if (!empty($esectechnaqua) )
  $etimetechnaqua.=$esectechnaqua."s";


//techanti
$temps1techanti = (5400 * $siege_temps_evolution * (bcpow(2, $New_techanti_lvl,3)));
$stimetechanti = (round($temps1techanti*(bcpow(0.9, $labo_lvl,3))));

$etimetechanti = $stimetechanti;
$emintechanti = $etimetechanti / 60;

if ( floor($emintechanti) != $emintechanti )
  $esectechanti = floor( ($emintechanti - floor( $emintechanti )) * 60);

  if ( $emintechanti > 60 ) {

    $ehourtechanti = floor( $emintechanti / 60 );
    $emintechanti = $emintechanti - ( 60 * $ehourtechanti );

    if ( $ehourtechanti > 24 ) {
      $edaytechanti = floor( $ehourtechanti / 24);
      $ehourtechanti = $ehourtechanti - ( 24 * $edaytechanti );
    }

  }

$etimetechanti ="";

if (!empty($edaytechanti) )
  $etimetechanti.=$edaytechanti."j";

if (!empty($ehourtechanti) )
  $etimetechanti.=$ehourtechanti."h";

if ($emintechanti != 0)
  $etimetechanti.= floor($emintechanti)."min";

if (!empty($esectechanti) )
  $etimetechanti.=$esectechanti."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 ( 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 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');





$techinfra_img = "infra";
$techenergie_img = "energie";
$techlaser_img = "laser";
$techions_img = "ions";
$techplasma_img = "plasma";
$techordi_img = "ordi";
$techcombustion_img = "combustion";
$techAsgaards_img = "impulsion";
$techhyperespace_img = "hyperespace";
$techhypernav_img = "hypernav";
$techespio1_img = "espio1";
$techArmement_img = "arme";
$techBouclier_img = "bouclier";
$techcoque_img = "coque";
$techproAncien_img = "ancien";
$technaqua_img = "naquadah";
$techanti_img = "anti";


$techinfra_namepage = "techinfra";
$techenergie_namepage = "techenergie";
$techlaser_namepage = "techlaser";
$techions_namepage = "techions";
$techplasma_namepage = "techplasma";
$techordi_namepage = "techordi";
$techcombustion_namepage = "techcombustion";
$techAsgaards_namepage = "techAsgaards";
$techhyperespace_namepage = "techhyperespace";
$techhypernav_namepage = "techhypernav";
$techespio1_namepage = "techespio1";
$techArmement_namepage = "techArmement";
$techBouclier_namepage = "techBouclier";
$techcoque_namepage = "techcoque";
$techproAncien_namepage = "techproAncien";
$technaqua_namepage = "technaqua";
$techanti_namepage = "techanti";

$techinfra_name = "Technologie d\'infrastructure des Vaisseaux";
$techenergie_name = "Technologie de maîtrise de l\'Energie";
$techlaser_name = "Technologie de Laser";
$techions_name = "Technologie d\'ions";
$techplasma_name = "Technologie de plasma";
$techordi_name = "Technologie Salle de contrôle";
$techcombustion_name = "Réacteur à combustion";
$techAsgaards_name = "Réacteur Asgard";
$techhyperespace_name = "Technologie des Réacteurs hyperespace";
$techhypernav_name = "Technologie de l\'Hypernavigation";
$techespio1_name = "Technologie Espionnage de Type 1";
$techArmement_name = "Technologie de l\'Armement";
$techBouclier_name = "Technologie Bouclier de protection";
$techcoque_name = "Technologie de renforcement de la coque";
$techproAncien_name = "Technologie \'Les Anciens\'";
$technaqua_name = "Technologie de Naquadah";
$techanti_name = "Technologie Champ Anti-gravité";


$techinfra_description = addslashes("Cette technologie est à la base de tout vaisseau. Elle permet de développer une structure de vaisseaux plus ou moins grande qui sera ensuite améliorée grâce aux autres technologies.");
$techenergie_description = addslashes("En maîtrisant le mieux possible le Naquadah, il est possible de construire de nouveaux systèmes d'armement. ");
$techlaser_description = addslashes("Le laser est un rayon de lumière fortement concentré très puissant.");
$techions_description = addslashes("Les armes à ions sont principalement utilisées par les Goa'ulds : elles permettent de déphaser les systèmes électroniques.");
$techplasma_description = addslashes("En combinant les ions et le laser on peut obtenir une arme bien plus puissante et dévastatrice: le plasma.");
$techordi_description = addslashes("Cette technologie est la base de tout programme politique, économique ou militaire. Chaque niveau de la technologie Salle de contrôle permet, en améliorant les processeurs et le personnel, de pouvoir gérer plus de flottes en mouvement. En gardant un matériel informatique performant, le fonctionnement de tous les secteurs est favorisé.");
$techcombustion_description = addslashes("Les réacteurs à combustion sont le plus vieux système de propulsion connu à ce jour. Petits et fiables, ils sont utilisés généralement pour les vaisseaux de petite taille.");
$techAsgaards_description = addslashes("Les réacteurs Asgards fonctionnent sur le principe des réacteurs à impulsion. Chaque niveau augmente la vitesse des vaisseaux de 15%.");
$techhyperespace_description = addslashes("Cette technologie se concentre sur l'ouverture d'une fenètre hyperespace. En comprimant la matière il est possible d'aller beaucoup plus vite.");
$techhypernav_description = addslashes("La véritable maîtrise de l'énergie a permis de créer un nouveau système de navigation beaucoup plus rapide que le précédant à l'échelle de l'univers.");
$techespio1_description = addslashes("Cette technologie permet de développer un système afin d'espionner les planètes des autres empires, mais il sert aussi au contre espionnage.");
$techArmement_description = addslashes("Augmente de 10% la puissance des armes des vaisseaux et des systèmes de défense. ");
$techBouclier_description = addslashes("La technologie bouclier de protection se base sur de grandes sources d'énergie afin de protéger un bâtiment ou un vaisseau de toute sorte d'arme.");
$techcoque_description = addslashes("Cette technologie base essentiellement sa recherche sur le développement d'alliages les plus solides possible. ");
$techproAncien_description = addslashes("Les Anciens sont, à notre connaissance, les êtres les plus puissants et les plus évolués. Ils sont aussi les créateurs des Portes des étoiles que l'on retrouve sur toutes les planètes.");
$technaqua_description = addslashes("Le Naquadah peut être utilisé comme arme. En restituant rapidement l'énergie qu'il accumule, les rayons de Naquadah sont terrifiants.");
$techanti_description = addslashes("Le champ Anti-gravité a été inventé pour pouvoir stocker un plus grand nombre de vaisseaux. Cette technologie est très importante pour les grands empires. ");


if ($timelabo2 != "-1") { echo"<br><div align=\"center\">Le centre de recherche scientifique est en cours d'évolution</div><br><br>"; }

if ($labo_lvl < "1") {
echo "<div align=\"center\">Aucune technologie disponible. Veillez évoluer le centre de recherches scientifiques.</div>"; }

if ($row2[techenergie_evolution] != "0000-00-00 00:00:00" | $row2[techlaser_evolution] != "0000-00-00 00:00:00" | $row2[techions_evolution] != "0000-00-00 00:00:00" | $row2[techplasma_evolution] != "0000-00-00 00:00:00" | $row2[techordi_evolution] != "0000-00-00 00:00:00" | $row2[techcombustion_evolution] != "0000-00-00 00:00:00" | $row2[techAsgaards_evolution] != "0000-00-00 00:00:00" | $row2[techhyperespace_evolution] != "0000-00-00 00:00:00" | $row2[techespio1_evolution] != "0000-00-00 00:00:00" | $row2[techespio2_evolution] != "0000-00-00 00:00:00" | $row2[techArmement_evolution] != "0000-00-00 00:00:00" | $row2[techBouclier_evolution] != "0000-00-00 00:00:00" | $row2[techcoque_evolution] != "0000-00-00 00:00:00" | $row2[techinfra_evolution] != "0000-00-00 00:00:00" | $row2[technaqua_evolution] != "0000-00-00 00:00:00" | $row2[techanti_evolution] != "0000-00-00 00:00:00" | $row2[techproAsgaard_evolution] != "0000-00-00 00:00:00" | $row2[techproAncien_evolution] != "0000-00-00 00:00:00" | $row2[techhypernav_evolution] != "0000-00-00 00:00:00") {
	$evolution_tech = 0;
}
else
{
	$evolution_tech = 1;
}

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

echo"<td width=\"120\" 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,$Depense2_fer,$Depense2_or,$Depense2_ada,$Depense2_ura,$Depense2_energie,$Depense_fer,$Depense_or,$Depense_ada,$Depense_ura,$Depense_energie) {

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($Depense2_fer)) { echo" <br> Fer : "; if($newwfer_ressource < ($Depense2_fer)){ echo"<span style=\'color:#FF0000\'>$Depense_fer</span>"; } else { echo"$Depense_fer"; }} if(!empty($Depense2_or)) { echo" <br> Or : "; if($newwor_ressource < ($Depense2_or)){ echo"<span style=\'color:#FF0000\'>$Depense_or</span>"; } else { echo"$Depense_or"; }} if(!empty($Depense2_ada)) { echo" <br> Cristal : "; if($newwada_ressource < ($Depense2_ada)){ echo"<span style=\'color:#FF0000\'>$Depense_ada</span>"; } else { echo"$Depense_ada"; }} if(!empty($Depense2_ura)) { echo" <br> Naquadah : "; if($newwura_ressource < ($Depense2_ura)){ echo"<span style=\'color:#FF0000\'>$Depense_ura</span>"; } else { echo"$Depense_ura"; }} if(!empty($Depense2_energie)) { echo" <br> Energie : "; if($Total_energie_reste < ($Depense2_energie)){ echo"<span style=\'color:#FF0000\'>$Depense_energie</span>"; } else { echo"$Depense_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 ($newwfer_ressource >= ($Depense2_fer) && $newwor_ressource >= ($Depense2_or) && $newwada_ressource >= ($Depense2_ada) && $newwura_ressource >= ($Depense2_ura)) { echo $img; } else { echo $img."_d"; } echo".gif\" alt=\"$name\" width=\"120\" height=\"120\"></a></td>";

}


function troisiemetd($evolution_tech,$namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_fer,$Depense2_or,$Depense2_ada,$Depense2_ura,$Depense2_energie,$construction,$tempsevolution,$timelabo2) {

echo"<td width=\"120\">"; if ($construction != "$namepage" && ($newwfer_ressource < ($Depense2_fer) || $newwor_ressource < ($Depense2_or) || $newwada_ressource < ($Depense2_ada) || $newwura_ressource < ($Depense2_ura) || $timelabo2 != "-1")) { echo"-"; } else { if ($evolution_tech == "1" && $newwfer_ressource >= ($Depense2_fer) && $newwor_ressource >= ($Depense2_or) && $newwura_ressource >= ($Depense2_ura) && $newwada_ressource >= ($Depense2_ada) && $timelabo2 == "-1") { echo"<a href=\"Evolution".$namepage.".php\" target=\"_parent\"  class=\"objet_construc\">Construire</a>"; } else { if ($evolution_tech == "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 = 0;
if ($labo_lvl > "0") { $premierecolonneressource ++; }
if ($labo_lvl > "3") { $premierecolonneressource ++; }
if ($labo_lvl > "4" && $techenergie_lvl > "4") { $premierecolonneressource ++; }
if ($labo_lvl > "0" && $chantier_lvl > "0") { $premierecolonneressource ++; }


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

              <tr>
                <td colspan=\"$premierecolonneressource\" style=\"BACKGROUND-COLOR: #222222\" class=\"Categorie\">Technologies</td>
              </tr>
			  <tr>";
			  if ($labo_lvl > "0") { premiertd($techinfra_name,$techinfra_lvl,$techinfra_namepage); }
			  if ($labo_lvl > "3") { premiertd($techArmement_name,$techArmement_lvl,$techArmement_namepage); }
			  if ($labo_lvl > "4" && $techenergie_lvl > "4") { premiertd($techBouclier_name,$techBouclier_lvl,$techBouclier_namepage); }
			  if ($labo_lvl > "0" && $chantier_lvl > "0") { premiertd($techcoque_name,$techcoque_lvl,$techcoque_namepage); }
			   
				echo"</tr>
              <tr style=\"text-align:center\">";
              if ($labo_lvl > "0") { deuxiemetd($techinfra_name,$techinfra_lvl,$techinfra_img,$techinfra_description,$etimetechinfra,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techinfra_fer,$Depense2_techinfra_or,$Depense2_techinfra_ada,$Depense2_techinfra_ura,$Depense2_techinfra_energie,$Depense_techinfra_fer,$Depense_techinfra_or,$Depense_techinfra_ada,$Depense_techinfra_ura,$Depense_techinfra_energie); }
			  if ($labo_lvl > "3") { deuxiemetd($techArmement_name,$techArmement_lvl,$techArmement_img,$techArmement_description,$etimetechArmement,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techArmement_fer,$Depense2_techArmement_or,$Depense2_techArmement_ada,$Depense2_techArmement_ura,$Depense2_techArmement_energie,$Depense_techArmement_fer,$Depense_techArmement_or,$Depense_techArmement_ada,$Depense_techArmement_ura,$Depense_techArmement_energie); }
			  if ($labo_lvl > "4" && $techenergie_lvl > "4") { deuxiemetd($techBouclier_name,$techBouclier_lvl,$techBouclier_img,$techBouclier_description,$etimetechBouclier,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techBouclier_fer,$Depense2_techBouclier_or,$Depense2_techBouclier_ada,$Depense2_techBouclier_ura,$Depense2_techBouclier_energie,$Depense_techBouclier_fer,$Depense_techBouclier_or,$Depense_techBouclier_ada,$Depense_techBouclier_ura,$Depense_techBouclier_energie); }
			  if ($labo_lvl > "0" && $chantier_lvl > "0") { deuxiemetd($techcoque_name,$techcoque_lvl,$techcoque_img,$techcoque_description,$etimetechcoque,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techcoque_fer,$Depense2_techcoque_or,$Depense2_techcoque_ada,$Depense2_techcoque_ura,$Depense2_techcoque_energie,$Depense_techcoque_fer,$Depense_techcoque_or,$Depense_techcoque_ada,$Depense_techcoque_ura,$Depense_techcoque_energie); }
			  
                echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  if ($labo_lvl > "0") { troisiemetd($evolution_tech,$techinfra_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techinfra_fer,$Depense2_techinfra_or,$Depense2_techinfra_ada,$Depense2_techinfra_ura,$Depense2_techinfra_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "3") { troisiemetd($evolution_tech,$techArmement_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techArmement_fer,$Depense2_techArmement_or,$Depense2_techArmement_ada,$Depense2_techArmement_ura,$Depense2_techArmement_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "4" && $techenergie_lvl > "4") { troisiemetd($evolution_tech,$techBouclier_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techBouclier_fer,$Depense2_techBouclier_or,$Depense2_techBouclier_ada,$Depense2_techBouclier_ura,$Depense2_techBouclier_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "0" && $chantier_lvl > "0") { troisiemetd($evolution_tech,$techcoque_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techcoque_fer,$Depense2_techcoque_or,$Depense2_techcoque_ada,$Depense2_techcoque_ura,$Depense2_techcoque_energie,$construction,$tempsevolution,$timelabo2); }
			  
                echo"
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>";
			  if ($labo_lvl > "0") { premiertd($techenergie_name,$techenergie_lvl,$techenergie_namepage); }
			  if ($labo_lvl > "1" && $techenergie_lvl > "1") { premiertd($techlaser_name,$techlaser_lvl,$techlaser_namepage); }
			  if ($labo_lvl > "3" && $techlaser_lvl > "6" && $techenergie_lvl > "3") { premiertd($techions_name,$techions_lvl,$techions_namepage); }
			  if ($labo_lvl > "5" && $techlaser_lvl > "9" && $techenergie_lvl > "5" && $techions_lvl > "7") { premiertd($techplasma_name,$techplasma_lvl,$techplasma_namepage); }

              echo"</tr>
              <tr style=\"text-align:center\">";
 			  if ($labo_lvl > "0") { deuxiemetd($techenergie_name,$techenergie_lvl,$techenergie_img,$techenergie_description,$etimetechenergie,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techenergie_fer,$Depense2_techenergie_or,$Depense2_techenergie_ada,$Depense2_techenergie_ura,$Depense2_techenergie_energie,$Depense_techenergie_fer,$Depense_techenergie_or,$Depense_techenergie_ada,$Depense_techenergie_ura,$Depense_techenergie_energie); }
			  if ($labo_lvl > "1" && $techenergie_lvl > "1") { deuxiemetd($techlaser_name,$techlaser_lvl,$techlaser_img,$techlaser_description,$etimetechlaser,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techlaser_fer,$Depense2_techlaser_or,$Depense2_techlaser_ada,$Depense2_techlaser_ura,$Depense2_techlaser_energie,$Depense_techlaser_fer,$Depense_techlaser_or,$Depense_techlaser_ada,$Depense_techlaser_ura,$Depense_techlaser_energie); }
			  if ($labo_lvl > "3" && $techlaser_lvl > "6" && $techenergie_lvl > "3") { deuxiemetd($techions_name,$techions_lvl,$techions_img,$techions_description,$etimetechions,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techions_fer,$Depense2_techions_or,$Depense2_techions_ada,$Depense2_techions_ura,$Depense2_techions_energie,$Depense_techions_fer,$Depense_techions_or,$Depense_techions_ada,$Depense_techions_ura,$Depense_techions_energie); }
			  if ($labo_lvl > "5" && $techlaser_lvl > "9" && $techenergie_lvl > "5" && $techions_lvl > "7") { deuxiemetd($techplasma_name,$techplasma_lvl,$techplasma_img,$techplasma_description,$etimetechplasma,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techplasma_fer,$Depense2_techplasma_or,$Depense2_techplasma_ada,$Depense2_techplasma_ura,$Depense2_techplasma_energie,$Depense_techplasma_fer,$Depense_techplasma_or,$Depense_techplasma_ada,$Depense_techplasma_ura,$Depense_techplasma_energie); }
			  
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  if ($labo_lvl > "0") { troisiemetd($evolution_tech,$techenergie_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techenergie_fer,$Depense2_techenergie_or,$Depense2_techenergie_ada,$Depense2_techenergie_ura,$Depense2_techenergie_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "1" && $techenergie_lvl > "1") { troisiemetd($evolution_tech,$techlaser_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techlaser_fer,$Depense2_techlaser_or,$Depense2_techlaser_ada,$Depense2_techlaser_ura,$Depense2_techlaser_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "3" && $techlaser_lvl > "6" && $techenergie_lvl > "3") { troisiemetd($evolution_tech,$techions_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techions_fer,$Depense2_techions_or,$Depense2_techions_ada,$Depense2_techions_ura,$Depense2_techions_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "5" && $techlaser_lvl > "9" && $techenergie_lvl > "5" && $techions_lvl > "7") { troisiemetd($evolution_tech,$techplasma_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techplasma_fer,$Depense2_techplasma_or,$Depense2_techplasma_ada,$Depense2_techplasma_ura,$Depense2_techplasma_energie,$construction,$tempsevolution,$timelabo2); }
			  
			  
                echo"
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>";
			  if ($labo_lvl > "0") { premiertd($techordi_name,$techordi_lvl,$techordi_namepage); }
			  if ($labo_lvl > "2") { premiertd($techespio1_name,$techespio1_lvl,$techespio1_namepage); }
			  if ($labo_lvl > "9") { premiertd($technaqua_name,$technaqua_lvl,$technaqua_namepage); }
			  if ($labo_lvl > "3" AND $row2[techcombustion_lvl] > "6" AND $row2[techenergie_lvl] > "4") { premiertd($techanti_name,$techanti_lvl,$techanti_namepage); }

              echo"</tr>
              <tr style=\"text-align:center\">";
			  if ($labo_lvl > "0") { deuxiemetd($techordi_name,$techordi_lvl,$techordi_img,$techordi_description,$etimetechordi,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techordi_fer,$Depense2_techordi_or,$Depense2_techordi_ada,$Depense2_techordi_ura,$Depense2_techordi_energie,$Depense_techordi_fer,$Depense_techordi_or,$Depense_techordi_ada,$Depense_techordi_ura,$Depense_techordi_energie); }
			  if ($labo_lvl > "2") { deuxiemetd($techespio1_name,$techespio1_lvl,$techespio1_img,$techespio1_description,$etimetechespio1,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techespio1_fer,$Depense2_techespio1_or,$Depense2_techespio1_ada,$Depense2_techespio1_ura,$Depense2_techespio1_energie,$Depense_techespio1_fer,$Depense_techespio1_or,$Depense_techespio1_ada,$Depense_techespio1_ura,$Depense_techespio1_energie); }
			  if ($labo_lvl > "9") { deuxiemetd($technaqua_name,$technaqua_lvl,$technaqua_img,$technaqua_description,$etimetechnaqua,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_technaqua_fer,$Depense2_technaqua_or,$Depense2_technaqua_ada,$Depense2_technaqua_ura,$Depense2_technaqua_energie,$Depense_technaqua_fer,$Depense_technaqua_or,$Depense_technaqua_ada,$Depense_technaqua_ura,$Depense_technaqua_energie); }
			  if ($labo_lvl > "3" AND $row2[techcombustion_lvl] > "6" AND $row2[techenergie_lvl] > "4") { deuxiemetd($techanti_name,$techanti_lvl,$techanti_img,$techanti_description,$etimetechanti,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techanti_fer,$Depense2_techanti_or,$Depense2_techanti_ada,$Depense2_techanti_ura,$Depense2_techanti_energie,$Depense_techanti_fer,$Depense_techanti_or,$Depense_techanti_ada,$Depense_techanti_ura,$Depense_techanti_energie); }
			  
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  if ($labo_lvl > "0") { troisiemetd($evolution_tech,$techordi_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techordi_fer,$Depense2_techordi_or,$Depense2_techordi_ada,$Depense2_techordi_ura,$Depense2_techordi_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "2") { troisiemetd($evolution_tech,$techespio1_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techespio1_fer,$Depense2_techespio1_or,$Depense2_techespio1_ada,$Depense2_techespio1_ura,$Depense2_techespio1_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "9") { troisiemetd($evolution_tech,$technaqua_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_technaqua_fer,$Depense2_technaqua_or,$Depense2_technaqua_ada,$Depense2_technaqua_ura,$Depense2_technaqua_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "3" AND $row2[techcombustion_lvl] > "6" AND $row2[techenergie_lvl] > "4") { troisiemetd($evolution_tech,$techanti_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techanti_fer,$Depense2_techanti_or,$Depense2_techanti_ada,$Depense2_techanti_ura,$Depense2_techanti_energie,$construction,$tempsevolution,$timelabo2); }
			  
			  echo"
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>";
			  if ($labo_lvl > "0" && $techenergie_lvl > "0" && $chantier_lvl > "0") { premiertd($techcombustion_name,$techcombustion_lvl,$techcombustion_namepage); }
			  if ($labo_lvl > "2" && $techenergie_lvl > "2" && $chantier_lvl > "2") { premiertd($techAsgaards_name,$techAsgaards_lvl,$techAsgaards_namepage); }
			  if ($labo_lvl > "6" && $techenergie_lvl > "6" && $chantier_lvl > "6" && $techBouclier_lvl > "4") { premiertd($techhyperespace_name,$techhyperespace_lvl,$techhyperespace_namepage); }
			  if ($labo_lvl > "7" && $techenergie_lvl > "3" && $techordi_lvl > "3") { premiertd($techproAncien_name,$techproAncien_lvl,$techproAncien_namepage); }
			  
              echo"</tr>
              <tr style=\"text-align:center\">";
			  if ($labo_lvl > "0" && $techenergie_lvl > "0" && $chantier_lvl > "0") { deuxiemetd($techcombustion_name,$techcombustion_lvl,$techcombustion_img,$techcombustion_description,$etimetechcombustion,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techcombustion_fer,$Depense2_techcombustion_or,$Depense2_techcombustion_ada,$Depense2_techcombustion_ura,$Depense2_techcombustion_energie,$Depense_techcombustion_fer,$Depense_techcombustion_or,$Depense_techcombustion_ada,$Depense_techcombustion_ura,$Depense_techcombustion_energie); }
			  if ($labo_lvl > "2" && $techenergie_lvl > "2" && $chantier_lvl > "2") { deuxiemetd($techAsgaards_name,$techAsgaards_lvl,$techAsgaards_img,$techAsgaards_description,$etimetechAsgaards,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techAsgaards_fer,$Depense2_techAsgaards_or,$Depense2_techAsgaards_ada,$Depense2_techAsgaards_ura,$Depense2_techAsgaards_energie,$Depense_techAsgaards_fer,$Depense_techAsgaards_or,$Depense_techAsgaards_ada,$Depense_techAsgaards_ura,$Depense_techAsgaards_energie); }
			  if ($labo_lvl > "6" && $techenergie_lvl > "6" && $chantier_lvl > "6" && $techBouclier_lvl > "4") { deuxiemetd($techhyperespace_name,$techhyperespace_lvl,$techhyperespace_img,$techhyperespace_description,$etimetechhyperespace,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techhyperespace_fer,$Depense2_techhyperespace_or,$Depense2_techhyperespace_ada,$Depense2_techhyperespace_ura,$Depense2_techhyperespace_energie,$Depense_techhyperespace_fer,$Depense_techhyperespace_or,$Depense_techhyperespace_ada,$Depense_techhyperespace_ura,$Depense_techhyperespace_energie); }
			  if ($labo_lvl > "7" && $techenergie_lvl > "3" && $techordi_lvl > "3") { deuxiemetd($techproAncien_name,$techproAncien_lvl,$techproAncien_img,$techproAncien_description,$etimetechproAncien,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techproAncien_fer,$Depense2_techproAncien_or,$Depense2_techproAncien_ada,$Depense2_techproAncien_ura,$Depense2_techproAncien_energie,$Depense_techproAncien_fer,$Depense_techproAncien_or,$Depense_techproAncien_ada,$Depense_techproAncien_ura,$Depense_techproAncien_energie); }
			  
              echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  if ($labo_lvl > "0" && $techenergie_lvl > "0" && $chantier_lvl > "0") { troisiemetd($evolution_tech,$techcombustion_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techcombustion_fer,$Depense2_techcombustion_or,$Depense2_techcombustion_ada,$Depense2_techcombustion_ura,$Depense2_techcombustion_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "2" && $techenergie_lvl > "2" && $chantier_lvl > "2") { troisiemetd($evolution_tech,$techAsgaards_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techAsgaards_fer,$Depense2_techAsgaards_or,$Depense2_techAsgaards_ada,$Depense2_techAsgaards_ura,$Depense2_techAsgaards_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "6" && $techenergie_lvl > "6" && $chantier_lvl > "6" && $techBouclier_lvl > "4") { troisiemetd($evolution_tech,$techhyperespace_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techhyperespace_fer,$Depense2_techhyperespace_or,$Depense2_techhyperespace_ada,$Depense2_techhyperespace_ura,$Depense2_techhyperespace_energie,$construction,$tempsevolution,$timelabo2); }
			  if ($labo_lvl > "7" && $techenergie_lvl > "3" && $techordi_lvl > "3") { troisiemetd($evolution_tech,$techproAncien_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techproAncien_fer,$Depense2_techproAncien_or,$Depense2_techproAncien_ada,$Depense2_techproAncien_ura,$Depense2_techproAncien_energie,$construction,$tempsevolution,$timelabo2); }
			  
			   echo"
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
			  <tr>";
			  if ($labo_lvl > "11" && $techenergie_lvl > "9") { premiertd($techhypernav_name,$techhypernav_lvl,$techhypernav_namepage); }
			  
			  echo"</tr>
              <tr style=\"text-align:center\">";
			  if ($labo_lvl > "11" && $techenergie_lvl > "9") { deuxiemetd($techhypernav_name,$techhypernav_lvl,$techhypernav_img,$techhypernav_description,$etimetechhypernav,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techhypernav_fer,$Depense2_techhypernav_or,$Depense2_techhypernav_ada,$Depense2_techhypernav_ura,$Depense2_techhypernav_energie,$Depense_techhypernav_fer,$Depense_techhypernav_or,$Depense_techhypernav_ada,$Depense_techhypernav_ura,$Depense_techhypernav_energie); }
			  
			  echo"</tr>
              <tr style=\"text-align:center;BACKGROUND-COLOR: #222222\">";
			  if ($labo_lvl > "11" && $techenergie_lvl > "9") { troisiemetd($evolution_tech,$techhypernav_namepage,$newwfer_ressource,$newwor_ressource,$newwada_ressource,$newwura_ressource,$Depense2_techhypernav_fer,$Depense2_techhypernav_or,$Depense2_techhypernav_ada,$Depense2_techhypernav_ura,$Depense2_techhypernav_energie,$construction,$tempsevolution,$timelabo2); }
			  echo"</tr>
            </table><br><br>";
			
			exit;

mysql_close($connect);

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