if (isset($_POST['nombrePiece'])) { $nombrePiece = htmlentities($_POST['nombrePiece']); } if (isset($_POST['nombreEtage'])) { $nombreEtage = htmlentities($_POST['nombreEtage']); } if (isset($_POST['emplacement'])) { $emplacement = htmlentities($_POST['emplacement']); } if (isset($_POST['cave'])) { $cave = htmlentities($_POST['cave']); } if (htmlentities($_POST['typeImmobiliere']) == "appartement") { $appartement = new Appartement(array('numeroTitre' => $numeroTitre, 'prix' => $prix, 'nom' => $nom, 'niveau' => $niveau, 'facade' => $facade, 'nombrePiece' => $nombrePiece, 'superficie' => $superficie, 'surplan' => $surplan, 'cave' => $cave, 'id' => $id)); $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);