$idAppartement = $_POST['idAppartement'];
     $status = htmlentities($_POST['status']);
     $appartementManager->changeStatus($idAppartement, $status);
     //add history data to db
     $createdBy = $_SESSION['userMerlaTrav']->login();
     $created = date('Y-m-d h:i:s');
     $history = new History(array('action' => "Modification Status", 'target' => "Table des appartements", 'description' => "Changer le status de l'appartement", 'created' => $created, 'createdBy' => $createdBy));
     //add it to db
     $historyManager->add($history);
     $actionMessage = "Opération Valide : Appartement Status Modifié avec succès.";
     $typeMessage = "success";
 } else {
     if ($action == "updateClient") {
         $idAppartement = $_POST['idAppartement'];
         $par = htmlentities($_POST['par']);
         $appartementManager->updatePar($par, $idAppartement);
         //add history data to db
         $createdBy = $_SESSION['userMerlaTrav']->login();
         $created = date('Y-m-d h:i:s');
         $history = new History(array('action' => "Modification Client", 'target' => "Table des appartements", 'description' => "Modifier le client réservant l'appartement", 'created' => $created, 'createdBy' => $createdBy));
         //add it to db
         $historyManager->add($history);
         $actionMessage = "Opération Valide : Appartement Réservation Modifiée avec succès.";
         $typeMessage = "success";
     } else {
         if ($action == "delete") {
             $idAppartement = $_POST['idAppartement'];
             $appartementManager->delete($idAppartement);
             //add history data to db
             $createdBy = $_SESSION['userMerlaTrav']->login();
             $created = date('Y-m-d h:i:s');