This repository has been archived on 2020-08-21. You can view files and clone it, but cannot push or open issues or pull requests.
nemubot-askweb/validation.php
2012-05-25 11:48:49 +02:00

64 lines
1.1 KiB
PHP

1;3001;0c<!DOCTYPE html>
<?php
include("Question.class.php");
include("QuestionsFile.class.php");
$id = $_GET['id'];
$file = new QuestionsFile("questions.xml");
$question = $file->get_question($id);
?>
<html>
<head>
<meta charset="utf8" />
<link rel="Stylesheet" href="styleConfirmation.css" />
</head>
<body>
<header>
<div id="main_title">
<a href="http://www.h2g2.com" target="_blank">
<img src="marvin-robot_normal.png" alt="" id="banner"/>
</a>
<h1>Nemubot Questions</h1>
</div>
</header>
<section>
<h1>Validation de la question</h1>
<h3>Rappel de la question</h3>
<?php if (!$question)
{
echo "La question n'existe pas.";
}
else
{
$question->print_test();
echo "\n\n";
}
?><br/>
<input type="button" value="Valider la question"
onclick=
"<?php
if ($question->isValidated() == 1)
{
$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>
</body>
</html>