<?php
include ('logue.php'); 
include ('entete2.php');
include ('evolutionbats.php');
include ('siege.php');

$sql = "SELECT pts,ada_lvl,ada_energie,robo_lvl,fer_ressource,or_ressource 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); 

$temps1ada = (432 / 3  * (bcpow(1.4, ($row[ada_lvl]),3)));
if ($row[robo_lvl] == "0") {
$ada_destruction =  strftime("%Y-%m-%d %H:%M:%S", time()+ (round($temps1ada)));
}
else {
$ada_destruction =  strftime("%Y-%m-%d %H:%M:%S", time()+ (round($temps1ada* $siege_temps_evolution * (bcpow(0.9, $row[robo_lvl],3)))));
} 
if($row['ada_lvl'] > 0) {
if ($evolution < 0) {
$sql = "UPDATE matgraph_users SET ada_destruction='$ada_destruction' WHERE id='$planete'";
$res = db_mysql_Query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error()); }}
echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("batiments.php");
-->
</script>';
?>