<?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(!verifmail('document.frmCo.identifiant',1)){
		return false;
	}
	if(document.frmCo.mdp.value==""){
		alert('Merci de renseigner votre mot de passe.');
		document.frmCo.mdp.focus();
		return false;
	}
	return true;
}	
jQuery(document).ready(function(){
	<?php
	if(isset($_SESSION['msg']) && !empty($_SESSION['msg'])){
		?>
	alert('<?php print addslashes($_SESSION['msg']);?>');
	<?php
		$_SESSION['msg']="";
	}
	?>
	
	document.frmCo.identifiant.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">CFA, lycées professionnels<br />identifiez vous :</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-cfa.php" onSubmit="return valid_co();">
			<div class="titreFrm"></div>
			<div class="labFrm">Email :</div>
			<input type="text" name="identifiant" id="identifiant" /><br />
			<div class="labFrm">Mot de passe : </div>
			<input type="password" name="mdp" id="mdp" /><br />
			<input type="hidden" name="action" value="go_co" />
			<input type="submit" value="Connexion">
		</form>
		<div class="ssTitreViolet"><a href="motdepasse.php">Mot de passe perdu</a></div>
		
	</div>
	
	<?php include('include/footer.php');?>
</body>
</html>