Exemplo n.º 1
0
    }
}
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());
        $typeBien = "Appartement";
    } else {
        if ($contrat->typeBien() == "localCommercial") {
            $biens = $locauxManager->getLocauxById($contrat->idBien());
            $typeBien = "Local Commercial";