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

64 lines
1.1 KiB
PHP
Raw Normal View History

2012-05-24 18:26:17 +00:00
1;3001;0c<!DOCTYPE html>
2012-05-22 15:01:33 +00:00
<?php
2012-05-23 12:56:34 +00:00
include("Question.class.php");
include("QuestionsFile.class.php");
2012-05-22 15:01:33 +00:00
2012-05-23 12:56:34 +00:00
$id = $_GET['id'];
$file = new QuestionsFile("questions.xml");
$question = $file->get_question($id);
2012-05-22 15:01:33 +00:00
?>
2012-05-22 14:05:46 +00:00
<html>
<head>
<meta charset="utf8" />
2012-05-24 12:19:45 +00:00
<link rel="Stylesheet" href="styleConfirmation.css" />
2012-05-22 14:05:46 +00:00
</head>
<body>
2012-05-24 12:19:45 +00:00
<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>
2012-05-22 14:05:46 +00:00
<h1>Validation de la question</h1>
2012-05-23 12:56:34 +00:00
<h3>Rappel de la question</h3>
<?php if (!$question)
{
echo "La question n'existe pas.";
}
else
{
$question->print_test();
echo "\n\n";
}
?><br/>
2012-05-22 14:05:46 +00:00
<input type="button" value="Valider la question"
onclick=
"<?php
2012-05-24 18:26:17 +00:00
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; ?>');"/>
2012-05-24 12:19:45 +00:00
</section>
2012-05-22 14:05:46 +00:00
</body>
</html>