Пример #1
0
     $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);
             }
         }
     }
 }
 //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);