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 { echo "[Nouvelle]"; $practice->PageMode = Constants::PAGE_MODE_ADD; } } ?> </h4> </div> <div class="row"> <form action="practice_edit.php" id="form_practice" method="post"> <div class="row"> <div class="small-6 columns"> <label <?php
<div class="row"> <h4>horaire - pratique</h4> </div> <div class="row"> <table id="saison" width="100%"> <thead> <tr> <th>Action</th><th>Date</th><th>Équipe</th></th><th>Stade</th> </tr> </thead> <tbody> <?php if ($result = $mySql->execute("SELECT p.* FROM practice AS p \n \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t INNER JOIN season AS s ON p.seasonId = s.year\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t WHERE s.IsCurrent\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY Date ASC")) { while ($row = $result->fetch_object("Practice")) { $practice = new Practice(); $practice->initDB($row->Id, $mySql); ?> <tr> <td> <a title="Modifier" href="practice_edit.php?id=<?php echo $row->Id; ?> "> <i class="fi-page-edit size-32"> </i> </a> <a title="Supprimer" onclick="javascript:return confirm('Voulez-vous supprimer l\'enregistrement?');" href='practice.php?delete=<?php echo $row->Id; ?> '>