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 = "";
//link redirection
$redirectLink = "";
//Component Class Manager
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
$reglementPrevuManager = new ReglementPrevuManager($pdo);
//Action Add Processing Begin
if ($action == "add") {
    if (!empty($_POST['datePrevu'])) {
        $datePrevu = htmlentities($_POST['datePrevu']);
        $codeContrat = htmlentities($_POST['codeContrat']);
        $status = htmlentities($_POST['status']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $reglementPrevu = new ReglementPrevu(array('datePrevu' => $datePrevu, 'codeContrat' => $codeContrat, 'status' => $status, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $reglementPrevuManager->add($reglementPrevu);
        //add History data
        $history = new History(array('action' => "Ajout", 'target' => "Table des réglements prévus", 'description' => "Ajouter une liste de réglements prévus", 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
$_SESSION['contrat-form-data'] = $_POST;
//If we get to this current ContratActionController through ClientActionController,
//which means, that the client data are valid, so we need to destroy the session
//"myFormData", that stores the client data form inputs
if (isset($_SESSION['myFormData'])) {
    unset($_SESSION['myFormData']);
}
//This var contains result message of CRUD action and the redirection url link
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//class manager
$clientManager = new ClientManager($pdo);
$contratManager = new ContratManager($pdo);
$contratCasLibreManager = new ContratCasLibreManager($pdo);
$reglementPrevuManager = new ReglementPrevuManager($pdo);
//The History Component is used in all ActionControllers to mention a historical version of each action
$historyManager = new HistoryManager($pdo);
//process starts
//Action Add Processing Begin
if ($action == "add") {
    $codeClient = $_POST['codeClient'];
    //post input validation
    if (!empty($_POST['typeBien']) and !empty($_POST['prixNegocie']) and !empty($_POST['numero']) and !empty($_POST['bien']) and !empty($_POST['dateCreation']) and !empty($_POST['avance']) and !empty($_POST['modePaiement']) and !empty($_POST['dureePaiement']) and !empty($_POST['nombreMois']) and !empty($_POST['echeance'])) {
        if (!empty($_POST['prixNegocie'])) {
            $prixNegocie = htmlentities($_POST['prixNegocie']);
            $numero = htmlentities($_POST['numero']);
            $typeBien = htmlentities($_POST['typeBien']);
            $idBien = htmlentities($_POST['bien']);
            $dateCreation = htmlentities($_POST['dateCreation']);
            $avance = htmlentities($_POST['avance']);
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //destroy contrat-form-data session
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    $contratCasLibreManager = new ContratCasLibreManager($pdo);
    $reglementPrevuManager = new ReglementPrevuManager($pdo);
    //reglements prevus
    $reglementsPrevusEnRetards = $reglementPrevuManager->getReglementPrevuEnRetard();
    $reglementsPrevusToday = $reglementPrevuManager->getReglementPrevuToday();
    $reglementsPrevusWeek = $reglementPrevuManager->getReglementPrevuWeek();
    $reglementsPrevusMonth = $reglementPrevuManager->getReglementPrevuMonth();
    //casLibre dates
    $casLibreEnRetards = $contratCasLibreManager->getReglementEnRetard();
    $casLibreToday = $contratCasLibreManager->getReglementToday();
    $casLibreWeek = $contratCasLibreManager->getReglementWeek();
    $casLibreMonth = $contratCasLibreManager->getReglementMonth();
    /*$codeContrat = $_GET['codeContrat'];
      $comptesBancaires = $compteBancaireManager->getCompteBancaires();
      $contrat = $contratManager->getContratByCode($codeContrat);
      //ContratCasLibre Elements
      $contratCasLibreNumber = 
$_SESSION['contrat-form-data'] = $_POST;
//If we get to this current ContratActionController through ClientActionController,
//which means, that the client data are valid, so we need to destroy the session
//"myFormData", that stores the client data form inputs
if (isset($_SESSION['myFormData'])) {
    unset($_SESSION['myFormData']);
}
//This var contains result message of CRUD action and the redirection url link
$actionMessage = "";
$typeMessage = "";
$redirectLink = "";
//class manager
$clientManager = new ClientManager($pdo);
$contratManager = new ContratManager($pdo);
$contratCasLibreManager = new ContratCasLibreManager($pdo);
$reglementPrevuManager = new ReglementPrevuManager($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);
//process starts
$nomProjet = $projetManager->getProjetById($idProjet)->nom();
//Action Add Processing Begin
if ($action == "add") {
    $codeClient = $_POST['codeClient'];
    //post input validation
    if (!empty($_POST['typeBien']) and !empty($_POST['prixNegocie']) and !empty($_POST['numero']) and !empty($_POST['bien']) and !empty($_POST['dateCreation']) and !empty($_POST['avance']) and !empty($_POST['modePaiement']) and !empty($_POST['dureePaiement']) and !empty($_POST['nombreMois']) and !empty($_POST['echeance'])) {
        if (!empty($_POST['prixNegocie'])) {
            $reference = 'C' . date('Ymd-his');
            $prixNegocie = htmlentities($_POST['prixNegocie']);
            $prixNegocieArabe = htmlentities($_POST['prixNegocieArabe']);
            $numero = htmlentities($_POST['numero']);
        include '../controller/' . $myClass . '.php';
    }
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //classes managers
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $contratCasLibreManager = new ContratCasLibreManager($pdo);
    $reglementPrevuManager = new ReglementPrevuManager($pdo);
    if (isset($_GET['codeContrat']) and (bool) $contratManager->getCodeContrat($_GET['codeContrat'])) {
        $codeContrat = $_GET['codeContrat'];
        $contrat = $contratManager->getContratByCode($codeContrat);
        $projet = $projetManager->getProjetById($contrat->idProjet());
        $client = $clientManager->getClientById($contrat->idClient());
        $sommeOperations = $operationManager->sommeOperations($contrat->id());
        $biens = "";
        $typeBien = "";
        $niveau = "";
        if ($contrat->typeBien() == "appartement") {
            $appartementManager = new AppartementManager($pdo);
            $biens = $appartementManager->getAppartementById($contrat->idBien());
            $typeBien = "Appartement";
            $niveau = $biens->niveau();
        } else {
Example #6
0
    }
}
spl_autoload_register("classLoad");
include 'config.php';
include 'lib/pagination.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav'])) {
    //destroy contrat-form-data session
    $projetManager = new ProjetManager($pdo);
    $clientManager = new ClientManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $compteBancaireManager = new CompteBancaireManager($pdo);
    $contratCasLibreManager = new ContratCasLibreManager($pdo);
    $reglementPrevuManager = new ReglementPrevuManager($pdo);
    //reglements prevus
    $reglementsPrevusEnRetards = $reglementPrevuManager->getReglementPrevuEnRetardGrouped();
    $reglementsPrevusToday = $reglementPrevuManager->getReglementPrevuToday();
    $reglementsPrevusWeek = $reglementPrevuManager->getReglementPrevuWeek();
    $reglementsPrevusMonth = $reglementPrevuManager->getReglementPrevuMonth();
    //casLibre dates
    $casLibreEnRetards = $contratCasLibreManager->getReglementEnRetardGrouped();
    $casLibreToday = $contratCasLibreManager->getReglementToday();
    $casLibreWeek = $contratCasLibreManager->getReglementWeek();
    $casLibreMonth = $contratCasLibreManager->getReglementMonth();
    //nombre des payments en retard
    $numberPaiementsEnRetard = $contratCasLibreManager->getReglementEnRetardNumber() + $reglementPrevuManager->getReglementPrevuEnRetardNumber();
    ?>
<!DOCTYPE html>
<!--[if IE 8]> <html lang="en" class="ie8"> <![endif]-->