Пример #1
0
	$date_absence_eleve_fin = isset ($_POST['date_absence_eleve_fin']) ? $_POST['date_absence_eleve_fin'] : NULL;
	$dt_date_absence_eleve_debut = new DateTime(str_replace("/", ".", $date_absence_eleve_debut));
	$dt_date_absence_eleve_fin = new DateTime(str_replace("/", ".", $date_absence_eleve_fin));
	$dt_date_absence_eleve_debut->setTime(0, 0, 0);
	$dt_date_absence_eleve_fin->setTime(23, 59, 59);
	$inverse_date=false;
	if($dt_date_absence_eleve_debut->format("U")>$dt_date_absence_eleve_fin->format("U")){
	  $date2=clone $dt_date_absence_eleve_fin;
	  $dt_date_absence_eleve_fin= $dt_date_absence_eleve_debut;
	  $dt_date_absence_eleve_debut= $date2;
	  $inverse_date=true;
	}
	$_SESSION['statJustifie']['date_absence_eleve_debut'] = serialize($dt_date_absence_eleve_debut->format('d/m/Y'));
	$_SESSION['statJustifie']['date_absence_eleve_fin'] = serialize($dt_date_absence_eleve_fin->format('d/m/Y'));
	// on recherche les élèves
	$eleve_col = getEleves();
	if ($eleve_col->isEmpty()) {
	  unset ($_SESSION['statJustifie']);
	  die("Aucun élève trouvé.");
	}
	$_SESSION['statJustifie']['eleve_col'] = serialize($eleve_col);
	// on initialise le parcours du tableau
	$_SESSION['statJustifie']['dernierePosition'] = -1;
	// on récupère le type de statistique
	$donneeBrut = $_POST['donneeBrut'];
	$_SESSION['statJustifie']['donneeBrut'] = $donneeBrut;
	// on affiche la page de chargement
	afficheChargement($_SESSION['statJustifie']['dernierePosition'], count($eleve_col));

  } elseif ($_POST['valide'] == "csv") {
  /***** On crée et envoie un fichier .csv *****/
include_once 'header.php';
?>

        <!-- Contenu de la page -->

        <?php 
//print_r($offres);
// Fonctionnalité étendu pour l'encadrand et l'admin
if (isset($_SESSION['user']) && ($_SESSION['user'] == 'encadrant' || $_SESSION['user'] == 'admin')) {
    //print_r($_SESSION); echo "<br />";
    //print_r(getEleves($pdo)); echo "<br />";
    //$encadrant = getEncadrant($pdo, 1);
    //print_r($encadrant); echo "<br/>";
    //echo $encadrant."<br/>";
    //echo ($encadrant == NULL)."<br/>";
    afficheVueGlobale($pdo, getEleves($pdo));
    //$etat = getEtatStageEleve($pdo, $eleves[0]["id"]);
    //echo $etat; echo "<br />";
} else {
    if (isset($_SESSION['user']) && ($_SESSION['user'] == 'etudiant' || $_SESSION['user'] == 'admin')) {
        echo "<section>" . "<h2>Offres de stages / alternances disponibles</h2>";
        $offres = getOffres($pdo);
        afficheOffres($pdo, $offres);
        echo "</section>";
    }
}
?>

        </div>
    </body>
</html>