?> <!-- MAIN SECTION --> <section class="main-section"> <div class="small-12 columns"> <div class="row"> <h4>marqueur - <?php $marker = new Marker(); if (isset($_POST["id"])) { $marker->initProperty($_POST["id"], $_POST["firstName"], $_POST["lastName"], strtotime($_POST["birth"])); $marker->PageMode = $_POST["pageMode"]; $marker->validate($mySql); if (!$marker->getHasError()) { if ($marker->PageMode == Constants::PAGE_MODE_EDIT) { $marker->update($mySql); } else { $marker->addNew($mySql); } header('Location: marker.php'); exit; } echo $marker->getFullName(); } else { if (isset($_GET["id"])) { $marker->initDB($_GET["id"], $mySql); echo $marker->getFullName(); $marker->PageMode = Constants::PAGE_MODE_EDIT; } else { echo "[Nouveau]"; $marker->PageMode = Constants::PAGE_MODE_ADD; } }