}
}
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 = "";
//Redirection link
$redirectLink = "";
//Component Class Manager
$contratCasLibreManager = new ContratCasLibreManager($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
if ($action == "add") {
    if (!empty($_POST['date'])) {
        $date = htmlentities($_POST['date']);
        $montant = htmlentities($_POST['montant']);
        $observation = htmlentities($_POST['observation']);
        $codeContrat = htmlentities($_POST['codeContrat']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $contratCasLibre = new ContratCasLibre(array('date' => $date, 'montant' => $montant, 'observation' => $observation, 'codeContrat' => $codeContrat, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $contratCasLibreManager->add($contratCasLibre);
//In case of error, and this help the user to do not put again what he filled out.
$_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']);
Esempio n. 3
0
        include 'controller/' . $myClass . '.php';
    }
}
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
    } 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']) 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();
    }
}
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 = "";
//Redirection link
$redirectLink = "";
//Component Class Manager
$contratCasLibreManager = new ContratCasLibreManager($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
if ($action == "add") {
    if (!empty($_POST['date'])) {
        $date = htmlentities($_POST['date']);
        $montant = htmlentities($_POST['montant']);
        $observation = htmlentities($_POST['observation']);
        $codeContrat = htmlentities($_POST['codeContrat']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        //create object
        $contratCasLibre = new ContratCasLibre(array('date' => $date, 'montant' => $montant, 'observation' => $observation, 'codeContrat' => $codeContrat, 'created' => $created, 'createdBy' => $createdBy));
        //add it to db
        $contratCasLibreManager->add($contratCasLibre);
Esempio n. 6
0
        include 'controller/' . $myClass . '.php';
    }
}
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>