Exemplo n.º 1
0
 private function enregistrerSession()
 {
     require_once 'modele/SessionSurf.php';
     require_once 'modele/Membre.php';
     $sessionSurf = new SessionSurf($this->proposition);
     $sessionSurf->setOrganisateur($_SESSION['Membre']);
     $manager = new SessionSurfsManager(null);
     $manager->ajoutSession($sessionSurf, $this->proposition['nomSpot'], $this->proposition['noVeh'], $this->proposition['nbrPlacesDispo'], $this->proposition['nbrPlanchesDispo']);
     $this->response_status = 1;
     $this->response_html = '<p>Ok, Proposition enregistrée! Go to surf !!! Recharges la page pour voir apparaitre dans la section je cherche ta proposition</p>';
     $sessionSurfEnBase = $manager->loadComplet($sessionSurf->noSes());
     require_once 'template.php';
     ob_start();
     ecrireJeChercheSection();
     $this->response_JeChercheSection = ob_get_contents();
     ob_end_clean();
 }
Exemplo n.º 2
0
 function load($noSes)
 {
     $dbh = $this->_db;
     $sql = "SELECT SS.*, S.*, M.* FROM SessionSurf AS SS, Spot AS S, Propose AS P, Membre AS M WHERE SS.noSes = :noSes AND SS.nomSpot = S.nomSpot AND SS.noSes = P.noSes AND P.noMem = M.noMem;";
     $sth = $dbh->prepare($sql);
     $sth->bindParam(":noSes", $noSes, PDO::PARAM_STR);
     $bool = $sth->execute();
     if ($result = $sth->fetch(PDO::FETCH_ASSOC)) {
         $sessionSurf = new SessionSurf($result);
         $spot = new Spot($result);
         $sessionSurf->setSpot($spot);
         $membre = new Membre($result);
         $sessionSurf->setOrganisateur($membre);
         return $sessionSurf;
     } else {
         echo "DEBUG SessionSurf.php result NOK";
     }
 }