Merge branch 'master' of /git/nemubot_askweb
Conflicts: validation.php
This commit is contained in:
commit
e86aba689f
|
@ -111,6 +111,11 @@ class Question
|
||||||
{
|
{
|
||||||
return $this->id;
|
return $this->id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isValidated()
|
||||||
|
{
|
||||||
|
return $this->validated;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
|
@ -87,13 +87,23 @@ else
|
||||||
<section>
|
<section>
|
||||||
<h2>Merci de votre participation</h2>
|
<h2>Merci de votre participation</h2>
|
||||||
<p>
|
<p>
|
||||||
Votre question a bien été prise en compte.<br/>
|
<?php
|
||||||
Un email a été envoyé à une personne du chan pour
|
if (!$question)
|
||||||
qu'elle valide votre question.
|
{
|
||||||
</p>
|
echo "La question n'existe pas.";
|
||||||
<p>
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
echo ("Votre question a bien été prise en compte.<br/>"
|
||||||
|
."Un email a été envoyé à une personne du chan pour "
|
||||||
|
."qu'elle valide votre question."
|
||||||
|
."</p>
|
||||||
|
<p>
|
||||||
Nemubot vous remercie de l'aider à agrandir sa base de donnée
|
Nemubot vous remercie de l'aider à agrandir sa base de donnée
|
||||||
</p>
|
</p>");
|
||||||
|
}
|
||||||
|
?>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|
|
@ -8,12 +8,7 @@ $id = $_GET['id'];
|
||||||
$file = new QuestionsFile("questions.xml");
|
$file = new QuestionsFile("questions.xml");
|
||||||
$question = $file->get_question($id);
|
$question = $file->get_question($id);
|
||||||
|
|
||||||
var_dump($question);
|
$message = "Question validated maddafakka";
|
||||||
|
|
||||||
$question->validated();
|
|
||||||
$question->set_validator("other@pomail.fr");
|
|
||||||
var_dump($question);
|
|
||||||
$file->save();
|
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
@ -36,13 +31,34 @@ $file->save();
|
||||||
<section>
|
<section>
|
||||||
<h1>Validation de la question</h1>
|
<h1>Validation de la question</h1>
|
||||||
<h3>Rappel de la question</h3>
|
<h3>Rappel de la question</h3>
|
||||||
<?php $question->print_test() ?><br/>
|
<?php if (!$question)
|
||||||
|
{
|
||||||
|
echo "La question n'existe pas.";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$question->print_test();
|
||||||
|
|
||||||
Vous pouvez valider la question. Cliquez simplement sur le
|
echo "\n\n";
|
||||||
lien ci dessous.<br/>
|
}
|
||||||
|
?><br/>
|
||||||
|
|
||||||
<input type="button" value="Valider la question"
|
<input type="button" value="Valider la question"
|
||||||
onclick="<?php $question->validated(); $file->save() ?>"/>
|
onclick=
|
||||||
|
"<?php
|
||||||
|
if ($question->isValidated())
|
||||||
|
{
|
||||||
|
$message = 'Votre question à déjà été validée'
|
||||||
|
. ' Merci de ne pas vous acharner.';
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
$question->validated();
|
||||||
|
$file->save();
|
||||||
|
$message = 'Question validée';
|
||||||
|
}
|
||||||
|
?>;
|
||||||
|
alert('<?php echo $message; ?>');"/>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
Reference in New Issue
Block a user