= 0) { if ($cristal - ($sa*300) >= 0) { $temps_caserne = time() + ceil($sa*(720 - (0.1*$chantier_terrestre*720))); $unit = 1; $metal -= ($sa*500); $cristal -= ($sa*300); 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"); }