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

$sql2 = "SELECT hangarfer_lvl,hangarfer_evolution,hangaror_lvl,hangaror_evolution,hangarada_lvl,hangarada_evolution,hangaror_lvl,hangarura_lvl,hangarura_evolution 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); 

$pts = floor(($row[pts] / 1000)) ;
$Total_energie_consom = $row2[fer_energie] + $row2[or_energie] + $row2[exfer_energie] + $row2[exor_energie] + $row2[ada_energie] + $row2[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);

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;
}
</style>
<STYLE TYPE=text/css>
.Style1 {color: #0000FF}
.Style2 {color: #FF0000}
</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'); 
$sql = "SELECT fission_lvl FROM matgraph_users WHERE id='$planete'";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_array($res); 
// fission
if ($row[fission_lvl] =="0") {
$fission_lvl = "0";
}
else {
$fission_lvl = $row[fission_lvl];
}
$fission_lvl22 = $fission_lvl+1;
$fission_lvl23 = $fission_lvl+2;
$fission_lvl24 = $fission_lvl+3;
$fission_lvl25 = $fission_lvl+4;
//conso 
if ($row[fission_lvl] == "0") {
$besoin_fission_energie2 = "0" ; }
else {
$besoin_fission_energie2 = floor((20 * (bcpow(1.3, $row[fission_lvl],3))));
}
$besoin_fission_energie = 1 * $besoin_fission_energie2 ;
$besoin_fission_energie22 = floor((20 * (bcpow(1.3, ($row[fission_lvl] + 1),3))));
$besoin_fission_energie23 = floor((20 * (bcpow(1.3, ($row[fission_lvl] + 2) ,3))));
$besoin_fission_energie24 = floor((20 * (bcpow(1.3, ($row[fission_lvl] + 3),3))));
$besoin_fission_energie25 = floor((20 * (bcpow(1.3, ($row[fission_lvl] + 4),3))));
//prod
	if ($row[fission_lvl] == "0") {
	$new9fission_ressource = (0);
	}
	else {
	$new9fission_ressource = $New_fission_energie ;
	}
	$new9fission_ressource22 = $New_fission_energie + round((((300 * ( bcpow( 1.3, ($row[fission_lvl]+1),3))))),0);
	$new9fission_ressource23 = $new9fission_ressource22 + round((((300 * ( bcpow( 1.3, ($row[fission_lvl]+2),3))))),0);
	$new9fission_ressource24 = $new9fission_ressource23 + round((((300 * ( bcpow( 1.3, ($row[fission_lvl]+3),3))))),0);
	$new9fission_ressource25 = $new9fission_ressource24 + round((((300 * ( bcpow( 1.3, ($row[fission_lvl]+4),3))))),0);
echo"<table width=\"618\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr>
    <td colspan=\"4\" style =\"background-color:#222222;\"><div align=\"center\"><b>Centrale énergétique au Naquadah </b>(Niveau $fission_lvl)</div></td>
  </tr>
  <tr>
    <td width=\"72\" height=\"120\"><img src=\"imgs/fission.gif\" width=\"120\" height=\"120\"></td>
    <td width=\"1119\" colspan=\"2\">Le Naquadah pouvant stocker et, ensuite, restituer de l'energie, il peut être utilisé pour alimenter en électricité une ville. Comme le Naquadah est très dangereux, les centrales de Naquadah sont très protégées. La centrale elle même est construite en Naquadah pour une plus grande résistance des locaux en cas d'explosion. Chaque niveau de la centrale augmente sa superficie et donc le nombre d'atomes entrant en fusion.</td>
  </tr>
</table>
<br>
<table width=\"618\"  border=\"0\" cellspacing=\"0\" cellpadding=\"0\">
  <tr style =\"background-color:#222222;\">
    <td width=\"93\" height=\"21\" align=\"center\">Niveau : </td>
    <td>Consommation de naquadah par heure : </td>
    <td>Production d'energie par heure : </td>
  </tr>
  <tr style =\"background-color:#000000;\">
    <td width=\"93\" height=\"21\" align=\"center\">$fission_lvl</td>
    <td width=289>$besoin_fission_energie</td>
    <td width=\"210\">$new9fission_ressource</td>
  </tr>
  <tr style =\"background-color:#111111;\">
    <td width=\"93\" height=\"21\" align=\"center\">$fission_lvl22</td>
    <td>$besoin_fission_energie22</td>
    <td width=\"210\">$new9fission_ressource22</td>
  </tr>
  <tr style =\"background-color:#000000;\">
    <td width=\"93\" height=\"21\" align=\"center\">$fission_lvl23</td>
    <td>$besoin_fission_energie23</td>
    <td width=210>$new9fission_ressource23</td>
  </tr>
  <tr style =\"background-color:#111111;\">
    <td width=\"93\" height=\"21\" align=\"center\">$fission_lvl24</td>
    <td>$besoin_fission_energie24</td>
    <td width=\"210\">$new9fission_ressource24</td>
  </tr>
  <tr style =\"background-color:#000000;\">
    <td width=\"93\" height=\"21\" align=\"center\">$fission_lvl25</td>
    <td>$besoin_fission_energie25</td>
    <td width=\"210\">$new9fission_ressource25</td>
  </tr>
</table>";	
?>

