Ejemplo n.º 1
0
}
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>horaire - <?php 
$practice = new Practice();
if (isset($_POST["date"])) {
    $practice->initProperty($_POST["MyId"], $_POST["seasonId"], $_POST["teamId"], strtotime($_POST["date"]), $_POST["stade"], $mySql);
    $practice->PageMode = $_POST["pageMode"];
    $practice->validate($mySql);
    if (!$practice->getHasError()) {
        if ($practice->PageMode == Constants::PAGE_MODE_EDIT) {
            $practice->update($mySql);
        } else {
            $practice->addNew($mySql);
        }
    }
    header('Location: practice.php');
    exit;
} else {
    if (isset($_GET["id"])) {
        $practice->initDB($_GET["id"], $mySql);
        echo date("Y-m-d H:i", $practice->Date);
        $practice->PageMode = Constants::PAGE_MODE_EDIT;
    } else {