<?php
include('include/entete.php');
if(isset($_SESSION['cfa_co']) && $_SESSION['cfa_co']==1){
	header('location:index-cfa.php');
		  exit();
}
if(isset($_SESSION['cap_co']) && $_SESSION['cap_co']==1){
	header('location:index-cap.php');
		  exit();
}
?>
<!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>
<link href="css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="css/style.css" rel="stylesheet" type="text/css">
<script>
function valid_co(){
	if(document.frmCo.mdp_first.value==""){
		alert('Merci de renseigner un mot de passe.')
		return false;
	}
	if(document.frmCo.mdp_first.value.length<8){
		alert('Merci de renseigner un mot de passe comportant au moins 8 caractères.')
		return false;
	}
	if(document.frmCo.mdp_first.value!=document.frmCo.mdp_conf.value){
		alert('Votre mot de passe n\est pas confirmé.')
		return false;
	}
	return true;
}	
jQuery(document).ready(function(){
	document.frmCo.mdp_first.focus();
});
</script>
																			
</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 mot de passe : </div>
		<div class="col-lg-2 col-md-2 col-sm-1 hidden-xs bgTitrePage"></div>
		<div class="clearfix"></div>
		<form name="frmCo" id="frmCo" method="post" action="actions-mdp.php" onSubmit="return valid_co();">
			<div class="titreFrm"></div>
			<div class="labFrm">Mot de passe :</div>
			<input type="password" name="mdp_first" id="mdp_first" /><br />
			<div class="labFrm">Confirmation mot de passe :</div>
			<input type="password" name="mdp_conf" id="mdp_conf" /><br />
			<input type="hidden" name="action" value="go_first" />
			<input type="submit" value="Envoyer">
		</form>
		
	</div>
	
	<?php include('include/footer.php');?>
</body>
</html>