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

$pts = floor(($row[pts] / 1000)) ;
$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);

echo"
<STYLE TYPE=text/css>
.Style1 {color: #00CC00}
.Style2 {color: #FF0000}
.Style3 {color: #0000FF}
</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\">Cristal : </div></td>
     <td width=\"100\"><div align=\"center\">Naquadah : </div></td>
     <td width=\"150\"><div align=\"center\">Energie : </div></td>
   </tr>
   <tr>
";
   if ($newwfer_ressource > (100000 *(bcpow(1.5, $row[hangarfer_lvl],3)))){
     echo"<td><div align=\"center\"><font color=\"FF0000\">$newwfer_ressource </font></div></td>"; }
	 else {echo"<td><div align=\"center\">$newwfer_ressource </div></td>"; }
   if ($newwor_ressource > (100000 *(bcpow(1.5, $row[hangaror_lvl],3)))){
     echo"<td><div align=\"center\"><font color=\"FF0000\">$newwor_ressource </font></div></td>"; }
	 else {echo"<td><div align=\"center\">$newwor_ressource </div></td>"; }
   if ($newwada_ressource > (100000 *(bcpow(1.5, $row[hangarada_lvl],3)))){
     echo"<td><div align=\"center\"><font color=\"FF0000\">$newwada_ressource </font></div></td>"; }
	 else {echo"<td><div align=\"center\">$newwada_ressource </div></td>"; }
   if ($newwura_ressource > (100000 *(bcpow(1.5, $row[hangarura_lvl],3)))){
     echo"<td><div align=\"center\"><font color=\"FF0000\">$newwura_ressource </font></div></td>"; }
	 else {echo"<td><div align=\"center\">$newwura_ressource </div></td>"; }
     echo"<td><div align=\"center\">$Total_energie_reste / $Total_energie_prod</div></td>
   </tr>
 </table>
<br>";

$sql = "SELECT techinfra_lvl 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); 
// techinfra
if ($row[techinfra_lvl] =="0") {
$techinfra_lvl = "0";
}
else {
$techinfra_lvl = $row[techinfra_lvl];
}
if($techinfra_lvl >= 1){
echo"<form action=\"creer.php\" method=\"post\" target=\"_parent\">
  <p align=\"center\">Infrastructure : 
    <select name=\"infra\" id=\"infra\">";
	if($techinfra_lvl >=1){echo"<option value=\"6000\">Infrastructure du Cargo Teltak</option>";}
      if($techinfra_lvl >=2){echo"<option value=\"15000\">Infrastructure du X-301</option>";}
      if($techinfra_lvl >=4){echo"<option value=\"25000\">Infrastructure de la Navette Bedrosienne</option>";}
      if($techinfra_lvl >=5){echo"<option value=\"50000\">Infrastructure du Prométhé</option>";}
      if($techinfra_lvl >=7){echo"<option value=\"75000\">Infrastructure du Vaisseau Amiral Goa'ulds</option>";}
      if($techinfra_lvl >=10){echo"<option value=\"100000\">Infrastructure du Vaisseau mére Asgaard</option>";}
    echo"</select>
</p>
  <p align=\"center\">
    <input name=\"creer.php\" type=\"submit\" id=\"creer.php\" value=\"Envoyer\">
</p>
</form>"; } 
else {
echo"Vous devez develloper la technologie infrastructure avant de pouvoir créer un vaisseau."; }
?>
