= 0) { if ($cristal - ($sa*500) >= 0) { $temps_caserne = time() + ceil($sa*(4680 - (0.1*$chantier_terrestre*4680))); $unit = 8; $metal -= ($sa*1000); $cristal -= ($sa*500); mysql_query("UPDATE user SET unit_t='".$unit."', temps_terrestre='".$temps_caserne."', metal='".$metal."', cristal='".$cristal."' WHERE ID='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_query("UPDATE user SET cons_terrestre='".$sa."', hydrogene='".$hydrogene."' WHERE ID='".$id."' AND galaxy='".$galaxy."' AND pos='".$pos."' AND ss='".$ss."'"); mysql_close(); @header("Location: chantier_terrestre.php"); } else {echo "Pas assez de cristal !";} } else {echo "Pas assez de métal !";} } else { @header("Location: chantier_terrestre.php"); }