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

//echo "<pre>";print_r($_SESSION);echo "</pre>";

if(isset($_GET['id_cv'])){
	$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_GET['id_cv']."' AND id_auditeur = '".$_SESSION['user']['id']."' ");
	if(dbnumrows($sql)>0){
		$_SESSION['user']['id_cv'] = $_GET['id_cv'];
	}
	else{
		Header("Location: /espace_personnel/eleve/cv/index.php?alert=".urlencode('Il y a une erreur, veuillez réessayer')."");
		exit();
	}
}

$sql = dbquery("SELECT * FROM cv_diplomes WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");
$sql = dbquery("SELECT * FROM cv_experiences WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");


?>


<style>

.tabs-2{
	margin:30px 0;
	}

.tabs-2 li{
	list-style:none;
	display:inline-block;
	}

.tabs-2 li a{
	border:1px solid #ddd;
	padding:0 15px;
	height:40px;
	line-height:40px;
	display:inline-block;
	}

.tabs-2 li a:hover,.tabs-2 a.current{
	text-decoration:none !important;
	background: #c1002a;
	color:#fff !important;
	border:1px solid #80001c;
}

img{vertical-align:middle;}

</style>

<!-- Overlay -->
	<div class="apple_overlay" id="overlay_cv_form" style="max-height:80%;overflow:auto;">
		<div class="contentWrap"></div>
	</div>

<!-- the tabs -->
<ul class="tabs-2">
  <li><a href="#1">Informations générales</a></li>
  <li><a href="#2">Diplômes</a></li>
  <li><a href="#3">Expériences</a></li>
  <li><a href="#4">Compétences</a></li>
  <li><a href="#5">Aperçu</a></li>
</ul>
 
<!-- tab "panes" -->
<div class="panes-2">

	<!-- INFOS GENERALES -->
	<div>
		
		<?php
		$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");

		$nom_cv					= dbresult_utf8($sql,0,"nom_cv");
		$permis_b				= dbresult_utf8($sql,0,"permis");
		$vehicule				= dbresult_utf8($sql,0,"vehicule");
		$autre_permis			= dbresult_utf8($sql,0,"autre_permis");
		$langue1				= dbresult_utf8($sql,0,"langue1");
		$pratique1				= dbresult_utf8($sql,0,"pratique1");
		$niveau1				= dbresult_utf8($sql,0,"niveau1");
		$langue2				= dbresult_utf8($sql,0,"langue2");
		$pratique2				= dbresult_utf8($sql,0,"pratique2");
		$niveau2				= dbresult_utf8($sql,0,"niveau2");
		$langue3				= dbresult_utf8($sql,0,"langue3");
		$pratique3				= dbresult_utf8($sql,0,"pratique3");
		$niveau3				= dbresult_utf8($sql,0,"niveau3");
		$sport1					= dbresult_utf8($sql,0,"sport1");
		$sport2					= dbresult_utf8($sql,0,"sport2");
		$sport3					= dbresult_utf8($sql,0,"sport3");
		$loisir1				= dbresult_utf8($sql,0,"loisir1");
		$loisir2				= dbresult_utf8($sql,0,"loisir2");
		$loisir3				= dbresult_utf8($sql,0,"loisir3");
		$autres					= dbresult_utf8($sql,0,"autres");

		$null = '<i class="lighter">Non renseigné</i>';
		
		// SELECT

			// YES or NO
			$_SELECT['YoN']['0'] = "Non";
			$_SELECT['YoN']['1'] = "Oui";

			// Langue
			$select_langue1 = str_replace('value="'.$langue1.'"','value="'.$langue1.'" selected ',$_SELECT['select']['langue1']);
			$select_langue2 = str_replace('value="'.$langue2.'"','value="'.$langue2.'" selected ',$_SELECT['select']['langue2']);
			$select_langue3 = str_replace('value="'.$langue3.'"','value="'.$langue3.'" selected ',$_SELECT['select']['langue3']);

			// Pratique
			$select_pratique1 = str_replace('value="'.$pratique1.'"','value="'.$pratique1.'" selected ',$_SELECT['select']['pratique1']);
			$select_pratique2 = str_replace('value="'.$pratique2.'"','value="'.$pratique2.'" selected ',$_SELECT['select']['pratique2']);
			$select_pratique3 = str_replace('value="'.$pratique3.'"','value="'.$pratique3.'" selected ',$_SELECT['select']['pratique3']);

			// Niveau
			$select_niveau1 = str_replace('value="'.$niveau1.'"','value="'.$niveau1.'" selected ',$_SELECT['select']['niveau1']);
			$select_niveau2 = str_replace('value="'.$niveau2.'"','value="'.$niveau2.'" selected ',$_SELECT['select']['niveau2']);
			$select_niveau3 = str_replace('value="'.$niveau3.'"','value="'.$niveau3.'" selected ',$_SELECT['select']['niveau3']);

		?>

		<span class="red smaller">Cliquez sur un champ pour pouvoir le modifier</span><br><br><br>

		<a class="tooltip-trigger" id="tip_nom_cv"><label>Nom du Cv : </label><?php echo $nom_cv?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_nom_cv">x</a>
			<form action="update_cv.php" method="POST">
				Nom du Cv : <input type="text" name="nom_cv" value="<?php echo $nom_cv?>" maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
				
		<a class="tooltip-trigger" id="tip_permis"><label><br>Permis B : </label><?php if($permis_b == '')	echo $null;else echo $_SELECT['YoN'][$permis_b]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_permis">x</a>
			<form action="update_cv.php" method="POST">
				Permis B : 
				<select name="permis">
					<option value="0" <?php if($permis_b == "0") echo 'selected';?>>Non</option>
					<option value="1" <?php if($permis_b == "1") echo 'selected';?>>Oui</option>
				</select>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
				
		<a class="tooltip-trigger" id="tip_vehicule"><label>Véhicule : </label><?php if($vehicule == '')	echo $null;else echo $_SELECT['YoN'][$vehicule]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_vehicule">x</a>
			<form action="update_cv.php" method="POST">
				Véhicule : 
				<select name="vehicule">
					<option value="0" <?php if($vehicule == "0") echo 'selected';?>>Non</option>
					<option value="1" <?php if($vehicule == "1") echo 'selected';?>>Oui</option>
				</select>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	
		<a class="tooltip-trigger" id="tip_autre_permis"><label>Autre permis : </label><?php if($autre_permis == '')	echo $null;else echo $autre_permis?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_autre_permis">x</a>
			<form action="update_cv.php" method="POST">
				Autre permis : <input type="text" name="autre_permis" value="<?php echo $autre_permis ?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	
		<a class="tooltip-trigger" id="tip_langue1"><label><br>Langue 1 : </label><?php if($langue1 == 'null')	echo $null;else echo $_TAB['langue'][$langue1]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_langue1">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_langue1;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
				
		<a class="tooltip-trigger" id="tip_pratique1"><label><br>Pratique : </label><?php if($pratique1 == 'null')	echo $null;else echo $_TAB['pratique'][$pratique1]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_pratique1">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_pratique1;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_niveau1"><label><br>Niveau : </label><?php if($niveau1 == 'null')	echo $null;else echo $_TAB['niveau'][$niveau1]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_niveau1">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_niveau1;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>

		<a class="tooltip-trigger" id="tip_langue2"><label><br>Langue 2 : </label><?php if($langue2 == 'null')	echo $null;else echo $_TAB['langue'][$langue2]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_langue2">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_langue2;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
				
		<a class="tooltip-trigger" id="tip_pratique2"><label><br>Pratique : </label><?php if($pratique2 == 'null')	echo $null;else echo $_TAB['pratique'][$pratique2]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_pratique2">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_pratique2;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_niveau2"><label><br>Niveau : </label><?php if($niveau2 == 'null')	echo $null;else echo $_TAB['niveau'][$niveau2]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_niveau2">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_niveau2;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>

		<a class="tooltip-trigger" id="tip_langue3"><label><br>Langue 3 : </label><?php if($langue3 == 'null')	echo $null;else echo $_TAB['langue'][$langue3]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_langue3">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_langue3;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
				
		<a class="tooltip-trigger" id="tip_pratique3"><label><br>Pratique : </label><?php if($pratique3 == 'null')	echo $null;else echo $_TAB['pratique'][$pratique3]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_pratique3">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_pratique3;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_niveau3"><label><br>Niveau : </label><?php if($niveau3 == 'null')	echo $null;else echo $_TAB['niveau'][$niveau3]?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_niveau3">x</a>
			<form action="update_cv.php" method="POST">
				<?php echo $select_niveau3;?>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	
	
		<a class="tooltip-trigger" id="tip_sport1"><label><br>Sport 1 : </label><?php if( $sport1 == '' )	echo $null;else echo $sport1?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_sport1">x</a>
			<form action="update_cv.php" method="POST">
				Sport 1 : <input type="text" name="sport1" value="<?php echo $sport1?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_sport2"><label><br>Sport 2 : </label><?php if( $sport2 == '' )	echo $null;else echo $sport2?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_sport2">x</a>
			<form action="update_cv.php" method="POST">
				Sport 2 : <input type="text" name="sport2" value="<?php echo $sport2?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_sport3"><label><br>Sport 3 : </label><?php if( $sport3 == '' )	echo $null;else echo $sport3?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_sport3">x</a>
			<form action="update_cv.php" method="POST">
				Sport 3 : <input type="text" name="sport3" value="<?php echo $sport3?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	
		<a class="tooltip-trigger" id="tip_loisir1"><label><br>Loisir 1 : </label><?php if( $loisir1 == '' )	echo $null;else echo $loisir1?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_loisir1">x</a>
			<form action="update_cv.php" method="POST">
				Loisir 1 : <input type="text" name="loisir1" value="<?php echo $loisir1?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_loisir2"><label><br>Loisir 2 : </label><?php if( $loisir2 == '' )	echo $null;else echo $loisir2?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_loisir2">x</a>
			<form action="update_cv.php" method="POST">
				Loisir 2 : <input type="text" name="loisir2" value="<?php echo $loisir2?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br>
	
		<a class="tooltip-trigger" id="tip_loisir3"><label><br>Loisir 3 : </label><?php if( $loisir3 == '' )	echo $null;else echo $loisir3?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_loisir3">x</a>
			<form action="update_cv.php" method="POST">
				Loisir 3 : <input type="text" name="loisir3" value="<?php echo $loisir3?>"  maxlength="30" />
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	
		<a class="tooltip-trigger" id="tip_autres"><label><br>Autres : </label><?php if( $autres == '' )	echo $null;else echo $autres?></a>
		<div class="tooltip">
			<a class="close-tooltip" rel="tip_autres">x</a>
			<form action="update_cv.php" method="POST">
				<textarea name="autres" style="width:280px;height:50px;"><?php echo $autres;?></textarea><br><br>
				<input type="submit" value="OK" class="bg-red"/>
			</form>
		</div>
		<br><br>
	</div>


		
		<?php
		/*
		$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");

		$_DATA[1]['nom_cv']					= dbresult_utf8($sql,0,"nom_cv");
		$_DATA[1]['permis']					= dbresult_utf8($sql,0,"permis");
		$_DATA[1]['vehicule']				= dbresult_utf8($sql,0,"vehicule");
		$_DATA[1]['autre_permis']			= dbresult_utf8($sql,0,"autre_permis");
		$_DATA[1]['langue1']				= dbresult_utf8($sql,0,"langue1");
		$_DATA[1]['pratique1']				= dbresult_utf8($sql,0,"pratique1");
		$_DATA[1]['niveau1']				= dbresult_utf8($sql,0,"niveau1");
		$_DATA[1]['langue2']				= dbresult_utf8($sql,0,"langue2");
		$_DATA[1]['pratique2']				= dbresult_utf8($sql,0,"pratique2");
		$_DATA[1]['niveau2']				= dbresult_utf8($sql,0,"niveau2");
		$_DATA[1]['langue3']				= dbresult_utf8($sql,0,"langue3");
		$_DATA[1]['pratique3']				= dbresult_utf8($sql,0,"pratique3");
		$_DATA[1]['niveau3']				= dbresult_utf8($sql,0,"niveau3");
		$_DATA[1]['sport1']					= dbresult_utf8($sql,0,"sport1");
		$_DATA[1]['sport2']					= dbresult_utf8($sql,0,"sport2");
		$_DATA[1]['sport3']					= dbresult_utf8($sql,0,"sport3");
		$_DATA[1]['loisir1']				= dbresult_utf8($sql,0,"loisir1");
		$_DATA[1]['loisir2']				= dbresult_utf8($sql,0,"loisir2");
		$_DATA[1]['loisir3']				= dbresult_utf8($sql,0,"loisir3");
		$_DATA[1]['autres']					= dbresult_utf8($sql,0,"autres");

		$_DATA['label']['nom_cv']			= 'Nom du Cv';
		$_DATA['label']['permis']			= '<br>Permis B';
		$_DATA['label']['vehicule']			= 'Véhicule';
		$_DATA['label']['autre_permis']		= 'Autre permis';

		$_DATA['label']['langue1']			= '<br>Langue 1';
		$_DATA['label']['pratique1']		= 'Pratique langue 1';
		$_DATA['label']['niveau1']			= 'Niveau langue 1';

		$_DATA['label']['langue2']			= '<br>Langue 2';
		$_DATA['label']['pratique2']		= 'Pratique langue 2';
		$_DATA['label']['niveau2']			= 'Niveau langue 2';

		$_DATA['label']['langue3']			= '<br>Langue 3';
		$_DATA['label']['pratique3']		= 'Pratique langue 3';
		$_DATA['label']['niveau3']			= 'Niveau langue 3';

		$_DATA['label']['sport1']			= '<br>Sport 1';
		$_DATA['label']['sport2']			= 'Sport 2';
		$_DATA['label']['sport3']			= 'Sport 3';

		$_DATA['label']['loisir1']			= '<br>Loisir 1';
		$_DATA['label']['loisir2']			= 'Loisir 2';
		$_DATA['label']['loisir3']			= 'Loisir 3';

		$_DATA['label']['autres']			= '<br>Autres';

		$_DATA['type']['nom_cv']			= 'text';
		$_DATA['type']['permis']			= 'select';
		$_DATA['type']['vehicule']			= 'select';
		$_DATA['type']['autre_permis']		= 'text';
		$_DATA['type']['langue1']			= 'select';
		$_DATA['type']['pratique1']			= 'select';
		$_DATA['type']['niveau1']			= 'select';
		$_DATA['type']['langue2']			= 'select';
		$_DATA['type']['pratique2']			= 'select';
		$_DATA['type']['niveau2']			= 'select';
		$_DATA['type']['langue3']			= 'select';
		$_DATA['type']['pratique3']			= 'select';
		$_DATA['type']['niveau3']			= 'select';
		$_DATA['type']['sport1']			= 'text';
		$_DATA['type']['sport2']			= 'text';
		$_DATA['type']['sport3']			= 'text';
		$_DATA['type']['loisir1']			= 'text';
		$_DATA['type']['loisir2']			= 'text';
		$_DATA['type']['loisir3']			= 'text';
		$_DATA['type']['autres']			= 'textarea';
		
		for($i=1;$i<2;$i++){

			$data = "";

			foreach($_DATA[$i] as $key => $value){

				require($_SERVER['DOCUMENT_ROOT'].'/espace_personnel/php/form_settings.php');
			
				// POP UP
				$data .= '
					<a class="tooltip-trigger" id="tip_'.$key.'"><label>'.$_DATA['label'][$key].' : </label>'.$value.'</a>
					<div class="tooltip">
						<a class="close-tooltip" rel="tip_'.$key.'">x</a>
						<form action="update_cv.php" method="POST">
							<input type="hidden" name="'.$key.'_type" value="'.$_DATA['type'][$key].'"/>'.$field.'<input type="submit" value="OK" class="bg-red"/>
						</form>
					</div>
					<br><br>
				';
			}
		}

		echo $data;
		*/
	?>



<!-- Diplomes -->
	<div>
		<a class="bloc bloc-small bg-green overlay-ajax" rel="#overlay_cv_form" href="update_diplome_form.php" ><p><span>Ajouter un<br>diplôme</span></p></a>

		<h1 class="clearfloat"><br>Diplôme(s) déjà enregistré(s) :</h1>

		<?php
		$sql = dbquery("SELECT * FROM cv_diplomes WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");

		if(dbnumrows($sql) == 0)
			echo "Aucun diplôme enregistré";
		else{
			echo '
				<table>
					<tr>
						<th class="align-left">Diplôme</th>
						<th style="width:10%">Modifier</th>
						<th style="width:10%">Supprimer</th>
					</tr>
			';

			for($i=0;$i<dbnumrows($sql);$i++){
				$id_diplome			= dbresult_utf8($sql,$i,"id_diplome_cv");
				$annee				= dbresult_utf8($sql,$i,"annee_obtention");
				$intitule			= dbresult_utf8($sql,$i,"intitule");

				echo'
					<tr>
						<td class="align-left"><b>'.$annee.' : </b>'.$intitule.'</td>
						<td><a class="overlay-ajax" rel="#update_diplome_form" href="update_diplome_form.php?id_diplome='.$id_diplome.'"><img src="/espace_personnel/images/process.png" /></a></td>
						<td><a class="overlay-ajax" rel="#delete_diplome_confirm" href="delete_diplome_confirm.php?id_diplome='.$id_diplome.'"><img src="/espace_personnel/images/remove.png" /></a></td>
					</tr>
				';
			}
			
			echo '
				</table>
				<div class="apple_overlay" id="update_diplome_form">
					<div class="contentWrap"></div>
				</div>
				<div class="apple_overlay" id="delete_diplome_confirm">
					<div class="contentWrap"></div>
				</div>
			';
		
		}
		?>
	</div>

<!-- Experiences -->
	<div>
		<a class="bloc bloc-small bg-green overlay-ajax" rel="#overlay_cv_form" href="update_experience_form.php" ><p><span>Ajouter une<br>expérience</span></p></a>

		<h1 class="clearfloat"><br>Expérience(s) déjà enregistrée(s) :</h1>

		<?php
		$sql = dbquery("SELECT * FROM cv_experiences WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");

		if(dbnumrows($sql) == 0)
			echo "Aucune expérience enregistrée";
		else{
			echo '
				<table>
					<tr>
						<th class="align-left">Expérience</th>
						<th style="width:10%">Modifier</th>
						<th style="width:10%">Supprimer</th>
						<th style="width:10%"><a title="">Exp. à mettre en avant (?)</a></th>
					</tr>
			';

			for($i=0;$i<dbnumrows($sql);$i++){
				$id_experience			= dbresult_utf8($sql,$i,"id_experience_cv");
				$entreprise				= dbresult_utf8($sql,$i,"entreprise");
				$fonction				= dbresult_utf8($sql,$i,"fonction");
				$affichage_recherche	= dbresult_utf8($sql,$i,"affichage_recherche");

				if($affichage_recherche == 1)	$checked = "checked";
				else							$checked = "";

				echo'
					<tr>
						<td class="align-left"><b>'.$entreprise.' : </b>'.$fonction.'</td>
						<td><a class="overlay-ajax" rel="#update_experience_form" href="update_experience_form.php?id_experience='.$id_experience.'"><img src="/espace_personnel/images/process.png" /></a></td>
						<td><a class="overlay-ajax" rel="#delete_experience_confirm" href="delete_experience_confirm.php?id_experience='.$id_experience.'"><img src="/espace_personnel/images/remove.png" /></a></td>
						<td><input name="affichage_recherche" class="radio-exp" type="radio" value="'.$id_experience.'" '.$checked.'/></td>
					</tr>
				';
			}
			
			

			echo '
				</table>
				<div class="apple_overlay" id="update_experience_form">
					<div class="contentWrap"></div>
				</div>
				<div class="apple_overlay" id="delete_experience_confirm">
					<div class="contentWrap"></div>
				</div>
			';
		
		}
		?>

	</div>

<!-- Compétences -->
	<div>
		<a class="bloc bloc-small bg-green overlay-ajax" rel="#overlay_cv_form" href="update_competence_form.php" ><p><span>Ajouter une<br>compétence</span></p></a>

		<h1 class="clearfloat"><br>Compétence(s) déjà enregistrée(s) :</h1>

		<?php
		$sql = dbquery("SELECT * FROM cv_competences WHERE id_cv = '".$_SESSION['user']['id_cv']."' ");

		if(dbnumrows($sql) == 0)
			echo "Aucune compétence enregistrée";
		else{
			echo '
				<table>
					<tr>
						<th class="align-left">Compétence</th>
						<th style="width:10%">Modifier</th>
						<th style="width:10%">Supprimer</th>
					</tr>
				';
			for($i=0;$i<dbnumrows($sql);$i++){
				$id_competence		= dbresult($sql,$i,"id_competence_cv");
				$intitule			= dbresult($sql,$i,"intitule");
				$description		= dbresult($sql,$i,"description");

				echo'
					<tr>
						<td class="align-left"><b>'.$intitule.' : </b>'.$description.'</td>
						<td><a class="overlay-ajax" rel="#overlay_cv_form" href="update_competence_form.php?id_competence='.$id_competence.'"><img src="/espace_personnel/images/process.png" /></a></td>
						<td><a class="overlay-ajax" rel="#overlay_cv_form" href="delete_competence_confirm.php?id_competence='.$id_competence.'"><img src="/espace_personnel/images/remove.png" /></a></td>
					</tr>
				';
			}
			
			

			echo '
				</table>
				
			';
		
		}
		?>
	</div>

	<div>
	 <?php require($_SERVER['DOCUMENT_ROOT'].'/espace_personnel/eleve/cv/apercu_cv.php');?>
	</div>

</div>

<script>

	$(function() {
		$(".radio-exp").click(function(){
			var id_experience = $(this).val();
		
			alert(id_experience);

			$.ajax({
				cache:		false,
				type:		"GET",
				url:		"update_experience_radio.php",
				data:		{ id_experience: id_experience},
				success:	function(response){				
								//alert(response);
							}
			});


		});
	});

 $(function() {
  $("ul.tabs-2").tabs("div.panes-2 > div", {effect: 'fade'});
  });

 </script>

<?php
require_once($_SERVER['DOCUMENT_ROOT'].'/espace_personnel/inc/end.php');
?>