<?php
require($_SERVER['DOCUMENT_ROOT'].'/espace_personnel/inc/head-lib.php');

// Vérification que le CV appartient bien à l'auditeur 

$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_auditeur = '".$_SESSION['user']['id']."' AND id_cv = '".$_GET['id_cv']."'  ");

if(dbnumrows($sql) == 0){
	Header("Location: /espace_personnel/eleve/cv/index.php?alert=".urlencode('L\'opération a échoué.')." ");
}
else{
	dbquery("DELETE FROM cv_auditeurs	 WHERE id_cv = '".$_GET['id_cv']."' ");
	dbquery("DELETE FROM cv_experiences	 WHERE id_cv = '".$_GET['id_cv']."' ");
	dbquery("DELETE FROM cv_competences	 WHERE id_cv = '".$_GET['id_cv']."' ");
	dbquery("DELETE FROM cv_diplomes	 WHERE id_cv = '".$_GET['id_cv']."' ");
	Header("Location: /espace_personnel/eleve/cv/index.php");
}

?>