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

$sql = "SELECT pts,techenergie_lvl,techenergie_evolution,techlaser_lvl,techlaser_evolution,techions_lvl,techions_evolution,techplasma_lvl,techplasma_evolution,techordi_lvl,techordi_evolution,techcombustion_lvl,techcombustion_evolution,techAsgaards_lvl,techAsgaards_evolution,techhyperespace_lvl,techhyperespace_evolution,techespio1_lvl,techespio1_evolution,techespio2_lvl,techespio2_evolution,techArmement_lvl,techArmement_evolution,techBouclier_lvl,techBouclier_evolution,techcoque_lvl,techcoque_evolution,robo_lvl,labo_lvl,labo_evolution,fer_energie,or_energie,ada_energie,ura_energie,exfer_energie,exor_energie,central_energie FROM matgraph_users WHERE id='$dataid[id]' ";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_array($res); 

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

$New_techenergie_lvl = ($row[techenergie_lvl] + 1);
$New_techlaser_lvl = ($row[techlaser_lvl] + 1);
$New_techions_lvl = ($row[techions_lvl] + 1);
$New_techplasma_lvl = ($row[techplasma_lvl] + 1);
$New_techordi_lvl = ($row[techordi_lvl] + 1);
$New_techcombustion_lvl = ($row[techcombustion_lvl] + 1);
$New_techAsgaards_lvl = ($row[techAsgaards_lvl] + 1);
$New_techhyperespace_lvl = ($row[techhyperespace_lvl] + 1);
$New_techespio1_lvl = ($row[techespio1_lvl] + 1);
$New_techespio2_lvl = ($row[techespio2_lvl] + 1);
$New_techArmement_lvl = ($row[techArmement_lvl] + 1);
$New_techBouclier_lvl = ($row[techBouclier_lvl] + 1);
$New_techcoque_lvl = ($row[techcoque_lvl] + 1);

$Total_energie_consom = $row[fer_energie] + $row[or_energie] + $row[exfer_energie] + $row[exor_energie] + $row[ada_energie] + $row[ura_energie] ;
$Total_energie_reste =  round(($New_central_energie + $New_fission_energie + $Total_energie_consom),0);
$Total_energie_prod = round(($New_central_energie + $New_fission_energie),0);

// temps evolution	if ($row[techenergie_evolution] != "0000-00-00 00:00:00" | $row[techlaserevolution] != "0000-00-00 00:00:00" | $row[techions_evolution] != "0000-00-00 00:00:00" | $row[techplasma_evolution] != "0000-00-00 00:00:00" | $row[techordi_evolution] != "0000-00-00 00:00:00" | $row[techcombustion_evolution] != "0000-00-00 00:00:00" | $row[techAsgaards_evolution] != "0000-00-00 00:00:00" | $row[techhyperespace_evolution] != "0000-00-00 00:00:00" | $row[techespio1_evolution] != "0000-00-00 00:00:00" | $row[techespio2_evolution] != "0000-00-00 00:00:00" | $row[techArmement_evolution] != "0000-00-00 00:00:00" | $row[techBouclier_evolution] != "0000-00-00 00:00:00" | $row[techcoque_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechenergie2 ; $construction = "techenergie" ; }
if ($row[techlaser_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechlaser2 ; $construction = "techlaser" ; }
if ($row[techions_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechions2 ; $construction = "techions" ; }
if ($row[techplasma_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechenergie2 ; $construction = "techenergie" ; }
if ($row[techordi_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechordi2 ; $construction = "techordi" ; }
if ($row[techcombustion_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcombustion2 ; $construction = "techcombustion" ; }
if ($row[techAsgaards_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechAsgaards2 ; $construction = "techAsgaards" ; }
if ($row[techhyperespace_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechhyperespace2 ; $construction = "techhyperespace" ; }
if ($row[techespio1_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio12 ; $construction = "techespio1" ; }
if ($row[techespio2_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechespio22 ; $construction = "techespio2" ; }
if ($row[techArmement_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechArmement2 ; $construction = "techArmement" ; }
if ($row[techBouclier_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechBouclier2 ; $construction = "techBouclier" ; }
if ($row[techcoque_evolution] != "0000-00-00 00:00:00") { $tempsevo = -1*$diftempstechcoque2 ; $construction = "techcoque" ; }


if ($row[robo_evolution] != "0000-00-00 00:00:00") { 
$robo_lvl = ($row[robo_lvl] -1);
}
else {
$robo_lvl = ($row[robo_lvl]);
}

$etimeevo = $tempsevo;
$eminevo = $etimeevo / 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 );
    }

  }

$etimeevo ="";

if (!empty($edayevo) )
  $etimeevo.="$edayevo j ";

if (!empty($ehourevo) )
  $etimeevo.="$ehourevo h ";

if ($eminevo != 0)
  $etimeevo.= floor($eminevo)." min. ";

if (!empty($esecevo) ) 
  $etimeevo.="$esecevo sec. ";
  
// labo
if ($row[labo_lvl] =="0") {
$labo_lvl = "0";
}
else {
$labo_lvl = $row[labo_lvl];
}
// techenergie
if ($row[techenergie_lvl] =="0") {
$techenergie_lvl = "0";
}
else {
$techenergie_lvl = $row[techenergie_lvl];
}
// techlaser
if ($row[techlaser_lvl] =="0") {
$techlaser_lvl = "0";
}
else {
$techlaser_lvl = $row[techlaser_lvl];
}
// techions
if ($row[techions_lvl] =="0") {
$techions_lvl = "0";
}
else {
$techions_lvl = $row[techions_lvl];
}
// techplasma
if ($row[techplasma_lvl] =="0") {
$techplasma_lvl = "0";
}
else {
$techplasma_lvl = $row[techplasma_lvl];
}
// techordi
if ($row[techordi_lvl] =="0") {
$techordi_lvl = "0";
}
else {
$techordi_lvl = $row[techordi_lvl];
}
// techcombustion
if ($row[techcombustion_lvl] =="0") {
$techcombustion_lvl = "0";
}
else {
$techcombustion_lvl = $row[techcombustion_lvl];
}
// techAsgaards
if ($row[techAsgaards_lvl] =="0") {
$techAsgaards_lvl = "0";
}
else {
$techAsgaards_lvl = $row[techAsgaards_lvl];
}
// techhyperespace
if ($row[techhyperespace_lvl] =="0") {
$techhyperespace_lvl = "0";
}
else {
$techhyperespace_lvl = $row[techhyperespace_lvl];
}
// techespio1
if ($row[techespio1_lvl] =="0") {
$techespio1_lvl = "0";
}
else {
$techespio1_lvl = $row[techespio1_lvl];
}
// techespio2
if ($row[techespio2_lvl] =="0") {
$techespio2_lvl = "0";
}
else {
$techespio2_lvl = $row[techespio2_lvl];
}
// techArmement
if ($row[techArmement_lvl] =="0") {
$techArmement_lvl = "0";
}
else {
$techArmement_lvl = $row[techArmement_lvl];
}
// techBouclier
if ($row[techBouclier_lvl] =="0") {
$techBouclier_lvl = "0";
}
else {
$techBouclier_lvl = $row[techBouclier_lvl];
}
// techcoque
if ($row[techcoque_lvl] =="0") {
$techcoque_lvl = "0";
}
else {
$techcoque_lvl = $row[techcoque_lvl];
}



// cout
//techenergie
if ($row[techenergie_lvl] == "0") {
$Depense_techenergie_or = "800";
$Depense_techenergie_ada = "400";
}
else {
$Depense_techenergie_or = round((800 * ( bcpow( 2, ($row[techenergie_lvl] + 1),3))),0);
$Depense_techenergie_ada = round((400 * ( bcpow( 2, ($row[techenergie_lvl] + 1),3))),0);
}
//techlaser
if ($row[techlaser_lvl] == "0") {
$Depense_techlaser_fer = "200";
$Depense_techlaser_or = "100";
}
else {
$Depense_techlaser_fer = round((200 * ( bcpow( 2, ($row[techlaser_lvl] + 1),3))),0);
$Depense_techlaser_or = round((100 * ( bcpow( 2, ($row[techlaser_lvl] + 1),3))),0);
}
//techions
if ($row[techions_lvl] == "0") {
$Depense_techions_fer = "1000";
$Depense_techions_or = "300";
$Depense_techions_ada = "100";
}
else {
$Depense_techions_fer = round((1000 * ( bcpow( 2, ($row[techions_lvl] + 1),3))),0);
$Depense_techions_or = round((300 * ( bcpow( 2, ($row[techions_lvl] + 1),3))),0);
$Depense_techions_ada = round((100 * ( bcpow( 2, ($row[techions_lvl] + 1),3))),0);
}
//techplasma
if ($row[techplasma_lvl] == "0") {
$Depense_techplasma_fer = "2000";
$Depense_techplasma_or = "4000";
$Depense_techplasma_ada = "1000";
}
else {
$Depense_techplasma_fer = round((2000 * ( bcpow( 2, ($row[techplasma_lvl] + 1),3))),0);
$Depense_techplasma_or = round((4000 * ( bcpow( 2, ($row[techplasma_lvl] + 1),3))),0);
$Depense_techplasma_ada = round((1000 * ( bcpow( 2, ($row[techplasma_lvl] + 1),3))),0);
}
//techordi
if ($row[techordi_lvl] == "0") {
$Depense_techordi_or = "400";
$Depense_techordi_ada = "600";
}
else {
$Depense_techordi_or = round((400 * ( bcpow( 2, ($row[techordi_lvl] + 1),3))),0);
$Depense_techordi_ada = round((600 * ( bcpow( 2, ($row[techordi_lvl] + 1),3))),0);
}
//techcombustion
if ($row[techcombustion_lvl] == "0") {
$Depense_techcombustion_fer = "400";
$Depense_techcombustion_ada = "600";
}
else {
$Depense_techcombustion_fer = round((400 * ( bcpow( 2, ($row[techcombustion_lvl] + 1),3))),0);
$Depense_techcombustion_ada = round((600 * ( bcpow( 2, ($row[techcombustion_lvl] + 1),3))),0);
}
//techAsgaards
if ($row[techAsgaards_lvl] == "0") {
$Depense_techAsgaards_fer = "2000";
$Depense_techAsgaards_or = "4000";
$Depense_techAsgaards_ada = "600";
}
else {
$Depense_techAsgaards_fer = round((2000 * ( bcpow( 2, ($row[techAsgaards_lvl] + 1),3))),0);
$Depense_techAsgaards_or = round((4000 * ( bcpow( 2, ($row[techAsgaards_lvl] + 1),3))),0);
$Depense_techAsgaards_ada = round((600 * ( bcpow( 2, ($row[techAsgaards_lvl] + 1),3))),0);
}
//techhyperespace
if ($row[techhyperespace_lvl] == "0") {
$Depense_techhyperespace_or = "4000";
$Depense_techhyperespace_ada = "2000";
}
else {
$Depense_techhyperespace_or = round((4000 * ( bcpow( 2, ($row[techhyperespace_lvl] + 1),3))),0);
$Depense_techhyperespace_ada = round((2000 * ( bcpow( 2, ($row[techhyperespace_lvl] + 1),3))),0);
}
//techespio1
if ($row[techespio1_lvl] == "0") {
$Depense_techespio1_fer = "200";
$Depense_techespio1_or = "1000";
$Depense_techespio1_ada = "200";
}
else {
$Depense_techespio1_fer = round((200 * ( bcpow( 2, ($row[techespio1_lvl] + 1),3))),0);
$Depense_techespio1_or = round((1000 * ( bcpow( 2, ($row[techespio1_lvl] + 1),3))),0);
$Depense_techespio1_ada = round((200 * ( bcpow( 2, ($row[techespio1_lvl] + 1),3))),0);
}
//techespio2
if ($row[techespio2_lvl] == "0") {
$Depense_techespio2_fer = "200";
$Depense_techespio2_or = "2000";
$Depense_techespio2_ada = "500";
}
else {
$Depense_techespio2_fer = round((200 * ( bcpow( 2, ($row[techespio1_lvl] + 1),3))),0);
$Depense_techespio2_or = round((2000 * ( bcpow( 2, ($row[techespio2_lvl] + 1),3))),0);
$Depense_techespio2_ada = round((500 * ( bcpow( 2, ($row[techespio2_lvl] + 1),3))),0);
}
//techArmement
if ($row[techArmement_lvl] == "0") {
$Depense_techArmement_fer = "800";
$Depense_techArmement_or = "200";
}
else {
$Depense_techArmement_fer = round((800 * ( bcpow( 2, ($row[techArmement_lvl] + 1),3))),0);
$Depense_techArmement_or = round((200 * ( bcpow( 2, ($row[techArmement_lvl] + 1),3))),0);
}
//techBouclier
if ($row[techBouclier_lvl] == "0") {
$Depense_techBouclier_fer = "200";
$Depense_techBouclier_or = "600";
}
else {
$Depense_techBouclier_fer = round((200 * ( bcpow( 2, ($row[techBouclier_lvl] + 1),3))),0);
$Depense_techBouclier_or = round((600 * ( bcpow( 2, ($row[techBouclier_lvl] + 1),3))),0);
}
//techcoque
if ($row[techcoque_lvl] == "0") {
$Depense_techcoque_fer = "800";
}
else {
$Depense_techcoque_fer = round((1000 * ( bcpow( 2, ($row[techcoque_lvl] + 1),3))),0);
}




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

$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 sec. ";
  
//techlaser 
$temps1techlaser = (400 * (bcpow(2, $New_techlaser_lvl,3)));
$stimetechlaser = (round(($temps1techlaser) - ($temps1techlaser*0.1*$labo_lvl)));

$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 sec. ";
  
//techions 
$temps1techions = (1334 * (bcpow(2, $New_techions_lvl,3)));
$stimetechions = (round(($temps1techions) - ($temps1techions*0.1*$labo_lvl)));

$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 sec. ";
  
//techplasma 
$temps1techplasma = (8000 * (bcpow(2, $New_techplasma_lvl,3)));
$stimetechplasma = (round(($temps1techplasma) - ($temps1techplasma*0.1*$labo_lvl)));

$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 sec. ";
  
//techordi 
$temps1techordi = (800 * (bcpow(2, $New_techordi_lvl,3)));
$stimetechordi = (round(($temps1techordi) - ($temps1techordi*0.1*$labo_lvl)));

$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 sec. ";
  
//techcombustion 
$temps1techcombustion = (334 * (bcpow(2, $New_techcombustion_lvl,3)));
$stimetechcombustion = (round(($temps1techcombustion) - ($temps1techcombustion*0.1*$labo_lvl)));

$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 sec. ";
  
//techAsgaards 
$temps1techAsgaards = (2000 * (bcpow(2, $New_techAsgaards_lvl,3)));
$stimetechAsgaards = (round(($temps1techAsgaards) - ($temps1techAsgaards*0.1*$labo_lvl)));

$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 sec. ";
  
//techhyperespace 
$temps1techhyperespace = (24000 * (bcpow(2, $New_techhyperespace_lvl,3)));
$stimetechhyperespace = (round(($temps1techhyperespace) - ($temps1techhyperespace*0.1*$labo_lvl)));

$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 sec. ";
  
//techespio1 
$temps1techespio1 = (1200 * (bcpow(2, $New_techespio1_lvl,3)));
$stimetechespio1 = (round(($temps1techespio1) - ($temps1techespio1*0.1*$labo_lvl)));

$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 sec. ";
  
//techespio2 
$temps1techespio2 = (1667 * (bcpow(2, $New_techespio2_lvl,3)));
$stimetechespio2 = (round(($temps1techespio2) - ($temps1techespio2*0.1*$labo_lvl)));

$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 sec. ";
  
//techArmement 
$temps1techArmement = (1000 * (bcpow(2, $New_techArmement_lvl,3)));
$stimetechArmement = (round(($temps1techArmement) - ($temps1techArmement*0.1*$labo_lvl)));

$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 sec. ";
  
//techBouclier 
$temps1techBouclier = (1000 * (bcpow(2, $New_techBouclier_lvl,3)));
$stimetechBouclier = (round(($temps1techBouclier) - ($temps1techBouclier*0.1*$labo_lvl)));

$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 sec. ";
  
//techcoque 
$temps1techcoque = (1000 * (bcpow(2, $New_techcoque_lvl,3)));
$stimetechcoque = (round(($temps1techcoque) - ($temps1techcoque*0.1*$labo_lvl)));

$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 sec. ";
  







//

include ('entete.php');
echo"<STYLE TYPE=text/css>
.Style1 {color: #0000FF}
.Style2 {color: #FF0000}
.Style3 {color: #00CC00}
.Style4 {color: #999999}
.Style5 {color: #3399FF}
.Style6 {color: #FFFF00}
A.menulink {
width: 150px;
text-decoration: none;
font-family:Verdana;
font-size:11px;
color: #00CC00;
BORDER: none;
border: solid 1px #000000;
}

A.menulink:hover {
border: solid 1px #000000;
background-color:#000000;
}
A.menulink2 {
width: 150px;
text-decoration: none;
font-family:Verdana;
font-size:11px;
color: #FF3300;
BORDER: none;
border: solid 1px #000000;
}

A.menulink2:hover {
border: solid 1px #000000;
background-color:#000000;
}
</STYLE>
<div align=\"center\"><table width=\"550\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td width=\"100\"><div align=\"center\">Fer :</div></td>
     <td width=\"100\"><div align=\"center\">Or : </div></td>
     <td width=\"100\"><div align=\"center\">Adamentium : </div></td>
     <td width=\"100\"><div align=\"center\">Uranium : </div></td>
     <td width=\"150\"><div align=\"center\">Energie : </div></td>
   </tr>
   <tr>
     <td><div align=\"center\">$newwfer_ressource </div></td>
     <td><div align=\"center\">$newwor_ressource </div></td>
     <td><div align=\"center\">$newwada_ressource </div></td>
     <td><div align=\"center\">$newwura_ressource </div></td>
     <td><div align=\"center\">$Total_energie_reste / $Total_energie_prod</div></td>
   </tr>
 </table>
<br>Points : $pts
</p>";


if ($timelabo2 != "-1") { echo"<div align=\"center\">Le centre de recherche scientifiques est en cous d'evolution</div>"; }

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

// techenergie
if ($labo_lvl > "0") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie de maîtrise de l'Energie </b>(Niveau $techenergie_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>En maîtrisant le mieux possible les différents types d'énergies, il est possible de construire de nouveaux systèmes d'alimentations.
	 <br><br>Coût : Or : <b>$Depense_techenergie_or</b> ; Adamentium : <b>$Depense_techenergie_ada</b><br>
       Temps de construction : $etimetechenergie</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {	if ($row[techenergie_evolution] != "0000-00-00 00:00:00" | $row[techlaserevolution] != "0000-00-00 00:00:00" | $row[techions_evolution] != "0000-00-00 00:00:00" | $row[techplasma_evolution] != "0000-00-00 00:00:00" | $row[techordi_evolution] != "0000-00-00 00:00:00" | $row[techcombustion_evolution] != "0000-00-00 00:00:00" | $row[techAsgaards_evolution] != "0000-00-00 00:00:00" | $row[techhyperespace_evolution] != "0000-00-00 00:00:00" | $row[techespio1_evolution] != "0000-00-00 00:00:00" | $row[techespio2_evolution] != "0000-00-00 00:00:00" | $row[techArmement_evolution] != "0000-00-00 00:00:00" | $row[techBouclier_evolution] != "0000-00-00 00:00:00" | $row[techcoque_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techenergie"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechenergie.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techenergie_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}	if ($row[techenergie_evolution] != "0000-00-00 00:00:00" | $row[techlaserevolution] != "0000-00-00 00:00:00" | $row[techions_evolution] != "0000-00-00 00:00:00" | $row[techplasma_evolution] != "0000-00-00 00:00:00" | $row[techordi_evolution] != "0000-00-00 00:00:00" | $row[techcombustion_evolution] != "0000-00-00 00:00:00" | $row[techAsgaards_evolution] != "0000-00-00 00:00:00" | $row[techhyperespace_evolution] != "0000-00-00 00:00:00" | $row[techespio1_evolution] != "0000-00-00 00:00:00" | $row[techespio2_evolution] != "0000-00-00 00:00:00" | $row[techArmement_evolution] != "0000-00-00 00:00:00" | $row[techBouclier_evolution] != "0000-00-00 00:00:00" | $row[techcoque_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techenergie_or) && $newwada_ressource >= ($Depense_techenergie_ada)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechenergie.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techenergie_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techenergie_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";

// techlaser
if ($labo_lvl > "0" && $techenergie_lvl > "1") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie de Laser </b>(Niveau $techlaser_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Le laser est un rayon de lumière fortement concentré très puissant.
	 <br><br>Coût : Fer : <b>$Depense_techlaser_fer</b> ; Or : <b>$Depense_techlaser_or</b><br>
       Temps de construction : $etimetechlaser</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techlaser_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techlaser"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechlaser.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techlaser_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techlaser_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techlaser_or) && $newwfer_ressource >= ($Depense_techlaser_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechlaser.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techlaser_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techlaser_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
	
// techions
if ($labo_lvl > "3" && $techlaser_lvl > "4" && $techenergie_lvl > "3") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie d'ions </b>(Niveau $techions_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Les ions sont une arme utilisé principalement par les Goa'ulds : ils permettent de dévarier les système électroniques. Le développement de cette technique à permis de les adapté aux vaisseaux.
	 <br><br>Coût : Fer : <b>$Depense_techlaser_fer</b> ; Or : <b>$Depense_techions_or</b> ; Adamentium : <b>$Depense_techions_ada</b><br>
       Temps de construction : $etimetechions</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techions_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techions"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechions.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techions_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techions_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techions_or) && $newwada_ressource >= ($Depense_techions_ada) && $newwfer_ressource >= ($Depense_techions_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechions.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techions_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techions_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
	
// techplasma
if ($labo_lvl > "3" && $techlaser_lvl > "9" && $techenergie_lvl > "7" && $techions_lvl > "4") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie de plasma </b>(Niveau $techplasma_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>En combinant les ions et le laser on peut obtenir une arme bien plus puissante et dévastatrice : le plasma.
	 <br><br>Coût : Fer : <b>$Depense_techplasma_fer</b> ; Or : <b>$Depense_techplasma_or</b> ; Adamentium : <b>$Depense_techplasma_ada</b><br>
       Temps de construction : $etimetechplasma</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techplasma_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techplasma"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechplasma.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techplasma_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techplasma_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techplasma_or) && $newwada_ressource >= ($Depense_techplasma_ada) && $newwfer_ressource >= ($Depense_techplasma_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechplasma.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techplasma_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techplasma_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
	
// techordi
if ($labo_lvl > "0") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie Ordinateur </b>(Niveau $techordi_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Cette technologie est la base de tout programme politique, économique ou militaire.
Chaque niveau de technologie ordinateur, permet en améliorant les processeurs de pouvoir gérer plus de flotte en mouvement.
En gardant un matériel informatique performant, le fonctionnement de tous les secteurs est favorisé.
	 <br><br>Coût : Or : <b>$Depense_techordi_or</b> ; Adamentium : <b>$Depense_techordi_ada</b><br>
       Temps de construction : $etimetechordi</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techordi_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techordi"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechordi.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techordi_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techordi_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techordi_or) && $newwada_ressource >= ($Depense_techordi_ada)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechordi.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techordi_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techordi_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
	
// techcombustion
if ($labo_lvl > "0" && $techenergie_lvl > "0") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Réacteur à combustion </b>(Niveau $techcombustion_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Les réacteurs à combustion sont le plus vieux système de transport connu à ce jour. Petit et fiable, ils sont utilisé généralement pour les vaisseaux de petite taille.
	 <br><br>Coût : Fer : <b>$Depense_techcombustion_fer</b> ; Adamentium : <b>$Depense_techcombustion_ada</b><br>
       Temps de construction : $etimetechcombustion</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techcombustion_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techcombustion"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechcombustion.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techcombustion_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techcombustion_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwfer_ressource >= ($Depense_techcombustion_fer) && $newwada_ressource >= ($Depense_techcombustion_ada)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechcombustion.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techcombustion_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techcombustion_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
	
// techAsgaards
if ($labo_lvl > "0" && $techenergie_lvl > "1") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Réacteurs Asgaards </b>(Niveau $techAsgaards_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Les réacteurs Asgaards fonctionnent sur le principe des réacteurs à impulsion. Chaque niveau augmente la vitesse des vaisseaux de 15%.
	 <br><br>Coût : Fer : <b>$Depense_techAsgaards_fer</b> ; Or : <b>$Depense_techAsgaards_or</b> ; Adamentium : <b>$Depense_techAsgaards_ada</b><br>
       Temps de construction : $etimetechAsgaards</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techAsgaards_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techAsgaards"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"ArrettechAsgaards.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techAsgaards_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techAsgaards_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techAsgaards_or) && $newwada_ressource >= ($Depense_techAsgaards_ada) && $newwfer_ressource >= ($Depense_techAsgaards_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"EvolutiontechAsgaards.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techAsgaards_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techAsgaards_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";

// techhyperespace
if ($labo_lvl > "6" && $techenergie_lvl > "4" && $techBouclier_lvl > "4") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie des Réacteur hyperespace </b>(Niveau $techhyperespace_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Cette technologie se concentre sur la propulsion hyperespace. On comprimant la matière il est possible d'aller beaucoup plus vite.
	 <br><br>Coût : Or : <b>$Depense_techhyperespace_or</b> ; Adamentium : <b>$Depense_techhyperespace_ada</b><br>
       Temps de construction : $etimetechhyperespace</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techhyperespace_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techhyperespace"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechhyperespace.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techhyperespace_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techhyperespace_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techhyperespace_or) && $newwada_ressource >= ($Depense_techhyperespace_ada)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechhyperespace.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techhyperespace_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techhyperespace_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
 
// techespio1
if ($labo_lvl > "2") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie Espionnage de Type 1 </b>(Niveau $techespio1_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>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.
	 <br><br>Coût : Fer : <b>$Depense_techespio1_fer</b> ; Or : <b>$Depense_techespio1_or</b> ; Adamentium : <b>$Depense_techespio1_ada</b><br>
       Temps de construction : $etimetechespio1</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techespio1_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techespio1"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechespio1.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techespio1_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techespio1_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techespio1_or) && $newwada_ressource >= ($Depense_techespio1_ada) && $newwfer_ressource >= ($Depense_techespio1_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechespio1.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techespio1_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techespio1_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";

// techespio2
if ($labo_lvl > "3" && $techespio1_lvl > "1") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie Espionnage de Type 2 </b>(Niveau $techespio2_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Cette autre technologie d'espionnage est plus dangereuse mais plus efficace : Elle envoi des petit rebot espion sur la planète visée et y reste plusieurs jours.
	 <br><br>Coût : Fer : <b>$Depense_techespio2_fer</b> ; Or : <b>$Depense_techespio2_or</b> ; Adamentium : <b>$Depense_techespio2_ada</b><br>
       Temps de construction : $etimetechespio2</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techespio2_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techespio2"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechespio2.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techespio2_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techespio2_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techespio2_or) && $newwada_ressource >= ($Depense_techespio2_ada) && $newwfer_ressource >= ($Depense_techespio2_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechespio2.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techespio2_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techespio2_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
 
 // techArmement
if ($labo_lvl > "3") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie de l'Armement </b>(Niveau $techArmement_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Augmente de 10% la puissance des armes des vaisseaux et des systèmes de défense.
	 <br><br>Coût : Fer : <b>$Depense_techArmement_fer</b> ; Or : <b>$Depense_techArmement_or</b><br>
       Temps de construction : $etimetechArmement</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techArmement_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techArmement"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"ArrettechArmement.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techArmement_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techArmement_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techArmement_or) && $newwfer_ressource >= ($Depense_techArmement_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"EvolutiontechArmement.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techArmement_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techArmement_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
 
// techBouclier
if ($labo_lvl > "5" && $techenergie_lvl > "2") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie Bouclier </b>(Niveau $techBouclier_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>La technologie bouclier se base sur la rechercher de sources d'énergie capable d'alimenter suffisamment les boucliers.
	 <br><br>Coût : Fer : <b>$Depense_techBouclier_fer</b> ; Or : <b>$Depense_techBouclier_or</b><br>
       Temps de construction : $etimetechBouclier</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techBouclier_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techBouclier"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"ArrettechBouclier.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techBouclier_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techBouclier_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwor_ressource >= ($Depense_techBouclier_or) && $newwfer_ressource >= ($Depense_techBouclier_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"EvolutiontechBouclier.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techBouclier_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techBouclier_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
 
// techcoque
if ($labo_lvl > "1") {
	echo"<br><table width=\"618\" border=\"1\" cellspacing=\"0\" cellpadding=\"0\">
   <tr>
     <td align=\"center\" colspan=\"2\"><b>Technologie de renforcement de la coque </b>(Niveau $techcoque_lvl)</td>
   </tr>
   <tr>
     <td width=\"120\" height=\"120\"><img src=\"http://80.237.203.201/download/use/epicblue/gebaeude/1.gif\" width=\"120\" height=\"120\"></td>
     <td width=\"498\" valign=\"top\"><p>Cette technologie base essentiellement sa recherche sur le développement d'alliage le plus solide possible.
	 <br><br>Coût : Fer : <b>$Depense_techcoque_fer</b><br>
       Temps de construction : $etimetechcoque</p>
     <p></td>
     </tr>
    <tr>";
if ($timelabo2 = "-1") {
	if ($row[techcoque_evolution] != "0000-00-00 00:00:00") {
		if ($construction == "techcoque"){
		echo"<td align=\"center\" height=\"40\" colspan=\"2\"><p class=\"Style1\">Batiment en cours de construction : $etimeevo<br><a href=\"Arrettechcoque.php\" target=\"_parent\" class=menulink2>Arreter le niveau $New_techcoque_lvl</a></td>"; }
 		else { 
		echo"<td align=\"center\" colspan=\"2\"><p class=\"Style1\">-</p></td>";
		}
	}
	if ($row[techcoque_evolution] != "0000-00-00 00:00:00") {
	} else {
		if ($newwfer_ressource >= ($Depense_techcoque_fer)) {
		echo"<td height=\"26\" align=\"center\" colspan=\"2\"><a href=\"Evolutiontechcoque.php\" target=\"_parent\" class=menulink>Am&eacute;lioration au niveau $New_techcoque_lvl</a></td>";
		}
	else { 
	echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">Pas assez de ressource pour l'am&eacute;lioration au niveau $New_techcoque_lvl</p></td>";
	}}}}
	else { echo"<td align=\"center\" colspan=\"2\"><p class=\"Style2\">- Indisponible -</p></td>"; }
	echo"</tr>
 </table>";
  
?>