<?php include('first.php');
$quotacrash = $donnees['quotacrash'];
$lastreport = $donnees['lastreport'];

if( time() <= $lastreport + "600")
{
$time = "N";
}
elseif( time() >= $lastreport + "600")
{
$time = "Y";
}


if($quotacrash <= "0" OR $time == "N")
		{
			echo '<meta http-equiv="refresh" content="0; URL=serv_crash_fail.php">';
		}
elseif($quotacrash >= "1" AND $time == "Y"){
			$core = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
			<html lang="fr">
			<head>
			  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="content-type">
			<title></title>
			</head>
			<body>
			<div style="text-align: center;"><img
			style="width: 800px; height: 200px;" alt=""
			src="' .$serverurl. 'maintenance/haut.png"><br>
			<br>
			<span
			style="color: rgb(255, 0, 0); font-weight: bold; text-decoration: underline;">Un
			membre &agrave; signal&eacute; votre serveur comme
			crash&eacute;.</span><br>
			Merci de verrifier votre serveur et de le
			r&eacute;activ&eacute; s\'il a bien crash.<br>
			Vous avez re&ccedil;u -1 de votre quota d\'email.<br>
			Vous pouvez lui ajout&eacute; 10 de plus via le panel.<br>
			<br>
			Tr&egrave;s cordialement, Habbixel.</div>
			</body>
			</html>';

			mail($perso_email,
				"Hotel à crashé",
				$core,
				"From: $perso_email\r\n".
				"Reply-To: $perso_email\r\n".
				"Content-Type: text/html; charset=\"iso-8859-1\"\r\n");
			$newsquotacrash = $quotacrash - 1;
			mysql_query('UPDATE systeme SET quotacrash=\'' . $newsquotacrash . '\', lastreport="' . time() . '"');
			mysql_query("INSERT INTO habcontrol VALUES('', '<b><font color=\"#993366\">[CRASH]</font></b> Un crash a etait signaler.', '" . time() . "')");
			echo '<meta http-equiv="refresh" content="0; URL=serv_crash_ok.php">';
}
else
		{
			echo '<meta http-equiv="refresh" content="0; URL=serv_crash_error.php">';
		}
?>