<?

include ('config_uni.php');
include ('logue.php') ;
include ('config.php') ;
include ('entete2.php') ;
include ('entete.php') ;
include ('ressource.php') ;


$sql2 = "SELECT
galaxi,system,position,robo_lvl,chantier_lvl,hangarfer_lvl,hangarfer_evolution,hangaror_lvl,hangaror_evolution,hangarada_lvl,hangarada_evolution,hangaror_lvl,hangarura_lvl,hangarura_evolution,labo_lvl,labo_evolution,fer_energie,or_energie,ada_energie,ura_energie,exfer_energie,exor_energie,central_energie FROM matgraph_users WHERE id='$planete' ";
$res2 = db_mysql_Query($sql2)or die('erreur sql<br>'.$sql2.'<br>'.mysql_error()) ;
$row2 = mysql_fetch_array($res2) ;


$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) ;
$Total_energie_reste2 =  number_format(round(($New_central_energie + $New_fission_energie + $Total_energie_consom),0), 0, ',', ' ') ;
$Total_energie_prod2 = number_format(round(($New_central_energie + $New_fission_energie),0), 0, ',', ' ') ;

echo"<style>
input {
border:1px solid #7E7E7E;
background-color:#000000;
font-family:'trebuchet ms',sans-serif;
color:white;
}
textarea {
border:1px solid #7E7E7E;
background-color:#000000;
font-family:'trebuchet ms',sans-serif;
color:white;
}
select, option {
background-color:#000000;
color:white;
}

.button {
border-left:1px solid #EEEEEE; border-right:1px solid #666666; border-top:1px solid #EEEEEE; border-bottom:1px solid #666666; background-color:#111111;text-decoration: none;text-align: center;padding: 3 px;
}
</style>

<STYLE TYPE=text/css>
.Style1 {color: #0000FF}
.Style2 {color: #FF0000}
</STYLE>" ;
// ------------------------- INFO BULLE -------------------------

$SQL = "SELECT * FROM matgraph_nbrevaisseaux WHERE planete = '$planete'" ;
include ('config.php') ;
$RES = db_mysql_Query($SQL) ;
mysql_close() ;
$NUM = mysql_num_rows($RES) ;
$i = 1 ;
if ($NUM > 0 )
{
	While ( $ROW = mysql_fetch_array($RES) )
	{
		$SQL_1 = "SELECT * FROM matgraph_vaisseaux WHERE id='$ROW[vaisseau]' ORDER BY nom" ;
		include ('config.php') ;
		$RES_1 = db_mysql_Query($SQL_1) ;
		mysql_close() ;
		$ROW_1 = mysql_fetch_array($RES_1) ;
		echo '
		<div id="bulle' . $i . '" style="position:absolute;visibility:hidden;width:147px;height:50px">
		<SCRIPT TYPE="text/javascript">
		document.write(AffBulle("<TABLE border=0 cellspacing=0 cellpadding=2 style=\'background-color:#222222;color:white ;font-family:trebuchet ms,sans-serif; font-size: 8pt ;\'><tr><td align=\'center\' valign=\'top\'>' . $ROW_1[description] . '</td><td><IMG SRC=\'imgs/vaisseaux/' . $ROW_1[img] . '.jpg\' width=50 valign=\'middle\'></td></tr></TABLE>"));
		</SCRIPT>
		</div>' ;
		++$i ;
	}
}

// ------------------------- INFO BULLE -------------------------


$test = "ok";
include( 'flotte_transport2.php' );

?>
<SCRIPT LANGUAGE="JavaScript" type="text/javascript">
function clignotement(_actif)
{
	if (document.getElementById(_actif).style.color=="black")
		document.getElementById(_actif).style.color="red" ;
	else
		document.getElementById(_actif).style.color="black" ;
}
// mise en place de l appel régulier de la fonction toutes les 0.5 secondes
Periode = setInterval("clignotement('cligno1')", 500) ;
Periode = setInterval("clignotement('cligno2')", 500) ;
</script>