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

$id = $_POST["id"];


$req = "SELECT * FROM matgraph_multiencours WHERE id=$id";
$res = mysql_query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$row = mysql_fetch_array($res);

$requete = "UPDATE matgraph_multi SET connection_multi = 0, alerte_multi = 0, nbre_passer = nbre_passer + 1  WHERE id='$row[idmulti]'";
$resultat = mysql_query($requete)or die('erreur sql<br>'.$requete.'<br>'.mysql_error());

$req = "SELECT joueur1,joueur2 FROM matgraph_multi WHERE id=$row[idmulti]";
$res = mysql_query($req) or die('Erreur SQL! <br>'.$req.'<br>'.mysql_error());
$row = mysql_fetch_array($res);

$req3 = "SELECT login FROM matgraph_users WHERE id=$row[joueur1]";
$res3 = mysql_query($req3) or die('Erreur SQL! <br>'.$req3.'<br>'.mysql_error());
$row3 = mysql_fetch_array($res3);

$req4 = "SELECT login FROM matgraph_users WHERE id=$row[joueur2]";
$res4 = mysql_query($req4) or die('Erreur SQL! <br>'.$req4.'<br>'.mysql_error());
$row4 = mysql_fetch_array($res4);


$sql4 = "INSERT INTO `matgraph_logadmin` ( `id` , `mdj` , `date` , `action` )
				VALUES (
				'', '".$login."', now(), 'Oubli push/multi | ".addslashes($row3[login])." & ".addslashes($row4[login])."'
				)";
$res4 = mysql_query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());

$sql4 = "DELETE FROM matgraph_multiencours WHERE id = $id";
$res4 = mysql_query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());

echo '<script language="javascript" type="text/javascript">
<!--
window.location.replace("multi_comptes.php");
-->
</script>';

?>