function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
include '../lib/image-processing.php';
//classes loading end
session_start();
//post input processing
$idEmploye = htmlentities($_POST['idEmploye']);
if (!empty($_POST['dateDebut']) and !empty($_POST['dateFin'])) {
    $idConge = htmlentities($_POST['idConge']);
    $dateDebut = htmlentities($_POST['dateDebut']);
    $dateFin = htmlentities($_POST['dateFin']);
    //create class
    $conge = new EmployeSocieteConge(array('id' => $idConge, 'dateDebut' => $dateDebut, 'dateFin' => $dateFin));
    //create class manager
    $congeManager = new EmployeSocieteCongeManager($pdo);
    $congeManager->update($conge);
    $_SESSION['conge-update-success'] = "<strong>Opération valide : </strong>Les infos du congé sont modifiées avec succès.";
    header('Location:../employe-societe-profile.php?idEmploye=' . $idEmploye);
} else {
    $_SESSION['conge-update-error'] = "<strong>Erreur Modification Congé : </strong>Vous devez remplir tous les champs";
    header('Location:../employe-societe-profile.php?idEmploye=' . $idEmploye);
    exit;
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //les sources
    $employeManager = new EmployeSocieteManager($pdo);
    $employe = "";
    $idEmploye = 0;
    if (isset($_GET['idEmploye']) and ($_GET['idEmploye'] > 0 and $_GET['idEmploye'] <= $employeManager->getLastId())) {
        $idEmploye = htmlentities($_GET['idEmploye']);
        $employe = $employeManager->getEmployesSocieteById($idEmploye);
        $salairesManager = new EmployeSocieteSalaireManager($pdo);
        $salaires = $salairesManager->getSalairesByIdEmploye($idEmploye);
        $congesManager = new EmployeSocieteCongeManager($pdo);
        $conges = $congesManager->getCongesByIdEmploye($idEmploye);
    }
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
<!--[if !IE]><!--> <html lang="en"> <!--<![endif]-->
<!-- BEGIN HEAD -->
<head>
	<meta charset="utf-8" />
	<title>ImmoERP - Management Application</title>
	<meta content="width=device-width, initial-scale=1.0" name="viewport" />
	<meta content="" name="description" />
	<meta content="" name="author" />
	<link href="assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<?php

//classes loading begin
function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
//post input processing
$idEmploye = $_POST['idEmploye'];
$idConge = $_POST['idConge'];
$congeManager = new EmployeSocieteCongeManager($pdo);
$congeManager->delete($idConge);
$_SESSION['conge-delete-success'] = "<strong>Opération valide : </strong>Congé supprimé avec succès.";
header('Location:../employe-societe-profile.php?idEmploye=' . $idEmploye);
//classes loading begin
function classLoad($myClass)
{
    if (file_exists('../model/' . $myClass . '.php')) {
        include '../model/' . $myClass . '.php';
    } elseif (file_exists('../controller/' . $myClass . '.php')) {
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
include '../lib/image-processing.php';
//classes loading end
session_start();
//post input processing
$idEmploye = htmlentities($_POST['idEmploye']);
if (!empty($_POST['dateDebut']) and !empty($_POST['dateFin'])) {
    $dateDebut = htmlentities($_POST['dateDebut']);
    $dateFin = htmlentities($_POST['dateFin']);
    //create class
    $conge = new EmployeSocieteConge(array('dateDebut' => $dateDebut, 'dateFin' => $dateFin, 'idEmploye' => $idEmploye));
    //create class manager
    $congeManager = new EmployeSocieteCongeManager($pdo);
    $congeManager->add($conge);
    $_SESSION['conge-add-success'] = "<strong>Opération valide : </strong>Le congé est ajouté avec succès.";
    header('Location:../employe-societe-profile.php?idEmploye=' . $idEmploye);
} else {
    $_SESSION['conge-add-error'] = "<strong>Erreur Ajout Congé : </strong>Vous devez remplir tous les champs.";
    header('Location:../employe-societe-profile.php?idEmploye=' . $idEmploye);
    exit;
}