<?	
$id = $_POST["id"];

$sql = "SELECT * FROM matgraph_guerre WHERE id = $id";
$res = mysql_query($sql)or die('erreur sql<br>'.$sql.'<br>'.mysql_error());
$row = mysql_fetch_array($res);

$req2 = "SELECT nom FROM matgraph_ally WHERE id = '".$row['alliance1']."'";
$res2 = mysql_query($req2) or die('Erreur SQL! <br>'.$req2.'<br>'.mysql_error());
$row2 = mysql_fetch_array($res2);

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

$sql4 = "INSERT INTO `matgraph_logadmin` ( `id` , `mdj` , `date` , `action` )
				VALUES (
				'', '".$login."', now(), 'Supr guerre | ".addslashes($row2['nom'])."(".$row['alliance1'].") Vs ".addslashes($row3['nom'])."(".$row['alliance2'].") | Deb :".$row['date_debut']."'
				)";
$res4 = mysql_query($sql4)or die('erreur sql<br>'.$sql4.'<br>'.mysql_error());

$sql4 = "DELETE FROM matgraph_guerre 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("index.php?action=guerre");
-->
</script>';
?>