public function add()
 {
     $m = new message();
     if (isset($_POST["addbtn"]) && $_POST["addbtn"] == "Ajouter") {
         if (empty($_POST["titre"]) || empty($_POST["detail"])) {
             $m = new message();
             $m->setFlash("Tous les champs doivent être remplis.");
         } else {
             $avi = new T_E_AVIS_AVI();
             $client = new T_E_CLIENT_CLI($_GET['id_client']);
             $jeu = new T_E_JEUVIDEO_JEU($_GET['id_game']);
             $avi->__set("T_E_CLIENT_CLI", $client);
             $avi->__set("T_E_JEUVIDEO_JEU", $jeu);
             $avi->__set("avi_titre", $_POST["titre"]);
             $avi->__set("avi_detail", $_POST["detail"]);
             $avi->__set("avi_note", $_POST["note"]);
             $avi->add();
             $m->setFlash($client->cli_prenom . ", votre avis a bien été déposé.", "success");
             $this->render("displayByGame", T_E_AVIS_AVI::findByGame($jeu->jeu_id));
         }
     } else {
         if (isset($_SESSION['user'])) {
             $this->render("add");
         } else {
             $m = new message();
             $m->setFlash("Vous devez etre connecté.");
             header('refresh:0;url=../Sprint/?r=cli/login');
         }
     }
 }
 public function displayById()
 {
     if (isset($_GET["jeu_id"])) {
         $idGame = $_GET["jeu_id"];
         $idGame;
         $game = new T_E_JEUVIDEO_JEU($idGame);
         $photo = T_E_PHOTO_PHO::findByGame($idGame);
         $movie = T_E_VIDEO_VID::findByGame($idGame);
         $advice = T_E_AVIS_AVI::findByGame($idGame);
         $this->render('displayById', array($game, $photo, $movie, $advice));
     } else {
         $this->render("find");
     }
 }