<?php
include('include/entete.php');
include('include/entete_cfa.php');
include('config/config.inc.php');
include('config/lib.inc.php');

$maCleDeCryptage = getCleDeCryptage();	

	$query="select * from eta where id_eta=:num_eta";
	$db = connect_base();
	$queryRequest = $db->prepare( $query );
	$queryRequest->bindParam( ':num_eta', $_SESSION['cfa_num'], PDO::PARAM_INT );
	$queryRequest->execute();
	$data=$queryRequest->fetchAll();

?>
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>FAFIH - DECIDAY</title>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/fonctions.js"></script>
<script type="text/javascript" src="js/wysiwyg.js"></script>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
	<style>
#editeur{
    width: 100%;
    height: 200px; 
    border: 1px solid black; 
    padding: 5px;
    overflow: auto;
}
		.contentPage form input {margin-bottom: 2px !important;}
	</style>

</head>

<body>
	
	<?php include('include/header.php');?>
	
	<div class="container contentPage">
		
		<div class="col-lg-2 col-md-2 col-sm-1 hidden-xs bgTitrePage"></div>
		<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12 titreContenuPage">Votre espace référent</div>
		<div class="col-lg-2 col-md-2 col-sm-1 hidden-xs bgTitrePage"></div>
		<div class="clearfix"></div>
	
		<div class="headerCap" style="text-align: center; margin:18px 0 12px;">
			<span class="ssTitreViolet"><?php echo decrypter($maCleDeCryptage,$data[0]['nom_eta']);?></span><br />
			<span style="font-size: 0.9em;">
			<?php 
				echo decrypter($maCleDeCryptage,$data[0]['adresse1']); 
				if(!empty($data[0]['adresse2']))	echo ' - '.decrypter($maCleDeCryptage,$data[0]['adresse2']); 
				echo ' - '.decrypter($maCleDeCryptage,$data[0]['cp']).' '.decrypter($maCleDeCryptage,$data[0]['ville']); 
			?>
			</span><br />
			<b>Référent : </b><?php echo decrypter($maCleDeCryptage,$data[0]['nom_ref']);?> <a href="modifier-referent.php">modifier</a><br />
			<a href="deco.php">Déconnexion</a></div>

		
		<div class="menuPage">
			<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
				<a href="index-cfa.php">Vos trinômes</a>
			</div>
			<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
				<a href="bao-cfa.php">Boite à outils</a>
			</div>
			<div class="col-lg-4 col-md-4 col-sm-12 col-xs-12">
				<a href="po-cfa.php">Portes ouvertes</a>
			</div>
			<div class="clearfix"></div>
		</div>
		
		<div class="col-lg-2 col-md-2 col-sm-1 hidden-xs"></div>
		<div class="col-lg-8 col-md-8 col-sm-10 col-xs-12 titreContenuPage">Ajouter une Journée Portes Ouvertes</div>
		<div class="col-lg-2 col-md-2 col-sm-1 hidden-xs"></div>
		<div class="clearfix"></div>
		
		<div class="textIntro"><br/>En qualité de référent de votre établissement, vous avez la possibilité d'ajouter une ou plusieurs journées portes ouvertes en renseignant le champs ci-desous.
		</div>
		<div class="clearfix"></div>
		
		<form name="jpo-form" id="jpo-form" method="post" action="traitement-jpo.php" onsubmit="return getContent()">
				<div class="form-row">
					<div class="col-lg-offset-2 col-lg-8 col-md-12 col-sm-12 text-left">
						<input type="hidden" name="action" value="go_jpo" />
						<label for="detailsJpo" >Définir vos journées portes ouvertes</label><br/><br/>
						
						<input type="button" value="G" style="font-weight:bold;" onClick="commande('bold');" title="Gras" /> 
	    				<input type="button" value="I" style="font-style:italic;" onClick="commande('italic');" title="Italique" /> 
						<input type="button" value="S" style="text-decoration:underline;" onClick="commande('underline');" title="Souligné" />  
						<div id="editeur"  class="form-control" required contentEditable ></div>
						<textarea id="detailsJpo" name="detailsJpo" class="hidden"></textarea>						
					</div>
				</div>
				<div class="clearfix"></div>
				<div class="col-lg-offset-8 col-lg-2">
					<br/>
					<button class="btn btn-block" type="submit">Envoyer</button>
				</div>
				<div class="clearfix"></div>
			</form>			
	</div>
	
	<?php include('include/footer.php');?>

</body>
</html>