Exemplo n.º 1
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']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    $contratManager = new ContratManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $terrainManager = new TerrainManager($pdo);
    $maisonManager = new MaisonManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $biens = "";
    $idContrat = 0;
    if (isset($_GET['idContrat']) and ($_GET['idContrat'] > 0 and $_GET['idContrat'] <= $contratManager->getLastId())) {
        $idContrat = $_GET['idContrat'];
    } else {
        header('Location:../dashboard.php');
        exit;
    }
    $contrat = $contratManager->getContratById($idContrat);
    $projet = $projetManager->getProjetById($contrat->idProjet());
    $typeBien = "";
    if ($contrat->typeBien() == "appartement") {
        $biens = $appartementManager->getAppartementById($contrat->idBien());
Exemplo n.º 2
0
         $appartementManager = new AppartementManager($pdo);
         $appartementManager->update($appartement);
     } else {
         if (htmlentities($_POST['typeImmobiliere']) == "local") {
             $local = new Locaux(array('numeroTitre' => $numeroTitre, 'prix' => $prix, 'nom' => $nom, 'mezzanine' => $mezzanine, 'facade' => $facade, 'superficie' => $superficie, 'surplan' => $surplan, 'id' => $id));
             $locauxManager = new LocauxManager($pdo);
             $locauxManager->update($local);
         } else {
             if (htmlentities($_POST['typeImmobiliere']) == "maison") {
                 $maison = new Maison(array('numeroTitre' => $numeroTitre, 'prix' => $prix, 'nom' => $nom, 'nombreEtage' => $nombreEtage, 'emplacement' => $emplacement, 'superficie' => $superficie, 'surplan' => $surplan, 'id' => $id));
                 $maisonManager = new MaisonManager($pdo);
                 $maisonManager->update($maison);
             } else {
                 if (htmlentities($_POST['typeImmobiliere']) == "terrain") {
                     $terrain = new Terrain(array('numeroTitre' => $numeroTitre, 'prix' => $prix, 'nom' => $nom, 'emplacement' => $emplacement, 'superficie' => $superficie, 'surplan' => $surplan, 'id' => $id));
                     $terrainManager = new TerrainManager($pdo);
                     $terrainManager->update($terrain);
                 }
             }
         }
     }
     //add history data to db
     $createdBy = $_SESSION['userMerlaTrav']->login();
     $created = date('Y-m-d h:i:s');
     $history = new History(array('action' => "Modification", 'target' => "Table des " . htmlentities($_POST['typeImmobiliere']), 'description' => "Modification de " . htmlentities($_POST['typeImmobiliere']) . " - ID : " . $id . " - Projet : " . $projetManager->getProjetById($idProjet)->nom(), 'created' => $created, 'createdBy' => $createdBy));
     //add it to db
     $historyManager->add($history);
     $_SESSION['bien-update-success'] = '<strong>Opération valide</strong> : Le Bien Immobilière est modifié avec succès !';
     $redirectLink = 'Location:../projet-biens.php?idProjet=' . $idProjet . '&type=' . $type . '&idSociete=' . $idSociete;
     header($redirectLink);
 } else {
Exemplo n.º 3
0
    } 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'])) {
    //les sources
    $idProjet = 0;
    $projetManager = new ProjetManager($pdo);
    if (isset($_GET['idProjet']) and $_GET['idProjet'] > 0 and $_GET['idProjet'] <= $projetManager->getLastId()) {
        $idProjet = $_GET['idProjet'];
        $projet = $projetManager->getProjetById($idProjet);
        $terrainManager = new TerrainManager($pdo);
        $piecesTerrainManager = new PiecesTerrainManager($pdo);
        $terrains = "";
        //test the terrain object number: if exists get terrain else do nothing
        $terrainNumber = $terrainManager->getTerrainNumberByIdProjet($idProjet);
        if ($terrainNumber != 0) {
            $terrains = $terrainManager->getTerrainByIdProjet($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>
Exemplo n.º 4
0
         $appartementManager = new AppartementManager($pdo);
         $appartementManager->updateStatus("Vendu", $idBien);
         $appartementManager->updateStatus("Disponible", $contrat->idBien());
     } else {
         if ($typeBien == "localCommercial") {
             $locauxManager = new LocauxManager($pdo);
             $locauxManager->updateStatus("Vendu", $idBien);
             $locauxManager->updateStatus("Disponible", $contrat->idBien());
         } else {
             if ($typeBien == "maison") {
                 $maisonManager = new MaisonManager($pdo);
                 $maisonManager->updateStatus("Vendu", $idBien);
                 $maisonManager->updateStatus("Disponible", $contrat->idBien());
             } else {
                 if ($typeBien == "terrain") {
                     $terrainManager = new TerrainManager($pdo);
                     $terrainManager->updateStatus("Vendu", $idBien);
                     $terrainManager->updateStatus("Disponible", $contrat->idBien());
                 }
             }
         }
     }
 }
 $newContrat = new Contrat(array('nomClient' => $nomClient, 'cin' => $cin, 'adresse' => $adresse, 'telephone' => $telephone, 'dateCreation' => $dateCreation, 'dateRetour' => $dateRetour, 'prixVente' => $prixNegocie, 'avance' => $avance, 'note' => $note, 'taille' => $taille, 'modePaiement' => $modePaiement, 'id' => $idContrat, 'idBien' => $idBien, 'typeBien' => $typeBien, 'numeroCheque' => $numeroCheque));
 $contratManager->update($newContrat);
 //add history data to db
 $projetManager = new ProjetManager($pdo);
 $historyManager = new HistoryManager($pdo);
 $projet = $projetManager->getProjetById($idProjet);
 $createdBy = $_SESSION['userMerlaTrav']->login();
 $created = date('Y-m-d h:i:s');
Exemplo n.º 5
0
}
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
//post input processing
$idProjet = $_POST['idProjet'];
$idSociete = $_POST['idSociete'];
$idContrat = $_POST['idContrat'];
$status = $_POST['status'];
//create classes managers
$contratManager = new ContratManager($pdo);
$locauxManager = new LocauxManager($pdo);
$appartementManager = new AppartementManager($pdo);
$maisonManager = new MaisonManager($pdo);
$terrainManager = new TerrainManager($pdo);
//create classes
$contrat = $contratManager->getContratById($idContrat);
$redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet . '&idSociete=' . $idSociete;
if (isset($_GET['p']) and $_GET['p'] == 99) {
    $redirectLink = 'Location:../clients-search.php';
}
if ($contrat->typeBien() == "appartement") {
    if ($appartementManager->getAppartementById($contrat->idBien())->status() == "Disponible") {
        $appartementManager->updateStatus($status, $contrat->idBien());
        $contratManager->activerContrat($idContrat);
        $_SESSION['contrat-activation-success'] = "<strong>Opération valide : </strong>Le contrat est activé avec succès.";
        header($redirectLink);
        exit;
    } else {
        $_SESSION['contrat-activation-error'] = "<strong>Erreur Activation Contrat : </strong>Le bien est déjà réservé par un autre client.";
        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
$action = htmlentities($_POST['action']);
//This var contains result message of CRUD action
$actionMessage = "";
$typeMessage = "";
$terrainManager = new TerrainManager($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);
$idProjet = htmlentities($_POST['idProjet']);
$nomProjet = $projetManager->getProjetById($idProjet)->nom();
if ($action == "add") {
    if (!empty($_POST['prix'])) {
        $vendeur = htmlentities($_POST['vendeur']);
        $emplacement = htmlentities($_POST['emplacement']);
        $superficie = htmlentities($_POST['superficie']);
        $prix = htmlentities($_POST['prix']);
        $fraisAchat = htmlentities($_POST['fraisAchat']);
        $createdBy = $_SESSION['userMerlaTrav']->login();
        $created = date('Y-m-d h:i:s');
        $terrain = new Terrain(array('vendeur' => $vendeur, 'prix' => $prix, 'superficie' => $superficie, 'fraisAchat' => $fraisAchat, 'emplacement' => $emplacement, 'idProjet' => $idProjet, 'created' => $created, 'createdBy' => $createdBy));
Exemplo n.º 7
0
if (!empty($_POST['idProjet'])) {
    $id = htmlentities($_POST['id']);
    if (htmlentities($_POST['typeImmobiliere']) == "appartement") {
        $appartementManager = new AppartementManager($pdo);
        $appartementManager->delete($id);
    } else {
        if (htmlentities($_POST['typeImmobiliere']) == "local") {
            $locauxManager = new LocauxManager($pdo);
            $locauxManager->delete($id);
        } else {
            if (htmlentities($_POST['typeImmobiliere']) == "maison") {
                $maisonManager = new MaisonManager($pdo);
                $maisonManager->delete($id);
            } else {
                if (htmlentities($_POST['typeImmobiliere']) == "terrain") {
                    $terrainManager = new TerrainManager($pdo);
                    $terrainManager->delete($id);
                }
            }
        }
    }
    //add history data to db
    $createdBy = $_SESSION['userMerlaTrav']->login();
    $created = date('Y-m-d h:i:s');
    $history = new History(array('action' => "Suppression", 'target' => "Table des " . htmlentities($_POST['typeImmobiliere']), 'description' => "Suppression de " . htmlentities($_POST['typeImmobiliere']) . " - ID : " . $id . " - Projet : " . $projetManager->getProjetById($idProjet)->nom(), 'created' => $created, 'createdBy' => $createdBy));
    //add it to db
    $historyManager->add($history);
    $_SESSION['bien-delete-success'] = '<strong>Opération valide</strong> : Le Bien Immobilière est supprimé avec succès !';
    $redirectLink = 'Location:../projet-biens.php?idProjet=' . $idProjet . '&type=' . $type . '&idSociete=' . $idSociete;
    header($redirectLink);
} else {
    if (filter_var($_POST['superficie'], FILTER_VALIDATE_FLOAT) == true) {
        $superficie = htmlentities($_POST['superficie']);
    } else {
        $_SESSION['terrain-add-error'] = "<strong>Erreur Ajout Terrain</strong> : La valeur du champ 'Superficie' est incorrecte !";
        header('Location:../terrain.php?idProjet=' . $idProjet);
        exit;
    }
    if (filter_var($_POST['prix'], FILTER_VALIDATE_FLOAT) == true) {
        $prix = htmlentities($_POST['prix']);
    } else {
        $_SESSION['terrain-add-error'] = "<strong>Erreur Ajout Terrain</strong> : La valeur du champ 'Prix' est incorrecte !";
        header('Location:../terrain.php?idProjet=' . $idProjet);
        exit;
    }
    if (filter_var($_POST['fraisAchat'], FILTER_VALIDATE_FLOAT) == true) {
        $fraisAchat = htmlentities($_POST['fraisAchat']);
    } else {
        $_SESSION['terrain-add-error'] = "<strong>Erreur Ajout Terrain</strong> : La valeur du champ 'Fais d'achat' est incorrecte !";
        header('Location:../terrain.php?idProjet=' . $idProjet);
        exit;
    }
    $createdBy = $_SESSION['userMerlaTrav']->login();
    $created = date('Y-m-d h:i:s');
    $terrain = new Terrain(array('vendeur' => $vendeur, 'prix' => $prix, 'superficie' => $superficie, 'fraisAchat' => $fraisAchat, 'emplacement' => $emplacement, 'idProjet' => $idProjet, 'created' => $created, 'createdBy' => $createdBy));
    $terrainManager = new TerrainManager($pdo);
    $terrainManager->add($terrain);
    $_SESSION['terrain-add-success'] = "<strong>Opération valide : </strong>Le terrain est ajouté avec succès !";
} else {
    $_SESSION['terrain-add-error'] = "<strong>Erreur Ajout Terrain : </strong>Vous devez remplir au moins le champ 'Vendeur'.";
}
header('Location:../terrain.php?idProjet=' . $idProjet);
Exemplo n.º 9
0
spl_autoload_register("classLoad");
include '../config.php';
//classes loading end
session_start();
if (isset($_SESSION['userMerlaTrav']) and $_SESSION['userMerlaTrav']->profil() == "admin") {
    //classes managers
    $idProjet = $_GET['idProjet'];
    $idSociete = $_GET['idSociete'];
    $type = $_GET['type'];
    $projetManager = new ProjetManager($pdo);
    $societeManager = new SocieteManager($pdo);
    $contratManager = new ContratManager($pdo);
    $operationManager = new OperationManager($pdo);
    $appartementManager = new AppartementManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $terrainsManager = new TerrainManager($pdo);
    $maisonsManager = new MaisonManager($pdo);
    $contratNumber = $contratManager->getContratsNumberByIdProjet($idProjet);
    $contrats = $contratManager->getContratsByIdProjetOnly($idProjet);
    ob_start();
    ?>
<style type="text/css">
    p, h1, h3{
        text-align: center;
        text-decoration: underline;
    }
    table, tr, td, th {
        border-collapse: collapse;
        width:auto;
        border: 1px solid black;
    }
Exemplo n.º 10
0
$idProjet = $_POST['idProjet'];
$idSociete = $_POST['idSociete'];
$idContrat = $_POST['idContrat'];
$status = $_POST['status'];
$typeBien = $_POST['typeBien'];
$idBien = $_POST['idBien'];
//create classes managers
$contratManager = new ContratManager($pdo);
//create classes
$redirectLink = 'Location:../contrats-list.php?idProjet=' . $idProjet . '&idSociete=' . $idSociete;
if ($typeBien == "appartement") {
    $appartementManager = new AppartementManager($pdo);
    $appartementManager->updateStatus($status, $idBien);
} else {
    if ($typeBien == "localCommercial") {
        $locauxManager = new LocauxManager($pdo);
        $locauxManager->updateStatus($status, $idBien);
    } else {
        if ($typeBien == "maison") {
            $maisonManager = new MaisonManager($pdo);
            $maisonManager->updateStatus($status, $idBien);
        } else {
            if ($typeBien == "terrain") {
                $terrainManager = new TerrainManager($pdo);
                $terrainManager->updateStatus($status, $idBien);
            }
        }
    }
}
$_SESSION['bien-change-status-success'] = "<strong>Opération valide : </strong>Le status du bien est changé avec succès.";
header($redirectLink);
<?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
$idProjet = $_POST['idProjet'];
$idTerrain = $_POST['idTerrain'];
$terrainManager = new TerrainManager($pdo);
$terrainManager->delete($idTerrain);
$_SESSION['terrain-delete-success'] = "<strong>Opération valide : </strong>Terrain supprimé avec succès.";
header('Location:../terrain.php?idProjet=' . $idProjet . '#listTerrain');
Exemplo n.º 12
0
            $locaux = $locauxManager->getLocauxNonVendu();
            $biens = $locauxManager->getNumberBiens();
            $biensDiponible = $locauxManager->getNumberBienDisbonible();
            $biensVendu = $locauxManager->getNumberBienVendu();
            $biensPromesseVente = $locauxManager->getNumberBienPromesseVente();
        } else {
            if ($type == "maisons") {
                $maisonManager = new MaisonManager($pdo);
                $maisons = $maisonManager->getMaisonsNonVendu();
                $biens = $maisonManager->getNumberBiens();
                $biensDiponible = $maisonManager->getNumberBienDisbonible();
                $biensVendu = $maisonManager->getNumberBienVendu();
                $biensPromesseVente = $maisonManager->getNumberBienPromesseVente();
            } else {
                if ($type == "terrains") {
                    $terrainManager = new TerrainManager($pdo);
                    $terrains = $terrainManager->getTerrainsNonVendu();
                    $biens = $terrainManager->getNumberBiens();
                    $biensDiponible = $terrainManager->getNumberBienDisbonible();
                    $biensVendu = $terrainManager->getNumberBienVendu();
                    $biensPromesseVente = $terrainManager->getNumberBienPromesseVente();
                }
            }
        }
    }
    ?>
<!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 -->
Exemplo n.º 13
0
            $maisonManager = new MaisonManager($pdo);
            $typeBien = "Maison";
            $nomBien = $maisonManager->getMaisonById($contrat->idBien())->nom();
        } else {
            if ($contrat->typeBien() == "localCommercial") {
                $locauxManager = new LocauxManager($pdo);
                $typeBien = "Local Commercial";
                $nomBien = $locauxManager->getLocauxById($contrat->idBien())->nom();
            } else {
                if ($contrat->typeBien() == "appartement") {
                    $appartementManager = new AppartementManager($pdo);
                    $typeBien = "Appartement";
                    $nomBien = $appartementManager->getAppartementById($contrat->idBien())->nom();
                } else {
                    if ($contrat->typeBien() == "terrain") {
                        $terrainManager = new TerrainManager($pdo);
                        $typeBien = "Terrain";
                        $nomBien = $terrainManager->getTerrainById($contrat->idBien())->nom();
                    }
                }
            }
        }
        ?>
												<li>
													<div class="col1">
														<div class="cont">
															<div class="cont-col1">
																<div class="label label-success">								
																	<i class="icon-bell"></i>
																</div>
															</div>
Exemplo n.º 14
0
     $bien = $appartementManager->getAppartementById($element->idBien());
     $niveau = $bien->niveau();
     $typeBien = "Appartement";
 } else {
     if ($element->typeBien() == "localCommercial") {
         $locauxManager = new LocauxManager($pdo);
         $bien = $locauxManager->getLocauxById($element->idBien());
         $typeBien = "Local Commercial";
     } else {
         if ($element->typeBien() == "maison") {
             $maisonManager = new MaisonManager($pdo);
             $bien = $maisonManager->getMaisonById($element->idBien());
             $typeBien = "Maison";
         } else {
             if ($element->typeBien() == "terrain") {
                 $terrainManager = new TerrainManager($pdo);
                 $bien = $terrainManager->getTerrainById($element->idBien());
                 $typeBien = "Terrain";
             }
         }
     }
 }
 //activate the update link only for admin's profil
 $link = "";
 if ($_SESSION['userMerlaTrav']->profil() == "admin") {
     $link = '#updateStatusReglementPrevuEnRetards' . $element->id();
     $link = '<a href="' . $link . '" data-toggle="modal" data-id="' . $element->id() . '" class="btn mini green">En cours</a>';
 } else {
     $link = '<a class="btn mini green">En cours</a>';
 }
 ?>
Exemplo n.º 15
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']) and isset($_GET['idProjet'])) {
    //classes managers
    //propeties managers
    $appartementManager = new AppartementManager($pdo);
    $locauxManager = new LocauxManager($pdo);
    $terrainManager = new TerrainManager($pdo);
    $maisonManager = new MaisonManager($pdo);
    //charges managers
    $chargesTerrainManager = new ChargesTerrainManager($pdo);
    $chargesConstructionManager = new ChargesConstructionManager($pdo);
    $chargesFinitionManager = new ChargesFinitionManager($pdo);
    //livraisons & fournisseurs managers
    $livraisonsManager = new LivraisonManager($pdo);
    $livraisonDetailManager = new LivraisonDetailManager($pdo);
    $fournisseursManager = new FournisseurManager($pdo);
    //other managers
    $caisseManager = new CaisseManager($pdo);
    $usersManager = new UserManager($pdo);
    $projetManager = new ProjetManager($pdo);
    $societeManager = new SocieteManager($pdo);
    $contratManager = new ContratManager($pdo);