<?php
////////////////
//test des états des mines
///fer
if($row[fer_on] == "0") {
$fer_energie = 0; }
else {
$fer_energie =$row[fer_energie] ; }
///exfer
if($row[exfer_on] =="0") {
$exfer_energie = 0; }
else {
$exfer_energie =$row[exfer_energie] ; }
///or
if($row[or_on] =="0") {
$or_energie = 0; }
else {
$or_energie =$row[or_energie] ; }
///exor
if($row[exor_on] =="0") {
$exor_energie = 0; }
else {
$exor_energie =$row[exor_energie] ; }
///ada
if($row[ada_on] =="0") {
$ada_energie = 0; }
else {
$ada_energie =$row[ada_energie] ; }
///sura
if($row[ura_on] =="0") {
$ura_energie = 0; }
else {
$ura_energie =$row[ura_energie] ; }
//
////////////////

////////////////
// calcul des totaux de l'energie
$Total_energie_consom = $fer_energie + $or_energie + $exfer_energie + $exor_energie + $ada_energie + $ura_energie ;
$Total_energie_reste =  round(( ($New_central_energie + $New_fission_energie)*pow(1.05,$energie_tech_lvl) + $Total_energie_consom),0);
$Total_energie_prod = round(( ($New_central_energie + $New_fission_energie)*pow(1.05,$energie_tech_lvl) ),0);
$Total_energie_reste2 =  number_format(round(( ($New_central_energie + $New_fission_energie)*pow(1.05,$energie_tech_lvl) + $Total_energie_consom),0), 0, ',', ' ');
$Total_energie_prod2 = number_format(round(( ($New_central_energie + $New_fission_energie)*pow(1.05,$energie_tech_lvl) ),0), 0, ',', ' ');
//
////////////////

////////////////
// affichage de la liste des colonies
echo"<option value=\"$planete\">$pnom&nbsp;&nbsp;[$pgalaxi:$psystem:$pposition]</option>";
$reqcolo = "SELECT id,idjoueur,planete,galaxi,system,position FROM matgraph_users WHERE idjoueur='$idlogin' ";
$rescolo = db_mysql_Query($reqcolo) or die('erreur sql<br>'.$reqcolo.'<br>'.mysql_error());
$numcolo = mysql_num_rows($rescolo);
if ($numcolo >0) {
	While ( $rowcolo = mysql_fetch_array($rescolo) ) {
		if ($rowcolo[id]!=$planete) {
			echo"<option value=\"$rowcolo[id]\">$rowcolo[planete]&nbsp;&nbsp;[$rowcolo[galaxi]:$rowcolo[system]:$rowcolo[position]]</option>";
		}
	}
}
//
////////////////

/////////////////
// affichage de la barre de ressource

echo"</select>
       </div>       <div align=\"center\">
       </div></td>
     <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=\"100\"><div align=\"center\">Energie : </div></td>
   </tr>
   <tr>";
if ($newwfer_ressource >= (100000 *(bcpow(1.5, $row[hangarfer_lvl],3)))){
     echo"<td><div align=\"center\"><p class=\"Style2\">$neww3fer_ressource </p></div></td>"; 
} else {
	echo"<td><div align=\"center\">$neww3fer_ressource </div></td>"; 
}
if ($newwor_ressource >= (100000 *(bcpow(1.5, $row[hangaror_lvl],3)))){
     echo"<td><div align=\"center\"><p class=\"Style2\">$neww3or_ressource </p></div></td>"; 
} else {
	echo"<td><div align=\"center\">$neww3or_ressource </div></td>"; 
}
if ($newwada_ressource >= (100000 *(bcpow(1.5, $row[hangarada_lvl],3)))){
     echo"<td><div align=\"center\"><p class=\"Style2\">$neww3ada_ressource </p></div></td>"; 
} else {
	echo"<td><div align=\"center\">$neww3ada_ressource </div></td>"; 
}
if ($newwura_ressource >= (100000 *(bcpow(1.5, $row[hangarura_lvl],3)))){
     echo"<td><div align=\"center\"><p class=\"Style2\">$neww3ura_ressource </p></div></td>"; 
} else {
	echo"<td><div align=\"center\">$neww3ura_ressource </div></td>"; 
}
echo"<td><div align=\"center\">$Total_energie_reste2 / $Total_energie_prod2</div></td>
   </tr>
 </table></form>";
//
////////////////
?>
