示例#1
0
if (isset($_SESSION[Session::C_SESSION_USER])) {
    $session = new Session($_SESSION[Session::C_SESSION_USER], $_SESSION[Session::C_SESSION_PASS], $mySql);
}
if (!isset($session) or !$session->IsConnected()) {
    header('Location: index.php');
    exit;
}
?>
            <!-- 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);