= 0) { if ($cristal - ($sa*240) >= 0) { $temps_caserne = time() + ceil($sa*(600 - (0.1*$chantier_terrestre*600))); $unit = 5; $metal -= ($sa*400); $cristal -= ($sa*240); 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"); }