Exemplo n.º 1
0
//recuperation id max dans la bdd questions
$stmt = $recupform->runQuery("SELECT id FROM questions ORDER BY id DESC LIMIT 1");
$stmt->execute();
$liste = $stmt->fetch();
$idmax = $liste[0];
extract($_POST);
$answerClasse = $_POST["secteur"];
$stmt = $recupform->runQuery("SELECT question FROM questions WHERE id = 1");
$stmt->execute();
$liste = $stmt->fetch();
$question = $liste[0];
$stmt2 = $recupform->runQuery("SELECT reponse FROM answers WHERE id={$answerClasse}");
$stmt2->execute();
$liste2 = $stmt2->fetch();
$reponse = $liste2[0];
$pdf->SetPoliceQuestion();
$pdf->Write(5, $question);
$pdf->Ln();
$pdf->SetPoliceReponse();
$pdf->Cell('25');
//recup reponse et affiché
$pdf->Write(5, $reponse);
$pdf->Ln(20);
if ($_POST['secteur'] == 1) {
    $classScore = 1;
} elseif ($_POST['secteur'] == 2) {
    $classScore = 2;
} else {
    $classScore = 3;
}
for ($i = 1; $i < $idmax + 1; $i++) {