<?php
//echo "<pre>";print_r($_GET);echo "</pre>";

$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_GET['id_cv']."' ");

$id_cv					= dbresult($sql,0,"id_cv");
$id_auditeur			= dbresult($sql,0,"id_auditeur");
$langue1				= dbresult($sql,0,"langue1");
$pratique1				= dbresult($sql,0,"pratique1");
$langue2				= dbresult($sql,0,"langue2");
$pratique2				= dbresult($sql,0,"pratique2");
$langue3				= dbresult($sql,0,"langue3");
$pratique3				= dbresult($sql,0,"pratique3");

// CSS
?>	


<style>
hr{height:5px;background:#fff;border:0;border-bottom:1px solid #ddd;margin-top:10px;}
</style>


<?php
// COMPÉTENCES

	$sql = dbquery("SELECT * FROM cv_competences WHERE id_cv = '".$_GET['id_cv']."' ");

	if(dbnumrows($sql) >0){

		echo '<hr><h1>Compétence(s) : </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){
			$intitule			= dbresult($sql,$i,"intitule");
			$description		= dbresult($sql,$i,"description");
			echo"<b>- ".$intitule."</b><br>".$description."<br><br>";
		}
	}


// EXPÉRIENCES
	
	$sql = dbquery("SELECT * FROM cv_experiences WHERE id_cv = '".$_GET['id_cv']."' ORDER BY date_debut DESC");

	if(dbnumrows($sql) > 0){

		echo '<hr><h1>Expérience(s) professionnelle(s): </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){
			$entreprise			 = dbresult($sql,$i,'entreprise');
			$secteur			 = dbresult($sql,$i,'secteur_activite');
			$taille				 = dbresult($sql,$i,'taille_entreprise');
			$fonction			 = dbresult($sql,$i,'fonction');
			$csp				 = dbresult($sql,$i,'csp');
			$date_debut			 = dbresult($sql,$i,'date_debut');
			$date_fin			 = dbresult($sql,$i,'date_fin');
			$lieu				 = dbresult($sql,$i,'lieu');
			$descriptif			 = dbresult($sql,$i,'descriptif');

			echo"<b>De".$fonction."</b><br>".$entreprise."<br><br>";
		}
	}


// DIPLOMES
	
	$sql = dbquery("SELECT * FROM cv_diplomes WHERE id_cv = '".$_GET['id_cv']."' ORDER BY annee_obtention DESC");

	if(dbnumrows($sql) > 0){

		echo '<hr><h1>Diplôme(s) : </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){
				$type				= dbresult($sql,$i,'type');
				$code_diplome		= dbresult($sql,$i,'code_diplome');
				$specialite			= dbresult($sql,$i,'specialite');
				$etablissement		= dbresult($sql,$i,'etablissement');
				$intitule			= dbresult($sql,$i,'intitule');
				$lieu_delivrance	= dbresult($sql,$i,'lieu_delivrance');
				$annee_obtention	= dbresult($sql,$i,'annee_obtention');

			echo"<b>".$annee_obtention."</b><br>".$intitule."<br><br>";
		}
	}

// LANGUES ETRANGERES

	$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_GET['id_cv']."' AND (langue1 <> '' OR langue2 <> '' OR langue3 <> '' )");
	
	if(dbnumrows($sql) > 0){

		echo '<hr><h1>Langue(s) étrangère(s) pratiquée(s) : </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){		
			$langue1				= dbresult($sql,0,"langue1");
			$pratique1				= dbresult($sql,0,"pratique1");
			$langue2				= dbresult($sql,0,"langue2");
			$pratique2				= dbresult($sql,0,"pratique2");
			$langue3				= dbresult($sql,0,"langue3");
			$pratique3				= dbresult($sql,0,"pratique3");

			if($langue1 <> '')		echo $langue1.' - '.$_SELECT['pratique1'][$pratique1].'<br><br>';
			if($langue2 <> '')		echo $langue2.' - '.$_SELECT['pratique1'][$pratique2].'<br><br>';
			if($langue3 <> '')		echo $langue3.' - '.$_SELECT['pratique1'][$pratique3].'<br><br>';
		}
	}

// SPORTS

	$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_GET['id_cv']."' AND (sport1 <> '' OR sport2 <> '' OR sport3 <> '' )");
	
	if(dbnumrows($sql) > 0){

		echo '<hr><h1>Sport(s) pratiqué(s) : </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){
			$sport1				= dbresult($sql,0,"sport1");
			$sport2				= dbresult($sql,0,"sport2");
			$sport3				= dbresult($sql,0,"sport3");

			if($sport1 <> '')		echo $sport1.'<br><br>';
			if($sport2 <> '')		echo $sport2.'<br><br>';
			if($sport3 <> '')		echo $sport3.'<br><br>';
		}
	}

// LOISIRS

	$sql = dbquery("SELECT * FROM cv_auditeurs WHERE id_cv = '".$_GET['id_cv']."' AND (loisir1 <> '' OR loisir2 <> '' OR loisir3 <> '' )");
	
	if(dbnumrows($sql) > 0){

		echo '<hr><h1>Loisir(s): </h1>';

		for($i=0;$i<dbnumrows($sql);$i++){
			$loisir1				= dbresult($sql,0,"loisir1");
			$loisir2				= dbresult($sql,0,"loisir2");
			$loisir3				= dbresult($sql,0,"loisir3");

			if($loisir1 <> '')		echo $loisir1.'<br><br>';
			if($loisir2 <> '')		echo $loisir2.'<br><br>';
			if($loisir3 <> '')		echo $loisir3.'<br><br>';
		}
	}
?>
