public function findAll() { $reponse = $this->db->query(self::FIND_ALL); $clubs = array(); while ($data = $reponse->fetch()) { $club = new Club(); $club->setId($data['NUMERO_CLUB']); $club->setNom($data['NOM_CLUB']); $club->setLocalisation($data['LOCALISATION']); array_push($clubs, $club); } $reponse->closeCursor(); return $clubs; }
$club->setLocalisation($_POST['localisation']); $club->save(); header('Location: ' . $config['url'] . "/" . basename(__FILE__)); } if (isset($_GET['id'])) { $club_id = intval($_GET['id']); render("clubs/editer", array('club' => $cr->findById($club_id))); } else { header('Location: ' . $config['url'] . "/" . basename(__FILE__)); } break; case "supprimer": if (isset($_GET['id'])) { $club_id = intval($_GET['id']); $club = new Club(); $club->setId($club_id); $club->delete(); } header('Location: ' . $config['url'] . "/" . basename(__FILE__)); break; case "voir": if (isset($_GET['id'])) { $club_id = intval($_GET['id']); render("clubs/voir", array('club' => $cr->findById($club_id), 'entraineur' => $er->findOneByClubId($club_id), 'responsables' => $rr->findByClubId($club_id), 'joueurs' => $jr->findByClubId($club_id))); } else { $_SESSION['flash'] = "Aucun id renseigné"; goto LOCATION; } break; default: goto RENDER;