{
    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/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and ($_SESSION['userMerlaTrav']->profil() == "admin" or $_SESSION['userMerlaTrav']->profil() == "consultant")) {
    //classManagers
    $chargeManager = new ChargeCommunManager($pdo);
    $typeChargeManager = new TypeChargeCommunManager($pdo);
    //
    $charges = $chargeManager->getChargesByGroup();
    $typeCharges = $typeChargeManager->getTypeCharges();
    ?>
<!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" />
Example #2
0
        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();
    if(isset($_SESSION['userMerlaTrav'])){
        //classes managers
        $releveBancaireManager = new ReleveBancaireManager($pdo);
        $chargesCommunsManager = new ChargeCommunManager($pdo);
        $typeChargeCommunManager = new TypeChargeCommunManager($pdo);
        $typeChargeProjetManager = new TypeChargeManager($pdo);
        $projetManager = new ProjetManager($pdo);
        $compteBancaireManager = new CompteBancaireManager($pdo);
        //obj and vars
        $typeChargesCommuns = $typeChargeCommunManager->getTypeCharges();
        $typeChargesProjets = $typeChargeProjetManager->getTypeCharges();
        $projets = $projetManager->getProjets();
        $releveBancaires = $releveBancaireManager->getReleveBancaires();
        $comptesBancaires = $compteBancaireManager->getCompteBancaires();
        $debit = $releveBancaireManager->getTotalDebit();
        $credit = $releveBancaireManager->getTotalCredit();
        $solde = $credit - $debit;
        
?>
<!DOCTYPE html>
    } 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
$action = htmlentities($_POST['action']);
//This var contains result message of CRUD action
$actionMessage = "";
$typeMessage = "";
//Component Class Manager
$typeChargeManager = new TypeChargeCommunManager($pdo);
//Action Add Processing Begin
if ($action == "add") {
    if (!empty($_POST['nom'])) {
        $nom = htmlentities($_POST['nom']);
        if (!$typeChargeManager->exists($nom)) {
            $createdBy = $_SESSION['userMerlaTrav']->login();
            $created = date('Y-m-d h:i:s');
            //create object
            $typeCharge = new TypeChargeCommun(array('nom' => $nom, 'created' => $created, 'createdBy' => $createdBy));
            //add it to db
            $typeChargeManager->add($typeCharge);
            $actionMessage = "Opération Valide : Type Charge Ajouté(e) avec succès.";
            $typeMessage = "success";
        } else {
            $actionMessage = "Erreur Ajout Type Charge : Un type de charge existe déjà avec ce nom <strong>" . $nom . "</strong>.";
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();
if (isset($_SESSION['userMerlaTrav'])) {
    //classes managers
    $chargeManager = new ChargeCommunManager($pdo);
    $typeChargeManager = new TypeChargeCommunManager($pdo);
    $criteria = htmlentities($_POST['criteria']);
    $resumeDetail = "";
    if ($criteria == "parDate") {
        $dateFrom = htmlentities($_POST['dateFrom']);
        $dateTo = htmlentities($_POST['dateTo']);
        $type = htmlentities($_POST['type']);
        if ($type == "Toutes") {
            $charges = $chargeManager->getChargesByDates($dateFrom, $dateTo);
            $totalCharges = number_format($chargeManager->getTotalByDates($dateFrom, $dateTo), 2, ',', ' ');
            $titreDocument = "Liste des charges communs entre : " . date('d/m/Y', strtotime($dateFrom)) . ' - ' . date('d/m/Y', strtotime($dateTo));
        } else {
            $charges = $chargeManager->getChargesByDatesByType($dateFrom, $dateTo, $type);
            $totalCharges = number_format($chargeManager->getTotalByDatesByType($dateFrom, $dateTo, $type), 2, ',', ' ');
            $titreDocument = "Liste des charges communs " . $typeChargeManager->getTypeChargeById($type)->nom() . " entre : " . date('d/m/Y', strtotime($dateFrom)) . ' - ' . date('d/m/Y', strtotime($dateTo));
        }
//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/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    $typeChargesManager = new TypeChargeCommunManager($pdo);
    $typesCharges = $typeChargesManager->getTypeCharges();
    ?>
<!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" />
    <link href="assets/css/metro.css" rel="stylesheet" />
{
    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/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and ($_SESSION['userMerlaTrav']->profil() == "admin" or $_SESSION['userMerlaTrav']->profil() == "consultant")) {
    //classManagers
    $chargeManager = new ChargeCommunManager($pdo);
    $typeChargeManager = new TypeChargeCommunManager($pdo);
    //
    $typeCharge = $_GET['type'];
    $nomTypeCharge = $typeChargeManager->getTypeChargeById($typeCharge)->nom();
    $charges = $chargeManager->getChargesByType($typeCharge);
    $total = number_format($chargeManager->getTotalByType($typeCharge), 2, ',', ' ');
    $typeCharges = $typeChargeManager->getTypeCharges();
    ?>
<!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>