|
|
@ -47,9 +47,10 @@ class UserControler {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function addComment(){
|
|
|
|
public function addComment(){
|
|
|
|
|
|
|
|
global $racine;
|
|
|
|
$id = $_POST['idQuote'];
|
|
|
|
$id = $_POST['idQuote'];
|
|
|
|
$this->cMod->createComment($_POST['content'],$_POST['idQuote'],$this->uMod->getIdByUsername($_SESSION['user']));
|
|
|
|
$this->cMod->createComment($_POST['content'],$_POST['idQuote'],$this->uMod->getIdByUsername($_SESSION['user']));
|
|
|
|
header("Location: /~lebeaulato/WF-Website/quote/$id");
|
|
|
|
header("Location:".$racine."/quote/$id");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -64,10 +65,11 @@ class UserControler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function unlog(){
|
|
|
|
public function unlog(){
|
|
|
|
|
|
|
|
global $racine;
|
|
|
|
session_unset();
|
|
|
|
session_unset();
|
|
|
|
session_destroy();
|
|
|
|
session_destroy();
|
|
|
|
$_SESSION = array();
|
|
|
|
$_SESSION = array();
|
|
|
|
header("Location: /~lebeaulato/WF-Website/");
|
|
|
|
header("Location:".$racine);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function quiz(array $args){
|
|
|
|
public function quiz(array $args){
|
|
|
@ -103,13 +105,14 @@ class UserControler {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
public function continueQuiz(int $id_quiz, int $total_questions) : void
|
|
|
|
public function continueQuiz(int $id_quiz, int $total_questions) : void
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
global $racine;
|
|
|
|
$score = $_SESSION['score'];
|
|
|
|
$score = $_SESSION['score'];
|
|
|
|
$_SESSION['no_question'] = isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1;
|
|
|
|
$_SESSION['no_question'] = isset($_SESSION['no_question']) ? ($_SESSION['no_question'] + 1) : 1;
|
|
|
|
if ($_SESSION['no_question'] >= $total_questions) {
|
|
|
|
if ($_SESSION['no_question'] >= $total_questions) {
|
|
|
|
session_destroy();
|
|
|
|
session_destroy();
|
|
|
|
$this->endQuiz($id_quiz, $score);
|
|
|
|
$this->endQuiz($id_quiz, $score);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else header("Location: /~lebeaulato/WF-Website/quiz/$id_quiz"); ///~kekentin/WF/WF-Website
|
|
|
|
else header("Location: ".$racine."/quiz/$id_quiz"); ///~kekentin/WF/WF-Website
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -193,15 +196,17 @@ class UserControler {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function addFav(array $arg){
|
|
|
|
public function addFav(array $arg){
|
|
|
|
|
|
|
|
global $racine;
|
|
|
|
$id= $arg['id'] ?? 1;
|
|
|
|
$id= $arg['id'] ?? 1;
|
|
|
|
$this->uMod->addFavorite($_SESSION["user"],$id);
|
|
|
|
$this->uMod->addFavorite($_SESSION["user"],$id);
|
|
|
|
header("Location: /~lebeaulato/WF-Website/quote/$id");
|
|
|
|
header("Location:" . $racine . "/quote/$id");
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public function supFav(array $arg){
|
|
|
|
public function supFav(array $arg){
|
|
|
|
|
|
|
|
global $racine;
|
|
|
|
$id= $arg['id'] ?? 1;
|
|
|
|
$id= $arg['id'] ?? 1;
|
|
|
|
$this->uMod->supFavorite($_SESSION["user"],$id);
|
|
|
|
$this->uMod->supFavorite($_SESSION["user"],$id);
|
|
|
|
header("Location: /~lebeaulato/WF-Website/quote/$id");
|
|
|
|
header("Location:". $racine ."/quote/$id");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|