Example #1
0
            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>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
    } 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 TypeChargeManager($pdo);
//Action Add Processing Begin
$idProjet = htmlentities($_POST['idProjet']);
if ($action == "add") {
    if (!empty($_POST['nom'])) {
        $nom = htmlentities($_POST['nom']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $typeCharge = new TypeCharge(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 : Vous devez remplir le champ <strong>Nom Charge</strong>.";
    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
    $projetManager = new ProjetManager($pdo);
    $chargeManager = new ChargeManager($pdo);
    $typeChargeManager = new TypeChargeManager($pdo);
    //
    if (isset($_GET['idProjet']) and ($_GET['idProjet'] >= 1 and $_GET['idProjet'] <= $projetManager->getLastId())) {
        $idProjet = $_GET['idProjet'];
        $charges = $chargeManager->getChargesByGroupByIdProjet($idProjet);
        $typeCharges = $typeChargeManager->getTypeCharges();
        $projet = $projetManager->getProjetById($idProjet);
    }
    ?>
<!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" />
Example #4
0
        }
        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
        $projetManager = new ProjetManager($pdo);
        $chargeManager = new ChargeManager($pdo);
        $typeChargeManager = new TypeChargeManager($pdo);
        //
        $typeCharge = $_GET['type'];
        $nomTypeCharge = $typeChargeManager->getTypeChargeById($typeCharge)->nom();
        if(isset($_GET['idProjet']) and 
        ($_GET['idProjet'] >=1 and $_GET['idProjet'] <= $projetManager->getLastId()) ){
            $idProjet = $_GET['idProjet'];
            $charges = $chargeManager->getChargesByIdProjetByType($idProjet, $typeCharge);
            $total = number_format($chargeManager->getTotalByIdProjetByType($idProjet, $typeCharge), 2, ',', ' ');
            $typeCharges = $typeChargeManager->getTypeCharges();
            $projet = $projetManager->getProjetById($idProjet);
        }       
?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en" class="ie9"> <![endif]-->
//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 TypeChargeManager($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" />
    } 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 TypeChargeManager($pdo);
//Action Add Processing Begin
$idProjet = htmlentities($_POST['idProjet']);
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 TypeCharge(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 {
        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
$chargeManager = new ChargeManager($pdo);
$typeChargeManager = new TypeChargeManager($pdo);
$projetManager = new ProjetManager($pdo);
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
//Action Add Processing Begin
$idProjet = htmlentities($_POST['idProjet']);
$nomProjet = $projetManager->getProjetById($idProjet)->nom();
//begin process: test the action
//Action Add Processing Begin
if ($action == "add") {
    if (!empty($_POST['type'])) {
        $type = htmlentities($_POST['type']);
        $typeCharge = $typeChargeManager->getTypeChargeById($type)->nom();
        $dateOperation = htmlentities($_POST['dateOperation']);
        $montant = htmlentities($_POST['montant']);
        $societe = htmlentities($_POST['societe']);
Example #8
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
    $projetManager = new ProjetManager($pdo);
    $chargeManager = new ChargeManager($pdo);
    $typeChargeManager = new TypeChargeManager($pdo);
    $idProjet = htmlentities($_POST['idProjet']);
    $projet = $projetManager->getProjetById($idProjet);
    $criteria = htmlentities($_POST['criteria']);
    if ($criteria == "parDate") {
        $dateFrom = htmlentities($_POST['dateFrom']);
        $dateTo = htmlentities($_POST['dateTo']);
        $type = htmlentities($_POST['type']);
        if ($type == "Toutes") {
            $charges = $chargeManager->getChargesByIdProjetByDates($idProjet, $dateFrom, $dateTo);
            $totalCharges = number_format($chargeManager->getTotalByIdProjetByDates($idProjet, $dateFrom, $dateTo), 2, ',', ' ');
            $titreDocument = "Liste des charges entre : " . date('d/m/Y', strtotime($dateFrom)) . ' - ' . date('d/m/Y', strtotime($dateTo));
        } else {
            $charges = $chargeManager->getChargesByIdProjetByDatesByType($idProjet, $dateFrom, $dateTo, $type);
            $totalCharges = number_format($chargeManager->getTotalByIdProjetByDatesByType($idProjet, $dateFrom, $dateTo, $type), 2, ',', ' ');
            $titreDocument = "Liste des charges " . $typeChargeManager->getTypeChargeById($type)->nom() . " entre : " . date('d/m/Y', strtotime($dateFrom)) . ' - ' . date('d/m/Y', strtotime($dateTo));